Fork me on GitHub

source: git/external/PUPPI/puppiAlgoBin.hh@ 781edf86

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 781edf86 was 0e11b5c, checked in by Michele Selvaggi <michele.selvaggi@…>, 9 years ago

Revert "added the new Puppi tune on CMS at 200 PU"

  • Property mode set to 100644
File size: 4.0 KB
RevLine 
[0e11b5c]1#ifndef PUPPIALGOBIN_HH
2#define PUPPIALGOBIN_HH
3
4#include <iostream>
5#include <vector>
6#include <cmath>
7
8//...................... class to identify the puppi Algorithm parameters to be used
9class puppiAlgoBin {
10
11 public :
12
13 puppiAlgoBin(){
14
15 fEtaMin_ = 0.;
16 fEtaMax_ = 0.;
17 fPtMin_ = 0.;
18 fConeSize_ = 0.;
19 fRMSPtMin_ = 0.;
20 fRMSScaleFactor_ = 1.0;
21 fNeutralMinE_ = 0.;
22 fNeutralPtSlope_ = 0.;
23 fApplyCHS_ = true;
24 fUseCharged_ = false ;
25 fApplyLowPUCorr_ = false;
26 fMetricId_ = 0;
27 fRMS_ = 0.;
28 fMean_ = 0.;
29 fMedian_ = 0.;
30 };
31
32 puppiAlgoBin(const float & etaMin, const float & etaMax, const float & ptMin, const float & coneSize, const float & RMSPtMin,
33 const float & RMSScaleFactor, const float & neutralMinE, const float & neutralPtSlope,
34 const bool & applyCHS, const bool & useCharged, const bool & applyLowPUCorr, const int & metricId):
35 fEtaMin_(etaMin),
36 fEtaMax_(etaMax),
37 fPtMin_(ptMin),
38 fConeSize_(coneSize),
39 fRMSPtMin_(RMSPtMin),
40 fRMSScaleFactor_(RMSScaleFactor),
41 fNeutralMinE_(neutralMinE),
42 fNeutralPtSlope_(neutralPtSlope),
43 fApplyCHS_(applyCHS),
44 fUseCharged_(useCharged),
45 fApplyLowPUCorr_(applyLowPUCorr),
46 fMetricId_(metricId)
47 {
48 fRMS_ = 0.;
49 fMean_ = 0.;
50 fMedian_ = 0.;
51
52 };
53
54 virtual ~puppiAlgoBin(){};
55
56 bool operator == (const puppiAlgoBin & algo2) const {
57 if( fEtaMin_ == algo2.fEtaMin_ and
58 fEtaMax_ == algo2.fEtaMax_ and
59 fApplyCHS_ == algo2.fApplyCHS_ and
60 fUseCharged_ == algo2.fUseCharged_ and
61 fApplyLowPUCorr_ == algo2.fApplyLowPUCorr_ and
62 fMetricId_ == algo2.fMetricId_ and
63 fPtMin_ == algo2.fPtMin_ and
64 fConeSize_ == algo2.fConeSize_ and
65 fRMSPtMin_ == algo2.fRMSPtMin_ and
66 fRMSScaleFactor_ == algo2.fRMSScaleFactor_ and
67 fNeutralMinE_ == algo2.fNeutralMinE_ and
68 fNeutralPtSlope_ == algo2.fNeutralPtSlope_ ) return true;
69 else return false;
70 };
71
72 void setPuppiParticles(const std::vector<puppiParticle> & puppiParticles){ // set the particles used by the current algorithm
73 fPuppiParticlesPU_.clear();
74 fPuppiParticlesPV_.clear();
75 fPuppiParticlesNULL_.clear();
76
77 for(size_t iPart = 0; iPart < puppiParticles.size(); iPart++){ // loop on the puppiParticles
78 if(puppiParticles.at(iPart).fPval_ == -999){ // default PVal
79 fPuppiParticlesNULL_.push_back(puppiParticles.at(iPart));
80 continue ;
81 }
82
83 if(puppiParticles.at(iPart).fPt_ < fRMSPtMin_){ // should be discarded in the RMS computation
84 fPuppiParticlesNULL_.push_back(puppiParticles.at(iPart));
85 continue ;
86 }
87
88 if(puppiParticles.at(iPart).fPt_ < fPtMin_){ // under the chosen pt cut
89 fPuppiParticlesNULL_.push_back(puppiParticles.at(iPart));
90 continue ;
91 }
92
93 // zero are neutral particle, 1 LV charged, 2PU
94 if(fUseCharged_ && (fabs(puppiParticles.at(iPart).fParticleId_) >=0 && fabs(puppiParticles.at(iPart).fParticleId_) <=1)) fPuppiParticlesPV_.push_back(puppiParticles.at(iPart));
95 if(fUseCharged_ && fabs(puppiParticles.at(iPart).fParticleId_) < 2) continue;
96 fPuppiParticlesPU_.push_back(puppiParticles.at(iPart));
97 }
98 };
99
100 float fEtaMin_;
101 float fEtaMax_;
102 float fPtMin_ ;
103 float fConeSize_;
104 float fRMSPtMin_;
105 float fRMSScaleFactor_;
106 float fNeutralMinE_;
107 float fNeutralPtSlope_;
108
109 bool fApplyCHS_;
110 bool fUseCharged_;
111 bool fApplyLowPUCorr_;
112
113 int fMetricId_;
114
115 float fRMS_;
116 float fMean_;
117 float fMedian_;
118
119 std::vector<puppiParticle> fPuppiParticlesPU_;
120 std::vector<puppiParticle> fPuppiParticlesPV_;
121 std::vector<puppiParticle> fPuppiParticlesNULL_;
122
123};
124
125#endif
Note: See TracBrowser for help on using the repository browser.