42 #include <TLorentzVector.h>
48 std::cout << X << std::endl; \
83 for (
int i = 1;
i <= 83;
i++) {
87 for (
int j = 1;
j <= 72;
j++) {
119 for (
int i = 1;
i <= 83;
i++)
120 for (
int j = 1;
j <= 73;
j++) {
245 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task "
246 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
261 std::vector<DetId>::iterator
i;
263 int HBmin_ieta = 99, HBmax_ieta = -99;
264 int HBmin_iphi = 99, HBmax_iphi = -99;
270 for (
i = HBids.begin();
i != HBids.end();
i++) {
275 int Calo_ieta = 42 + HcalID.
ieta();
276 int Calo_iphi = HcalID.
iphi();
285 if (Calo_ieta > HBmax_ieta)
286 HBmax_ieta = Calo_ieta;
287 if (Calo_ieta < HBmin_ieta)
288 HBmin_ieta = Calo_ieta;
289 if (Calo_iphi > HBmax_iphi)
290 HBmax_iphi = Calo_iphi;
291 if (Calo_iphi > HBmax_iphi)
292 HBmin_iphi = Calo_iphi;
295 int HEmin_ieta = 99, HEmax_ieta = -99;
296 int HEmin_iphi = 99, HEmax_iphi = -99;
302 for (
i = HEids.begin();
i != HEids.end();
i++) {
307 int Calo_ieta = 42 + HcalID.
ieta();
308 int Calo_iphi = HcalID.
iphi();
309 double Calo_eta = HEgeom->getPosition(HcalID).eta();
310 double Calo_phi = HEgeom->getPosition(HcalID).phi();
318 if (Calo_ieta > HEmax_ieta)
319 HEmax_ieta = Calo_ieta;
320 if (Calo_ieta < HEmin_ieta)
321 HEmin_ieta = Calo_ieta;
322 if (Calo_iphi > HEmax_iphi)
323 HEmax_iphi = Calo_iphi;
324 if (Calo_iphi > HEmax_iphi)
325 HEmin_iphi = Calo_iphi;
328 int HFmin_ieta = 99, HFmax_ieta = -99;
329 int HFmin_iphi = 99, HFmax_iphi = -99;
335 for (
i = HFids.begin();
i != HFids.end();
i++) {
342 int Calo_ieta = 42 + HcalID.
ieta();
343 int Calo_iphi = HcalID.iphi();
344 double Calo_eta = cell->getPosition().eta();
345 double Calo_phi = cell->getPosition().phi();
353 if (Calo_ieta > HFmax_ieta)
354 HFmax_ieta = Calo_ieta;
355 if (Calo_ieta < HFmin_ieta)
356 HFmin_ieta = Calo_ieta;
357 if (Calo_iphi > HFmax_iphi)
358 HFmax_iphi = Calo_iphi;
359 if (Calo_iphi > HFmax_iphi)
360 HFmin_iphi = Calo_iphi;
363 int HOmin_ieta = 99, HOmax_ieta = -99;
364 int HOmin_iphi = 99, HOmax_iphi = -99;
370 for (
i = HOids.begin();
i != HOids.end();
i++) {
373 auto cell = HOgeom->getGeometry(*
i);
377 int Calo_ieta = 42 + HcalID.
ieta();
378 int Calo_iphi = HcalID.iphi();
379 double Calo_eta = cell->getPosition().eta();
380 double Calo_phi = cell->getPosition().phi();
388 if (Calo_ieta > HOmax_ieta)
389 HOmax_ieta = Calo_ieta;
390 if (Calo_ieta < HOmin_ieta)
391 HOmin_ieta = Calo_ieta;
392 if (Calo_iphi > HOmax_iphi)
393 HOmax_iphi = Calo_iphi;
394 if (Calo_iphi > HOmax_iphi)
395 HOmin_iphi = Calo_iphi;
399 double currentLowEdge_eta = 0;
401 int ieta_ = 42 +
ieta;
404 double deta = 2.0 * (
eta - currentLowEdge_eta);
405 deta = ((
float)((
int)(1.0E3 * deta + 0.5))) / 1.0E3;
406 double dphi = 2.0 *
phi;
409 if (ieta <= 39 && ieta >= 21)
418 currentLowEdge_eta += deta;
422 currentLowEdge_eta = 2.964;
431 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
432 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
433 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
434 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
435 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
436 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
437 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
438 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
454 if (!HBHERecHitsHandle.
isValid()) {
455 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
456 <<
"HCALRecHitAnalyzer::analyze!\n";
463 if (!HORecHitsHandle.
isValid()) {
464 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
465 <<
"HCALRecHitAnalyzer::analyze!\n";
468 HORecHits = HORecHitsHandle.
product();
472 if (!HFRecHitsHandle.
isValid()) {
473 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
474 <<
"HCALRecHitAnalyzer::analyze!\n";
484 TLorentzVector vHBHEMET_EtaRing[83][4];
485 int HBHEActiveRing[83][4];
486 int HBHENActiveCells[83][4];
487 double HBHESET_EtaRing[83][4];
488 double HBHEMinEnergy_EtaRing[83][4];
489 double HBHEMaxEnergy_EtaRing[83][4];
491 for (
int i = 0;
i < 83;
i++) {
492 for (
int j = 0;
j < 4;
j++) {
493 HBHEActiveRing[
i][
j] = 0;
494 HBHENActiveCells[
i][
j] = 0;
495 HBHESET_EtaRing[
i][
j] = 0;
496 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
497 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
503 int nHBrechit = 0, nHErechit = 0;
507 double Energy = hbherechit->energy();
511 int EtaRing = 41 +
ieta;
521 HBHEActiveRing[EtaRing][
depth - 1] = 1;
522 HBHENActiveCells[EtaRing][
depth - 1]++;
523 HBHESET_EtaRing[EtaRing][
depth - 1] +=
ET;
524 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
525 vHBHEMET_EtaRing[EtaRing][
depth - 1] -= v_;
528 << vHBHEMET_EtaRing[EtaRing][
depth - 1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][
depth - 1].Pt());
543 if (
Energy > HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1])
544 HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
545 if (
Energy < HBHEMinEnergy_EtaRing[EtaRing][
depth - 1])
546 HBHEMinEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
554 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
564 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
573 if (Energy < hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
586 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
587 for (
int jDepth = 0; jDepth < 3; jDepth++) {
588 switch (jDepth + 1) {
603 if (HBHEActiveRing[iEtaRing][jDepth]) {
604 switch (jDepth + 1) {
635 TLorentzVector vHOMET_EtaRing[83];
636 int HOActiveRing[83];
637 int HONActiveCells[83];
638 double HOSET_EtaRing[83];
639 double HOMinEnergy_EtaRing[83];
640 double HOMaxEnergy_EtaRing[83];
642 for (
int i = 0;
i < 83;
i++) {
644 HONActiveCells[
i] = 0;
645 HOSET_EtaRing[
i] = 0;
646 HOMinEnergy_EtaRing[
i] = 14E3;
647 HOMaxEnergy_EtaRing[
i] = -999;
654 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
658 double Energy = horechit->energy();
662 int EtaRing = 41 +
ieta;
671 HOActiveRing[EtaRing] = 1;
672 HONActiveCells[EtaRing]++;
673 HOSET_EtaRing[EtaRing] +=
ET;
674 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
675 vHOMET_EtaRing[EtaRing] -= v_;
680 if (
Energy > HOMaxEnergy_EtaRing[EtaRing])
681 HOMaxEnergy_EtaRing[EtaRing] =
Energy;
682 if (
Energy < HOMinEnergy_EtaRing[EtaRing])
683 HOMinEnergy_EtaRing[EtaRing] =
Energy;
690 if (Energy < hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
696 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
700 if (HOActiveRing[iEtaRing]) {
712 TLorentzVector vHFMET_EtaRing[83][2];
713 int HFActiveRing[83][2];
714 int HFNActiveCells[83][2];
715 double HFSET_EtaRing[83][2];
716 double HFMinEnergy_EtaRing[83][2];
717 double HFMaxEnergy_EtaRing[83][2];
719 for (
int i = 0;
i < 83;
i++) {
720 for (
int j = 0;
j < 2;
j++) {
721 HFActiveRing[
i][
j] = 0;
722 HFNActiveCells[
i][
j] = 0;
723 HFSET_EtaRing[
i][
j] = 0;
724 HFMinEnergy_EtaRing[
i][
j] = 14E3;
725 HFMaxEnergy_EtaRing[
i][
j] = -999;
737 double Energy = hfrechit->energy();
741 int EtaRing = 41 +
ieta;
750 HFActiveRing[EtaRing][
depth - 1] = 1;
751 HFNActiveCells[EtaRing][
depth - 1]++;
752 HFSET_EtaRing[EtaRing][
depth - 1] +=
ET;
753 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
754 vHFMET_EtaRing[EtaRing][
depth - 1] -= v_;
766 if (
Energy > HFMaxEnergy_EtaRing[EtaRing][
depth - 1])
768 if (
Energy < HFMinEnergy_EtaRing[EtaRing][
depth - 1])
778 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
787 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
795 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
796 for (
int jDepth = 0; jDepth < 2; jDepth++) {
797 switch (jDepth + 1) {
808 if (HFActiveRing[iEtaRing][jDepth]) {
809 switch (jDepth + 1) {