56 #include <TLorentzVector.h>
68 if(iConfig.
exists(
"HLTBitLabels"))
69 HLTBitLabel_ = iConfig.
getParameter<std::vector<edm::InputTag> >(
"HLTBitLabels");
92 for(
unsigned int i = 0 ;
i < HLTBitLabel_.size() ;
i++ )
94 if( HLTBitLabel_[
i].
label().size() )
96 hCT_NEvents_HLT.push_back(
dbe_->
book1D(
"METTask_CT_"+HLTBitLabel_[
i].label(),HLTBitLabel_[
i].label(),2,-0.5,1.5) );
101 hCT_Nevents =
dbe_->
book1D(
"METTask_CT_Nevents",
"",1,0,1);
103 hCT_et_ieta_iphi =
dbe_->
book2D(
"METTask_CT_et_ieta_iphi",
"",83,-41,42, 72,1,73);
104 hCT_et_ieta_iphi->
getTH2F()->SetOption(
"colz");
105 hCT_et_ieta_iphi->setAxisTitle(
"ieta",1);
106 hCT_et_ieta_iphi->setAxisTitle(
"ephi",2);
108 hCT_emEt_ieta_iphi =
dbe_->
book2D(
"METTask_CT_emEt_ieta_iphi",
"",83,-41,42, 72,1,73);
109 hCT_emEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
110 hCT_emEt_ieta_iphi->setAxisTitle(
"ieta",1);
111 hCT_emEt_ieta_iphi->setAxisTitle(
"ephi",2);
112 hCT_hadEt_ieta_iphi =
dbe_->
book2D(
"METTask_CT_hadEt_ieta_iphi",
"",83,-41,42, 72,1,73);
113 hCT_hadEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
114 hCT_hadEt_ieta_iphi->setAxisTitle(
"ieta",1);
115 hCT_hadEt_ieta_iphi->setAxisTitle(
"ephi",2);
116 hCT_outerEt_ieta_iphi =
dbe_->
book2D(
"METTask_CT_outerEt_ieta_iphi",
"",83,-41,42, 72,1,73);
117 hCT_outerEt_ieta_iphi->
getTH2F()->SetOption(
"colz");
118 hCT_outerEt_ieta_iphi->setAxisTitle(
"ieta",1);
119 hCT_outerEt_ieta_iphi->setAxisTitle(
"ephi",2);
120 hCT_Occ_ieta_iphi =
dbe_->
book2D(
"METTask_CT_Occ_ieta_iphi",
"",83,-41,42, 72,1,73);
121 hCT_Occ_ieta_iphi->
getTH2F()->SetOption(
"colz");
122 hCT_Occ_ieta_iphi->setAxisTitle(
"ieta",1);
123 hCT_Occ_ieta_iphi->setAxisTitle(
"ephi",2);
125 hCT_Occ_EM_Et_ieta_iphi =
dbe_->
book2D(
"METTask_CT_Occ_EM_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
126 hCT_Occ_EM_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
127 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ieta",1);
128 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ephi",2);
130 hCT_Occ_HAD_Et_ieta_iphi =
dbe_->
book2D(
"METTask_CT_Occ_HAD_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
131 hCT_Occ_HAD_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
132 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ieta",1);
133 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ephi",2);
135 hCT_Occ_Outer_Et_ieta_iphi =
dbe_->
book2D(
"METTask_CT_Occ_Outer_Et_ieta_iphi",
"",83,-41,42, 72,1,73);
136 hCT_Occ_Outer_Et_ieta_iphi->
getTH2F()->SetOption(
"colz");
137 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ieta",1);
138 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ephi",2);
147 hCT_etvsieta =
dbe_->
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 10001,0,1001);
148 hCT_Minetvsieta =
dbe_->
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 10001,0,1001);
149 hCT_Maxetvsieta =
dbe_->
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 10001,0,1001);
150 hCT_emEtvsieta =
dbe_->
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 10001,0,1001);
151 hCT_hadEtvsieta =
dbe_->
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 10001,0,1001);
152 hCT_outerEtvsieta =
dbe_->
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 10001,0,1001);
155 hCT_Occvsieta =
dbe_->
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 84,0,84);
156 hCT_SETvsieta =
dbe_->
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 20001,0,2001);
157 hCT_METvsieta =
dbe_->
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 20001,0,2001);
158 hCT_METPhivsieta =
dbe_->
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
159 hCT_MExvsieta =
dbe_->
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 10001,-500,501);
160 hCT_MEyvsieta =
dbe_->
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 10001,-500,501);
166 hCT_etvsieta =
dbe_->
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 200,-0.5,999.5);
167 hCT_Minetvsieta =
dbe_->
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
168 hCT_Maxetvsieta =
dbe_->
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
169 hCT_emEtvsieta =
dbe_->
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
170 hCT_hadEtvsieta =
dbe_->
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
171 hCT_outerEtvsieta =
dbe_->
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 80,-0.5,399.5);
175 hCT_Occvsieta =
dbe_->
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 73,-0.5,72.5);
176 hCT_SETvsieta =
dbe_->
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 200,-0.5,1999.5);
177 hCT_METvsieta =
dbe_->
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 200,-0.5,1999.5);
178 hCT_METPhivsieta =
dbe_->
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
179 hCT_MExvsieta =
dbe_->
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 100,-499.5,499.5);
180 hCT_MEyvsieta =
dbe_->
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 100,-499.5,499.5);
191 iEvent.
getByLabel( HLTResultsLabel_ , TheHLTResults);
193 bool EventPasses =
true;
196 if( TheHLTResults.
isValid() && hltselection_ )
206 if(
index == 0 ) EventPasses =
false;
209 if( bit < TheHLTResults->
size() )
212 if( TheHLTResults->accept( bit ) && !TheHLTResults->error( bit ) )
215 hCT_NEvents_HLT[
index]->Fill(1);
218 hCT_NEvents_HLT[
index]->Fill(0);
223 <<
"The HLT Trigger Name : " << HLTBitLabel_[
index].label() <<
" is not valid for this trigger table " << std::endl;
229 if( !EventPasses && hltselection_ )
233 float ETTowerMin = -1;
234 float METRingMin = -2;
237 hCT_Nevents->Fill(0);
247 edm::LogInfo(
"")<<
"CaloTowers "<< caloTowersLabel_<<
" not found!"<<std::endl;
253 iEvent.
getByLabel(HBHENoiseFilterResultLabel_, HBHENoiseFilterResultHandle);
254 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
255 if (!HBHENoiseFilterResultHandle.
isValid()) {
256 LogDebug(
"") <<
"CaloTowerAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
260 bool bHcalNoiseFilter = HBHENoiseFilterResult;
262 if(!bHcalNoiseFilter)
return;
270 int CTmin_iphi = 99, CTmax_iphi = -99;
271 int CTmin_ieta = 99, CTmax_ieta = -99;
273 TLorentzVector vMET_EtaRing[83];
275 int NActiveTowers[83];
276 double SET_EtaRing[83];
277 double MinEt_EtaRing[83];
278 double MaxEt_EtaRing[83];
279 for (
int i=0;
i<83;
i++)
282 NActiveTowers[
i] = 0;
284 MinEt_EtaRing[
i] = 0;
285 MaxEt_EtaRing[
i] = 0;
290 for ( ; towerCand != towers->end(); towerCand++)
292 const Candidate* candidate = &(*towerCand);
298 double Tower_ET = calotower->
et();
301 double Tower_Phi = calotower->
phi();
304 double Tower_OuterEt = calotower->
outerEt();
305 double Tower_EMEt = calotower->
emEt();
306 double Tower_HadEt = calotower->
hadEt();
309 int Tower_ieta = calotower->
id().
ieta();
310 int Tower_iphi = calotower->
id().
iphi();
311 int EtaRing = 41+Tower_ieta;
312 ActiveRing[EtaRing] = 1;
313 NActiveTowers[EtaRing]++;
314 SET_EtaRing[EtaRing]+=Tower_ET;
316 v_.SetPtEtaPhiE(Tower_ET, 0, Tower_Phi, Tower_ET);
317 if (Tower_ET>ETTowerMin)
318 vMET_EtaRing[EtaRing]-=v_;
321 hCT_Occ_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
322 if (calotower->
emEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
323 hCT_Occ_EM_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
324 if (calotower->
hadEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
325 hCT_Occ_HAD_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
326 if (calotower->
outerEt() > 0 && calotower->
emEt() + calotower->
hadEt() > 0.3)
327 hCT_Occ_Outer_Et_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
329 hCT_et_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_ET);
330 hCT_emEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_EMEt);
331 hCT_hadEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_HadEt);
332 hCT_outerEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_OuterEt);
335 hCT_etvsieta->Fill(Tower_ieta, Tower_ET);
336 hCT_emEtvsieta->Fill(Tower_ieta, Tower_EMEt);
337 hCT_hadEtvsieta->Fill(Tower_ieta,Tower_HadEt);
338 hCT_outerEtvsieta->Fill(Tower_ieta,Tower_OuterEt);
341 if (Tower_ET > MaxEt_EtaRing[EtaRing])
342 MaxEt_EtaRing[EtaRing] = Tower_ET;
343 if (Tower_ET < MinEt_EtaRing[EtaRing] && Tower_ET>0)
344 MinEt_EtaRing[EtaRing] = Tower_ET;
347 if (Tower_ieta < CTmin_ieta) CTmin_ieta = Tower_ieta;
348 if (Tower_ieta > CTmax_ieta) CTmax_ieta = Tower_ieta;
349 if (Tower_iphi < CTmin_iphi) CTmin_iphi = Tower_iphi;
350 if (Tower_iphi > CTmax_iphi) CTmax_iphi = Tower_iphi;
358 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++)
360 hCT_Minetvsieta->Fill(iEtaRing-41, MinEt_EtaRing[iEtaRing]);
361 hCT_Maxetvsieta->Fill(iEtaRing-41, MaxEt_EtaRing[iEtaRing]);
363 if (ActiveRing[iEtaRing])
365 if (vMET_EtaRing[iEtaRing].
Pt()>METRingMin)
367 hCT_METPhivsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Phi());
368 hCT_MExvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Px());
369 hCT_MEyvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Py());
370 hCT_METvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Pt());
372 hCT_SETvsieta->Fill(iEtaRing-41, SET_EtaRing[iEtaRing]);
373 hCT_Occvsieta->Fill(iEtaRing-41, NActiveTowers[iEtaRing]);
378 edm::LogInfo(
"OutputInfo") <<
"CT ieta range: " << CTmin_ieta <<
" " << CTmax_ieta;
379 edm::LogInfo(
"OutputInfo") <<
"CT iphi range: " << CTmin_iphi <<
" " << CTmax_iphi;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
CaloTowerAnalyzer(const edm::ParameterSet &)
unsigned int triggerIndex(std::string const &name) const
int iphi() const
get the tower iphi
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
CaloTowerDetId id() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
double et(double vtxZ) const
int ieta() const
get the tower ieta
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)