11 std::cout << X << std::endl; \
59 for (
int i = 1;
i <= 100;
i++)
60 for (
int j = 1;
j <= 100;
j++) {
76 for (
int i = 1;
i <= 171;
i++) {
79 for (
int j = 1;
j <= 360;
j++) {
104 for (
int i = 1;
i <= 171;
i++)
105 for (
int j = 1;
j <= 360;
j++) {
109 for (
int i = 1;
i <= 100;
i++)
110 for (
int j = 1;
j <= 100;
j++) {
205 std::vector<DetId> EBids = EBgeom->getValidDetIds(
DetId::Ecal, 1);
206 for (std::vector<DetId>::iterator
i = EBids.begin();
i != EBids.end();
i++) {
208 auto cell = EBgeom->getGeometry(*
i);
213 int Crystal_ieta = EcalID.
ieta();
214 int Crystal_iphi = EcalID.iphi();
215 double Crystal_eta = cell->getPosition().eta();
216 double Crystal_phi = cell->getPosition().phi();
221 DEBUG(
" ieta, iphi = " << Crystal_ieta <<
", " << Crystal_iphi);
222 DEBUG(
" eta, phi = " << cell->getPosition().eta() <<
", " << cell->getPosition().phi());
228 std::vector<DetId> EEids = EEgeom->getValidDetIds(
DetId::Ecal, 2);
229 for (std::vector<DetId>::iterator
i = EEids.begin();
i != EEids.end();
i++) {
231 auto cell = EEgeom->getGeometry(*
i);
234 int Crystal_zside = EcalID.
zside();
235 int Crystal_ix = EcalID.ix();
236 int Crystal_iy = EcalID.iy();
237 Float_t ix_ = Crystal_ix - 50.5;
238 Float_t iy_ = Crystal_iy - 50.5;
239 Int_t ir = (Int_t)
sqrt(ix_ * ix_ + iy_ * iy_);
243 double Crystal_x = cell->getPosition().x();
244 double Crystal_y = cell->getPosition().y();
245 double Crystal_z = cell->getPosition().z();
247 if (Crystal_zside == -1) {
254 if (Crystal_zside == 1) {
262 DEBUG(
" side = " << Crystal_zside);
263 DEBUG(
" ix, iy = " << Crystal_ix <<
", " << Crystal_iy);
264 DEBUG(
" x, y = " << Crystal_x <<
", " << Crystal_y);
270 double currentLowEdge_eta = 0;
272 for (
int ieta = 1; ieta <= 85; ieta++) {
273 int ieta_ = 86 + ieta;
284 double deta = fabs(eta - etam1);
287 currentLowEdge_eta += deta;
307 DEBUG(
"Got ECALRecHits");
311 DEBUG(
"Got Geometry");
313 TLorentzVector vEBMET_EtaRing[171];
314 int EBActiveRing[171];
315 int EBNActiveCells[171];
316 double EBSET_EtaRing[171];
317 double EBMaxEnergy_EtaRing[171];
318 double EBMinEnergy_EtaRing[171];
319 double EBenergy_EtaRing[171];
321 for (
int i = 0;
i < 171;
i++) {
323 EBNActiveCells[
i] = 0;
324 EBSET_EtaRing[
i] = 0.0;
325 EBMaxEnergy_EtaRing[
i] = -999;
326 EBMinEnergy_EtaRing[
i] = 14E3;
327 EBenergy_EtaRing[
i] = 0.0;
330 edm::LogInfo(
"OutputInfo") <<
"Looping over EB" << std::endl;
335 for (ebrechit = EBRecHits->begin(); ebrechit != EBRecHits->end(); ebrechit++) {
337 double Energy = ebrechit->energy();
338 Int_t ieta = det.
ieta();
339 Int_t iphi = det.
iphi();
340 int EtaRing = 85 + ieta;
343 double theta = 2 * TMath::ATan(
exp(-1 * eta));
344 double ET = Energy * TMath::Sin(theta);
347 if (Energy > EBMaxEnergy_EtaRing[EtaRing])
348 EBMaxEnergy_EtaRing[EtaRing] = Energy;
349 if (Energy < EBMinEnergy_EtaRing[EtaRing])
350 EBMinEnergy_EtaRing[EtaRing] = Energy;
353 EBActiveRing[EtaRing] = 1;
354 EBNActiveCells[EtaRing]++;
355 EBSET_EtaRing[EtaRing] +=
ET;
356 v_.SetPtEtaPhiE(ET, 0, phi, ET);
357 vEBMET_EtaRing[EtaRing] -= v_;
358 EBenergy_EtaRing[EtaRing] += Energy;
365 if (Energy < hEB_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
370 for (
int iEtaRing = 0; iEtaRing < 171; iEtaRing++) {
374 if (EBActiveRing[iEtaRing]) {
385 TLorentzVector vEEpZMET_EtaRing[101];
386 int EEpZActiveRing[101];
387 int EEpZNActiveCells[101];
388 double EEpZSET_EtaRing[101];
389 double EEpZMaxEnergy_EtaRing[101];
390 double EEpZMinEnergy_EtaRing[101];
392 TLorentzVector vEEmZMET_EtaRing[101];
393 int EEmZActiveRing[101];
394 int EEmZNActiveCells[101];
395 double EEmZSET_EtaRing[101];
396 double EEmZMaxEnergy_EtaRing[101];
397 double EEmZMinEnergy_EtaRing[101];
399 for (
int i = 0;
i < 101;
i++) {
400 EEpZActiveRing[
i] = 0;
401 EEpZNActiveCells[
i] = 0;
402 EEpZSET_EtaRing[
i] = 0.0;
403 EEpZMaxEnergy_EtaRing[
i] = -999;
404 EEpZMinEnergy_EtaRing[
i] = 14E3;
406 EEmZActiveRing[
i] = 0;
407 EEmZNActiveCells[
i] = 0;
408 EEmZSET_EtaRing[
i] = 0.0;
409 EEmZMaxEnergy_EtaRing[
i] = -999;
410 EEmZMinEnergy_EtaRing[
i] = 14E3;
413 edm::LogInfo(
"OutputInfo") <<
"Looping over EE" << std::endl;
416 for (eerechit = EERecHits->begin(); eerechit != EERecHits->end(); eerechit++) {
418 double Energy = eerechit->energy();
432 int Crystal_zside = det.
zside();
434 if (Crystal_zside == -1) {
440 if (Crystal_zside == 1) {
446 TVector3 pos_vector(x, y, z);
447 phi = pos_vector.Phi();
448 theta = pos_vector.Theta();
449 double ET = Energy * TMath::Sin(theta);
452 if (Crystal_zside == -1) {
454 EEmZActiveRing[ir] = 1;
455 EEmZNActiveCells[ir]++;
456 EEmZSET_EtaRing[ir] +=
ET;
457 v_.SetPtEtaPhiE(ET, 0, phi, ET);
458 vEEmZMET_EtaRing[ir] -= v_;
464 if (Energy > EEmZMaxEnergy_EtaRing[ir])
465 EEmZMaxEnergy_EtaRing[ir] = Energy;
466 if (Energy < EEmZMinEnergy_EtaRing[ir])
467 EEmZMinEnergy_EtaRing[ir] = Energy;
471 if (Energy < hEEmZ_Minenergy_ix_iy->getBinContent(ix, iy))
474 if (Crystal_zside == 1) {
476 EEpZActiveRing[ir] = 1;
477 EEpZNActiveCells[ir]++;
478 EEpZSET_EtaRing[ir] +=
ET;
479 v_.SetPtEtaPhiE(ET, 0, phi, ET);
480 vEEpZMET_EtaRing[ir] -= v_;
486 if (Energy > EEpZMaxEnergy_EtaRing[ir])
487 EEpZMaxEnergy_EtaRing[ir] = Energy;
488 if (Energy < EEpZMinEnergy_EtaRing[ir])
489 EEpZMinEnergy_EtaRing[ir] = Energy;
492 if (Energy < hEEpZ_Minenergy_ix_iy->getBinContent(ix, iy))
496 edm::LogInfo(
"OutputInfo") <<
"Done Looping over EE" << std::endl;
497 for (
int iEtaRing = 0; iEtaRing < 101; iEtaRing++) {
503 if (EEpZActiveRing[iEtaRing]) {
512 if (EEmZActiveRing[iEtaRing]) {
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
MonitorElement * hEEmZ_Occvsir
MonitorElement * hEEpZ_METPhivsir
MonitorElement * hEEmZ_METvsir
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hEEpZ_METvsir
MonitorElement * hEB_Maxenergy_ieta_iphi
MonitorElement * hEB_METvsieta
MonitorElement * hEEpZ_ix_iy_irMap
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
Exp< T >::type exp(const T &t)
MonitorElement * hEEpZ_ix_iy_zMap
MonitorElement * hEEpZ_Maxenergy_ix_iy
MonitorElement * hEB_METPhivsieta
MonitorElement * hEEmZ_Minenergyvsir
int iphi() const
get the crystal iphi
bool getData(T &iHolder) const
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
const CaloGeometry * caloGeom_
MonitorElement * hEB_Occ_ieta_iphi
MonitorElement * hEEpZ_Minenergyvsir
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
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
virtual double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * hEB_energy_ieta_iphi
MonitorElement * hEB_MEyvsieta
MonitorElement * hEB_Minenergyvsieta
ECALRecHitAnalyzer(const edm::ParameterSet &)
Log< level::Info, false > LogInfo
MonitorElement * hEEpZ_ix_iy_yMap
MonitorElement * hEEmZ_ix_iy_zMap
MonitorElement * hEEmZ_Maxenergy_ix_iy
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual void dqmbeginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * hEB_ieta_iphi_etaMap
MonitorElement * hEEpZ_SETvsir
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
MonitorElement * hEEpZ_Maxenergyvsir
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
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
edm::EDGetTokenT< EBRecHitCollection > EBRecHitsLabel_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * hEEpZ_ix_iy_dxMap