Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHDecayToV0Builder_h
0002 #define HeavyFlavorAnalysis_SpecificDecay_BPHDecayToV0Builder_h
0003 /** \class BPHDecayToV0Builder
0004  *
0005  *  Description: 
0006  *     Class to build neutral particles decaying to a V0,
0007  *     starting from reco::Candidates or already reconstructed V0s
0008  *
0009  *  \author Paolo Ronchese INFN Padova
0010  *
0011  */
0012 
0013 //----------------------
0014 // Base Class Headers --
0015 //----------------------
0016 #include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHDecayGenericBuilderBase.h"
0017 #include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHDecayGenericBuilder.h"
0018 
0019 //------------------------------------
0020 // Collaborating Class Declarations --
0021 //------------------------------------
0022 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoBuilder.h"
0023 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoCandidate.h"
0024 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusCandidate.h"
0025 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHVertexCompositePtrCandidate.h"
0026 
0027 #include "DataFormats/Candidate/interface/VertexCompositeCandidate.h"
0028 
0029 class BPHEventSetupWrapper;
0030 
0031 //---------------
0032 // C++ Headers --
0033 //---------------
0034 #include <string>
0035 #include <vector>
0036 #include <map>
0037 
0038 //              ---------------------
0039 //              -- Class Interface --
0040 //              ---------------------
0041 
0042 class BPHDecayToV0Builder : public virtual BPHDecayGenericBuilderBase,
0043                             public virtual BPHDecayGenericBuilder<BPHPlusMinusCandidate> {
0044 public:
0045   enum v0Type { VertexCompositeCandidate, VertexCompositePtrCandidate };
0046   struct V0Info {
0047     v0Type type;
0048     const void* v0;
0049   };
0050 
0051   /** Constructor
0052    */
0053   BPHDecayToV0Builder(const BPHEventSetupWrapper& es,
0054                       const std::string& daug1Name,
0055                       const std::string& daug2Name,
0056                       const BPHRecoBuilder::BPHGenericCollection* daug1Collection,
0057                       const BPHRecoBuilder::BPHGenericCollection* daug2Collection);
0058   BPHDecayToV0Builder(const BPHEventSetupWrapper& es,
0059                       const std::string& daug1Name,
0060                       const std::string& daug2Name,
0061                       const std::vector<reco::VertexCompositeCandidate>* v0Collection,
0062                       const std::string& searchList = "cfp");
0063   BPHDecayToV0Builder(const BPHEventSetupWrapper& es,
0064                       const std::string& daug1Name,
0065                       const std::string& daug2Name,
0066                       const std::vector<reco::VertexCompositePtrCandidate>* vpCollection,
0067                       const std::string& searchList = "cfp");
0068 
0069   // deleted copy constructor and assignment operator
0070   BPHDecayToV0Builder(const BPHDecayToV0Builder& x) = delete;
0071   BPHDecayToV0Builder& operator=(const BPHDecayToV0Builder& x) = delete;
0072 
0073   /** Destructor
0074    */
0075   ~BPHDecayToV0Builder() override;
0076 
0077 protected:
0078   std::string p1Name;
0079   std::string p2Name;
0080 
0081   const BPHRecoBuilder::BPHGenericCollection* p1Collection;
0082   const BPHRecoBuilder::BPHGenericCollection* p2Collection;
0083   const std::vector<reco::VertexCompositeCandidate>* vCollection;
0084   const std::vector<reco::VertexCompositePtrCandidate>* rCollection;
0085   std::string sList;
0086 
0087   std::map<const BPHRecoCandidate*, const V0Info*> v0Map;
0088 
0089   /// build candidates and link to V0
0090   virtual void buildFromBPHGenericCollection() = 0;
0091   template <class T>
0092   void buildFromV0(const T* v0Collection, v0Type type);
0093   virtual BPHPlusMinusCandidatePtr buildCandidate(const reco::Candidate* c1,
0094                                                   const reco::Candidate* c2,
0095                                                   const void* v0,
0096                                                   v0Type type) = 0;
0097   void v0Clear();
0098 
0099   /// build candidates
0100   void fillRecList() override;
0101 };
0102 
0103 #endif