CMS 3D CMS Logo

BPHMassFitSelect.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHMassFitSelect_h
2 #define HeavyFlavorAnalysis_SpecificDecay_BPHMassFitSelect_h
3 
12 //----------------------
13 // Base Class Headers --
14 //----------------------
17 
18 //------------------------------------
19 // Collaborating Class Declarations --
20 //------------------------------------
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 #include <string>
29 
30 // ---------------------
31 // -- Class Interface --
32 // ---------------------
33 
34 class BPHMassFitSelect : public BPHFitSelect, public BPHMassCuts {
35 public:
39 
40  BPHMassFitSelect(const std::string& name, double mass, double sigma, double minMass, double maxMass)
42  setFitConstraint(name, mass, sigma);
43  }
44 
45  BPHMassFitSelect(const std::string& name, double mass, double minMass, double maxMass)
48  }
49 
53  }
54 
58  }
59 
60  // deleted copy constructor and assignment operator
61  BPHMassFitSelect(const BPHMassFitSelect& x) = delete;
62  BPHMassFitSelect& operator=(const BPHMassFitSelect& x) = delete;
63 
66  ~BPHMassFitSelect() override {}
67 
70  bool accept(const BPHKinematicFit& cand) const override {
72  switch (type) {
73  default:
74  case none:
75  break;
76  case mcss:
77  cand.kinematicTree(cName, cMass, cSigma);
78  break;
79  case mcst:
80  cand.kinematicTree(cName, cMass);
81  break;
82  case kf:
83  cand.kinematicTree(cName, kc);
84  break;
85  case mtkf:
86  cand.kinematicTree(cName, mtkc);
87  break;
88  }
89  double mass = cand.p4().mass();
90  return ((mass >= mMin) && (mass <= mMax));
91  }
92 
95  type = none;
96  cName = "";
97  cMass = -1.0;
98  cSigma = -1.0;
99  kc = nullptr;
100  mtkc = nullptr;
101  }
102  void setFitConstraint(const std::string& name, double mass) {
103  type = mcst;
104  cName = name;
105  cMass = mass;
106  cSigma = -1.0;
107  kc = nullptr;
108  mtkc = nullptr;
109  }
110  void setFitConstraint(const std::string& name, double mass, double sigma) {
111  type = mcss;
112  cName = name;
113  cMass = mass;
114  cSigma = sigma;
115  kc = nullptr;
116  mtkc = nullptr;
117  }
119  type = kf;
120  cName = name;
121  cMass = -1.0;
122  cSigma = -1.0;
123  kc = c;
124  mtkc = nullptr;
125  }
127  type = mtkf;
128  cName = name;
129  cMass = -1.0;
130  cSigma = -1.0;
131  kc = nullptr;
132  mtkc = c;
133  }
134 
136  const std::string& getConstrainedName() const { return cName; }
137  double getMass() const { return cMass; }
138  double getSigma() const { return cSigma; }
139  KinematicConstraint* getKC() const { return kc; }
141 
142 private:
143  enum fit_type { none, mcss, mcst, kf, mtkf };
144 
147  double cMass;
148  double cSigma;
151 };
152 
153 #endif
KinematicConstraint.h
BPHFitSelect.h
BPHFitSelect
Definition: BPHFitSelect.h:29
BPHMassFitSelect::BPHMassFitSelect
BPHMassFitSelect(const std::string &name, double mass, double minMass, double maxMass)
Definition: BPHMassFitSelect.h:45
BPHMassFitSelect::setFitConstraint
void setFitConstraint(const std::string &name, KinematicConstraint *c)
Definition: BPHMassFitSelect.h:118
MultiTrackKinematicConstraint.h
BPHMassFitSelect::operator=
BPHMassFitSelect & operator=(const BPHMassFitSelect &x)=delete
BPHMassFitSelect::mcst
Definition: BPHMassFitSelect.h:143
BPHMassFitSelect::getMass
double getMass() const
Definition: BPHMassFitSelect.h:137
BPHMassFitSelect::getKC
KinematicConstraint * getKC() const
Definition: BPHMassFitSelect.h:139
MultiTrackKinematicConstraint
Definition: MultiTrackKinematicConstraint.h:23
BPHMassFitSelect::BPHMassFitSelect
BPHMassFitSelect(const std::string &name, double mass, double sigma, double minMass, double maxMass)
Definition: BPHMassFitSelect.h:40
DDAxes::x
BPHMassCuts.h
BPHMassCuts::mMax
double mMax
Definition: BPHMassCuts.h:63
BPHMassFitSelect::cMass
double cMass
Definition: BPHMassFitSelect.h:147
BPHMassFitSelect::mtkc
MultiTrackKinematicConstraint * mtkc
Definition: BPHMassFitSelect.h:150
BPHMassFitSelect::type
fit_type type
Definition: BPHMassFitSelect.h:145
BPHMassFitSelect::mcss
Definition: BPHMassFitSelect.h:143
BPHMassFitSelect::BPHMassFitSelect
BPHMassFitSelect(const std::string &name, KinematicConstraint *c, double minMass, double maxMass)
Definition: BPHMassFitSelect.h:50
BPHMassFitSelect::getSigma
double getSigma() const
Definition: BPHMassFitSelect.h:138
BPHMassFitSelect::fit_type
fit_type
Definition: BPHMassFitSelect.h:143
BPHMassFitSelect::kf
Definition: BPHMassFitSelect.h:143
KinematicConstraint
Definition: KinematicConstraint.h:21
BPHMassFitSelect::setFitConstraint
void setFitConstraint(const std::string &name, double mass)
Definition: BPHMassFitSelect.h:102
BPHMassFitSelect::none
Definition: BPHMassFitSelect.h:143
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BPHMassFitSelect::mtkf
Definition: BPHMassFitSelect.h:143
B2GTnPMonitor_cfi.maxMass
maxMass
Definition: B2GTnPMonitor_cfi.py:55
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
cand
Definition: decayParser.h:32
BPHMassFitSelect::cName
std::string cName
Definition: BPHMassFitSelect.h:146
BPHMassFitSelect::BPHMassFitSelect
BPHMassFitSelect(double minMass, double maxMass)
Definition: BPHMassFitSelect.h:38
BPHMassFitSelect::setFitConstraint
void setFitConstraint(const std::string &name, MultiTrackKinematicConstraint *c)
Definition: BPHMassFitSelect.h:126
BPHMassCuts::mMin
double mMin
Definition: BPHMassCuts.h:62
BPHMassFitSelect::getConstrainedName
const std::string & getConstrainedName() const
get fit constraint
Definition: BPHMassFitSelect.h:136
BPHMassFitSelect::kc
KinematicConstraint * kc
Definition: BPHMassFitSelect.h:149
BPHKinematicFit.h
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
B2GTnPMonitor_cfi.minMass
minMass
Definition: B2GTnPMonitor_cfi.py:54
BPHKinematicFit
Definition: BPHKinematicFit.h:38
BPHMassFitSelect::setFitConstraint
void setFitConstraint()
set fit constraint
Definition: BPHMassFitSelect.h:94
BPHMassFitSelect::~BPHMassFitSelect
~BPHMassFitSelect() override
Definition: BPHMassFitSelect.h:66
BPHMassFitSelect::getMultiTrackKC
MultiTrackKinematicConstraint * getMultiTrackKC() const
Definition: BPHMassFitSelect.h:140
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
BPHMassFitSelect::setFitConstraint
void setFitConstraint(const std::string &name, double mass, double sigma)
Definition: BPHMassFitSelect.h:110
BPHMassFitSelect::accept
bool accept(const BPHKinematicFit &cand) const override
select particle
Definition: BPHMassFitSelect.h:71
BPHMassFitSelect::BPHMassFitSelect
BPHMassFitSelect(const std::string &name, MultiTrackKinematicConstraint *c, double minMass, double maxMass)
Definition: BPHMassFitSelect.h:55
BPHMassCuts
Definition: BPHMassCuts.h:31
BPHMassFitSelect::cSigma
double cSigma
Definition: BPHMassFitSelect.h:148
BPHMassFitSelect
Definition: BPHMassFitSelect.h:34