56 #include <TLorentzVector.h> 69 if(iConfig.
exists(
"HLTBitLabels"))
70 HLTBitLabel_ = iConfig.
getParameter<std::vector<edm::InputTag> >(
"HLTBitLabels");
94 for(
unsigned int i = 0 ;
i < HLTBitLabel_.size() ;
i++ )
96 if( !HLTBitLabel_[
i].
label().empty() )
98 hCT_NEvents_HLT.push_back( ibooker.
book1D(
"METTask_CT_"+HLTBitLabel_[
i].label(),HLTBitLabel_[
i].label(),2,-0.5,1.5) );
103 hCT_Nevents = ibooker.
book1D(
"METTask_CT_Nevents",
"",1,0,1);
105 hCT_et_ieta_iphi = ibooker.
book2D(
"METTask_CT_et_ieta_iphi",
"",83,-41,42, 72,1,73);
106 hCT_et_ieta_iphi->
getTH2F()->SetOption(
"colz");
107 hCT_et_ieta_iphi->setAxisTitle(
"ieta",1);
108 hCT_et_ieta_iphi->setAxisTitle(
"ephi",2);
110 hCT_emEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_emEt_ieta_iphi",
"",83,-41,42, 72,1,73);
111 hCT_emEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
112 hCT_emEt_ieta_iphi->setAxisTitle(
"ieta",1);
113 hCT_emEt_ieta_iphi->setAxisTitle(
"ephi",2);
114 hCT_hadEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_hadEt_ieta_iphi",
"",83,-41,42, 72,1,73);
115 hCT_hadEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
116 hCT_hadEt_ieta_iphi->setAxisTitle(
"ieta",1);
117 hCT_hadEt_ieta_iphi->setAxisTitle(
"ephi",2);
118 hCT_outerEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_outerEt_ieta_iphi",
"",83,-41,42, 72,1,73);
119 hCT_outerEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
120 hCT_outerEt_ieta_iphi->setAxisTitle(
"ieta",1);
121 hCT_outerEt_ieta_iphi->setAxisTitle(
"ephi",2);
122 hCT_Occ_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_ieta_iphi",
"",83,-41,42, 72,1,73);
123 hCT_Occ_ieta_iphi->
getTH2F()->SetOption(
"colz");
124 hCT_Occ_ieta_iphi->setAxisTitle(
"ieta",1);
125 hCT_Occ_ieta_iphi->setAxisTitle(
"ephi",2);
127 hCT_Occ_EM_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_EM_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
128 hCT_Occ_EM_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
129 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ieta",1);
130 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ephi",2);
132 hCT_Occ_HAD_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_HAD_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
133 hCT_Occ_HAD_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
134 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ieta",1);
135 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ephi",2);
137 hCT_Occ_Outer_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_Outer_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
138 hCT_Occ_Outer_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
139 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ieta",1);
140 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ephi",2);
149 hCT_etvsieta = ibooker.
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 10001,0,1001);
150 hCT_Minetvsieta = ibooker.
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 10001,0,1001);
151 hCT_Maxetvsieta = ibooker.
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 10001,0,1001);
152 hCT_emEtvsieta = ibooker.
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 10001,0,1001);
153 hCT_hadEtvsieta = ibooker.
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 10001,0,1001);
154 hCT_outerEtvsieta = ibooker.
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 10001,0,1001);
157 hCT_Occvsieta = ibooker.
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 84,0,84);
158 hCT_SETvsieta = ibooker.
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 20001,0,2001);
159 hCT_METvsieta = ibooker.
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 20001,0,2001);
160 hCT_METPhivsieta = ibooker.
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
161 hCT_MExvsieta = ibooker.
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 10001,-500,501);
162 hCT_MEyvsieta = ibooker.
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 10001,-500,501);
168 hCT_etvsieta = ibooker.
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 200,-0.5,999.5);
169 hCT_Minetvsieta = ibooker.
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
170 hCT_Maxetvsieta = ibooker.
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
171 hCT_emEtvsieta = ibooker.
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
172 hCT_hadEtvsieta = ibooker.
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
173 hCT_outerEtvsieta = ibooker.
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 80,-0.5,399.5);
177 hCT_Occvsieta = ibooker.
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 73,-0.5,72.5);
178 hCT_SETvsieta = ibooker.
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 200,-0.5,1999.5);
179 hCT_METvsieta = ibooker.
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 200,-0.5,1999.5);
180 hCT_METPhivsieta = ibooker.
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
181 hCT_MExvsieta = ibooker.
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 100,-499.5,499.5);
182 hCT_MEyvsieta = ibooker.
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 100,-499.5,499.5);
194 iEvent.
getByToken( HLTResultsLabel_ , TheHLTResults);
202 bool EventPasses =
true;
204 if( TheHLTResults.
isValid() && hltselection_ )
215 if(
index == 0 ) EventPasses =
false;
218 if( bit < TheHLTResults->
size() )
221 if( TheHLTResults->
accept( bit ) && !TheHLTResults->
error( bit ) )
224 hCT_NEvents_HLT[
index]->Fill(1);
227 hCT_NEvents_HLT[
index]->Fill(0);
232 <<
"The HLT Trigger Name : " << HLTBitLabel_[
index].label() <<
" is not valid for this trigger table " << std::endl;
238 if( !EventPasses && hltselection_ )
242 float ETTowerMin = -1;
243 float METRingMin = -2;
246 hCT_Nevents->Fill(0);
263 iEvent.
getByToken(HBHENoiseFilterResultLabel_, HBHENoiseFilterResultHandle);
264 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
265 if (!HBHENoiseFilterResultHandle.
isValid()) {
266 LogDebug(
"") <<
"CaloTowerAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
270 bool bHcalNoiseFilter = HBHENoiseFilterResult;
272 if(!bHcalNoiseFilter)
return;
280 int CTmin_iphi = 99, CTmax_iphi = -99;
281 int CTmin_ieta = 99, CTmax_ieta = -99;
283 TLorentzVector vMET_EtaRing[83];
285 int NActiveTowers[83];
286 double SET_EtaRing[83];
287 double MinEt_EtaRing[83];
288 double MaxEt_EtaRing[83];
289 for (
int i=0;
i<83;
i++)
292 NActiveTowers[
i] = 0;
294 MinEt_EtaRing[
i] = 0;
295 MaxEt_EtaRing[
i] = 0;
299 for ( ; towerCand != towers->end(); towerCand++)
301 const Candidate* candidate = &(*towerCand);
307 double Tower_ET = calotower->
et();
310 double Tower_Phi = calotower->
phi();
313 double Tower_OuterEt = calotower->
outerEt();
314 double Tower_EMEt = calotower->
emEt();
315 double Tower_HadEt = calotower->
hadEt();
318 int Tower_ieta = calotower->
id().
ieta();
319 int Tower_iphi = calotower->
id().
iphi();
320 int EtaRing = 41+Tower_ieta;
321 ActiveRing[EtaRing] = 1;
322 NActiveTowers[EtaRing]++;
323 SET_EtaRing[EtaRing]+=Tower_ET;
325 v_.SetPtEtaPhiE(Tower_ET, 0, Tower_Phi, Tower_ET);
326 if (Tower_ET>ETTowerMin)
327 vMET_EtaRing[EtaRing]-=v_;
330 hCT_Occ_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
331 if (calotower->
emEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
332 hCT_Occ_EM_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
333 if (calotower->
hadEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
334 hCT_Occ_HAD_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
335 if (calotower->
outerEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
336 hCT_Occ_Outer_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
338 hCT_et_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_ET);
339 hCT_emEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_EMEt);
340 hCT_hadEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_HadEt);
341 hCT_outerEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_OuterEt);
344 hCT_etvsieta->Fill(Tower_ieta, Tower_ET);
345 hCT_emEtvsieta->Fill(Tower_ieta, Tower_EMEt);
346 hCT_hadEtvsieta->Fill(Tower_ieta,Tower_HadEt);
347 hCT_outerEtvsieta->Fill(Tower_ieta,Tower_OuterEt);
350 if (Tower_ET > MaxEt_EtaRing[EtaRing])
351 MaxEt_EtaRing[EtaRing] = Tower_ET;
352 if (Tower_ET < MinEt_EtaRing[EtaRing] && Tower_ET>0)
353 MinEt_EtaRing[EtaRing] = Tower_ET;
356 if (Tower_ieta < CTmin_ieta) CTmin_ieta = Tower_ieta;
357 if (Tower_ieta > CTmax_ieta) CTmax_ieta = Tower_ieta;
358 if (Tower_iphi < CTmin_iphi) CTmin_iphi = Tower_iphi;
359 if (Tower_iphi > CTmax_iphi) CTmax_iphi = Tower_iphi;
367 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++)
369 hCT_Minetvsieta->Fill(iEtaRing-41, MinEt_EtaRing[iEtaRing]);
370 hCT_Maxetvsieta->Fill(iEtaRing-41, MaxEt_EtaRing[iEtaRing]);
372 if (ActiveRing[iEtaRing])
374 if (vMET_EtaRing[iEtaRing].
Pt()>METRingMin)
376 hCT_METPhivsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Phi());
377 hCT_MExvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Px());
378 hCT_MEyvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Py());
379 hCT_METvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Pt());
381 hCT_SETvsieta->Fill(iEtaRing-41, SET_EtaRing[iEtaRing]);
382 hCT_Occvsieta->Fill(iEtaRing-41, NActiveTowers[iEtaRing]);
387 edm::LogInfo(
"OutputInfo") <<
"CT ieta range: " << CTmin_ieta <<
" " << CTmax_ieta;
388 edm::LogInfo(
"OutputInfo") <<
"CT iphi range: " << CTmin_iphi <<
" " << CTmax_iphi;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool accept() const
Has at least one path accepted the event?
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual void dqmbeginRun(const edm::Run &, const edm::EventSetup &)
CaloTowerAnalyzer(const edm::ParameterSet &)
void setCurrentFolder(std::string const &fullpath)
unsigned int triggerIndex(std::string const &name) const
MonitorElement * book1D(Args &&...args)
int iphi() const
get the tower iphi
bool error() const
Has any path encountered an error (exception)
CaloTowerDetId id() const
MonitorElement * book2D(Args &&...args)
void analyze(const edm::Event &, const edm::EventSetup &) override
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
double et(double vtxZ) const
int ieta() const
get the tower ieta
double phi() const final
momentum azimuthal angle
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override