56 #include <TLorentzVector.h>
70 if(iConfig.
exists(
"HLTBitLabels"))
71 HLTBitLabel_ = iConfig.
getParameter<std::vector<edm::InputTag> >(
"HLTBitLabels");
95 for(
unsigned int i = 0 ;
i < HLTBitLabel_.size() ;
i++ )
97 if( HLTBitLabel_[
i].
label().size() )
99 hCT_NEvents_HLT.push_back( ibooker.
book1D(
"METTask_CT_"+HLTBitLabel_[
i].label(),HLTBitLabel_[
i].label(),2,-0.5,1.5) );
104 hCT_Nevents = ibooker.
book1D(
"METTask_CT_Nevents",
"",1,0,1);
106 hCT_et_ieta_iphi = ibooker.
book2D(
"METTask_CT_et_ieta_iphi",
"",83,-41,42, 72,1,73);
107 hCT_et_ieta_iphi->
getTH2F()->SetOption(
"colz");
108 hCT_et_ieta_iphi->setAxisTitle(
"ieta",1);
109 hCT_et_ieta_iphi->setAxisTitle(
"ephi",2);
111 hCT_emEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_emEt_ieta_iphi",
"",83,-41,42, 72,1,73);
112 hCT_emEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
113 hCT_emEt_ieta_iphi->setAxisTitle(
"ieta",1);
114 hCT_emEt_ieta_iphi->setAxisTitle(
"ephi",2);
115 hCT_hadEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_hadEt_ieta_iphi",
"",83,-41,42, 72,1,73);
116 hCT_hadEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
117 hCT_hadEt_ieta_iphi->setAxisTitle(
"ieta",1);
118 hCT_hadEt_ieta_iphi->setAxisTitle(
"ephi",2);
119 hCT_outerEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_outerEt_ieta_iphi",
"",83,-41,42, 72,1,73);
120 hCT_outerEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
121 hCT_outerEt_ieta_iphi->setAxisTitle(
"ieta",1);
122 hCT_outerEt_ieta_iphi->setAxisTitle(
"ephi",2);
123 hCT_Occ_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_ieta_iphi",
"",83,-41,42, 72,1,73);
124 hCT_Occ_ieta_iphi->
getTH2F()->SetOption(
"colz");
125 hCT_Occ_ieta_iphi->setAxisTitle(
"ieta",1);
126 hCT_Occ_ieta_iphi->setAxisTitle(
"ephi",2);
128 hCT_Occ_EM_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_EM_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
129 hCT_Occ_EM_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
130 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ieta",1);
131 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ephi",2);
133 hCT_Occ_HAD_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_HAD_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
134 hCT_Occ_HAD_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
135 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ieta",1);
136 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ephi",2);
138 hCT_Occ_Outer_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_Outer_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
139 hCT_Occ_Outer_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
140 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ieta",1);
141 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ephi",2);
150 hCT_etvsieta = ibooker.
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 10001,0,1001);
151 hCT_Minetvsieta = ibooker.
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 10001,0,1001);
152 hCT_Maxetvsieta = ibooker.
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 10001,0,1001);
153 hCT_emEtvsieta = ibooker.
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 10001,0,1001);
154 hCT_hadEtvsieta = ibooker.
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 10001,0,1001);
155 hCT_outerEtvsieta = ibooker.
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 10001,0,1001);
158 hCT_Occvsieta = ibooker.
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 84,0,84);
159 hCT_SETvsieta = ibooker.
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 20001,0,2001);
160 hCT_METvsieta = ibooker.
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 20001,0,2001);
161 hCT_METPhivsieta = ibooker.
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
162 hCT_MExvsieta = ibooker.
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 10001,-500,501);
163 hCT_MEyvsieta = ibooker.
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 10001,-500,501);
169 hCT_etvsieta = ibooker.
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 200,-0.5,999.5);
170 hCT_Minetvsieta = ibooker.
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
171 hCT_Maxetvsieta = ibooker.
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
172 hCT_emEtvsieta = ibooker.
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
173 hCT_hadEtvsieta = ibooker.
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
174 hCT_outerEtvsieta = ibooker.
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 80,-0.5,399.5);
178 hCT_Occvsieta = ibooker.
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 73,-0.5,72.5);
179 hCT_SETvsieta = ibooker.
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 200,-0.5,1999.5);
180 hCT_METvsieta = ibooker.
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 200,-0.5,1999.5);
181 hCT_METPhivsieta = ibooker.
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
182 hCT_MExvsieta = ibooker.
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 100,-499.5,499.5);
183 hCT_MEyvsieta = ibooker.
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 100,-499.5,499.5);
195 iEvent.
getByToken( HLTResultsLabel_ , TheHLTResults);
203 bool EventPasses =
true;
205 if( TheHLTResults.
isValid() && hltselection_ )
216 if(
index == 0 ) EventPasses =
false;
219 if( bit < TheHLTResults->
size() )
222 if( TheHLTResults->accept( bit ) && !TheHLTResults->error( bit ) )
225 hCT_NEvents_HLT[
index]->Fill(1);
228 hCT_NEvents_HLT[
index]->Fill(0);
233 <<
"The HLT Trigger Name : " << HLTBitLabel_[
index].label() <<
" is not valid for this trigger table " << std::endl;
239 if( !EventPasses && hltselection_ )
243 float ETTowerMin = -1;
244 float METRingMin = -2;
247 hCT_Nevents->Fill(0);
264 iEvent.
getByToken(HBHENoiseFilterResultLabel_, HBHENoiseFilterResultHandle);
265 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
266 if (!HBHENoiseFilterResultHandle.
isValid()) {
267 LogDebug(
"") <<
"CaloTowerAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
271 bool bHcalNoiseFilter = HBHENoiseFilterResult;
273 if(!bHcalNoiseFilter)
return;
281 int CTmin_iphi = 99, CTmax_iphi = -99;
282 int CTmin_ieta = 99, CTmax_ieta = -99;
284 TLorentzVector vMET_EtaRing[83];
286 int NActiveTowers[83];
287 double SET_EtaRing[83];
288 double MinEt_EtaRing[83];
289 double MaxEt_EtaRing[83];
290 for (
int i=0;
i<83;
i++)
293 NActiveTowers[
i] = 0;
295 MinEt_EtaRing[
i] = 0;
296 MaxEt_EtaRing[
i] = 0;
300 for ( ; towerCand != towers->end(); towerCand++)
302 const Candidate* candidate = &(*towerCand);
308 double Tower_ET = calotower->
et();
311 double Tower_Phi = calotower->
phi();
314 double Tower_OuterEt = calotower->
outerEt();
315 double Tower_EMEt = calotower->
emEt();
316 double Tower_HadEt = calotower->
hadEt();
319 int Tower_ieta = calotower->
id().
ieta();
320 int Tower_iphi = calotower->
id().
iphi();
321 int EtaRing = 41+Tower_ieta;
322 ActiveRing[EtaRing] = 1;
323 NActiveTowers[EtaRing]++;
324 SET_EtaRing[EtaRing]+=Tower_ET;
326 v_.SetPtEtaPhiE(Tower_ET, 0, Tower_Phi, Tower_ET);
327 if (Tower_ET>ETTowerMin)
328 vMET_EtaRing[EtaRing]-=v_;
331 hCT_Occ_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
332 if (calotower->
emEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
333 hCT_Occ_EM_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
334 if (calotower->
hadEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
335 hCT_Occ_HAD_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
336 if (calotower->
outerEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
337 hCT_Occ_Outer_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
339 hCT_et_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_ET);
340 hCT_emEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_EMEt);
341 hCT_hadEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_HadEt);
342 hCT_outerEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_OuterEt);
345 hCT_etvsieta->Fill(Tower_ieta, Tower_ET);
346 hCT_emEtvsieta->Fill(Tower_ieta, Tower_EMEt);
347 hCT_hadEtvsieta->Fill(Tower_ieta,Tower_HadEt);
348 hCT_outerEtvsieta->Fill(Tower_ieta,Tower_OuterEt);
351 if (Tower_ET > MaxEt_EtaRing[EtaRing])
352 MaxEt_EtaRing[EtaRing] = Tower_ET;
353 if (Tower_ET < MinEt_EtaRing[EtaRing] && Tower_ET>0)
354 MinEt_EtaRing[EtaRing] = Tower_ET;
357 if (Tower_ieta < CTmin_ieta) CTmin_ieta = Tower_ieta;
358 if (Tower_ieta > CTmax_ieta) CTmax_ieta = Tower_ieta;
359 if (Tower_iphi < CTmin_iphi) CTmin_iphi = Tower_iphi;
360 if (Tower_iphi > CTmax_iphi) CTmax_iphi = Tower_iphi;
368 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++)
370 hCT_Minetvsieta->Fill(iEtaRing-41, MinEt_EtaRing[iEtaRing]);
371 hCT_Maxetvsieta->Fill(iEtaRing-41, MaxEt_EtaRing[iEtaRing]);
373 if (ActiveRing[iEtaRing])
375 if (vMET_EtaRing[iEtaRing].
Pt()>METRingMin)
377 hCT_METPhivsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Phi());
378 hCT_MExvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Px());
379 hCT_MEyvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Py());
380 hCT_METvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Pt());
382 hCT_SETvsieta->Fill(iEtaRing-41, SET_EtaRing[iEtaRing]);
383 hCT_Occvsieta->Fill(iEtaRing-41, NActiveTowers[iEtaRing]);
388 edm::LogInfo(
"OutputInfo") <<
"CT ieta range: " << CTmin_ieta <<
" " << CTmax_ieta;
389 edm::LogInfo(
"OutputInfo") <<
"CT iphi range: " << CTmin_iphi <<
" " << CTmax_iphi;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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 &)
unsigned int triggerIndex(std::string const &name) const
MonitorElement * book1D(Args &&...args)
int iphi() const
get the tower iphi
CaloTowerDetId id() const
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
double et(double vtxZ) const
int ieta() const
get the tower ieta
TH2F * getTH2F(void) const
virtual double phi() const
momentum azimuthal angle
tuple size
Write out results.