54 #include <TLorentzVector.h> 65 if (iConfig.
exists(
"HLTBitLabels"))
66 HLTBitLabel_ = iConfig.
getParameter<std::vector<edm::InputTag> >(
"HLTBitLabels");
82 for (
unsigned int i = 0;
i < HLTBitLabel_.size();
i++) {
83 if (!HLTBitLabel_[
i].
label().empty()) {
84 hCT_NEvents_HLT.push_back(
85 ibooker.
book1D(
"METTask_CT_" + HLTBitLabel_[
i].label(), HLTBitLabel_[
i].label(), 2, -0.5, 1.5));
90 hCT_Nevents = ibooker.
book1D(
"METTask_CT_Nevents",
"", 1, 0, 1);
92 hCT_et_ieta_iphi = ibooker.
book2D(
"METTask_CT_et_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
94 hCT_et_ieta_iphi->setAxisTitle(
"ieta", 1);
95 hCT_et_ieta_iphi->setAxisTitle(
"ephi", 2);
97 hCT_emEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_emEt_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
99 hCT_emEt_ieta_iphi->setAxisTitle(
"ieta", 1);
100 hCT_emEt_ieta_iphi->setAxisTitle(
"ephi", 2);
101 hCT_hadEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_hadEt_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
103 hCT_hadEt_ieta_iphi->setAxisTitle(
"ieta", 1);
104 hCT_hadEt_ieta_iphi->setAxisTitle(
"ephi", 2);
105 hCT_outerEt_ieta_iphi = ibooker.
book2D(
"METTask_CT_outerEt_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
106 hCT_outerEt_ieta_iphi->
setOption(
"colz");
107 hCT_outerEt_ieta_iphi->setAxisTitle(
"ieta", 1);
108 hCT_outerEt_ieta_iphi->setAxisTitle(
"ephi", 2);
109 hCT_Occ_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
111 hCT_Occ_ieta_iphi->setAxisTitle(
"ieta", 1);
112 hCT_Occ_ieta_iphi->setAxisTitle(
"ephi", 2);
114 hCT_Occ_EM_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_EM_Et_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
115 hCT_Occ_EM_Et_ieta_iphi->
setOption(
"colz");
116 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ieta", 1);
117 hCT_Occ_EM_Et_ieta_iphi->setAxisTitle(
"ephi", 2);
119 hCT_Occ_HAD_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_HAD_Et_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
120 hCT_Occ_HAD_Et_ieta_iphi->
setOption(
"colz");
121 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ieta", 1);
122 hCT_Occ_HAD_Et_ieta_iphi->setAxisTitle(
"ephi", 2);
124 hCT_Occ_Outer_Et_ieta_iphi = ibooker.
book2D(
"METTask_CT_Occ_Outer_Et_ieta_iphi",
"", 83, -41, 42, 72, 1, 73);
125 hCT_Occ_Outer_Et_ieta_iphi->
setOption(
"colz");
126 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ieta", 1);
127 hCT_Occ_Outer_Et_ieta_iphi->setAxisTitle(
"ephi", 2);
134 hCT_etvsieta = ibooker.
book2D(
"METTask_CT_etvsieta",
"", 83, -41, 42, 10001, 0, 1001);
135 hCT_Minetvsieta = ibooker.
book2D(
"METTask_CT_Minetvsieta",
"", 83, -41, 42, 10001, 0, 1001);
136 hCT_Maxetvsieta = ibooker.
book2D(
"METTask_CT_Maxetvsieta",
"", 83, -41, 42, 10001, 0, 1001);
137 hCT_emEtvsieta = ibooker.
book2D(
"METTask_CT_emEtvsieta",
"", 83, -41, 42, 10001, 0, 1001);
138 hCT_hadEtvsieta = ibooker.
book2D(
"METTask_CT_hadEtvsieta",
"", 83, -41, 42, 10001, 0, 1001);
139 hCT_outerEtvsieta = ibooker.
book2D(
"METTask_CT_outerEtvsieta",
"", 83, -41, 42, 10001, 0, 1001);
142 hCT_Occvsieta = ibooker.
book2D(
"METTask_CT_Occvsieta",
"", 83, -41, 42, 84, 0, 84);
143 hCT_SETvsieta = ibooker.
book2D(
"METTask_CT_SETvsieta",
"", 83, -41, 42, 20001, 0, 2001);
144 hCT_METvsieta = ibooker.
book2D(
"METTask_CT_METvsieta",
"", 83, -41, 42, 20001, 0, 2001);
145 hCT_METPhivsieta = ibooker.
book2D(
"METTask_CT_METPhivsieta",
"", 83, -41, 42, 80, -4, 4);
146 hCT_MExvsieta = ibooker.
book2D(
"METTask_CT_MExvsieta",
"", 83, -41, 42, 10001, -500, 501);
147 hCT_MEyvsieta = ibooker.
book2D(
"METTask_CT_MEyvsieta",
"", 83, -41, 42, 10001, -500, 501);
150 hCT_etvsieta = ibooker.
book2D(
"METTask_CT_etvsieta",
"", 83, -41, 42, 200, -0.5, 999.5);
151 hCT_Minetvsieta = ibooker.
book2D(
"METTask_CT_Minetvsieta",
"", 83, -41, 42, 200, -0.5, 999.5);
152 hCT_Maxetvsieta = ibooker.
book2D(
"METTask_CT_Maxetvsieta",
"", 83, -41, 42, 200, -0.5, 999.5);
153 hCT_emEtvsieta = ibooker.
book2D(
"METTask_CT_emEtvsieta",
"", 83, -41, 42, 200, -0.5, 999.5);
154 hCT_hadEtvsieta = ibooker.
book2D(
"METTask_CT_hadEtvsieta",
"", 83, -41, 42, 200, -0.5, 999.5);
155 hCT_outerEtvsieta = ibooker.
book2D(
"METTask_CT_outerEtvsieta",
"", 83, -41, 42, 80, -0.5, 399.5);
159 hCT_Occvsieta = ibooker.
book2D(
"METTask_CT_Occvsieta",
"", 83, -41, 42, 73, -0.5, 72.5);
160 hCT_SETvsieta = ibooker.
book2D(
"METTask_CT_SETvsieta",
"", 83, -41, 42, 200, -0.5, 1999.5);
161 hCT_METvsieta = ibooker.
book2D(
"METTask_CT_METvsieta",
"", 83, -41, 42, 200, -0.5, 1999.5);
162 hCT_METPhivsieta = ibooker.
book2D(
"METTask_CT_METPhivsieta",
"", 83, -41, 42, 80, -4, 4);
163 hCT_MExvsieta = ibooker.
book2D(
"METTask_CT_MExvsieta",
"", 83, -41, 42, 100, -499.5, 499.5);
164 hCT_MEyvsieta = ibooker.
book2D(
"METTask_CT_MEyvsieta",
"", 83, -41, 42, 100, -499.5, 499.5);
172 iEvent.getByToken(HLTResultsLabel_, TheHLTResults);
179 bool EventPasses =
true;
181 if (TheHLTResults.
isValid() && hltselection_) {
192 if (bit < TheHLTResults->size()) {
196 hCT_NEvents_HLT[
index]->Fill(1);
198 hCT_NEvents_HLT[
index]->Fill(0);
200 edm::LogInfo(
"OutputInfo") <<
"The HLT Trigger Name : " << HLTBitLabel_[
index].label()
201 <<
" is not valid for this trigger table " << std::endl;
207 if (!EventPasses && hltselection_)
211 float ETTowerMin = -1;
212 float METRingMin = -2;
215 hCT_Nevents->Fill(0);
224 if ((!
towers.isValid())) {
232 iEvent.getByToken(HBHENoiseFilterResultLabel_, HBHENoiseFilterResultHandle);
233 bool HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
234 if (!HBHENoiseFilterResultHandle.
isValid()) {
235 LogDebug(
"") <<
"CaloTowerAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
238 bool bHcalNoiseFilter = HBHENoiseFilterResult;
240 if (!bHcalNoiseFilter)
249 int CTmin_iphi = 99, CTmax_iphi = -99;
250 int CTmin_ieta = 99, CTmax_ieta = -99;
252 TLorentzVector vMET_EtaRing[83];
254 int NActiveTowers[83];
255 double SET_EtaRing[83];
256 double MinEt_EtaRing[83];
257 double MaxEt_EtaRing[83];
258 for (
int i = 0;
i < 83;
i++) {
260 NActiveTowers[
i] = 0;
262 MinEt_EtaRing[
i] = 0;
263 MaxEt_EtaRing[
i] = 0;
267 for (; towerCand !=
towers->end(); towerCand++) {
268 const Candidate* candidate = &(*towerCand);
279 double Tower_OuterEt =
calotower->outerEt();
286 int EtaRing = 41 + Tower_ieta;
287 ActiveRing[EtaRing] = 1;
288 NActiveTowers[EtaRing]++;
289 SET_EtaRing[EtaRing] += Tower_ET;
291 v_.SetPtEtaPhiE(Tower_ET, 0, Tower_Phi, Tower_ET);
292 if (Tower_ET > ETTowerMin)
293 vMET_EtaRing[EtaRing] -= v_;
296 hCT_Occ_ieta_iphi->Fill(Tower_ieta, Tower_iphi);
298 hCT_Occ_EM_Et_ieta_iphi->Fill(Tower_ieta, Tower_iphi);
300 hCT_Occ_HAD_Et_ieta_iphi->Fill(Tower_ieta, Tower_iphi);
302 hCT_Occ_Outer_Et_ieta_iphi->Fill(Tower_ieta, Tower_iphi);
304 hCT_et_ieta_iphi->Fill(Tower_ieta, Tower_iphi, Tower_ET);
305 hCT_emEt_ieta_iphi->Fill(Tower_ieta, Tower_iphi, Tower_EMEt);
306 hCT_hadEt_ieta_iphi->Fill(Tower_ieta, Tower_iphi, Tower_HadEt);
307 hCT_outerEt_ieta_iphi->Fill(Tower_ieta, Tower_iphi, Tower_OuterEt);
310 hCT_etvsieta->Fill(Tower_ieta, Tower_ET);
311 hCT_emEtvsieta->Fill(Tower_ieta, Tower_EMEt);
312 hCT_hadEtvsieta->Fill(Tower_ieta, Tower_HadEt);
313 hCT_outerEtvsieta->Fill(Tower_ieta, Tower_OuterEt);
316 if (Tower_ET > MaxEt_EtaRing[EtaRing])
317 MaxEt_EtaRing[EtaRing] = Tower_ET;
318 if (Tower_ET < MinEt_EtaRing[EtaRing] && Tower_ET > 0)
319 MinEt_EtaRing[EtaRing] = Tower_ET;
321 if (Tower_ieta < CTmin_ieta)
322 CTmin_ieta = Tower_ieta;
323 if (Tower_ieta > CTmax_ieta)
324 CTmax_ieta = Tower_ieta;
325 if (Tower_iphi < CTmin_iphi)
326 CTmin_iphi = Tower_iphi;
327 if (Tower_iphi > CTmax_iphi)
328 CTmax_iphi = Tower_iphi;
336 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
337 hCT_Minetvsieta->Fill(iEtaRing - 41, MinEt_EtaRing[iEtaRing]);
338 hCT_Maxetvsieta->Fill(iEtaRing - 41, MaxEt_EtaRing[iEtaRing]);
340 if (ActiveRing[iEtaRing]) {
341 if (vMET_EtaRing[iEtaRing].Pt() > METRingMin) {
342 hCT_METPhivsieta->Fill(iEtaRing - 41, vMET_EtaRing[iEtaRing].
Phi());
343 hCT_MExvsieta->Fill(iEtaRing - 41, vMET_EtaRing[iEtaRing].Px());
344 hCT_MEyvsieta->Fill(iEtaRing - 41, vMET_EtaRing[iEtaRing].Py());
345 hCT_METvsieta->Fill(iEtaRing - 41, vMET_EtaRing[iEtaRing].Pt());
347 hCT_SETvsieta->Fill(iEtaRing - 41, SET_EtaRing[iEtaRing]);
348 hCT_Occvsieta->Fill(iEtaRing - 41, NActiveTowers[iEtaRing]);
353 edm::LogInfo(
"OutputInfo") <<
"CT ieta range: " << CTmin_ieta <<
" " << CTmax_ieta;
354 edm::LogInfo(
"OutputInfo") <<
"CT iphi range: " << CTmin_iphi <<
" " << CTmax_iphi;
bool accept() const
Has at least one path accepted the event?
T getParameter(std::string const &) const
bool error() const
Has any path encountered an error (exception)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
virtual void setOption(const char *option)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
unsigned int triggerIndex(std::string_view name) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void dqmbeginRun(const edm::Run &, const edm::EventSetup &)
CaloTowerAnalyzer(const edm::ParameterSet &)
Log< level::Info, false > LogInfo
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void analyze(const edm::Event &, const edm::EventSetup &) override
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())