Belle II Software  release-08-01-10
VertexVector.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <genfit/GFRaveVertex.h>
11 #include <vector>
12 
13 namespace Belle2 {
24  class VertexVector {
25 
26  public:
27 
29  ~VertexVector() noexcept
30  {
31  for (size_t i = 0; i < v.size(); ++i)
32  delete v[i];
33  }
34 
36  size_t size() const noexcept { return v.size(); }
37 
39  genfit::GFRaveVertex*& operator[](int idx) { return v[idx]; }
40 
42  std::vector<genfit::GFRaveVertex*> v;
43  };
44 
46 }
Need this container for exception-safe cleanup, GFRave's interface isn't exception-safe as is.
Definition: VertexVector.h:24
std::vector< genfit::GFRaveVertex * > v
Fitted vertices.
Definition: VertexVector.h:42
size_t size() const noexcept
Return size of vertex vector.
Definition: VertexVector.h:36
~VertexVector() noexcept
Detor which cleans up the pointers created by the vertex factory.
Definition: VertexVector.h:29
genfit::GFRaveVertex *& operator[](int idx)
Random Access operator.
Definition: VertexVector.h:39
GFRaveVertex class.
Definition: GFRaveVertex.h:48
Abstract base class for different kinds of events.