CMS 3D CMS Logo

BPHChi2Select.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHChi2Select_h
2 #define HeavyFlavorAnalysis_SpecificDecay_BPHChi2Select_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:
36 
37  // deleted copy constructor and assignment operator
38  BPHChi2Select(const BPHChi2Select& x) = delete;
39  BPHChi2Select& operator=(const BPHChi2Select& x) = delete;
40 
43  ~BPHChi2Select() override = default;
44 
47  bool accept(const BPHDecayVertex& cand) const override {
49  if (probMin < 0.0)
50  return true;
51  const reco::Vertex& v = cand.vertex();
52  if (v.isFake())
53  return false;
54  if (!v.isValid())
55  return false;
56  return (TMath::Prob(v.chi2(), lround(v.ndof())) >= probMin);
57  }
58 
60  void setProbMin(double p) {
61  probMin = p;
62  return;
63  }
64 
66  double getProbMin() const { return probMin; }
67 
68 private:
69  double probMin;
70 };
71 
72 #endif
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:66
BPHChi2Select(double prob)
Definition: BPHChi2Select.h:35
~BPHChi2Select() override=default
bool accept(const BPHDecayVertex &cand) const override
select vertex
Definition: BPHChi2Select.h:48
void setProbMin(double p)
set prob min
Definition: BPHChi2Select.h:60
BPHChi2Select & operator=(const BPHChi2Select &x)=delete