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:
35  BPHChi2Select(double prob) : probMin(prob) {}
36 
39  ~BPHChi2Select() override {}
40 
43  bool accept(const BPHDecayVertex& cand) const override {
45  const reco::Vertex& v = cand.vertex();
46  if (v.isFake())
47  return false;
48  if (!v.isValid())
49  return false;
50  return (TMath::Prob(v.chi2(), lround(v.ndof())) > probMin);
51  }
52 
54  void setProbMin(double p) {
55  probMin = p;
56  return;
57  }
58 
60  double getProbMin() const { return probMin; }
61 
62 private:
63  // private copy and assigment constructors
64  BPHChi2Select(const BPHChi2Select& x) = delete;
65  BPHChi2Select& operator=(const BPHChi2Select& x) = delete;
66 
67  double probMin;
68 };
69 
70 #endif
BPHChi2Select(double prob)
Definition: BPHChi2Select.h:35
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:71
~BPHChi2Select() override
Definition: BPHChi2Select.h:39
bool accept(const BPHDecayVertex &cand) const override
select vertex
Definition: BPHChi2Select.h:44
void setProbMin(double p)
set prob min
Definition: BPHChi2Select.h:54
double chi2() const
chi-squares
Definition: Vertex.h:102
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:60
double ndof() const
Definition: Vertex.h:109
bool isFake() const
Definition: Vertex.h:75
BPHChi2Select & operator=(const BPHChi2Select &x)=delete
virtual const reco::Vertex & vertex() const
get reconstructed vertex