CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PuppiAlgo.h
Go to the documentation of this file.
1 #ifndef CommonTools_PileupAlgos_PuppiAlgo_h
2 #define CommonTools_PileupAlgos_PuppiAlgo_h
3 
6 #include "fastjet/PseudoJet.hh"
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 add(const fastjet::PseudoJet &iParticle,const double &iVal,const unsigned int iAlgo);
16  void computeMedRMS(const unsigned int &iAlgo,const double &iPVFrac);
17  //Get the Weight
18  double compute(std::vector<double> const &iVals,double iChi2) const;
19  const std::vector<float> & alphas(){ return fPups; }
20  //Helpers
21  inline double ptMin() const { return fPtMin; }
22  inline double etaMin() const { return fEtaMin; }
23  inline double etaMax() const { return fEtaMax; }
24  inline int numAlgos () const { return fNAlgos;}
25  inline int algoId ( unsigned int iAlgo) const { return fAlgoId.at(iAlgo); }
26  inline bool isCharged ( unsigned int iAlgo) const { return fCharged.at(iAlgo); }
27  inline double coneSize ( unsigned int iAlgo) const { return fConeSize.at(iAlgo); }
28  inline double neutralPt (int iNPV) const { return fNeutralPtMin + iNPV * fNeutralPtSlope; }
29 
30  inline double rms( unsigned int i ) const {return fRMS[i];}
31  inline double median( unsigned int i ) const {return fMedian[i];}
32 
33 private:
34  unsigned int fNAlgos;
35  float fEtaMax;
36  float fEtaMin;
37  float fPtMin ;
38  double fNeutralPtMin;
40 
41  double fRMSEtaSF;
42  double fMedEtaSF;
43  double fEtaMaxExtrap;
44 
45  std::vector<double> fRMS;
46  std::vector<double> fMedian;
47 
48  std::vector<float> fPups;
49  std::vector<float> fPupsPV;
50  std::vector<int> fAlgoId;
51  std::vector<bool> fCharged;
52  std::vector<bool> fAdjust;
53  std::vector<int> fCombId;
54  std::vector<double> fConeSize;
55  std::vector<double> fRMSPtMin;
56  std::vector<double> fRMSScaleFactor;
57  std::vector<double> fMean;
58  std::vector<int> fNCount;
59 };
60 
61 
62 #endif
double neutralPt(int iNPV) const
Definition: PuppiAlgo.h:28
bool isCharged(unsigned int iAlgo) const
Definition: PuppiAlgo.h:26
int i
Definition: DBlmapReader.cc:9
double ptMin() const
Definition: PuppiAlgo.h:21
void add(const fastjet::PseudoJet &iParticle, const double &iVal, const unsigned int iAlgo)
Definition: PuppiAlgo.cc:63
double fMedEtaSF
Definition: PuppiAlgo.h:42
double fNeutralPtMin
Definition: PuppiAlgo.h:38
float fPtMin
Definition: PuppiAlgo.h:37
const std::vector< float > & alphas()
Definition: PuppiAlgo.h:19
std::vector< bool > fAdjust
Definition: PuppiAlgo.h:52
PuppiAlgo(edm::ParameterSet &iConfig)
Definition: PuppiAlgo.cc:11
double fRMSEtaSF
Definition: PuppiAlgo.h:41
float fEtaMin
Definition: PuppiAlgo.h:36
std::vector< double > fConeSize
Definition: PuppiAlgo.h:54
void reset()
Definition: PuppiAlgo.cc:53
double median(unsigned int i) const
Definition: PuppiAlgo.h:31
~PuppiAlgo()
Definition: PuppiAlgo.cc:49
std::vector< double > fRMS
Definition: PuppiAlgo.h:45
int algoId(unsigned int iAlgo) const
Definition: PuppiAlgo.h:25
std::vector< float > fPupsPV
Definition: PuppiAlgo.h:49
double compute(std::vector< double > const &iVals, double iChi2) const
Definition: PuppiAlgo.cc:158
std::vector< float > fPups
Definition: PuppiAlgo.h:48
std::vector< double > fMean
Definition: PuppiAlgo.h:57
std::vector< int > fAlgoId
Definition: PuppiAlgo.h:50
double coneSize(unsigned int iAlgo) const
Definition: PuppiAlgo.h:27
std::vector< double > fRMSPtMin
Definition: PuppiAlgo.h:55
std::vector< int > fCombId
Definition: PuppiAlgo.h:53
std::vector< double > fRMSScaleFactor
Definition: PuppiAlgo.h:56
double rms(unsigned int i) const
Definition: PuppiAlgo.h:30
void computeMedRMS(const unsigned int &iAlgo, const double &iPVFrac)
Definition: PuppiAlgo.cc:103
double fEtaMaxExtrap
Definition: PuppiAlgo.h:43
double fNeutralPtSlope
Definition: PuppiAlgo.h:39
double etaMax() const
Definition: PuppiAlgo.h:23
int numAlgos() const
Definition: PuppiAlgo.h:24
std::vector< bool > fCharged
Definition: PuppiAlgo.h:51
unsigned int fNAlgos
Definition: PuppiAlgo.h:34
double etaMin() const
Definition: PuppiAlgo.h:22
float fEtaMax
Definition: PuppiAlgo.h:35
std::vector< int > fNCount
Definition: PuppiAlgo.h:58
std::vector< double > fMedian
Definition: PuppiAlgo.h:46