CMS 3D CMS Logo

PuppiAlgo.h
Go to the documentation of this file.
1 #ifndef CommonTools_PileupAlgos_PuppiAlgo_h
2 #define CommonTools_PileupAlgos_PuppiAlgo_h
3 
7 #include <vector>
8 
9 class PuppiAlgo{
10 public:
11  PuppiAlgo(edm::ParameterSet &iConfig);
12  ~PuppiAlgo();
13  //Computing Mean and RMS
14  void reset();
15  void fixAlgoEtaBin(int i_eta );
16  void add(const PuppiCandidate &iParticle,const double &iVal,const unsigned int iAlgo);
17  void computeMedRMS(const unsigned int &iAlgo,const double &iPVFrac);
18  //Get the Weight
19  double compute(std::vector<double> const &iVals,double iChi2) const;
20  const std::vector<float> & alphas(){ return fPups; }
21  //Helpers
22  inline int etaBins() const {return fEtaMin.size(); }
23  inline double etaMin(int i) const { return fEtaMin[i]; }
24  inline double etaMax(int i) const { return fEtaMax[i]; }
25  inline double ptMin() const { return cur_PtMin; }
26 
27  inline int numAlgos () const { return fNAlgos;}
28  inline int algoId ( unsigned int iAlgo) const { return fAlgoId.at(iAlgo); }
29  inline bool isCharged ( unsigned int iAlgo) const { return fCharged.at(iAlgo); }
30  inline double coneSize ( unsigned int iAlgo) const { return fConeSize.at(iAlgo); }
31  inline double neutralPt (int iNPV) const { return cur_NeutralPtMin + iNPV * cur_NeutralPtSlope; }
32 
33  inline double rms() const {return cur_RMS;}
34  inline double median() const {return cur_Med;}
35 
36 private:
37  unsigned int fNAlgos;
38  std::vector<double> fEtaMax;
39  std::vector<double> fEtaMin;
40  std::vector<double> fPtMin ;
41  std::vector<double> fNeutralPtMin;
42  std::vector<double> fNeutralPtSlope;
43 
44  std::vector<double> fRMSEtaSF;
45  std::vector<double> fMedEtaSF;
46  double fEtaMaxExtrap;
47 
48  double cur_PtMin;
51  double cur_RMS;
52  double cur_Med;
53 
54  std::vector<double> fRMS; // this is the raw RMS per algo
55  std::vector<double> fMedian; // this is the raw Median per algo
56  std::vector< std::vector<double> > fRMS_perEta; // this is the final RMS used after eta corrections
57  std::vector< std::vector<double> > fMedian_perEta; // this is the final Med used after eta corrections
58 
59  std::vector<float> fPups;
60  std::vector<float> fPupsPV;
61  std::vector<int> fAlgoId;
62  std::vector<bool> fCharged;
63  std::vector<bool> fAdjust;
64  std::vector<int> fCombId;
65  std::vector<double> fConeSize;
66  std::vector<double> fRMSPtMin;
67  std::vector<double> fRMSScaleFactor;
68  std::vector<double> fMean;
69  std::vector<int> fNCount;
70 
71 };
72 
73 
74 #endif
double neutralPt(int iNPV) const
Definition: PuppiAlgo.h:31
void add(const PuppiCandidate &iParticle, const double &iVal, const unsigned int iAlgo)
Definition: PuppiAlgo.cc:89
bool isCharged(unsigned int iAlgo) const
Definition: PuppiAlgo.h:29
double etaMax(int i) const
Definition: PuppiAlgo.h:24
double cur_PtMin
Definition: PuppiAlgo.h:48
double ptMin() const
Definition: PuppiAlgo.h:25
std::vector< double > fEtaMin
Definition: PuppiAlgo.h:39
const std::vector< float > & alphas()
Definition: PuppiAlgo.h:20
std::vector< bool > fAdjust
Definition: PuppiAlgo.h:63
std::vector< std::vector< double > > fMedian_perEta
Definition: PuppiAlgo.h:57
double rms() const
Definition: PuppiAlgo.h:33
PuppiAlgo(edm::ParameterSet &iConfig)
Definition: PuppiAlgo.cc:10
double cur_NeutralPtSlope
Definition: PuppiAlgo.h:50
std::vector< std::vector< double > > fRMS_perEta
Definition: PuppiAlgo.h:56
std::vector< double > fConeSize
Definition: PuppiAlgo.h:65
void reset()
Definition: PuppiAlgo.cc:70
double cur_Med
Definition: PuppiAlgo.h:52
double median() const
Definition: PuppiAlgo.h:34
~PuppiAlgo()
Definition: PuppiAlgo.cc:66
std::vector< double > fRMS
Definition: PuppiAlgo.h:54
std::vector< double > fNeutralPtMin
Definition: PuppiAlgo.h:41
int algoId(unsigned int iAlgo) const
Definition: PuppiAlgo.h:28
std::vector< float > fPupsPV
Definition: PuppiAlgo.h:60
int etaBins() const
Definition: PuppiAlgo.h:22
double cur_NeutralPtMin
Definition: PuppiAlgo.h:49
double compute(std::vector< double > const &iVals, double iChi2) const
Definition: PuppiAlgo.cc:187
std::vector< float > fPups
Definition: PuppiAlgo.h:59
std::vector< double > fMean
Definition: PuppiAlgo.h:68
std::vector< int > fAlgoId
Definition: PuppiAlgo.h:61
double coneSize(unsigned int iAlgo) const
Definition: PuppiAlgo.h:30
std::vector< double > fRMSPtMin
Definition: PuppiAlgo.h:66
std::vector< int > fCombId
Definition: PuppiAlgo.h:64
std::vector< double > fRMSScaleFactor
Definition: PuppiAlgo.h:67
std::vector< double > fPtMin
Definition: PuppiAlgo.h:40
std::vector< double > fRMSEtaSF
Definition: PuppiAlgo.h:44
std::vector< double > fNeutralPtSlope
Definition: PuppiAlgo.h:42
void computeMedRMS(const unsigned int &iAlgo, const double &iPVFrac)
Definition: PuppiAlgo.cc:123
std::vector< double > fMedEtaSF
Definition: PuppiAlgo.h:45
std::vector< double > fEtaMax
Definition: PuppiAlgo.h:38
double fEtaMaxExtrap
Definition: PuppiAlgo.h:46
double cur_RMS
Definition: PuppiAlgo.h:51
void fixAlgoEtaBin(int i_eta)
Definition: PuppiAlgo.cc:81
double etaMin(int i) const
Definition: PuppiAlgo.h:23
int numAlgos() const
Definition: PuppiAlgo.h:27
std::vector< bool > fCharged
Definition: PuppiAlgo.h:62
unsigned int fNAlgos
Definition: PuppiAlgo.h:37
std::vector< int > fNCount
Definition: PuppiAlgo.h:69
std::vector< double > fMedian
Definition: PuppiAlgo.h:55