8 #define DEBUG(X) { if (debug_) { std::cout << X << std::endl; } }
67 for (
int i=1;
i<=100;
i++)
68 for (
int j=1;
j<=100;
j++)
85 for (
int i=1;
i<=171;
i++)
89 for (
int j=1;
j<=360;
j++)
116 for (
int i=1;
i<=171;
i++)
117 for (
int j=1;
j<=360;
j++)
122 for (
int i=1;
i<=100;
i++)
123 for (
int j=1;
j<=100;
j++)
233 std::vector<DetId> EBids=EBgeom->getValidDetIds(
DetId::Ecal, 1);
234 for (std::vector<DetId>::iterator
i=EBids.begin();
i!=EBids.end();
i++) {
241 int Crystal_ieta = EcalID.
ieta();
242 int Crystal_iphi = EcalID.iphi();
248 DEBUG(
" Crystal " <<
n );
249 DEBUG(
" ieta, iphi = " << Crystal_ieta <<
", " << Crystal_iphi);
257 std::vector<DetId> EEids=EEgeom->getValidDetIds(
DetId::Ecal, 2);
258 for (std::vector<DetId>::iterator
i=EEids.begin();
i!=EEids.end();
i++) {
263 int Crystal_zside = EcalID.
zside();
264 int Crystal_ix = EcalID.ix();
265 int Crystal_iy = EcalID.iy();
266 Float_t ix_ = Crystal_ix-50.5;
267 Float_t iy_ = Crystal_iy-50.5;
268 Int_t ir = (Int_t)
sqrt(ix_*ix_ + iy_*iy_);
276 if (Crystal_zside == -1)
284 if (Crystal_zside == 1)
292 DEBUG(
" Crystal " <<
n );
293 DEBUG(
" side = " << Crystal_zside );
294 DEBUG(
" ix, iy = " << Crystal_ix <<
", " << Crystal_iy);
295 DEBUG(
" x, y = " << Crystal_x <<
", " << Crystal_y);;
301 double currentLowEdge_eta = 0;
303 for (
int ieta=1; ieta<=85 ; ieta++)
305 int ieta_ = 86 + ieta;
316 double deta = fabs( eta - etam1 );
319 currentLowEdge_eta += deta;
343 DEBUG(
"Got ECALRecHits");
362 DEBUG(
"Got Geometry");
364 TLorentzVector vEBMET_EtaRing[171];
365 int EBActiveRing[171];
366 int EBNActiveCells[171];
367 double EBSET_EtaRing[171];
368 double EBMaxEnergy_EtaRing[171];
369 double EBMinEnergy_EtaRing[171];
370 double EBenergy_EtaRing[171];
372 for (
int i=0;
i<171;
i++)
375 EBNActiveCells[
i] = 0;
376 EBSET_EtaRing[
i] = 0.0;
377 EBMaxEnergy_EtaRing[
i] = -999;
378 EBMinEnergy_EtaRing[
i] = 14E3;
379 EBenergy_EtaRing[
i] = 0.0;
382 edm::LogInfo(
"OutputInfo") <<
"Looping over EB" << std::endl;
387 for (ebrechit = EBRecHits->begin(); ebrechit != EBRecHits->end(); ebrechit++) {
390 double Energy = ebrechit->energy();
391 Int_t ieta = det.
ieta();
392 Int_t iphi = det.
iphi();
393 int EtaRing = 85 + ieta;
396 double theta = 2*TMath::ATan(
exp(-1*eta));
397 double ET = Energy*TMath::Sin(theta);
400 if (Energy>EBMaxEnergy_EtaRing[EtaRing]) EBMaxEnergy_EtaRing[EtaRing] = Energy;
401 if (Energy<EBMinEnergy_EtaRing[EtaRing]) EBMinEnergy_EtaRing[EtaRing] = Energy;
405 EBActiveRing[EtaRing] = 1;
406 EBNActiveCells[EtaRing]++;
407 EBSET_EtaRing[EtaRing]+=
ET;
408 v_.SetPtEtaPhiE(ET, 0, phi, ET);
409 vEBMET_EtaRing[EtaRing]-=v_;
410 EBenergy_EtaRing[EtaRing]+=Energy;
418 if (Energy<hEB_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
424 for (
int iEtaRing = 0; iEtaRing < 171; iEtaRing++)
429 if (EBActiveRing[iEtaRing])
442 TLorentzVector vEEpZMET_EtaRing[101];
443 int EEpZActiveRing[101];
444 int EEpZNActiveCells[101];
445 double EEpZSET_EtaRing[101];
446 double EEpZMaxEnergy_EtaRing[101];
447 double EEpZMinEnergy_EtaRing[101];
449 TLorentzVector vEEmZMET_EtaRing[101];
450 int EEmZActiveRing[101];
451 int EEmZNActiveCells[101];
452 double EEmZSET_EtaRing[101];
453 double EEmZMaxEnergy_EtaRing[101];
454 double EEmZMinEnergy_EtaRing[101];
456 for (
int i=0;
i<101;
i++)
458 EEpZActiveRing[
i] = 0;
459 EEpZNActiveCells[
i] = 0;
460 EEpZSET_EtaRing[
i] = 0.0;
461 EEpZMaxEnergy_EtaRing[
i] = -999;
462 EEpZMinEnergy_EtaRing[
i] = 14E3;
464 EEmZActiveRing[
i] = 0;
465 EEmZNActiveCells[
i] = 0;
466 EEmZSET_EtaRing[
i] = 0.0;
467 EEmZMaxEnergy_EtaRing[
i] = -999;
468 EEmZMinEnergy_EtaRing[
i] = 14E3;
471 edm::LogInfo(
"OutputInfo") <<
"Looping over EE" << std::endl;
474 for (eerechit = EERecHits->begin(); eerechit != EERecHits->end(); eerechit++) {
477 double Energy = eerechit->energy();
491 int Crystal_zside = det.
zside();
493 if (Crystal_zside == -1)
500 if (Crystal_zside == 1)
507 TVector3 pos_vector(x,y,z);
508 phi = pos_vector.Phi();
509 theta = pos_vector.Theta();
510 double ET = Energy*TMath::Sin(theta);
514 if (Crystal_zside == -1)
518 EEmZActiveRing[ir] = 1;
519 EEmZNActiveCells[ir]++;
520 EEmZSET_EtaRing[ir]+=
ET;
521 v_.SetPtEtaPhiE(ET,0,phi,ET);
522 vEEmZMET_EtaRing[ir]-=v_;
528 if (Energy>EEmZMaxEnergy_EtaRing[ir]) EEmZMaxEnergy_EtaRing[ir] = Energy;
529 if (Energy<EEmZMinEnergy_EtaRing[ir]) EEmZMinEnergy_EtaRing[ir] = Energy;
533 if (Energy<hEEmZ_Minenergy_ix_iy->getBinContent(ix,iy))
536 if (Crystal_zside == 1)
540 EEpZActiveRing[ir] = 1;
541 EEpZNActiveCells[ir]++;
542 EEpZSET_EtaRing[ir]+=
ET;
543 v_.SetPtEtaPhiE(ET,0,phi,ET);
544 vEEpZMET_EtaRing[ir]-=v_;
550 if (Energy>EEpZMaxEnergy_EtaRing[ir]) EEpZMaxEnergy_EtaRing[ir] = Energy;
551 if (Energy<EEpZMinEnergy_EtaRing[ir]) EEpZMinEnergy_EtaRing[ir] = Energy;
554 if (Energy<hEEpZ_Minenergy_ix_iy->getBinContent(ix,iy))
558 edm::LogInfo(
"OutputInfo") <<
"Done Looping over EE" << std::endl;
559 for (
int iEtaRing = 0; iEtaRing<101; iEtaRing++)
566 if (EEpZActiveRing[iEtaRing])
576 if (EEmZActiveRing[iEtaRing])
T getParameter(std::string const &) const
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
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * hEEpZ_METvsir
MonitorElement * hEB_Maxenergy_ieta_iphi
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
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
MonitorElement * hEEpZ_ix_iy_zMap
edm::InputTag EBRecHitsLabel_
MonitorElement * hEEpZ_Maxenergy_ix_iy
MonitorElement * hEB_METPhivsieta
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 * 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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * hEB_Minenergyvsieta
ECALRecHitAnalyzer(const edm::ParameterSet &)
edm::InputTag EERecHitsLabel_
MonitorElement * hEEpZ_ix_iy_yMap
MonitorElement * hEEmZ_ix_iy_zMap
MonitorElement * hEEmZ_Maxenergy_ix_iy
MonitorElement * hEB_ieta_iphi_etaMap
MonitorElement * hEEpZ_SETvsir
MonitorElement * hEEpZ_Maxenergyvsir
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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
MonitorElement * hEB_ieta_iphi_phiMap
MonitorElement * hEEpZ_ix_iy_xMap
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * hEEpZ_ix_iy_dxMap