CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
17 namespace edm {
18  class EventSetup;
19 }
20 
21 namespace reco {
22  class TransientTrack;
23  class Vertex;
24 } // namespace reco
25 
26 //------------------------------------
27 // Collaborating Class Declarations --
28 //------------------------------------
31 
32 //---------------
33 // C++ Headers --
34 //---------------
35 #include <vector>
36 #include <map>
37 #include <string>
38 
39 // ---------------------
40 // -- Class Interface --
41 // ---------------------
42 
43 class BPHDecayVertex : public virtual BPHDecayMomentum {
44 public:
48  // deleted copy constructor and assignment operator
49  BPHDecayVertex(const BPHDecayVertex& x) = delete;
50  BPHDecayVertex& operator=(const BPHDecayVertex& x) = delete;
51 
54  ~BPHDecayVertex() override;
55 
59  virtual bool validTracks() const;
61  virtual bool validVertex() const;
62 
64  virtual const reco::Vertex& vertex(VertexFitter<5>* fitter = nullptr,
65  const reco::BeamSpot* bs = nullptr,
66  const GlobalPoint* priorPos = nullptr,
67  const GlobalError* priorError = nullptr) const;
68 
70  const std::vector<const reco::Track*>& tracks() const;
71 
73  const reco::Track* getTrack(const reco::Candidate* cand) const;
74 
76  const std::vector<reco::TransientTrack>& transientTracks() const;
77 
80 
82  const edm::EventSetup* getEventSetup() const;
83 
85  const std::string& getTrackSearchList(const reco::Candidate* cand) const;
86 
87 protected:
88  // constructor
90  // pointer used to retrieve informations from other bases
91  BPHDecayVertex(const BPHDecayVertex* ptr, const edm::EventSetup* es);
92 
95  virtual void addV(const std::string& name, const reco::Candidate* daug, const std::string& searchList, double mass);
97  virtual void addV(const std::string& name, const BPHRecoConstCandPtr& comp);
98 
99  // utility function used to cash reconstruction results
100  void setNotUpdated() const override;
101 
102 private:
103  // EventSetup needed to build TransientTrack
105 
106  // map linking particles to associated track search list
107  std::map<const reco::Candidate*, std::string> searchMap;
108 
109  // reconstruction results cache
110  mutable bool oldTracks;
111  mutable bool oldVertex;
112  mutable bool validTks;
113  mutable std::vector<const reco::Track*> rTracks;
114  mutable std::vector<reco::TransientTrack> trTracks;
115  mutable std::map<const reco::Candidate*, const reco::Track*> tkMap;
116  mutable std::map<const reco::Candidate*, reco::TransientTrack*> ttMap;
119  mutable reco::BeamSpot const* savedBS;
120  mutable GlobalPoint const* savedPP;
121  mutable GlobalError const* savedPE;
122 
123  // create TransientTrack and fit vertex
124  virtual void tTracks() const;
125  virtual void fitVertex(VertexFitter<5>* fitter,
126  const reco::BeamSpot* bs,
127  const GlobalPoint* priorPos,
128  const GlobalError* priorError) const;
129 };
130 
131 #endif
const reco::Track * getTrack(const reco::Candidate *cand) const
get Track for a daughter
const edm::EventSetup * getEventSetup() const
retrieve EventSetup
BPHGenericPtr< const BPHRecoCandidate >::type BPHRecoConstCandPtr
VertexFitter< 5 > * savedFitter
reco::TransientTrack * getTransientTrack(const reco::Candidate *cand) const
get TransientTrack for a daughter
virtual bool validVertex() const
virtual void tTracks() const
std::vector< reco::TransientTrack > trTracks
std::map< const reco::Candidate *, std::string > searchMap
const std::string & getTrackSearchList(const reco::Candidate *cand) const
retrieve track search list
virtual void addV(const std::string &name, const reco::Candidate *daug, const std::string &searchList, double mass)
reco::BeamSpot const * savedBS
std::map< const reco::Candidate *, reco::TransientTrack * > ttMap
GlobalError const * savedPE
virtual void fitVertex(VertexFitter< 5 > *fitter, const reco::BeamSpot *bs, const GlobalPoint *priorPos, const GlobalError *priorError) const
const std::vector< const reco::Track * > & tracks() const
get list of Tracks
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
BPHDecayVertex(const BPHDecayVertex &x)=delete
reco::Vertex fittedVertex
std::map< const reco::Candidate *, const reco::Track * > tkMap
const edm::EventSetup * evSetup
virtual bool validTracks() const
check for valid reconstructed vertex
GlobalPoint const * savedPP
const std::vector< reco::TransientTrack > & transientTracks() const
get list of TransientTracks
void setNotUpdated() const override
BPHDecayVertex & operator=(const BPHDecayVertex &x)=delete
std::vector< const reco::Track * > rTracks
~BPHDecayVertex() override