Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:35

0001 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHDecayToResResBuilderBase_h
0002 #define HeavyFlavorAnalysis_SpecificDecay_BPHDecayToResResBuilderBase_h
0003 /** \class BPHDecayToResResBuilderBase
0004  *
0005  *  Description: 
0006  *     Class to build a particle decaying to two particles, decaying
0007  *     themselves in cascade
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/RecoDecay/interface/BPHRecoBuilder.h"
0023 
0024 class BPHEventSetupWrapper;
0025 class BPHRecoBuilder;
0026 
0027 //---------------
0028 // C++ Headers --
0029 //---------------
0030 #include <iostream>
0031 #include <string>
0032 #include <vector>
0033 #include <cmath>
0034 
0035 //              ---------------------
0036 //              -- Class Interface --
0037 //              ---------------------
0038 
0039 class BPHDecayToResResBuilderBase : public virtual BPHDecaySpecificBuilderBase,
0040                                     public virtual BPHDecayConstrainedBuilderBase {
0041 public:
0042   /** Constructor
0043    */
0044   BPHDecayToResResBuilderBase(const BPHEventSetupWrapper& es,
0045                               const std::string& res1Name,
0046                               double res1Mass,
0047                               double res1Width,
0048                               const std::string& res2Name);
0049 
0050   // deleted copy constructor and assignment operator
0051   BPHDecayToResResBuilderBase(const BPHDecayToResResBuilderBase& x) = delete;
0052   BPHDecayToResResBuilderBase& operator=(const BPHDecayToResResBuilderBase& x) = delete;
0053 
0054   /** Destructor
0055    */
0056   ~BPHDecayToResResBuilderBase() override;
0057 
0058   /** Operations
0059    */
0060 
0061   /// set cuts
0062   void setRes1MassMin(double m) { setResMassMin(m); }
0063   void setRes1MassMax(double m) { setResMassMax(m); }
0064   void setRes1MassRange(double mMin, double mMax) { setResMassRange(mMin, mMax); }
0065   void setRes2MassMin(double m);
0066   void setRes2MassMax(double m);
0067   void setRes2MassRange(double mMin, double mMax);
0068 
0069   /// get current cuts
0070   double getRes1MassMin() const { return getResMassMin(); }
0071   double getRes1MassMax() const { return getResMassMax(); }
0072   double getRes2MassMin() const { return res2Sel->getMassMin(); }
0073   double getRes2MassMax() const { return res2Sel->getMassMax(); }
0074 
0075 protected:
0076   BPHDecayToResResBuilderBase(const std::string& res2Name);
0077 
0078   std::string sName;
0079 
0080   BPHMassSelect* res2Sel;
0081 
0082   virtual void addRes1Collection(BPHRecoBuilder& brb) { addResCollection(brb); }
0083   virtual void addRes2Collection(BPHRecoBuilder& brb) = 0;
0084 
0085   /// build candidates
0086   void fill(BPHRecoBuilder& brb, void* parameters) override;
0087 
0088   class DZSelect : public BPHVertexSelect {
0089   public:
0090     DZSelect(const std::string* n) : name(n) {}
0091     bool accept(const BPHDecayVertex& cand) const override { return true; }
0092     bool accept(const BPHDecayVertex& cand, const BPHRecoBuilder* builder) const override {
0093       const auto& res1 = builder->getComp(*name);
0094       return (fabs(cand.vertex().z() - res1->vertex().z()) < 1.0);
0095     }
0096 
0097   private:
0098     const std::string* name;
0099   };
0100   DZSelect dzFilter;
0101 };
0102 
0103 #endif