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