CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BPHKinFitChi2Select.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHKinFitChi2Select_h
2 #define HeavyFlavorAnalysis_SpecificDecay_BPHKinFitChi2Select_h
3 
12 //----------------------
13 // Base Class Headers --
14 //----------------------
16 
17 //------------------------------------
18 // Collaborating Class Declarations --
19 //------------------------------------
21 #include "TMath.h"
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 // ---------------------
28 // -- Class Interface --
29 // ---------------------
30 
32 public:
35  BPHKinFitChi2Select(double prob) : probMin(prob) {}
36 
37  // deleted copy constructor and assignment operator
38  BPHKinFitChi2Select(const BPHKinFitChi2Select& x) = delete;
40 
43  ~BPHKinFitChi2Select() override {}
44 
47  bool accept(const BPHKinematicFit& cand) const override {
49  if (probMin < 0.0)
50  return true;
51  const RefCountedKinematicVertex tdv = cand.topDecayVertex();
52  if (tdv.get() == nullptr)
53  return false;
54  if (!tdv->vertexIsValid())
55  return false;
56  reco::Vertex v(*tdv);
57  if (v.isFake())
58  return false;
59  if (!v.isValid())
60  return false;
61  return (TMath::Prob(v.chi2(), lround(v.ndof())) >= probMin);
62  }
63 
65  void setProbMin(double p) {
66  probMin = p;
67  return;
68  }
69 
71  double getProbMin() const { return probMin; }
72 
73 private:
74  double probMin;
75 };
76 
77 #endif
bool accept(const BPHKinematicFit &cand) const override
select vertex
BPHKinFitChi2Select & operator=(const BPHKinFitChi2Select &x)=delete
double getProbMin() const
get current prob min
BPHKinFitChi2Select(double prob)
virtual const RefCountedKinematicVertex topDecayVertex() const
void setProbMin(double p)
set prob min