LCFIVertex  0.7.2
vertex_lcfi/inc/decaychain.h
1 #ifndef LCFIDECAYCHAIN_H
2 #define LCFIDECAYCHAIN_H
3 
4 #include <vector>
5 #include "../util/inc/vector3.h"
6 namespace vertex_lcfi
7 {
8  //Forward Declarations
9  class Track;
10  class Vertex;
11  class Jet;
12 
14 
19  class DecayChain
20  {
21  public:
22 
25  {}
26 
28  DecayChain(const DecayChain & OldDecayChain);
29 
30 
32 
36  DecayChain(Jet* MyJet, const std::vector<Track*> & Tracks, const std::vector<Vertex*> & Vertices);
37 
39 
43  inline Jet* jet() const
44  {return _OwnerJet;}
45 
47 
51  const std::vector<Track*> & allTracks() const;
52 
54 
58  const std::vector<Track*> & attachedTracks() const;
59 
61 
65  const std::vector<Vertex*> & vertices() const;
66 
68 
72  double charge() const;
73 
75 
79  const util::Vector3 & momentum() const;
80 
82 
86  void addTrack(Track* Track);
87 
89 
94  bool removeTrack(Track* Track);
95 
97 
102  bool hasTrack(Track* Track) const;
103 
105 
109  void addVertex(Vertex* Vertex);
110 
112 
117  bool removeVertex(Vertex* Vertex);
118 
120 
125  bool hasVertex(Vertex* Vertex) const;
126 
128 
134  private:
135  Jet* _OwnerJet;
136  std::vector<vertex_lcfi::Track*> _AttachedTracks;
137  std::vector<vertex_lcfi::Vertex*> _Vertices;
138 
139  //Caching Variables
140  mutable bool _MomValid;
141  mutable util::Vector3 _Momentum;
142  mutable bool _ChargeValid;
143  mutable double _Charge;
144  mutable bool _AllTracksValid;
145  mutable std::vector<Track*> _AllTracks;
146 
147  //Wipe cache (for when track content has changed)
148  void _invalidateCache() const;
149  };
150 
151  }
152 #endif //LCFICLASSNAME_H
153 
154 
bool removeVertex(Vertex *Vertex)
Remove Vertex.
Definition: decaychain.cpp:187
bool removeTrack(Track *Track)
Remove Track.
Definition: decaychain.cpp:140
const std::vector< Track * > & allTracks() const
All tracks contained in DecayChain.
Definition: decaychain.cpp:52
void addVertex(Vertex *Vertex)
Add Vertex.
Definition: decaychain.cpp:180
DecayChain()
Default Constructor.
bool hasVertex(Vertex *Vertex) const
Does the DecayChain have this Vertex?
Definition: decaychain.cpp:201
void addTrack(Track *Track)
Add Track.
Definition: decaychain.cpp:133
bool hasTrack(Track *Track) const
Does the DecayChain have this Track?
Definition: decaychain.cpp:164
const std::vector< Vertex * > & vertices() const
Vertices contained in DecayChain.
Definition: decaychain.cpp:80
Jet * jet() const
Owner Jet.
double charge() const
Charge sum of all tracks in the DecayChain.
Definition: decaychain.cpp:85
Unique Track representation.
const util::Vector3 & momentum() const
Perigee momentum sum of all tracks in the DecayChain.
Definition: decaychain.cpp:109
const std::vector< Track * > & attachedTracks() const
Attached tracks contained in DecayChain.
Definition: decaychain.cpp:75