Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:22

0001 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHChi2Select_h
0002 #define HeavyFlavorAnalysis_SpecificDecay_BPHChi2Select_h
0003 /** \class BPHChi2Select
0004  *
0005  *  Description: 
0006  *     Class for candidate selection by chisquare (at vertex fit level)
0007  *
0008  *  \author Paolo Ronchese INFN Padova
0009  *
0010  */
0011 
0012 //----------------------
0013 // Base Class Headers --
0014 //----------------------
0015 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHVertexSelect.h"
0016 
0017 //------------------------------------
0018 // Collaborating Class Declarations --
0019 //------------------------------------
0020 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHDecayVertex.h"
0021 #include "TMath.h"
0022 
0023 //---------------
0024 // C++ Headers --
0025 //---------------
0026 
0027 //              ---------------------
0028 //              -- Class Interface --
0029 //              ---------------------
0030 
0031 class BPHChi2Select : public BPHVertexSelect {
0032 public:
0033   /** Constructor
0034    */
0035   BPHChi2Select(double prob) : probMin(prob) {}
0036 
0037   // deleted copy constructor and assignment operator
0038   BPHChi2Select(const BPHChi2Select& x) = delete;
0039   BPHChi2Select& operator=(const BPHChi2Select& x) = delete;
0040 
0041   /** Destructor
0042    */
0043   ~BPHChi2Select() override {}
0044 
0045   /** Operations
0046    */
0047   /// select vertex
0048   bool accept(const BPHDecayVertex& cand) const override {
0049     if (probMin < 0.0)
0050       return true;
0051     const reco::Vertex& v = cand.vertex();
0052     if (v.isFake())
0053       return false;
0054     if (!v.isValid())
0055       return false;
0056     return (TMath::Prob(v.chi2(), lround(v.ndof())) >= probMin);
0057   }
0058 
0059   /// set prob min
0060   void setProbMin(double p) {
0061     probMin = p;
0062     return;
0063   }
0064 
0065   /// get current prob min
0066   double getProbMin() const { return probMin; }
0067 
0068 private:
0069   double probMin;
0070 };
0071 
0072 #endif