8 #define DEBUG(X) { if (debug_) { std::cout << X << std::endl; } } 58 for (
int i=1;
i<=100;
i++)
59 for (
int j=1; j<=100; j++)
76 for (
int i=1;
i<=171;
i++)
80 for (
int j=1; j<=360; j++)
107 for (
int i=1;
i<=171;
i++)
108 for (
int j=1; j<=360; j++)
113 for (
int i=1;
i<=100;
i++)
114 for (
int j=1; j<=100; j++)
221 for (std::vector<DetId>::iterator
i=EBids.begin();
i!=EBids.end();
i++) {
228 int Crystal_ieta = EcalID.
ieta();
229 int Crystal_iphi = EcalID.iphi();
235 DEBUG(
" Crystal " << n );
236 DEBUG(
" ieta, iphi = " << Crystal_ieta <<
", " << Crystal_iphi);
245 for (std::vector<DetId>::iterator
i=EEids.begin();
i!=EEids.end();
i++) {
250 int Crystal_zside = EcalID.
zside();
251 int Crystal_ix = EcalID.ix();
252 int Crystal_iy = EcalID.iy();
253 Float_t ix_ = Crystal_ix-50.5;
254 Float_t iy_ = Crystal_iy-50.5;
255 Int_t ir = (Int_t)
sqrt(ix_*ix_ + iy_*iy_);
263 if (Crystal_zside == -1)
271 if (Crystal_zside == 1)
279 DEBUG(
" Crystal " << n );
280 DEBUG(
" side = " << Crystal_zside );
281 DEBUG(
" ix, iy = " << Crystal_ix <<
", " << Crystal_iy);
282 DEBUG(
" x, y = " << Crystal_x <<
", " << Crystal_y);;
288 double currentLowEdge_eta = 0;
290 for (
int ieta=1; ieta<=85 ; ieta++)
292 int ieta_ = 86 + ieta;
303 double deta = fabs( eta - etam1 );
306 currentLowEdge_eta += deta;
330 DEBUG(
"Got ECALRecHits");
337 DEBUG(
"Got Geometry");
339 TLorentzVector vEBMET_EtaRing[171];
340 int EBActiveRing[171];
341 int EBNActiveCells[171];
342 double EBSET_EtaRing[171];
343 double EBMaxEnergy_EtaRing[171];
344 double EBMinEnergy_EtaRing[171];
345 double EBenergy_EtaRing[171];
347 for (
int i=0;
i<171;
i++)
350 EBNActiveCells[
i] = 0;
351 EBSET_EtaRing[
i] = 0.0;
352 EBMaxEnergy_EtaRing[
i] = -999;
353 EBMinEnergy_EtaRing[
i] = 14E3;
354 EBenergy_EtaRing[
i] = 0.0;
357 edm::LogInfo(
"OutputInfo") <<
"Looping over EB" << std::endl;
362 for (ebrechit = EBRecHits->
begin(); ebrechit != EBRecHits->
end(); ebrechit++) {
365 double Energy = ebrechit->energy();
366 Int_t ieta = det.
ieta();
367 Int_t iphi = det.
iphi();
368 int EtaRing = 85 + ieta;
371 double theta = 2*TMath::ATan(
exp(-1*eta));
372 double ET = Energy*TMath::Sin(theta);
375 if (Energy>EBMaxEnergy_EtaRing[EtaRing]) EBMaxEnergy_EtaRing[EtaRing] = Energy;
376 if (Energy<EBMinEnergy_EtaRing[EtaRing]) EBMinEnergy_EtaRing[EtaRing] = Energy;
380 EBActiveRing[EtaRing] = 1;
381 EBNActiveCells[EtaRing]++;
382 EBSET_EtaRing[EtaRing]+=
ET;
383 v_.SetPtEtaPhiE(ET, 0, phi, ET);
384 vEBMET_EtaRing[EtaRing]-=v_;
385 EBenergy_EtaRing[EtaRing]+=Energy;
393 if (Energy<hEB_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
399 for (
int iEtaRing = 0; iEtaRing < 171; iEtaRing++)
404 if (EBActiveRing[iEtaRing])
417 TLorentzVector vEEpZMET_EtaRing[101];
418 int EEpZActiveRing[101];
419 int EEpZNActiveCells[101];
420 double EEpZSET_EtaRing[101];
421 double EEpZMaxEnergy_EtaRing[101];
422 double EEpZMinEnergy_EtaRing[101];
424 TLorentzVector vEEmZMET_EtaRing[101];
425 int EEmZActiveRing[101];
426 int EEmZNActiveCells[101];
427 double EEmZSET_EtaRing[101];
428 double EEmZMaxEnergy_EtaRing[101];
429 double EEmZMinEnergy_EtaRing[101];
431 for (
int i=0;
i<101;
i++)
433 EEpZActiveRing[
i] = 0;
434 EEpZNActiveCells[
i] = 0;
435 EEpZSET_EtaRing[
i] = 0.0;
436 EEpZMaxEnergy_EtaRing[
i] = -999;
437 EEpZMinEnergy_EtaRing[
i] = 14E3;
439 EEmZActiveRing[
i] = 0;
440 EEmZNActiveCells[
i] = 0;
441 EEmZSET_EtaRing[
i] = 0.0;
442 EEmZMaxEnergy_EtaRing[
i] = -999;
443 EEmZMinEnergy_EtaRing[
i] = 14E3;
446 edm::LogInfo(
"OutputInfo") <<
"Looping over EE" << std::endl;
449 for (eerechit = EERecHits->
begin(); eerechit != EERecHits->
end(); eerechit++) {
452 double Energy = eerechit->energy();
466 int Crystal_zside = det.
zside();
468 if (Crystal_zside == -1)
475 if (Crystal_zside == 1)
482 TVector3 pos_vector(x,y,z);
483 phi = pos_vector.Phi();
484 theta = pos_vector.Theta();
485 double ET = Energy*TMath::Sin(theta);
489 if (Crystal_zside == -1)
493 EEmZActiveRing[ir] = 1;
494 EEmZNActiveCells[ir]++;
495 EEmZSET_EtaRing[ir]+=
ET;
496 v_.SetPtEtaPhiE(ET,0,phi,ET);
497 vEEmZMET_EtaRing[ir]-=v_;
503 if (Energy>EEmZMaxEnergy_EtaRing[ir]) EEmZMaxEnergy_EtaRing[ir] = Energy;
504 if (Energy<EEmZMinEnergy_EtaRing[ir]) EEmZMinEnergy_EtaRing[ir] = Energy;
508 if (Energy<hEEmZ_Minenergy_ix_iy->getBinContent(ix,iy))
511 if (Crystal_zside == 1)
515 EEpZActiveRing[ir] = 1;
516 EEpZNActiveCells[ir]++;
517 EEpZSET_EtaRing[ir]+=
ET;
518 v_.SetPtEtaPhiE(ET,0,phi,ET);
519 vEEpZMET_EtaRing[ir]-=v_;
525 if (Energy>EEpZMaxEnergy_EtaRing[ir]) EEpZMaxEnergy_EtaRing[ir] = Energy;
526 if (Energy<EEpZMinEnergy_EtaRing[ir]) EEpZMinEnergy_EtaRing[ir] = Energy;
529 if (Energy<hEEpZ_Minenergy_ix_iy->getBinContent(ix,iy))
533 edm::LogInfo(
"OutputInfo") <<
"Done Looping over EE" << std::endl;
534 for (
int iEtaRing = 0; iEtaRing<101; iEtaRing++)
541 if (EEpZActiveRing[iEtaRing])
551 if (EEmZActiveRing[iEtaRing])
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hEB_Maxenergyvsieta
MonitorElement * hEB_MExvsieta
MonitorElement * hEEmZ_ix_iy_dxMap
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * hEEmZ_Occvsir
MonitorElement * hEEpZ_METPhivsir
MonitorElement * hEEmZ_METvsir
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hEEpZ_METvsir
MonitorElement * hEB_Maxenergy_ieta_iphi
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
MonitorElement * hEB_METvsieta
MonitorElement * hEEpZ_ix_iy_irMap
Geom::Phi< T > phi() const
MonitorElement * hEB_Occvsieta
std::vector< EcalRecHit >::const_iterator const_iterator
Geom::Theta< T > theta() const
MonitorElement * hEB_energyvsieta
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hEEpZ_ix_iy_zMap
MonitorElement * hEEpZ_Maxenergy_ix_iy
MonitorElement * hEB_METPhivsieta
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
MonitorElement * hEEmZ_Minenergyvsir
int iphi() const
get the crystal iphi
MonitorElement * hEEmZ_energy_ix_iy
MonitorElement * hEEmZ_energyvsir
MonitorElement * hEEmZ_ix_iy_dyMap
MonitorElement * hEEmZ_Occ_ix_iy
MonitorElement * hECAL_Nevents
MonitorElement * hEB_ieta_dphiMap
MonitorElement * hEEmZ_Maxenergyvsir
MonitorElement * hEEmZ_SETvsir
MonitorElement * hEB_Occ_ieta_iphi
MonitorElement * hEEpZ_Minenergyvsir
MonitorElement * book1D(Args &&...args)
MonitorElement * hEEpZ_Minenergy_ix_iy
MonitorElement * hEB_Minenergy_ieta_iphi
MonitorElement * hEEmZ_METPhivsir
MonitorElement * hEEmZ_MEyvsir
MonitorElement * hEEpZ_energyvsir
void FillGeometry(const edm::EventSetup &)
MonitorElement * hEEpZ_ix_iy_dyMap
MonitorElement * hEB_ieta_detaMap
MonitorElement * hEEmZ_Minenergy_ix_iy
int ieta() const
get the crystal ieta
MonitorElement * hEB_energy_ieta_iphi
MonitorElement * hEB_MEyvsieta
MonitorElement * hEB_Minenergyvsieta
const_iterator end() const
ECALRecHitAnalyzer(const edm::ParameterSet &)
MonitorElement * hEEpZ_ix_iy_yMap
MonitorElement * hEEmZ_ix_iy_zMap
void setCurrentFolder(const std::string &fullpath)
MonitorElement * hEEmZ_Maxenergy_ix_iy
virtual void dqmbeginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * book2D(Args &&...args)
MonitorElement * hEB_ieta_iphi_etaMap
MonitorElement * hEEpZ_SETvsir
MonitorElement * hEEpZ_Maxenergyvsir
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * hEEmZ_MExvsir
MonitorElement * hEEmZ_ix_iy_yMap
MonitorElement * hEEmZ_ix_iy_xMap
MonitorElement * hEEpZ_MEyvsir
void WriteECALRecHits(const edm::Event &, const edm::EventSetup &)
MonitorElement * hEB_SETvsieta
MonitorElement * hEEpZ_MExvsir
MonitorElement * hEEpZ_Occvsir
MonitorElement * hEEpZ_energy_ix_iy
MonitorElement * hEEpZ_Occ_ix_iy
MonitorElement * hEEmZ_ix_iy_irMap
edm::EDGetTokenT< EERecHitCollection > EERecHitsLabel_
MonitorElement * hEB_ieta_iphi_phiMap
MonitorElement * hEEpZ_ix_iy_xMap
edm::EDGetTokenT< EBRecHitCollection > EBRecHitsLabel_
const_iterator begin() const
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * hEEpZ_ix_iy_dxMap