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++) {
246 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task "
247 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
262 std::vector<DetId>::iterator
i;
264 int HBmin_ieta = 99, HBmax_ieta = -99;
265 int HBmin_iphi = 99, HBmax_iphi = -99;
271 for (
i = HBids.begin();
i != HBids.end();
i++) {
276 int Calo_ieta = 42 + HcalID.
ieta();
277 int Calo_iphi = HcalID.
iphi();
286 if (Calo_ieta > HBmax_ieta)
287 HBmax_ieta = Calo_ieta;
288 if (Calo_ieta < HBmin_ieta)
289 HBmin_ieta = Calo_ieta;
290 if (Calo_iphi > HBmax_iphi)
291 HBmax_iphi = Calo_iphi;
292 if (Calo_iphi > HBmax_iphi)
293 HBmin_iphi = Calo_iphi;
296 int HEmin_ieta = 99, HEmax_ieta = -99;
297 int HEmin_iphi = 99, HEmax_iphi = -99;
303 for (
i = HEids.begin();
i != HEids.end();
i++) {
308 int Calo_ieta = 42 + HcalID.
ieta();
309 int Calo_iphi = HcalID.
iphi();
310 double Calo_eta = HEgeom->getPosition(HcalID).eta();
311 double Calo_phi = HEgeom->getPosition(HcalID).phi();
319 if (Calo_ieta > HEmax_ieta)
320 HEmax_ieta = Calo_ieta;
321 if (Calo_ieta < HEmin_ieta)
322 HEmin_ieta = Calo_ieta;
323 if (Calo_iphi > HEmax_iphi)
324 HEmax_iphi = Calo_iphi;
325 if (Calo_iphi > HEmax_iphi)
326 HEmin_iphi = Calo_iphi;
329 int HFmin_ieta = 99, HFmax_ieta = -99;
330 int HFmin_iphi = 99, HFmax_iphi = -99;
336 for (
i = HFids.begin();
i != HFids.end();
i++) {
343 int Calo_ieta = 42 + HcalID.
ieta();
344 int Calo_iphi = HcalID.iphi();
345 double Calo_eta = cell->getPosition().eta();
346 double Calo_phi = cell->getPosition().phi();
354 if (Calo_ieta > HFmax_ieta)
355 HFmax_ieta = Calo_ieta;
356 if (Calo_ieta < HFmin_ieta)
357 HFmin_ieta = Calo_ieta;
358 if (Calo_iphi > HFmax_iphi)
359 HFmax_iphi = Calo_iphi;
360 if (Calo_iphi > HFmax_iphi)
361 HFmin_iphi = Calo_iphi;
364 int HOmin_ieta = 99, HOmax_ieta = -99;
365 int HOmin_iphi = 99, HOmax_iphi = -99;
371 for (
i = HOids.begin();
i != HOids.end();
i++) {
374 auto cell = HOgeom->getGeometry(*
i);
378 int Calo_ieta = 42 + HcalID.
ieta();
379 int Calo_iphi = HcalID.iphi();
380 double Calo_eta = cell->getPosition().eta();
381 double Calo_phi = cell->getPosition().phi();
389 if (Calo_ieta > HOmax_ieta)
390 HOmax_ieta = Calo_ieta;
391 if (Calo_ieta < HOmin_ieta)
392 HOmin_ieta = Calo_ieta;
393 if (Calo_iphi > HOmax_iphi)
394 HOmax_iphi = Calo_iphi;
395 if (Calo_iphi > HOmax_iphi)
396 HOmin_iphi = Calo_iphi;
400 double currentLowEdge_eta = 0;
402 int ieta_ = 42 +
ieta;
405 double deta = 2.0 * (
eta - currentLowEdge_eta);
406 deta = ((
float)((
int)(1.0E3 * deta + 0.5))) / 1.0E3;
407 double dphi = 2.0 *
phi;
410 if (ieta <= 39 && ieta >= 21)
419 currentLowEdge_eta += deta;
423 currentLowEdge_eta = 2.964;
432 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
433 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
434 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
435 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
436 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
437 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
438 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
439 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
455 if (!HBHERecHitsHandle.
isValid()) {
456 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
457 <<
"HCALRecHitAnalyzer::analyze!\n";
464 if (!HORecHitsHandle.
isValid()) {
465 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
466 <<
"HCALRecHitAnalyzer::analyze!\n";
469 HORecHits = HORecHitsHandle.
product();
473 if (!HFRecHitsHandle.
isValid()) {
474 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
475 <<
"HCALRecHitAnalyzer::analyze!\n";
485 TLorentzVector vHBHEMET_EtaRing[83][4];
486 int HBHEActiveRing[83][4];
487 int HBHENActiveCells[83][4];
488 double HBHESET_EtaRing[83][4];
489 double HBHEMinEnergy_EtaRing[83][4];
490 double HBHEMaxEnergy_EtaRing[83][4];
492 for (
int i = 0;
i < 83;
i++) {
493 for (
int j = 0;
j < 4;
j++) {
494 HBHEActiveRing[
i][
j] = 0;
495 HBHENActiveCells[
i][
j] = 0;
496 HBHESET_EtaRing[
i][
j] = 0;
497 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
498 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
504 int nHBrechit = 0, nHErechit = 0;
508 double Energy = hbherechit->energy();
512 int EtaRing = 41 +
ieta;
522 HBHEActiveRing[EtaRing][
depth - 1] = 1;
523 HBHENActiveCells[EtaRing][
depth - 1]++;
524 HBHESET_EtaRing[EtaRing][
depth - 1] +=
ET;
525 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
526 vHBHEMET_EtaRing[EtaRing][
depth - 1] -= v_;
529 << vHBHEMET_EtaRing[EtaRing][
depth - 1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][
depth - 1].Pt());
544 if (
Energy > HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1])
545 HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
546 if (
Energy < HBHEMinEnergy_EtaRing[EtaRing][
depth - 1])
547 HBHEMinEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
555 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
565 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
574 if (Energy < hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
587 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
588 for (
int jDepth = 0; jDepth < 3; jDepth++) {
589 switch (jDepth + 1) {
604 if (HBHEActiveRing[iEtaRing][jDepth]) {
605 switch (jDepth + 1) {
636 TLorentzVector vHOMET_EtaRing[83];
637 int HOActiveRing[83];
638 int HONActiveCells[83];
639 double HOSET_EtaRing[83];
640 double HOMinEnergy_EtaRing[83];
641 double HOMaxEnergy_EtaRing[83];
643 for (
int i = 0;
i < 83;
i++) {
645 HONActiveCells[
i] = 0;
646 HOSET_EtaRing[
i] = 0;
647 HOMinEnergy_EtaRing[
i] = 14E3;
648 HOMaxEnergy_EtaRing[
i] = -999;
655 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
659 double Energy = horechit->energy();
663 int EtaRing = 41 +
ieta;
672 HOActiveRing[EtaRing] = 1;
673 HONActiveCells[EtaRing]++;
674 HOSET_EtaRing[EtaRing] +=
ET;
675 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
676 vHOMET_EtaRing[EtaRing] -= v_;
681 if (
Energy > HOMaxEnergy_EtaRing[EtaRing])
682 HOMaxEnergy_EtaRing[EtaRing] =
Energy;
683 if (
Energy < HOMinEnergy_EtaRing[EtaRing])
684 HOMinEnergy_EtaRing[EtaRing] =
Energy;
691 if (Energy < hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
697 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
701 if (HOActiveRing[iEtaRing]) {
713 TLorentzVector vHFMET_EtaRing[83][2];
714 int HFActiveRing[83][2];
715 int HFNActiveCells[83][2];
716 double HFSET_EtaRing[83][2];
717 double HFMinEnergy_EtaRing[83][2];
718 double HFMaxEnergy_EtaRing[83][2];
720 for (
int i = 0;
i < 83;
i++) {
721 for (
int j = 0;
j < 2;
j++) {
722 HFActiveRing[
i][
j] = 0;
723 HFNActiveCells[
i][
j] = 0;
724 HFSET_EtaRing[
i][
j] = 0;
725 HFMinEnergy_EtaRing[
i][
j] = 14E3;
726 HFMaxEnergy_EtaRing[
i][
j] = -999;
738 double Energy = hfrechit->energy();
742 int EtaRing = 41 +
ieta;
751 HFActiveRing[EtaRing][
depth - 1] = 1;
752 HFNActiveCells[EtaRing][
depth - 1]++;
753 HFSET_EtaRing[EtaRing][
depth - 1] +=
ET;
754 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
755 vHFMET_EtaRing[EtaRing][
depth - 1] -= v_;
767 if (
Energy > HFMaxEnergy_EtaRing[EtaRing][
depth - 1])
769 if (
Energy < HFMinEnergy_EtaRing[EtaRing][
depth - 1])
779 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
788 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
796 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
797 for (
int jDepth = 0; jDepth < 2; jDepth++) {
798 switch (jDepth + 1) {
809 if (HFActiveRing[iEtaRing][jDepth]) {
810 switch (jDepth + 1) {