1 |
antoniov |
1.1 |
|
2 |
|
|
#include "FWCore/Framework/interface/EDProducer.h"
|
3 |
|
|
#include "FWCore/Utilities/interface/InputTag.h"
|
4 |
|
|
#include "FWCore/Framework/interface/EventSetup.h"
|
5 |
|
|
|
6 |
|
|
#include "ForwardAnalysis/Utilities/interface/AcceptCaloTower.h"
|
7 |
|
|
|
8 |
|
|
#include <vector>
|
9 |
|
|
|
10 |
|
|
class CaloTower;
|
11 |
|
|
|
12 |
|
|
class HCALActivitySummary : public edm::EDProducer {
|
13 |
|
|
public:
|
14 |
|
|
HCALActivitySummary( edm::ParameterSet const& );
|
15 |
|
|
private:
|
16 |
|
|
void produce( edm::Event &, edm::EventSetup const& );
|
17 |
|
|
bool checkTowerFlagsHB( CaloTower const& );
|
18 |
|
|
bool checkTowerFlagsHE( CaloTower const& );
|
19 |
|
|
bool checkTowerFlagsHF( CaloTower const&, double );
|
20 |
|
|
|
21 |
|
|
forwardAnalysis::AcceptCaloTower acceptCaloTower_;
|
22 |
|
|
edm::InputTag caloTowersTag_;
|
23 |
|
|
|
24 |
|
|
double eThresholdHBMin_;
|
25 |
|
|
double eThresholdHBMax_;
|
26 |
|
|
double eThresholdHEMin_;
|
27 |
|
|
double eThresholdHEMax_;
|
28 |
|
|
double eThresholdHFMin_;
|
29 |
|
|
double eThresholdHFMax_;
|
30 |
|
|
double eThresholdEBMin_;
|
31 |
|
|
double eThresholdEBMax_;
|
32 |
|
|
double eThresholdEEMin_;
|
33 |
|
|
double eThresholdEEMax_;
|
34 |
|
|
unsigned int nThresholdIter_;
|
35 |
|
|
bool discardFlaggedTowers_;
|
36 |
|
|
bool applyEnergyScale_;
|
37 |
|
|
double energyScaleHB_;
|
38 |
|
|
double energyScaleHE_;
|
39 |
|
|
double energyScaleHF_;
|
40 |
|
|
double energyScaleEB_;
|
41 |
|
|
double energyScaleEE_;
|
42 |
|
|
std::vector<double> thresholdsHB_;
|
43 |
|
|
std::vector<double> thresholdsHE_;
|
44 |
|
|
std::vector<double> thresholdsHF_;
|
45 |
|
|
std::vector<double> thresholdsEB_;
|
46 |
|
|
std::vector<double> thresholdsEE_;
|
47 |
|
|
};
|
48 |
|
|
|
49 |
|
|
#include "DataFormats/Common/interface/Handle.h"
|
50 |
|
|
#include "FWCore/Framework/interface/Event.h"
|
51 |
|
|
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
52 |
|
|
#include "FWCore/Framework/interface/MakerMacros.h"
|
53 |
|
|
#include "FWCore/Framework/interface/ESHandle.h"
|
54 |
|
|
#include "FWCore/MessageLogger/interface/MessageLogger.h"
|
55 |
|
|
|
56 |
|
|
#include "DataFormats/CaloTowers/interface/CaloTower.h"
|
57 |
|
|
#include "DataFormats/CaloTowers/interface/CaloTowerFwd.h"
|
58 |
|
|
#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
|
59 |
|
|
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
|
60 |
|
|
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
|
61 |
|
|
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
|
62 |
|
|
|
63 |
|
|
using namespace reco;
|
64 |
|
|
|
65 |
|
|
HCALActivitySummary::HCALActivitySummary(edm::ParameterSet const& pset):
|
66 |
|
|
acceptCaloTower_(pset),
|
67 |
|
|
caloTowersTag_(pset.getParameter<edm::InputTag>("CaloTowersTag")),
|
68 |
|
|
eThresholdHBMin_(pset.getParameter<double>("TowerEnergyThresholdHBMin")),
|
69 |
|
|
eThresholdHBMax_(pset.getParameter<double>("TowerEnergyThresholdHBMax")),
|
70 |
|
|
eThresholdHEMin_(pset.getParameter<double>("TowerEnergyThresholdHEMin")),
|
71 |
|
|
eThresholdHEMax_(pset.getParameter<double>("TowerEnergyThresholdHEMax")),
|
72 |
|
|
eThresholdHFMin_(pset.getParameter<double>("TowerEnergyThresholdHFMin")),
|
73 |
|
|
eThresholdHFMax_(pset.getParameter<double>("TowerEnergyThresholdHFMax")),
|
74 |
|
|
eThresholdEBMin_(pset.getParameter<double>("TowerEnergyThresholdEBMin")),
|
75 |
|
|
eThresholdEBMax_(pset.getParameter<double>("TowerEnergyThresholdEBMax")),
|
76 |
|
|
eThresholdEEMin_(pset.getParameter<double>("TowerEnergyThresholdEEMin")),
|
77 |
|
|
eThresholdEEMax_(pset.getParameter<double>("TowerEnergyThresholdEEMax")),
|
78 |
|
|
nThresholdIter_(pset.getParameter<unsigned int>("NumberOfThresholds")),
|
79 |
|
|
discardFlaggedTowers_(pset.getParameter<bool>("DiscardFlaggedTowers")),
|
80 |
|
|
applyEnergyScale_(pset.getParameter<bool>("ApplyEnergyScale")),
|
81 |
|
|
energyScaleHB_(1.0),
|
82 |
|
|
energyScaleHE_(1.0),
|
83 |
|
|
energyScaleHF_(1.0),
|
84 |
|
|
energyScaleEB_(1.0),
|
85 |
|
|
energyScaleEE_(1.0) {
|
86 |
|
|
|
87 |
|
|
if(applyEnergyScale_){
|
88 |
|
|
energyScaleHB_ = pset.getParameter<double>("EnergyScaleFactorHB");
|
89 |
|
|
energyScaleHE_ = pset.getParameter<double>("EnergyScaleFactorHE");
|
90 |
|
|
energyScaleHF_ = pset.getParameter<double>("EnergyScaleFactorHF");
|
91 |
|
|
energyScaleEB_ = pset.getParameter<double>("EnergyScaleFactorEB");
|
92 |
|
|
energyScaleEE_ = pset.getParameter<double>("EnergyScaleFactorEE");
|
93 |
|
|
}
|
94 |
|
|
|
95 |
|
|
thresholdsHB_ = std::vector<double>(nThresholdIter_);
|
96 |
|
|
thresholdsHE_ = std::vector<double>(nThresholdIter_);
|
97 |
|
|
thresholdsHF_ = std::vector<double>(nThresholdIter_);
|
98 |
|
|
thresholdsEB_ = std::vector<double>(nThresholdIter_);
|
99 |
|
|
thresholdsEE_ = std::vector<double>(nThresholdIter_);
|
100 |
|
|
for(size_t k = 0; k < nThresholdIter_; ++k){
|
101 |
|
|
thresholdsHB_[k] = eThresholdHBMin_ + k*((eThresholdHBMax_ - eThresholdHBMin_)/nThresholdIter_);
|
102 |
|
|
thresholdsHE_[k] = eThresholdHEMin_ + k*((eThresholdHEMax_ - eThresholdHEMin_)/nThresholdIter_);
|
103 |
|
|
thresholdsHF_[k] = eThresholdHFMin_ + k*((eThresholdHFMax_ - eThresholdHFMin_)/nThresholdIter_);
|
104 |
|
|
thresholdsEB_[k] = eThresholdEBMin_ + k*((eThresholdEBMax_ - eThresholdEBMin_)/nThresholdIter_);
|
105 |
|
|
thresholdsEE_[k] = eThresholdEEMin_ + k*((eThresholdEEMax_ - eThresholdEEMin_)/nThresholdIter_);
|
106 |
|
|
}
|
107 |
|
|
|
108 |
|
|
std::string alias;
|
109 |
|
|
// HB
|
110 |
|
|
//FIXME: thresholds should not be event by event product
|
111 |
|
|
produces<std::vector<double> >( alias = "thresholdsHB" ).setBranchAlias( alias );
|
112 |
|
|
produces<std::vector<unsigned int> >( alias = "nHBplus" ).setBranchAlias( alias );
|
113 |
|
|
produces<std::vector<unsigned int> >( alias = "nHBminus" ).setBranchAlias( alias );
|
114 |
|
|
produces<std::vector<double> >( alias = "sumEHBplus" ).setBranchAlias( alias );
|
115 |
|
|
produces<std::vector<double> >( alias = "sumEHBminus" ).setBranchAlias( alias );
|
116 |
|
|
produces<std::vector<double> >( alias = "sumETHBplus" ).setBranchAlias( alias );
|
117 |
|
|
produces<std::vector<double> >( alias = "sumETHBminus" ).setBranchAlias( alias );
|
118 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaHBMultiplicityPlus" ).setBranchAlias( alias );
|
119 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaHBMultiplicityMinus" ).setBranchAlias( alias );
|
120 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHBEnergySumPlus").setBranchAlias( alias );
|
121 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHBEnergySumMinus").setBranchAlias( alias );
|
122 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHBETSumPlus").setBranchAlias( alias );
|
123 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHBETSumMinus").setBranchAlias( alias );
|
124 |
|
|
// HE
|
125 |
|
|
produces<std::vector<double> >( alias = "thresholdsHE" ).setBranchAlias( alias );
|
126 |
|
|
produces<std::vector<unsigned int> >( alias = "nHEplus" ).setBranchAlias( alias );
|
127 |
|
|
produces<std::vector<unsigned int> >( alias = "nHEminus" ).setBranchAlias( alias );
|
128 |
|
|
produces<std::vector<double> >( alias = "sumEHEplus" ).setBranchAlias( alias );
|
129 |
|
|
produces<std::vector<double> >( alias = "sumEHEminus" ).setBranchAlias( alias );
|
130 |
|
|
produces<std::vector<double> >( alias = "sumETHEplus" ).setBranchAlias( alias );
|
131 |
|
|
produces<std::vector<double> >( alias = "sumETHEminus" ).setBranchAlias( alias );
|
132 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaHEMultiplicityPlus" ).setBranchAlias( alias );
|
133 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaHEMultiplicityMinus" ).setBranchAlias( alias );
|
134 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHEEnergySumPlus").setBranchAlias( alias );
|
135 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHEEnergySumMinus").setBranchAlias( alias );
|
136 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHEETSumPlus").setBranchAlias( alias );
|
137 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHEETSumMinus").setBranchAlias( alias );
|
138 |
|
|
// HF
|
139 |
|
|
produces<std::vector<double> >( alias = "thresholdsHF" ).setBranchAlias( alias );
|
140 |
|
|
produces<std::vector<unsigned int> >( alias = "nHFplus" ).setBranchAlias( alias );
|
141 |
|
|
produces<std::vector<unsigned int> >( alias = "nHFminus" ).setBranchAlias( alias );
|
142 |
|
|
produces<std::vector<double> >( alias = "sumEHFplus" ).setBranchAlias( alias );
|
143 |
|
|
produces<std::vector<double> >( alias = "sumEHFminus" ).setBranchAlias( alias );
|
144 |
|
|
produces<std::vector<double> >( alias = "sumETHFplus" ).setBranchAlias( alias );
|
145 |
|
|
produces<std::vector<double> >( alias = "sumETHFminus" ).setBranchAlias( alias );
|
146 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaHFMultiplicityPlus" ).setBranchAlias( alias );
|
147 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaHFMultiplicityMinus" ).setBranchAlias( alias );
|
148 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHFEnergySumPlus").setBranchAlias( alias );
|
149 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHFEnergySumMinus").setBranchAlias( alias );
|
150 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHFETSumPlus").setBranchAlias( alias );
|
151 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaHFETSumMinus").setBranchAlias( alias );
|
152 |
|
|
// EB
|
153 |
|
|
produces<std::vector<double> >( alias = "thresholdsEB" ).setBranchAlias( alias ); produces<std::vector<unsigned int> >( alias = "nEBplus" ).setBranchAlias( alias );
|
154 |
|
|
produces<std::vector<unsigned int> >( alias = "nEBminus" ).setBranchAlias( alias ); produces<std::vector<double> >( alias = "sumEEBplus" ).setBranchAlias( alias );
|
155 |
|
|
produces<std::vector<double> >( alias = "sumEEBminus" ).setBranchAlias( alias );
|
156 |
|
|
produces<std::vector<double> >( alias = "sumETEBplus" ).setBranchAlias( alias );
|
157 |
|
|
produces<std::vector<double> >( alias = "sumETEBminus" ).setBranchAlias( alias );
|
158 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaEBMultiplicityPlus" ).setBranchAlias( alias );
|
159 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaEBMultiplicityMinus" ).setBranchAlias( alias );
|
160 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEBEnergySumPlus").setBranchAlias( alias );
|
161 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEBEnergySumMinus").setBranchAlias( alias );
|
162 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEBETSumPlus").setBranchAlias( alias );
|
163 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEBETSumMinus").setBranchAlias( alias );
|
164 |
|
|
// EE
|
165 |
|
|
produces<std::vector<double> >( alias = "thresholdsEE" ).setBranchAlias( alias ); produces<std::vector<unsigned int> >( alias = "nEEplus" ).setBranchAlias( alias );
|
166 |
|
|
produces<std::vector<unsigned int> >( alias = "nEEminus" ).setBranchAlias( alias ); produces<std::vector<double> >( alias = "sumEEEplus" ).setBranchAlias( alias );
|
167 |
|
|
produces<std::vector<double> >( alias = "sumEEEminus" ).setBranchAlias( alias );
|
168 |
|
|
produces<std::vector<double> >( alias = "sumETEEplus" ).setBranchAlias( alias );
|
169 |
|
|
produces<std::vector<double> >( alias = "sumETEEminus" ).setBranchAlias( alias );
|
170 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaEEMultiplicityPlus" ).setBranchAlias( alias );
|
171 |
|
|
produces<std::map<unsigned int, std::vector<unsigned int> > >( alias = "iEtaEEMultiplicityMinus" ).setBranchAlias( alias );
|
172 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEEEnergySumPlus").setBranchAlias( alias );
|
173 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEEEnergySumMinus").setBranchAlias( alias );
|
174 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEEETSumPlus").setBranchAlias( alias );
|
175 |
|
|
produces<std::map<unsigned int,std::vector<double> > >(alias = "iEtaEEETSumMinus").setBranchAlias( alias );
|
176 |
|
|
}
|
177 |
|
|
|
178 |
|
|
void HCALActivitySummary::produce(edm::Event& event, edm::EventSetup const& setup) {
|
179 |
|
|
|
180 |
|
|
edm::Handle<CaloTowerCollection> towerCollectionH;
|
181 |
|
|
event.getByLabel(caloTowersTag_,towerCollectionH);
|
182 |
|
|
const CaloTowerCollection& towerCollection = *(towerCollectionH.product());
|
183 |
|
|
|
184 |
|
|
// Loop over CaloTowers
|
185 |
|
|
std::map<int,std::vector<unsigned int> > iEtaHBMultiplicity;
|
186 |
|
|
std::map<int,std::vector<double> > iEtaHBEnergySum;
|
187 |
|
|
std::map<int,std::vector<double> > iEtaHBETSum;
|
188 |
|
|
std::map<int,std::vector<unsigned int> > iEtaHEMultiplicity;
|
189 |
|
|
std::map<int,std::vector<double> > iEtaHEEnergySum;
|
190 |
|
|
std::map<int,std::vector<double> > iEtaHEETSum;
|
191 |
|
|
std::map<int,std::vector<unsigned int> > iEtaHFMultiplicity;
|
192 |
|
|
std::map<int,std::vector<double> > iEtaHFEnergySum;
|
193 |
|
|
std::map<int,std::vector<double> > iEtaHFETSum;
|
194 |
|
|
std::map<int,std::vector<unsigned int> > iEtaEBMultiplicity;
|
195 |
|
|
std::map<int,std::vector<double> > iEtaEBEnergySum;
|
196 |
|
|
std::map<int,std::vector<double> > iEtaEBETSum;
|
197 |
|
|
std::map<int,std::vector<unsigned int> > iEtaEEMultiplicity;
|
198 |
|
|
std::map<int,std::vector<double> > iEtaEEEnergySum;
|
199 |
|
|
std::map<int,std::vector<double> > iEtaEEETSum;
|
200 |
|
|
|
201 |
|
|
CaloTowerCollection::const_iterator calotower = towerCollection.begin();
|
202 |
|
|
CaloTowerCollection::const_iterator calotowers_end = towerCollection.end();
|
203 |
|
|
for(; calotower != calotowers_end; ++calotower) {
|
204 |
|
|
|
205 |
|
|
// General calo tower selector
|
206 |
|
|
if( !acceptCaloTower_(*calotower) ) continue;
|
207 |
|
|
|
208 |
|
|
bool hasHCAL = false;
|
209 |
|
|
bool hasHF = false;
|
210 |
|
|
bool hasHE = false;
|
211 |
|
|
bool hasHB = false;
|
212 |
|
|
bool hasHO = false;
|
213 |
|
|
bool hasECAL = false;
|
214 |
|
|
bool hasEB = false;
|
215 |
|
|
bool hasEE = false;
|
216 |
|
|
|
217 |
|
|
for(size_t iconst = 0; iconst < calotower->constituentsSize(); iconst++){
|
218 |
|
|
DetId detId = calotower->constituent(iconst);
|
219 |
|
|
if( detId.det() == DetId::Hcal ){
|
220 |
|
|
hasHCAL = true;
|
221 |
|
|
HcalDetId hcalDetId(detId);
|
222 |
|
|
if( hcalDetId.subdet() == HcalForward ) hasHF = true;
|
223 |
|
|
else if( hcalDetId.subdet() == HcalEndcap ) hasHE = true;
|
224 |
|
|
else if( hcalDetId.subdet() == HcalBarrel ) hasHB = true;
|
225 |
|
|
else if( hcalDetId.subdet() == HcalOuter ) hasHO = true;
|
226 |
|
|
} else if( detId.det() == DetId::Ecal ){
|
227 |
|
|
hasECAL = true;
|
228 |
|
|
EcalSubdetector ecalSubDet = (EcalSubdetector)detId.subdetId();
|
229 |
|
|
if(ecalSubDet == EcalBarrel) hasEB = true;
|
230 |
|
|
else if(ecalSubDet == EcalEndcap) hasEE = true;
|
231 |
|
|
}
|
232 |
|
|
}
|
233 |
|
|
|
234 |
|
|
//int zside = calotower->zside();
|
235 |
|
|
//double eta = calotower->eta();
|
236 |
|
|
int ieta = calotower->ieta();
|
237 |
|
|
double energy = calotower->energy();
|
238 |
|
|
double emEnergy = calotower->emEnergy();
|
239 |
|
|
double hadEnergy = calotower->hadEnergy();
|
240 |
|
|
|
241 |
|
|
// FIXME: Determine ET from vertex position
|
242 |
|
|
//double towerEt = calotower->et(primVtx.position());
|
243 |
|
|
//double towerEt = calotower->et(primVtx.z());
|
244 |
|
|
double towerEt = calotower->et();
|
245 |
|
|
double towerEmEt = calotower->emEt();
|
246 |
|
|
double towerHadEt = calotower->hadEt();
|
247 |
|
|
|
248 |
|
|
// HCAL
|
249 |
|
|
bool isHBTower = hasHB && (!hasHE);
|
250 |
|
|
bool isHETower = hasHE && (!hasHB) && (!hasHF);
|
251 |
|
|
bool isHFTower = hasHF && (!hasHE);
|
252 |
|
|
// ECAL
|
253 |
|
|
bool isEBTower = hasEB && (!hasEE);
|
254 |
|
|
bool isEETower = hasEE && (!hasEB);
|
255 |
|
|
|
256 |
|
|
// HCAL
|
257 |
|
|
if(isHBTower){
|
258 |
|
|
bool acceptHBTower = true;
|
259 |
|
|
if(discardFlaggedTowers_ && checkTowerFlagsHB(*calotower)) acceptHBTower = false;
|
260 |
|
|
if(!acceptHBTower) continue;
|
261 |
|
|
|
262 |
|
|
if(applyEnergyScale_) { hadEnergy *= energyScaleHB_; towerHadEt *= energyScaleHB_; }
|
263 |
|
|
} else if(isHETower){
|
264 |
|
|
bool acceptHETower = true;
|
265 |
|
|
if(discardFlaggedTowers_ && checkTowerFlagsHE(*calotower)) acceptHETower = false;
|
266 |
|
|
if(!acceptHETower) continue;
|
267 |
|
|
|
268 |
|
|
if(applyEnergyScale_) { hadEnergy *= energyScaleHE_; towerHadEt *= energyScaleHE_; }
|
269 |
|
|
} else if(isHFTower){
|
270 |
|
|
bool acceptHFTower = true;
|
271 |
|
|
if(discardFlaggedTowers_ && checkTowerFlagsHF(*calotower,0.99)) acceptHFTower = false;
|
272 |
|
|
if(!acceptHFTower) continue;
|
273 |
|
|
|
274 |
|
|
if(applyEnergyScale_) {
|
275 |
|
|
energy *= energyScaleHF_; towerEt *= energyScaleHF_;
|
276 |
|
|
emEnergy *= energyScaleHF_; towerEmEt *= energyScaleHF_;
|
277 |
|
|
hadEnergy *= energyScaleHF_; towerHadEt *= energyScaleHF_;
|
278 |
|
|
}
|
279 |
|
|
}
|
280 |
|
|
// ECAL
|
281 |
|
|
if(isEBTower){
|
282 |
|
|
if(applyEnergyScale_) { emEnergy *= energyScaleEB_; towerEmEt *= energyScaleEB_; }
|
283 |
|
|
} else if(isEETower){
|
284 |
|
|
if(applyEnergyScale_) { emEnergy *= energyScaleEE_; towerEmEt *= energyScaleEE_; }
|
285 |
|
|
}
|
286 |
|
|
|
287 |
|
|
// Loop over tower thresholds
|
288 |
|
|
// For HB/HE use had. energy; for HF energy; for EB/EE em. energy
|
289 |
|
|
for(size_t i_threshold = 0; i_threshold < nThresholdIter_; ++i_threshold){
|
290 |
|
|
// HCAL
|
291 |
|
|
if( isHBTower && (hadEnergy >= thresholdsHB_[i_threshold]) ){
|
292 |
|
|
if(iEtaHBMultiplicity.find(ieta) == iEtaHBMultiplicity.end()){
|
293 |
|
|
iEtaHBMultiplicity[ieta] = std::vector<unsigned int>(nThresholdIter_);
|
294 |
|
|
iEtaHBEnergySum[ieta] = std::vector<double>(nThresholdIter_);
|
295 |
|
|
iEtaHBETSum[ieta] = std::vector<double>(nThresholdIter_);
|
296 |
|
|
}
|
297 |
|
|
++iEtaHBMultiplicity[ieta][i_threshold];
|
298 |
|
|
iEtaHBEnergySum[ieta][i_threshold] += hadEnergy;
|
299 |
|
|
iEtaHBETSum[ieta][i_threshold] += towerHadEt;
|
300 |
|
|
} else if( isHETower && (hadEnergy >= thresholdsHE_[i_threshold]) ){
|
301 |
|
|
if(iEtaHEMultiplicity.find(ieta) == iEtaHEMultiplicity.end()){
|
302 |
|
|
iEtaHEMultiplicity[ieta] = std::vector<unsigned int>(nThresholdIter_);
|
303 |
|
|
iEtaHEEnergySum[ieta] = std::vector<double>(nThresholdIter_);
|
304 |
|
|
iEtaHEETSum[ieta] = std::vector<double>(nThresholdIter_);
|
305 |
|
|
}
|
306 |
|
|
++iEtaHEMultiplicity[ieta][i_threshold];
|
307 |
|
|
iEtaHEEnergySum[ieta][i_threshold] += hadEnergy;
|
308 |
|
|
iEtaHEETSum[ieta][i_threshold] += towerHadEt;
|
309 |
|
|
} else if( isHFTower && (energy >= thresholdsHF_[i_threshold]) ){
|
310 |
|
|
if(iEtaHFMultiplicity.find(ieta) == iEtaHFMultiplicity.end()){
|
311 |
|
|
iEtaHFMultiplicity[ieta] = std::vector<unsigned int>(nThresholdIter_);
|
312 |
|
|
iEtaHFEnergySum[ieta] = std::vector<double>(nThresholdIter_);
|
313 |
|
|
iEtaHFETSum[ieta] = std::vector<double>(nThresholdIter_);
|
314 |
|
|
}
|
315 |
|
|
++iEtaHFMultiplicity[ieta][i_threshold];
|
316 |
|
|
iEtaHFEnergySum[ieta][i_threshold] += energy;
|
317 |
|
|
iEtaHFETSum[ieta][i_threshold] += towerEt;
|
318 |
|
|
}
|
319 |
|
|
// ECAL
|
320 |
|
|
if( isEBTower && (emEnergy >= thresholdsEB_[i_threshold]) ){
|
321 |
|
|
if(iEtaEBMultiplicity.find(ieta) == iEtaEBMultiplicity.end()){
|
322 |
|
|
iEtaEBMultiplicity[ieta] = std::vector<unsigned int>(nThresholdIter_);
|
323 |
|
|
iEtaEBEnergySum[ieta] = std::vector<double>(nThresholdIter_);
|
324 |
|
|
iEtaEBETSum[ieta] = std::vector<double>(nThresholdIter_);
|
325 |
|
|
}
|
326 |
|
|
++iEtaEBMultiplicity[ieta][i_threshold];
|
327 |
|
|
iEtaEBEnergySum[ieta][i_threshold] += emEnergy;
|
328 |
|
|
iEtaEBETSum[ieta][i_threshold] += towerEmEt;
|
329 |
|
|
} else if( isEETower && (emEnergy >= thresholdsEE_[i_threshold]) ){
|
330 |
|
|
if(iEtaEEMultiplicity.find(ieta) == iEtaEEMultiplicity.end()){
|
331 |
|
|
iEtaEEMultiplicity[ieta] = std::vector<unsigned int>(nThresholdIter_);
|
332 |
|
|
iEtaEEEnergySum[ieta] = std::vector<double>(nThresholdIter_);
|
333 |
|
|
iEtaEEETSum[ieta] = std::vector<double>(nThresholdIter_);
|
334 |
|
|
}
|
335 |
|
|
++iEtaEEMultiplicity[ieta][i_threshold];
|
336 |
|
|
iEtaEEEnergySum[ieta][i_threshold] += emEnergy;
|
337 |
|
|
iEtaEEETSum[ieta][i_threshold] += towerEmEt;
|
338 |
|
|
}
|
339 |
|
|
}
|
340 |
|
|
}
|
341 |
|
|
|
342 |
|
|
// HB
|
343 |
|
|
std::vector<unsigned int> nHB_plus(nThresholdIter_,0);
|
344 |
|
|
std::vector<unsigned int> nHB_minus(nThresholdIter_,0);
|
345 |
|
|
std::vector<double> sumEHB_plus(nThresholdIter_,0.);
|
346 |
|
|
std::vector<double> sumEHB_minus(nThresholdIter_,0.);
|
347 |
|
|
std::vector<double> sumETHB_plus(nThresholdIter_,0.);
|
348 |
|
|
std::vector<double> sumETHB_minus(nThresholdIter_,0.);
|
349 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaHBMultiplicity_plus;
|
350 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaHBMultiplicity_minus;
|
351 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHBEnergySum_plus;
|
352 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHBEnergySum_minus;
|
353 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHBETSum_plus;
|
354 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHBETSum_minus;
|
355 |
|
|
|
356 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itHBMult = iEtaHBMultiplicity.begin();
|
357 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itHBMult_end = iEtaHBMultiplicity.end();
|
358 |
|
|
for(; itHBMult != itHBMult_end; ++itHBMult){
|
359 |
|
|
int ieta = itHBMult->first;
|
360 |
|
|
std::vector<unsigned int> const& vec_mult = iEtaHBMultiplicity[ieta];
|
361 |
|
|
std::vector<double> const& vec_esum = iEtaHBEnergySum[ieta];
|
362 |
|
|
std::vector<double> const& vec_etsum = iEtaHBETSum[ieta];
|
363 |
|
|
for(size_t i_threshold = 0; i_threshold < nThresholdIter_; ++i_threshold){
|
364 |
|
|
if(ieta >= 0){
|
365 |
|
|
nHB_plus[i_threshold] += vec_mult[i_threshold];
|
366 |
|
|
sumEHB_plus[i_threshold] += vec_esum[i_threshold];
|
367 |
|
|
sumETHB_plus[i_threshold] += vec_etsum[i_threshold];
|
368 |
|
|
} else{
|
369 |
|
|
nHB_minus[i_threshold] += vec_mult[i_threshold];
|
370 |
|
|
sumEHB_minus[i_threshold] += vec_esum[i_threshold];
|
371 |
|
|
sumETHB_minus[i_threshold] += vec_etsum[i_threshold];
|
372 |
|
|
}
|
373 |
|
|
}
|
374 |
|
|
|
375 |
|
|
unsigned int abs_ieta = (ieta >= 0) ? ieta : -ieta;
|
376 |
|
|
if(ieta >= 0){
|
377 |
|
|
iEtaHBMultiplicity_plus[abs_ieta] = vec_mult;
|
378 |
|
|
iEtaHBEnergySum_plus[abs_ieta] = vec_esum;
|
379 |
|
|
iEtaHBETSum_plus[abs_ieta] = vec_etsum;
|
380 |
|
|
} else{
|
381 |
|
|
iEtaHBMultiplicity_minus[abs_ieta] = vec_mult;
|
382 |
|
|
iEtaHBEnergySum_minus[abs_ieta] = vec_esum;
|
383 |
|
|
iEtaHBETSum_minus[abs_ieta] = vec_etsum;
|
384 |
|
|
}
|
385 |
|
|
}
|
386 |
|
|
|
387 |
|
|
// HE
|
388 |
|
|
std::vector<unsigned int> nHE_plus(nThresholdIter_,0);
|
389 |
|
|
std::vector<unsigned int> nHE_minus(nThresholdIter_,0);
|
390 |
|
|
std::vector<double> sumEHE_plus(nThresholdIter_,0.);
|
391 |
|
|
std::vector<double> sumEHE_minus(nThresholdIter_,0.);
|
392 |
|
|
std::vector<double> sumETHE_plus(nThresholdIter_,0.);
|
393 |
|
|
std::vector<double> sumETHE_minus(nThresholdIter_,0.);
|
394 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaHEMultiplicity_plus;
|
395 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaHEMultiplicity_minus;
|
396 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHEEnergySum_plus;
|
397 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHEEnergySum_minus;
|
398 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHEETSum_plus;
|
399 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHEETSum_minus;
|
400 |
|
|
|
401 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itHEMult = iEtaHEMultiplicity.begin();
|
402 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itHEMult_end = iEtaHEMultiplicity.end();
|
403 |
|
|
for(; itHEMult != itHEMult_end; ++itHEMult){
|
404 |
|
|
int ieta = itHEMult->first;
|
405 |
|
|
std::vector<unsigned int> const& vec_mult = iEtaHEMultiplicity[ieta];
|
406 |
|
|
std::vector<double> const& vec_esum = iEtaHEEnergySum[ieta];
|
407 |
|
|
std::vector<double> const& vec_etsum = iEtaHEETSum[ieta];
|
408 |
|
|
for(size_t i_threshold = 0; i_threshold < nThresholdIter_; ++i_threshold){
|
409 |
|
|
if(ieta >= 0){
|
410 |
|
|
nHE_plus[i_threshold] += vec_mult[i_threshold];
|
411 |
|
|
sumEHE_plus[i_threshold] += vec_esum[i_threshold];
|
412 |
|
|
sumETHE_plus[i_threshold] += vec_etsum[i_threshold];
|
413 |
|
|
} else{
|
414 |
|
|
nHE_minus[i_threshold] += vec_mult[i_threshold];
|
415 |
|
|
sumEHE_minus[i_threshold] += vec_esum[i_threshold];
|
416 |
|
|
sumETHE_minus[i_threshold] += vec_etsum[i_threshold];
|
417 |
|
|
}
|
418 |
|
|
}
|
419 |
|
|
|
420 |
|
|
unsigned int abs_ieta = (ieta >= 0) ? ieta : -ieta;
|
421 |
|
|
if(ieta >= 0){
|
422 |
|
|
iEtaHEMultiplicity_plus[abs_ieta] = vec_mult;
|
423 |
|
|
iEtaHEEnergySum_plus[abs_ieta] = vec_esum;
|
424 |
|
|
iEtaHEETSum_plus[abs_ieta] = vec_etsum;
|
425 |
|
|
} else{
|
426 |
|
|
iEtaHEMultiplicity_minus[abs_ieta] = vec_mult;
|
427 |
|
|
iEtaHEEnergySum_minus[abs_ieta] = vec_esum;
|
428 |
|
|
iEtaHEETSum_minus[abs_ieta] = vec_etsum;
|
429 |
|
|
}
|
430 |
|
|
}
|
431 |
|
|
|
432 |
|
|
// HF
|
433 |
|
|
std::vector<unsigned int> nHF_plus(nThresholdIter_,0);
|
434 |
|
|
std::vector<unsigned int> nHF_minus(nThresholdIter_,0);
|
435 |
|
|
std::vector<double> sumEHF_plus(nThresholdIter_,0.);
|
436 |
|
|
std::vector<double> sumEHF_minus(nThresholdIter_,0.);
|
437 |
|
|
std::vector<double> sumETHF_plus(nThresholdIter_,0.);
|
438 |
|
|
std::vector<double> sumETHF_minus(nThresholdIter_,0.);
|
439 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaHFMultiplicity_plus;
|
440 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaHFMultiplicity_minus;
|
441 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHFEnergySum_plus;
|
442 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHFEnergySum_minus;
|
443 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHFETSum_plus;
|
444 |
|
|
std::map<unsigned int,std::vector<double> > iEtaHFETSum_minus;
|
445 |
|
|
|
446 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itHFMult = iEtaHFMultiplicity.begin();
|
447 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itHFMult_end = iEtaHFMultiplicity.end();
|
448 |
|
|
for(; itHFMult != itHFMult_end; ++itHFMult){
|
449 |
|
|
int ieta = itHFMult->first;
|
450 |
|
|
std::vector<unsigned int> const& vec_mult = iEtaHFMultiplicity[ieta];
|
451 |
|
|
std::vector<double> const& vec_esum = iEtaHFEnergySum[ieta];
|
452 |
|
|
std::vector<double> const& vec_etsum = iEtaHFETSum[ieta];
|
453 |
|
|
for(size_t i_threshold = 0; i_threshold < nThresholdIter_; ++i_threshold){
|
454 |
|
|
if(ieta >= 0){
|
455 |
|
|
nHF_plus[i_threshold] += vec_mult[i_threshold];
|
456 |
|
|
sumEHF_plus[i_threshold] += vec_esum[i_threshold];
|
457 |
|
|
sumETHF_plus[i_threshold] += vec_etsum[i_threshold];
|
458 |
|
|
} else{
|
459 |
|
|
nHF_minus[i_threshold] += vec_mult[i_threshold];
|
460 |
|
|
sumEHF_minus[i_threshold] += vec_esum[i_threshold];
|
461 |
|
|
sumETHF_minus[i_threshold] += vec_etsum[i_threshold];
|
462 |
|
|
}
|
463 |
|
|
}
|
464 |
|
|
|
465 |
|
|
unsigned int abs_ieta = (ieta >= 0) ? ieta : -ieta;
|
466 |
|
|
if(ieta >= 0){
|
467 |
|
|
iEtaHFMultiplicity_plus[abs_ieta] = vec_mult;
|
468 |
|
|
iEtaHFEnergySum_plus[abs_ieta] = vec_esum;
|
469 |
|
|
iEtaHFETSum_plus[abs_ieta] = vec_etsum;
|
470 |
|
|
} else{
|
471 |
|
|
iEtaHFMultiplicity_minus[abs_ieta] = vec_mult;
|
472 |
|
|
iEtaHFEnergySum_minus[abs_ieta] = vec_esum;
|
473 |
|
|
iEtaHFETSum_minus[abs_ieta] = vec_etsum;
|
474 |
|
|
}
|
475 |
|
|
}
|
476 |
|
|
|
477 |
|
|
// EB
|
478 |
|
|
std::vector<unsigned int> nEB_plus(nThresholdIter_,0);
|
479 |
|
|
std::vector<unsigned int> nEB_minus(nThresholdIter_,0);
|
480 |
|
|
std::vector<double> sumEEB_plus(nThresholdIter_,0.);
|
481 |
|
|
std::vector<double> sumEEB_minus(nThresholdIter_,0.);
|
482 |
|
|
std::vector<double> sumETEB_plus(nThresholdIter_,0.);
|
483 |
|
|
std::vector<double> sumETEB_minus(nThresholdIter_,0.);
|
484 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaEBMultiplicity_plus;
|
485 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaEBMultiplicity_minus;
|
486 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEBEnergySum_plus;
|
487 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEBEnergySum_minus;
|
488 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEBETSum_plus;
|
489 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEBETSum_minus;
|
490 |
|
|
|
491 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itEBMult = iEtaEBMultiplicity.begin();
|
492 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itEBMult_end = iEtaEBMultiplicity.end();
|
493 |
|
|
for(; itEBMult != itEBMult_end; ++itEBMult){
|
494 |
|
|
int ieta = itEBMult->first;
|
495 |
|
|
std::vector<unsigned int> const& vec_mult = iEtaEBMultiplicity[ieta];
|
496 |
|
|
std::vector<double> const& vec_esum = iEtaEBEnergySum[ieta];
|
497 |
|
|
std::vector<double> const& vec_etsum = iEtaEBETSum[ieta];
|
498 |
|
|
for(size_t i_threshold = 0; i_threshold < nThresholdIter_; ++i_threshold){
|
499 |
|
|
if(ieta >= 0){
|
500 |
|
|
nEB_plus[i_threshold] += vec_mult[i_threshold];
|
501 |
|
|
sumEEB_plus[i_threshold] += vec_esum[i_threshold];
|
502 |
|
|
sumETEB_plus[i_threshold] += vec_etsum[i_threshold];
|
503 |
|
|
} else{
|
504 |
|
|
nEB_minus[i_threshold] += vec_mult[i_threshold];
|
505 |
|
|
sumEEB_minus[i_threshold] += vec_esum[i_threshold];
|
506 |
|
|
sumETEB_minus[i_threshold] += vec_etsum[i_threshold];
|
507 |
|
|
}
|
508 |
|
|
}
|
509 |
|
|
|
510 |
|
|
unsigned int abs_ieta = (ieta >= 0) ? ieta : -ieta;
|
511 |
|
|
if(ieta >= 0){
|
512 |
|
|
iEtaEBMultiplicity_plus[abs_ieta] = vec_mult;
|
513 |
|
|
iEtaEBEnergySum_plus[abs_ieta] = vec_esum;
|
514 |
|
|
iEtaEBETSum_plus[abs_ieta] = vec_etsum;
|
515 |
|
|
} else{
|
516 |
|
|
iEtaEBMultiplicity_minus[abs_ieta] = vec_mult;
|
517 |
|
|
iEtaEBEnergySum_minus[abs_ieta] = vec_esum;
|
518 |
|
|
iEtaEBETSum_minus[abs_ieta] = vec_etsum;
|
519 |
|
|
}
|
520 |
|
|
}
|
521 |
|
|
|
522 |
|
|
// EE
|
523 |
|
|
std::vector<unsigned int> nEE_plus(nThresholdIter_,0);
|
524 |
|
|
std::vector<unsigned int> nEE_minus(nThresholdIter_,0);
|
525 |
|
|
std::vector<double> sumEEE_plus(nThresholdIter_,0.);
|
526 |
|
|
std::vector<double> sumEEE_minus(nThresholdIter_,0.);
|
527 |
|
|
std::vector<double> sumETEE_plus(nThresholdIter_,0.);
|
528 |
|
|
std::vector<double> sumETEE_minus(nThresholdIter_,0.);
|
529 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaEEMultiplicity_plus;
|
530 |
|
|
std::map<unsigned int,std::vector<unsigned int> > iEtaEEMultiplicity_minus;
|
531 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEEEnergySum_plus;
|
532 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEEEnergySum_minus;
|
533 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEEETSum_plus;
|
534 |
|
|
std::map<unsigned int,std::vector<double> > iEtaEEETSum_minus;
|
535 |
|
|
|
536 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itEEMult = iEtaEEMultiplicity.begin();
|
537 |
|
|
std::map<int,std::vector<unsigned int> >::const_iterator itEEMult_end = iEtaEEMultiplicity.end();
|
538 |
|
|
for(; itEEMult != itEEMult_end; ++itEEMult){
|
539 |
|
|
int ieta = itEEMult->first;
|
540 |
|
|
std::vector<unsigned int> const& vec_mult = iEtaEEMultiplicity[ieta];
|
541 |
|
|
std::vector<double> const& vec_esum = iEtaEEEnergySum[ieta];
|
542 |
|
|
std::vector<double> const& vec_etsum = iEtaEEETSum[ieta];
|
543 |
|
|
for(size_t i_threshold = 0; i_threshold < nThresholdIter_; ++i_threshold){
|
544 |
|
|
if(ieta >= 0){
|
545 |
|
|
nEE_plus[i_threshold] += vec_mult[i_threshold];
|
546 |
|
|
sumEEE_plus[i_threshold] += vec_esum[i_threshold];
|
547 |
|
|
sumETEE_plus[i_threshold] += vec_etsum[i_threshold];
|
548 |
|
|
} else{
|
549 |
|
|
nEE_minus[i_threshold] += vec_mult[i_threshold];
|
550 |
|
|
sumEEE_minus[i_threshold] += vec_esum[i_threshold];
|
551 |
|
|
sumETEE_minus[i_threshold] += vec_etsum[i_threshold];
|
552 |
|
|
}
|
553 |
|
|
}
|
554 |
|
|
|
555 |
|
|
unsigned int abs_ieta = (ieta >= 0) ? ieta : -ieta;
|
556 |
|
|
if(ieta >= 0){
|
557 |
|
|
iEtaEEMultiplicity_plus[abs_ieta] = vec_mult;
|
558 |
|
|
iEtaEEEnergySum_plus[abs_ieta] = vec_esum;
|
559 |
|
|
iEtaEEETSum_plus[abs_ieta] = vec_etsum;
|
560 |
|
|
} else{
|
561 |
|
|
iEtaEEMultiplicity_minus[abs_ieta] = vec_mult;
|
562 |
|
|
iEtaEEEnergySum_minus[abs_ieta] = vec_esum;
|
563 |
|
|
iEtaEEETSum_minus[abs_ieta] = vec_etsum;
|
564 |
|
|
}
|
565 |
|
|
}
|
566 |
|
|
|
567 |
|
|
// HB
|
568 |
|
|
std::auto_ptr<std::vector<double> > thresholdsHB_ptr( new std::vector<double>(thresholdsHB_) );
|
569 |
|
|
std::auto_ptr<std::vector<unsigned int> > nHBplus_ptr( new std::vector<unsigned int>(nHB_plus) );
|
570 |
|
|
std::auto_ptr<std::vector<unsigned int> > nHBminus_ptr( new std::vector<unsigned int>(nHB_minus) );
|
571 |
|
|
std::auto_ptr<std::vector<double> > sumEHBplus_ptr( new std::vector<double>(sumEHB_plus) );
|
572 |
|
|
std::auto_ptr<std::vector<double> > sumEHBminus_ptr( new std::vector<double>(sumEHB_minus) );
|
573 |
|
|
std::auto_ptr<std::vector<double> > sumETHBplus_ptr( new std::vector<double>(sumETHB_plus) );
|
574 |
|
|
std::auto_ptr<std::vector<double> > sumETHBminus_ptr( new std::vector<double>(sumETHB_minus) );
|
575 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaHBMultiplicityPlus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaHBMultiplicity_plus) );
|
576 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaHBMultiplicityMinus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaHBMultiplicity_minus) );
|
577 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHBEnergySumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHBEnergySum_plus) );
|
578 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHBEnergySumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHBEnergySum_minus) );
|
579 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHBETSumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHBETSum_plus) );
|
580 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHBETSumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHBETSum_minus) );
|
581 |
|
|
// HE
|
582 |
|
|
std::auto_ptr<std::vector<double> > thresholdsHE_ptr( new std::vector<double>(thresholdsHE_) );
|
583 |
|
|
std::auto_ptr<std::vector<unsigned int> > nHEplus_ptr( new std::vector<unsigned int>(nHE_plus) );
|
584 |
|
|
std::auto_ptr<std::vector<unsigned int> > nHEminus_ptr( new std::vector<unsigned int>(nHE_minus) );
|
585 |
|
|
std::auto_ptr<std::vector<double> > sumEHEplus_ptr( new std::vector<double>(sumEHE_plus) );
|
586 |
|
|
std::auto_ptr<std::vector<double> > sumEHEminus_ptr( new std::vector<double>(sumEHE_minus) );
|
587 |
|
|
std::auto_ptr<std::vector<double> > sumETHEplus_ptr( new std::vector<double>(sumETHE_plus) );
|
588 |
|
|
std::auto_ptr<std::vector<double> > sumETHEminus_ptr( new std::vector<double>(sumETHE_minus) );
|
589 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaHEMultiplicityPlus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaHEMultiplicity_plus) );
|
590 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaHEMultiplicityMinus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaHEMultiplicity_minus) );
|
591 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHEEnergySumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHEEnergySum_plus) );
|
592 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHEEnergySumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHEEnergySum_minus) );
|
593 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHEETSumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHEETSum_plus) );
|
594 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHEETSumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHEETSum_minus) );
|
595 |
|
|
// HF
|
596 |
|
|
std::auto_ptr<std::vector<double> > thresholdsHF_ptr( new std::vector<double>(thresholdsHF_) );
|
597 |
|
|
std::auto_ptr<std::vector<unsigned int> > nHFplus_ptr( new std::vector<unsigned int>(nHF_plus) );
|
598 |
|
|
std::auto_ptr<std::vector<unsigned int> > nHFminus_ptr( new std::vector<unsigned int>(nHF_minus) );
|
599 |
|
|
std::auto_ptr<std::vector<double> > sumEHFplus_ptr( new std::vector<double>(sumEHF_plus) );
|
600 |
|
|
std::auto_ptr<std::vector<double> > sumEHFminus_ptr( new std::vector<double>(sumEHF_minus) );
|
601 |
|
|
std::auto_ptr<std::vector<double> > sumETHFplus_ptr( new std::vector<double>(sumETHF_plus) );
|
602 |
|
|
std::auto_ptr<std::vector<double> > sumETHFminus_ptr( new std::vector<double>(sumETHF_minus) );
|
603 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaHFMultiplicityPlus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaHFMultiplicity_plus) );
|
604 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaHFMultiplicityMinus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaHFMultiplicity_minus) );
|
605 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHFEnergySumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHFEnergySum_plus) );
|
606 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHFEnergySumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHFEnergySum_minus) );
|
607 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHFETSumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHFETSum_plus) );
|
608 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaHFETSumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaHFETSum_minus) );
|
609 |
|
|
// EB
|
610 |
|
|
std::auto_ptr<std::vector<double> > thresholdsEB_ptr( new std::vector<double>(thresholdsEB_) );
|
611 |
|
|
std::auto_ptr<std::vector<unsigned int> > nEBplus_ptr( new std::vector<unsigned int>(nEB_plus) );
|
612 |
|
|
std::auto_ptr<std::vector<unsigned int> > nEBminus_ptr( new std::vector<unsigned int>(nEB_minus) );
|
613 |
|
|
std::auto_ptr<std::vector<double> > sumEEBplus_ptr( new std::vector<double>(sumEEB_plus) );
|
614 |
|
|
std::auto_ptr<std::vector<double> > sumEEBminus_ptr( new std::vector<double>(sumEEB_minus) );
|
615 |
|
|
std::auto_ptr<std::vector<double> > sumETEBplus_ptr( new std::vector<double>(sumETEB_plus) );
|
616 |
|
|
std::auto_ptr<std::vector<double> > sumETEBminus_ptr( new std::vector<double>(sumETEB_minus) );
|
617 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaEBMultiplicityPlus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaEBMultiplicity_plus) );
|
618 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaEBMultiplicityMinus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaEBMultiplicity_minus) );
|
619 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEBEnergySumPlus_ptr( new std::map<unsigned int, std::vector<double> >(iEtaEBEnergySum_plus) );
|
620 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEBEnergySumMinus_ptr( new std::map<unsigned int, std::vector<double> >(iEtaEBEnergySum_minus) );
|
621 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEBETSumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaEBETSum_plus) );
|
622 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEBETSumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaEBETSum_minus) );
|
623 |
|
|
// EE
|
624 |
|
|
std::auto_ptr<std::vector<double> > thresholdsEE_ptr( new std::vector<double>(thresholdsEE_) );
|
625 |
|
|
std::auto_ptr<std::vector<unsigned int> > nEEplus_ptr( new std::vector<unsigned int>(nEE_plus) );
|
626 |
|
|
std::auto_ptr<std::vector<unsigned int> > nEEminus_ptr( new std::vector<unsigned int>(nEE_minus) );
|
627 |
|
|
std::auto_ptr<std::vector<double> > sumEEEplus_ptr( new std::vector<double>(sumEEE_plus) );
|
628 |
|
|
std::auto_ptr<std::vector<double> > sumEEEminus_ptr( new std::vector<double>(sumEEE_minus) );
|
629 |
|
|
std::auto_ptr<std::vector<double> > sumETEEplus_ptr( new std::vector<double>(sumETEE_plus) );
|
630 |
|
|
std::auto_ptr<std::vector<double> > sumETEEminus_ptr( new std::vector<double>(sumETEE_minus) );
|
631 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaEEMultiplicityPlus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaEEMultiplicity_plus) );
|
632 |
|
|
std::auto_ptr<std::map<unsigned int, std::vector<unsigned int> > > iEtaEEMultiplicityMinus_ptr( new std::map<unsigned int, std::vector<unsigned int> >(iEtaEEMultiplicity_minus) );
|
633 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEEEnergySumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaEEEnergySum_plus) );
|
634 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEEEnergySumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaEEEnergySum_minus) );
|
635 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEEETSumPlus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaEEETSum_plus) );
|
636 |
|
|
std::auto_ptr<std::map<unsigned int,std::vector<double> > > iEtaEEETSumMinus_ptr( new std::map<unsigned int,std::vector<double> >(iEtaEEETSum_minus) );
|
637 |
|
|
|
638 |
|
|
event.put( thresholdsHB_ptr, "thresholdsHB" );
|
639 |
|
|
event.put( nHBplus_ptr, "nHBplus" );
|
640 |
|
|
event.put( nHBminus_ptr, "nHBminus" );
|
641 |
|
|
event.put( sumEHBplus_ptr, "sumEHBplus" );
|
642 |
|
|
event.put( sumEHBminus_ptr, "sumEHBminus" );
|
643 |
|
|
event.put( sumETHBplus_ptr, "sumETHBplus" );
|
644 |
|
|
event.put( sumETHBminus_ptr, "sumETHBminus" );
|
645 |
|
|
event.put( iEtaHBMultiplicityPlus_ptr, "iEtaHBMultiplicityPlus" );
|
646 |
|
|
event.put( iEtaHBMultiplicityMinus_ptr, "iEtaHBMultiplicityMinus" );
|
647 |
|
|
event.put( iEtaHBEnergySumPlus_ptr, "iEtaHBEnergySumPlus" );
|
648 |
|
|
event.put( iEtaHBEnergySumMinus_ptr, "iEtaHBEnergySumMinus" );
|
649 |
|
|
event.put( iEtaHBETSumPlus_ptr, "iEtaHBETSumPlus" );
|
650 |
|
|
event.put( iEtaHBETSumMinus_ptr, "iEtaHBETSumMinus" );
|
651 |
|
|
|
652 |
|
|
event.put( thresholdsHE_ptr, "thresholdsHE" );
|
653 |
|
|
event.put( nHEplus_ptr, "nHEplus" );
|
654 |
|
|
event.put( nHEminus_ptr, "nHEminus" );
|
655 |
|
|
event.put( sumEHEplus_ptr, "sumEHEplus" );
|
656 |
|
|
event.put( sumEHEminus_ptr, "sumEHEminus" );
|
657 |
|
|
event.put( sumETHEplus_ptr, "sumETHEplus" );
|
658 |
|
|
event.put( sumETHEminus_ptr, "sumETHEminus" );
|
659 |
|
|
event.put( iEtaHEMultiplicityPlus_ptr, "iEtaHEMultiplicityPlus" );
|
660 |
|
|
event.put( iEtaHEMultiplicityMinus_ptr, "iEtaHEMultiplicityMinus" );
|
661 |
|
|
event.put( iEtaHEEnergySumPlus_ptr, "iEtaHEEnergySumPlus" );
|
662 |
|
|
event.put( iEtaHEEnergySumMinus_ptr, "iEtaHEEnergySumMinus" );
|
663 |
|
|
event.put( iEtaHEETSumPlus_ptr, "iEtaHEETSumPlus" );
|
664 |
|
|
event.put( iEtaHEETSumMinus_ptr, "iEtaHEETSumMinus" );
|
665 |
|
|
|
666 |
|
|
event.put( thresholdsHF_ptr, "thresholdsHF" );
|
667 |
|
|
event.put( nHFplus_ptr, "nHFplus" );
|
668 |
|
|
event.put( nHFminus_ptr, "nHFminus" );
|
669 |
|
|
event.put( sumEHFplus_ptr, "sumEHFplus" );
|
670 |
|
|
event.put( sumEHFminus_ptr, "sumEHFminus" );
|
671 |
|
|
event.put( sumETHFplus_ptr, "sumETHFplus" );
|
672 |
|
|
event.put( sumETHFminus_ptr, "sumETHFminus" );
|
673 |
|
|
event.put( iEtaHFMultiplicityPlus_ptr, "iEtaHFMultiplicityPlus" );
|
674 |
|
|
event.put( iEtaHFMultiplicityMinus_ptr, "iEtaHFMultiplicityMinus" );
|
675 |
|
|
event.put( iEtaHFEnergySumPlus_ptr, "iEtaHFEnergySumPlus" );
|
676 |
|
|
event.put( iEtaHFEnergySumMinus_ptr, "iEtaHFEnergySumMinus" );
|
677 |
|
|
event.put( iEtaHFETSumPlus_ptr, "iEtaHFETSumPlus" );
|
678 |
|
|
event.put( iEtaHFETSumMinus_ptr, "iEtaHFETSumMinus" );
|
679 |
|
|
|
680 |
|
|
event.put( thresholdsEB_ptr, "thresholdsEB" );
|
681 |
|
|
event.put( nEBplus_ptr, "nEBplus" );
|
682 |
|
|
event.put( nEBminus_ptr, "nEBminus" );
|
683 |
|
|
event.put( sumEEBplus_ptr, "sumEEBplus" );
|
684 |
|
|
event.put( sumEEBminus_ptr, "sumEEBminus" );
|
685 |
|
|
event.put( sumETEBplus_ptr, "sumETEBplus" );
|
686 |
|
|
event.put( sumETEBminus_ptr, "sumETEBminus" );
|
687 |
|
|
event.put( iEtaEBMultiplicityPlus_ptr, "iEtaEBMultiplicityPlus" );
|
688 |
|
|
event.put( iEtaEBMultiplicityMinus_ptr, "iEtaEBMultiplicityMinus" );
|
689 |
|
|
event.put( iEtaEBEnergySumPlus_ptr, "iEtaEBEnergySumPlus" );
|
690 |
|
|
event.put( iEtaEBEnergySumMinus_ptr, "iEtaEBEnergySumMinus" );
|
691 |
|
|
event.put( iEtaEBETSumPlus_ptr, "iEtaEBETSumPlus" );
|
692 |
|
|
event.put( iEtaEBETSumMinus_ptr, "iEtaEBETSumMinus" );
|
693 |
|
|
|
694 |
|
|
event.put( thresholdsEE_ptr, "thresholdsEE" );
|
695 |
|
|
event.put( nEEplus_ptr, "nEEplus" );
|
696 |
|
|
event.put( nEEminus_ptr, "nEEminus" );
|
697 |
|
|
event.put( sumEEEplus_ptr, "sumEEEplus" );
|
698 |
|
|
event.put( sumEEEminus_ptr, "sumEEEminus" );
|
699 |
|
|
event.put( sumETEEplus_ptr, "sumETEEplus" );
|
700 |
|
|
event.put( sumETEEminus_ptr, "sumETEEminus" );
|
701 |
|
|
event.put( iEtaEEMultiplicityPlus_ptr, "iEtaEEMultiplicityPlus" );
|
702 |
|
|
event.put( iEtaEEMultiplicityMinus_ptr, "iEtaEEMultiplicityMinus" );
|
703 |
|
|
event.put( iEtaEEEnergySumPlus_ptr, "iEtaEEEnergySumPlus" );
|
704 |
|
|
event.put( iEtaEEEnergySumMinus_ptr, "iEtaEEEnergySumMinus" );
|
705 |
|
|
event.put( iEtaEEETSumPlus_ptr, "iEtaEEETSumPlus" );
|
706 |
|
|
event.put( iEtaEEETSumMinus_ptr, "iEtaEEETSumMinus" );
|
707 |
|
|
}
|
708 |
|
|
|
709 |
|
|
bool HCALActivitySummary::checkTowerFlagsHB(CaloTower const& tower){ return false; }
|
710 |
|
|
|
711 |
|
|
bool HCALActivitySummary::checkTowerFlagsHE(CaloTower const& tower){ return false; }
|
712 |
|
|
|
713 |
|
|
bool HCALActivitySummary::checkTowerFlagsHF(CaloTower const& tower, double emFracThreshold){
|
714 |
|
|
bool flagged = false;
|
715 |
|
|
|
716 |
|
|
double emEnergy = tower.emEnergy();
|
717 |
|
|
double hadEnergy = tower.hadEnergy();
|
718 |
|
|
double eTot = emEnergy + hadEnergy;
|
719 |
|
|
double emFrac = fabs(emEnergy/eTot);
|
720 |
|
|
if(eTot > 50.0 && emFrac > emFracThreshold) flagged = true;
|
721 |
|
|
|
722 |
|
|
return flagged;
|
723 |
|
|
}
|
724 |
|
|
|
725 |
|
|
DEFINE_FWK_MODULE(HCALActivitySummary);
|