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);
131 hCT_etvsieta =
dbe_->
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 10001,0,1001);
132 hCT_Minetvsieta =
dbe_->
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 10001,0,1001);
133 hCT_Maxetvsieta =
dbe_->
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 10001,0,1001);
134 hCT_emEtvsieta =
dbe_->
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 10001,0,1001);
135 hCT_hadEtvsieta =
dbe_->
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 10001,0,1001);
136 hCT_outerEtvsieta =
dbe_->
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 10001,0,1001);
139 hCT_Occvsieta =
dbe_->
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 84,0,84);
140 hCT_SETvsieta =
dbe_->
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 20001,0,2001);
141 hCT_METvsieta =
dbe_->
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 20001,0,2001);
142 hCT_METPhivsieta =
dbe_->
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
143 hCT_MExvsieta =
dbe_->
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 10001,-500,501);
144 hCT_MEyvsieta =
dbe_->
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 10001,-500,501);
150 hCT_etvsieta =
dbe_->
book2D(
"METTask_CT_etvsieta",
"", 83,-41,42, 200,-0.5,999.5);
151 hCT_Minetvsieta =
dbe_->
book2D(
"METTask_CT_Minetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
152 hCT_Maxetvsieta =
dbe_->
book2D(
"METTask_CT_Maxetvsieta",
"", 83,-41,42, 200,-0.5,999.5);
153 hCT_emEtvsieta =
dbe_->
book2D(
"METTask_CT_emEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
154 hCT_hadEtvsieta =
dbe_->
book2D(
"METTask_CT_hadEtvsieta",
"",83,-41,42, 200,-0.5,999.5);
155 hCT_outerEtvsieta =
dbe_->
book2D(
"METTask_CT_outerEtvsieta",
"",83,-41,42, 80,-0.5,399.5);
159 hCT_Occvsieta =
dbe_->
book2D(
"METTask_CT_Occvsieta",
"",83,-41,42, 73,-0.5,72.5);
160 hCT_SETvsieta =
dbe_->
book2D(
"METTask_CT_SETvsieta",
"",83,-41,42, 200,-0.5,1999.5);
161 hCT_METvsieta =
dbe_->
book2D(
"METTask_CT_METvsieta",
"",83,-41,42, 200,-0.5,1999.5);
162 hCT_METPhivsieta =
dbe_->
book2D(
"METTask_CT_METPhivsieta",
"",83,-41,42, 80,-4,4);
163 hCT_MExvsieta =
dbe_->
book2D(
"METTask_CT_MExvsieta",
"",83,-41,42, 100,-499.5,499.5);
164 hCT_MEyvsieta =
dbe_->
book2D(
"METTask_CT_MEyvsieta",
"",83,-41,42, 100,-499.5,499.5);
175 iEvent.
getByLabel( HLTResultsLabel_ , TheHLTResults);
177 bool EventPasses =
true;
180 if( TheHLTResults.
isValid() && hltselection_ )
190 if(
index == 0 ) EventPasses =
false;
193 if( bit < TheHLTResults->
size() )
196 if( TheHLTResults->accept( bit ) && !TheHLTResults->error( bit ) )
199 hCT_NEvents_HLT[
index]->Fill(1);
202 hCT_NEvents_HLT[
index]->Fill(0);
207 <<
"The HLT Trigger Name : " << HLTBitLabel_[
index].label() <<
" is not valid for this trigger table " << std::endl;
213 if( !EventPasses && hltselection_ )
217 float ETTowerMin = -1;
218 float METRingMin = -2;
221 hCT_Nevents->Fill(0);
231 edm::LogInfo(
"")<<
"CaloTowers "<< caloTowersLabel_<<
" not found!"<<std::endl;
237 iEvent.
getByLabel(HcalNoiseSummaryTag_,HNoiseSummary);
238 if (!HNoiseSummary.
isValid()) {
239 LogDebug(
"") <<
"CaloTowerAnalyzer: Could not find Hcal NoiseSummary product" << std::endl;
242 bool bHcalNoiseFilter = HNoiseSummary->passLooseNoiseFilter();
243 if(!bHcalNoiseFilter)
return;
251 int CTmin_iphi = 99, CTmax_iphi = -99;
252 int CTmin_ieta = 99, CTmax_ieta = -99;
254 TLorentzVector vMET_EtaRing[83];
256 int NActiveTowers[83];
257 double SET_EtaRing[83];
258 double MinEt_EtaRing[83];
259 double MaxEt_EtaRing[83];
260 for (
int i=0;
i<83;
i++)
263 NActiveTowers[
i] = 0;
265 MinEt_EtaRing[
i] = 0;
266 MaxEt_EtaRing[
i] = 0;
271 for ( ; towerCand != towers->end(); towerCand++)
273 const Candidate* candidate = &(*towerCand);
279 double Tower_ET = calotower->
et();
282 double Tower_Phi = calotower->
phi();
285 double Tower_OuterEt = calotower->
outerEt();
286 double Tower_EMEt = calotower->
emEt();
287 double Tower_HadEt = calotower->
hadEt();
290 int Tower_ieta = calotower->
id().
ieta();
291 int Tower_iphi = calotower->
id().
iphi();
292 int EtaRing = 41+Tower_ieta;
293 ActiveRing[EtaRing] = 1;
294 NActiveTowers[EtaRing]++;
295 SET_EtaRing[EtaRing]+=Tower_ET;
297 v_.SetPtEtaPhiE(Tower_ET, 0, Tower_Phi, Tower_ET);
298 if (Tower_ET>ETTowerMin)
299 vMET_EtaRing[EtaRing]-=v_;
302 hCT_Occ_ieta_iphi->Fill(Tower_ieta,Tower_iphi);
303 hCT_et_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_ET);
304 hCT_emEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_EMEt);
305 hCT_hadEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_HadEt);
306 hCT_outerEt_ieta_iphi->Fill(Tower_ieta,Tower_iphi,Tower_OuterEt);
309 hCT_etvsieta->Fill(Tower_ieta, Tower_ET);
310 hCT_emEtvsieta->Fill(Tower_ieta, Tower_EMEt);
311 hCT_hadEtvsieta->Fill(Tower_ieta,Tower_HadEt);
312 hCT_outerEtvsieta->Fill(Tower_ieta,Tower_OuterEt);
315 if (Tower_ET > MaxEt_EtaRing[EtaRing])
316 MaxEt_EtaRing[EtaRing] = Tower_ET;
317 if (Tower_ET < MinEt_EtaRing[EtaRing] && Tower_ET>0)
318 MinEt_EtaRing[EtaRing] = Tower_ET;
321 if (Tower_ieta < CTmin_ieta) CTmin_ieta = Tower_ieta;
322 if (Tower_ieta > CTmax_ieta) CTmax_ieta = Tower_ieta;
323 if (Tower_iphi < CTmin_iphi) CTmin_iphi = Tower_iphi;
324 if (Tower_iphi > CTmax_iphi) CTmax_iphi = Tower_iphi;
332 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++)
334 hCT_Minetvsieta->Fill(iEtaRing-41, MinEt_EtaRing[iEtaRing]);
335 hCT_Maxetvsieta->Fill(iEtaRing-41, MaxEt_EtaRing[iEtaRing]);
337 if (ActiveRing[iEtaRing])
339 if (vMET_EtaRing[iEtaRing].
Pt()>METRingMin)
341 hCT_METPhivsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Phi());
342 hCT_MExvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Px());
343 hCT_MEyvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].Py());
344 hCT_METvsieta->Fill(iEtaRing-41, vMET_EtaRing[iEtaRing].
Pt());
346 hCT_SETvsieta->Fill(iEtaRing-41, SET_EtaRing[iEtaRing]);
347 hCT_Occvsieta->Fill(iEtaRing-41, NActiveTowers[iEtaRing]);
352 edm::LogInfo(
"OutputInfo") <<
"CT ieta range: " << CTmin_ieta <<
" " << CTmax_ieta;
353 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
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.
virtual double phi() const
momentum azimuthal angle
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)