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