CMS 3D CMS Logo

BPHDecayToResResBuilderBase.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHDecayToResResBuilderBase_h
2 #define HeavyFlavorAnalysis_SpecificDecay_BPHDecayToResResBuilderBase_h
3 
13 //----------------------
14 // Base Class Headers --
15 //----------------------
18 
19 //------------------------------------
20 // Collaborating Class Declarations --
21 //------------------------------------
23 
25 class BPHRecoBuilder;
26 
27 //---------------
28 // C++ Headers --
29 //---------------
30 #include <iostream>
31 #include <string>
32 #include <vector>
33 #include <cmath>
34 
35 // ---------------------
36 // -- Class Interface --
37 // ---------------------
38 
40  public virtual BPHDecayConstrainedBuilderBase {
41 public:
45  const std::string& res1Name,
46  double res1Mass,
47  double res1Width,
48  const std::string& res2Name);
49 
50  // deleted copy constructor and assignment operator
53 
57 
61  void setRes1MassMin(double m) { setResMassMin(m); }
63  void setRes1MassMax(double m) { setResMassMax(m); }
64  void setRes1MassRange(double mMin, double mMax) { setResMassRange(mMin, mMax); }
65  void setRes2MassMin(double m);
66  void setRes2MassMax(double m);
67  void setRes2MassRange(double mMin, double mMax);
68 
70  double getRes1MassMin() const { return getResMassMin(); }
71  double getRes1MassMax() const { return getResMassMax(); }
72  double getRes2MassMin() const { return res2Sel->getMassMin(); }
73  double getRes2MassMax() const { return res2Sel->getMassMax(); }
74 
75 protected:
77 
79 
81 
82  virtual void addRes1Collection(BPHRecoBuilder& brb) { addResCollection(brb); }
83  virtual void addRes2Collection(BPHRecoBuilder& brb) = 0;
84 
86  void fill(BPHRecoBuilder& brb, void* parameters) override;
87 
88  class DZSelect : public BPHVertexSelect {
89  public:
90  DZSelect(const std::string* n) : name(n) {}
91  bool accept(const BPHDecayVertex& cand) const override { return true; }
92  bool accept(const BPHDecayVertex& cand, const BPHRecoBuilder* builder) const override {
93  const auto& res1 = builder->getComp(*name);
94  return (fabs(cand.vertex().z() - res1->vertex().z()) < 1.0);
95  }
96 
97  private:
98  const std::string* name;
99  };
101 };
102 
103 #endif
bool accept(const BPHDecayVertex &cand) const override
accept function
virtual void addResCollection(BPHRecoBuilder &brb)=0
double getMassMin() const
get current mass cuts
Definition: BPHMassCuts.h:58
virtual void addRes2Collection(BPHRecoBuilder &brb)=0
virtual void addRes1Collection(BPHRecoBuilder &brb)
double getRes1MassMin() const
get current cuts
double getResMassMin() const
get current cuts
void setRes2MassRange(double mMin, double mMax)
BPHRecoConstCandPtr getComp(const std::string &name) const
double getMassMax() const
Definition: BPHMassCuts.h:59
BPHDecayToResResBuilderBase(const BPHEventSetupWrapper &es, const std::string &res1Name, double res1Mass, double res1Width, const std::string &res2Name)
void setResMassRange(double mMin, double mMax)
void fill(BPHRecoBuilder &brb, void *parameters) override
build candidates
bool accept(const BPHDecayVertex &cand, const BPHRecoBuilder *builder) const override
void setRes1MassRange(double mMin, double mMax)
BPHDecayToResResBuilderBase & operator=(const BPHDecayToResResBuilderBase &x)=delete
void setRes1MassMin(double m)
set cuts