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  virtual ~BPHChi2Select() {}
43 
46  virtual bool accept( const BPHDecayVertex& cand ) const {
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 );
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 & operator=(const BPHChi2Select &x)
void setProbMin(double p)
set prob min
Definition: BPHChi2Select.h:55
double chi2() const
chi-squares
Definition: Vertex.h:98
virtual bool accept(const BPHDecayVertex &cand) const
select vertex
Definition: BPHChi2Select.h:47
double getProbMin() const
get current prob min
Definition: BPHChi2Select.h:58
double ndof() const
Definition: Vertex.h:105
virtual ~BPHChi2Select()
Definition: BPHChi2Select.h:42
bool isFake() const
Definition: Vertex.h:72
virtual const reco::Vertex & vertex() const
get reconstructed vertex