CMS 3D CMS Logo

BPHDecayVertex.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHDecayVertex_h
2 #define HeavyFlavorAnalysis_RecoDecay_BPHDecayVertex_h
3 
12 //----------------------
13 // Base Class Headers --
14 //----------------------
16 
18 
19 namespace edm {
20  class EventSetup;
21 }
22 
23 namespace reco {
24  class TransientTrack;
25  class Vertex;
26 } // namespace reco
27 
28 //------------------------------------
29 // Collaborating Class Declarations --
30 //------------------------------------
33 
34 //---------------
35 // C++ Headers --
36 //---------------
37 #include <vector>
38 #include <map>
39 #include <string>
40 
41 // ---------------------
42 // -- Class Interface --
43 // ---------------------
44 
45 class BPHDecayVertex : public virtual BPHDecayMomentum {
46 public:
50  // deleted copy constructor and assignment operator
51  BPHDecayVertex(const BPHDecayVertex& x) = delete;
52  BPHDecayVertex& operator=(const BPHDecayVertex& x) = delete;
53 
56  ~BPHDecayVertex() override;
57 
61  virtual bool validTracks() const;
63  virtual bool validVertex() const;
64 
66  virtual const reco::Vertex& vertex(VertexFitter<5>* fitter = nullptr,
67  const reco::BeamSpot* bs = nullptr,
68  const GlobalPoint* priorPos = nullptr,
69  const GlobalError* priorError = nullptr) const;
70 
72  const std::vector<const reco::Track*>& tracks() const;
73 
75  const reco::Track* getTrack(const reco::Candidate* cand) const;
76 
78  char getTMode(const reco::Candidate* cand) const;
79 
81  const std::vector<reco::TransientTrack>& transientTracks() const;
82 
85 
87  const BPHEventSetupWrapper* getEventSetup() const;
88 
91 
92 protected:
93  // constructor
94  BPHDecayVertex(const BPHEventSetupWrapper* es, int daugNum = 2, int compNum = 2);
95  // pointer used to retrieve informations from other bases
96  BPHDecayVertex(const BPHDecayVertex* ptr, const BPHEventSetupWrapper* es);
97 
98  // add a simple particle giving it a name and specifying an option list
99  // to search for the associated track
100  virtual void addV(const std::string& name, const reco::Candidate* daug, const std::string& searchList, double mass);
101  // add a previously reconstructed particle giving it a name
102  virtual void addV(const std::string& name, const BPHRecoConstCandPtr& comp);
103 
104  // utility function used to cash reconstruction results
105  void setNotUpdated() const override;
106 
107 private:
108  // EventSetup needed to build TransientTrack
110 
111  // map linking particles to associated track search list
112  std::map<const reco::Candidate*, std::string> searchMap;
113 
114  // reconstruction results cache
115  mutable bool oldTracks;
116  mutable bool oldTTracks;
117  mutable bool oldVertex;
118  mutable bool validTks;
119  mutable std::vector<const reco::Track*> rTracks;
120  mutable std::vector<reco::TransientTrack> trTracks;
121  mutable std::map<const reco::Candidate*, const reco::Track*> tkMap;
122  mutable std::map<const reco::Candidate*, char> tmMap;
123  mutable std::map<const reco::Candidate*, reco::TransientTrack*> ttMap;
126  mutable const reco::BeamSpot* savedBS;
127  mutable const GlobalPoint* savedPP;
128  mutable const GlobalError* savedPE;
129 
130  // create TransientTrack and fit vertex
131  virtual void fTracks() const;
132  virtual void fTTracks() const;
133  virtual void fitVertex(VertexFitter<5>* fitter,
134  const reco::BeamSpot* bs,
135  const GlobalPoint* priorPos,
136  const GlobalError* priorError) const;
137 };
138 
139 #endif
const BPHEventSetupWrapper * getEventSetup() const
retrieve EventSetup
const BPHEventSetupWrapper * evSetup
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
VertexFitter< 5 > * savedFitter
reco::TransientTrack * getTransientTrack(const reco::Candidate *cand) const
get TransientTrack for a daughter
virtual bool validTracks() const
check for valid reconstructed vertex
std::vector< reco::TransientTrack > trTracks
const std::vector< const reco::Track * > & tracks() const
get list of Tracks
std::map< const reco::Candidate *, std::string > searchMap
const reco::Track * getTrack(const reco::Candidate *cand) const
get Track for a daughter
const std::string & getTrackSearchList(const reco::Candidate *cand) const
retrieve track search list
virtual void fitVertex(VertexFitter< 5 > *fitter, const reco::BeamSpot *bs, const GlobalPoint *priorPos, const GlobalError *priorError) const
char getTMode(const reco::Candidate *cand) const
get Track mode for a daughter
virtual void addV(const std::string &name, const reco::Candidate *daug, const std::string &searchList, double mass)
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
BPHDecayVertex(const BPHDecayVertex &x)=delete
reco::Vertex fittedVertex
const std::vector< reco::TransientTrack > & transientTracks() const
get list of TransientTracks
virtual const reco::Vertex & vertex(VertexFitter< 5 > *fitter=nullptr, const reco::BeamSpot *bs=nullptr, const GlobalPoint *priorPos=nullptr, const GlobalError *priorError=nullptr) const
get reconstructed vertex
virtual void fTracks() const
const GlobalError * savedPE
std::map< const reco::Candidate *, const reco::Track * > tkMap
std::map< const reco::Candidate *, char > tmMap
const GlobalPoint * savedPP
virtual bool validVertex() const
fixed size matrix
HLT enums.
void setNotUpdated() const override
virtual void fTTracks() const
const reco::BeamSpot * savedBS
BPHDecayVertex & operator=(const BPHDecayVertex &x)=delete
std::vector< const reco::Track * > rTracks
~BPHDecayVertex() override