File indexing completed on 2024-04-06 12:15:35
0001 #ifndef HeavyFlavorAnalysis_SpecificDecay_BPHChi2Select_h
0002 #define HeavyFlavorAnalysis_SpecificDecay_BPHChi2Select_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHVertexSelect.h"
0016
0017
0018
0019
0020 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHDecayVertex.h"
0021 #include "TMath.h"
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 class BPHChi2Select : public BPHVertexSelect {
0032 public:
0033
0034
0035 BPHChi2Select(double prob) : probMin(prob) {}
0036
0037
0038 BPHChi2Select(const BPHChi2Select& x) = delete;
0039 BPHChi2Select& operator=(const BPHChi2Select& x) = delete;
0040
0041
0042
0043 ~BPHChi2Select() override = default;
0044
0045
0046
0047
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
0060 void setProbMin(double p) {
0061 probMin = p;
0062 return;
0063 }
0064
0065
0066 double getProbMin() const { return probMin; }
0067
0068 private:
0069 double probMin;
0070 };
0071
0072 #endif