Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHDecayToResTrkBuilderBase_h
0002 #define HeavyFlavorAnalysis_SpecificDecay_BPHDecayToResTrkBuilderBase_h
0003 /** \class BPHDecayToResTrkBuilderBase
0004  *
0005  *  Description: 
0006  *     Base class to build a particle decaying to a particle, decaying itself
0007  *     in cascade, and an additional track
0008  *
0009  *  \author Paolo Ronchese INFN Padova
0010  *
0011  */
0012 
0013 //----------------------
0014 // Base Class Headers --
0015 //----------------------
0016 #include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHDecaySpecificBuilder.h"
0017 #include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHDecayConstrainedBuilderBase.h"
0018 
0019 //------------------------------------
0020 // Collaborating Class Declarations --
0021 //------------------------------------
0022 #include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticlePtSelect.h"
0023 #include "HeavyFlavorAnalysis/SpecificDecay/interface/BPHParticleEtaSelect.h"
0024 
0025 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoBuilder.h"
0026 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoCandidate.h"
0027 
0028 class BPHEventSetupWrapper;
0029 class BPHParticleNeutralVeto;
0030 
0031 //---------------
0032 // C++ Headers --
0033 //---------------
0034 #include <string>
0035 #include <vector>
0036 
0037 //              ---------------------
0038 //              -- Class Interface --
0039 //              ---------------------
0040 
0041 class BPHDecayToResTrkBuilderBase : public virtual BPHDecaySpecificBuilderBase,
0042                                     public virtual BPHDecayConstrainedBuilderBase {
0043 public:
0044   /** Constructor
0045    */
0046   BPHDecayToResTrkBuilderBase(const BPHEventSetupWrapper& es,
0047                               const std::string& resName,
0048                               double resMass,
0049                               double resWidth,
0050                               const std::string& trkName,
0051                               double trkMass,
0052                               double trkSigma,
0053                               const BPHRecoBuilder::BPHGenericCollection* trkCollection);
0054 
0055   // deleted copy constructor and assignment operator
0056   BPHDecayToResTrkBuilderBase(const BPHDecayToResTrkBuilderBase& x) = delete;
0057   BPHDecayToResTrkBuilderBase& operator=(const BPHDecayToResTrkBuilderBase& x) = delete;
0058 
0059   /** Destructor
0060    */
0061   ~BPHDecayToResTrkBuilderBase() override;
0062 
0063   /** Operations
0064    */
0065 
0066   /// set cuts
0067   void setTrkPtMin(double pt);
0068   void setTrkEtaMax(double eta);
0069 
0070   /// get current cuts
0071   double getTrkPtMin() const { return ptSel->getPtMin(); }
0072   double getTrkEtaMax() const { return etaSel->getEtaMax(); }
0073 
0074 protected:
0075   BPHDecayToResTrkBuilderBase(const std::string& trkName,
0076                               double trkMass,
0077                               double trkSigma,
0078                               const BPHRecoBuilder::BPHGenericCollection* trkCollection);
0079 
0080   std::string tName;
0081   double tMass;
0082   double tSigma;
0083 
0084   const BPHRecoBuilder::BPHGenericCollection* tCollection;
0085 
0086   BPHParticleNeutralVeto* tknVeto;
0087   BPHParticlePtSelect* ptSel;
0088   BPHParticleEtaSelect* etaSel;
0089 
0090   /// build candidates
0091   void fill(BPHRecoBuilder& brb, void* parameters) override;
0092 
0093 private:
0094   std::vector<const reco::Candidate*> tCollectSel1;
0095   std::vector<const reco::Candidate*> tCollectSel2;
0096   static void filter(const std::vector<const reco::Candidate*>* s,
0097                      std::vector<const reco::Candidate*>* d,
0098                      BPHRecoSelect* f) {
0099     int i;
0100     int n = s->size();
0101     d->clear();
0102     d->reserve(n);
0103     for (i = 0; i < n; ++i) {
0104       if (f->accept(*s->at(i)))
0105         d->push_back(s->at(i));
0106     }
0107   }
0108   void swap(std::vector<const reco::Candidate*>*& l, std::vector<const reco::Candidate*>*& r) {
0109     std::vector<const reco::Candidate*>* t = l;
0110     l = r;
0111     r = t;
0112   }
0113 };
0114 
0115 #endif