Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-08 01:45:51

0001 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHDecayVertex_h
0002 #define HeavyFlavorAnalysis_RecoDecay_BPHDecayVertex_h
0003 /** \class BPHDecayVertex
0004  *
0005  *  Description: 
0006  *     Mid-level base class to reconstruct decay vertex
0007  *
0008  *  \author Paolo Ronchese INFN Padova
0009  *
0010  */
0011 
0012 //----------------------
0013 // Base Class Headers --
0014 //----------------------
0015 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHDecayMomentum.h"
0016 
0017 class BPHEventSetupWrapper;
0018 
0019 namespace edm {
0020   class EventSetup;
0021 }
0022 
0023 namespace reco {
0024   class TransientTrack;
0025   class Vertex;
0026 }  // namespace reco
0027 
0028 //------------------------------------
0029 // Collaborating Class Declarations --
0030 //------------------------------------
0031 #include "DataFormats/VertexReco/interface/Vertex.h"
0032 #include "RecoVertex/VertexPrimitives/interface/VertexFitter.h"
0033 
0034 //---------------
0035 // C++ Headers --
0036 //---------------
0037 #include <vector>
0038 #include <map>
0039 #include <string>
0040 
0041 //              ---------------------
0042 //              -- Class Interface --
0043 //              ---------------------
0044 
0045 class BPHDecayVertex : public virtual BPHDecayMomentum {
0046 public:
0047   /** Constructors are protected
0048    *  this object can exist only as part of a derived class
0049    */
0050   // deleted copy constructor and assignment operator
0051   BPHDecayVertex(const BPHDecayVertex& x) = delete;
0052   BPHDecayVertex& operator=(const BPHDecayVertex& x) = delete;
0053 
0054   /** Destructor
0055    */
0056   ~BPHDecayVertex() override;
0057 
0058   /** Operations
0059    */
0060 
0061   /// check for valid reconstructed vertex
0062   virtual bool validTracks() const;
0063   virtual bool validVertex() const;
0064 
0065   /// get reconstructed vertex
0066   virtual const reco::Vertex& vertex(VertexFitter<5>* fitter = nullptr,
0067                                      const reco::BeamSpot* bs = nullptr,
0068                                      const GlobalPoint* priorPos = nullptr,
0069                                      const GlobalError* priorError = nullptr) const;
0070 
0071   /// get list of Tracks
0072   const std::vector<const reco::Track*>& tracks() const;
0073 
0074   /// get Track for a daughter
0075   const reco::Track* getTrack(const reco::Candidate* cand) const;
0076 
0077   /// get Track mode for a daughter
0078   char getTMode(const reco::Candidate* cand) const;
0079 
0080   /// get list of TransientTracks
0081   const std::vector<reco::TransientTrack>& transientTracks() const;
0082 
0083   /// get TransientTrack for a daughter
0084   reco::TransientTrack* getTransientTrack(const reco::Candidate* cand) const;
0085 
0086   /// retrieve EventSetup
0087   const BPHEventSetupWrapper* getEventSetup() const;
0088 
0089   /// retrieve track search list
0090   const std::string& getTrackSearchList(const reco::Candidate* cand) const;
0091 
0092 protected:
0093   // constructor
0094   BPHDecayVertex(const BPHEventSetupWrapper* es, int daugNum = 2, int compNum = 2);
0095   // pointer used to retrieve informations from other bases
0096   BPHDecayVertex(const BPHDecayVertex* ptr, const BPHEventSetupWrapper* es);
0097 
0098   // add a simple particle giving it a name and specifying an option list
0099   // to search for the associated track
0100   virtual void addV(const std::string& name, const reco::Candidate* daug, const std::string& searchList, double mass);
0101   // add a previously reconstructed particle giving it a name
0102   virtual void addV(const std::string& name, const BPHRecoConstCandPtr& comp);
0103 
0104   // utility function used to cash reconstruction results
0105   void setNotUpdated() const override;
0106 
0107 private:
0108   // EventSetup needed to build TransientTrack
0109   const BPHEventSetupWrapper* evSetup;
0110 
0111   // map linking particles to associated track search list
0112   std::map<const reco::Candidate*, std::string> searchMap;
0113 
0114   // reconstruction results cache
0115   mutable bool oldTracks;
0116   mutable bool oldTTracks;
0117   mutable bool oldVertex;
0118   mutable bool validTks;
0119   mutable std::vector<const reco::Track*> rTracks;
0120   mutable std::vector<reco::TransientTrack> trTracks;
0121   mutable std::map<const reco::Candidate*, const reco::Track*> tkMap;
0122   mutable std::map<const reco::Candidate*, char> tmMap;
0123   mutable std::map<const reco::Candidate*, reco::TransientTrack*> ttMap;
0124   mutable reco::Vertex fittedVertex;
0125   mutable VertexFitter<5>* savedFitter;
0126   mutable const reco::BeamSpot* savedBS;
0127   mutable const GlobalPoint* savedPP;
0128   mutable const GlobalError* savedPE;
0129 
0130   // create TransientTrack and fit vertex
0131   virtual void fTracks() const;
0132   virtual void fTTracks() const;
0133   virtual void fitVertex(VertexFitter<5>* fitter,
0134                          const reco::BeamSpot* bs,
0135                          const GlobalPoint* priorPos,
0136                          const GlobalError* priorError) const;
0137 };
0138 
0139 #endif