41 #include <TLorentzVector.h>
44 #define DEBUG(X) { if (debug_) { std::cout << X << std::endl; } }
83 for (
int i = 1;
i <= 83;
i++) {
88 for (
int j = 1;
j <= 72;
j++) {
123 for (
int i=1;
i<=83;
i++)
124 for (
int j=1;
j<=73;
j++)
264 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task "
265 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
281 std::vector<DetId>::iterator
i;
283 int HBmin_ieta = 99, HBmax_ieta = -99;
284 int HBmin_iphi = 99, HBmax_iphi = -99;
290 for (i = HBids.begin(); i != HBids.end(); i++) {
298 int Calo_ieta = 42 + HcalID.
ieta();
299 int Calo_iphi = HcalID.iphi();
310 if (Calo_ieta > HBmax_ieta) HBmax_ieta = Calo_ieta;
311 if (Calo_ieta < HBmin_ieta) HBmin_ieta = Calo_ieta;
312 if (Calo_iphi > HBmax_iphi) HBmax_iphi = Calo_iphi;
313 if (Calo_iphi > HBmax_iphi) HBmin_iphi = Calo_iphi;
317 int HEmin_ieta = 99, HEmax_ieta = -99;
318 int HEmin_iphi = 99, HEmax_iphi = -99;
324 for (i = HEids.begin(); i != HEids.end(); i++) {
332 int Calo_ieta = 42 + HcalID.
ieta();
333 int Calo_iphi = HcalID.iphi();
343 if (Calo_ieta > HEmax_ieta) HEmax_ieta = Calo_ieta;
344 if (Calo_ieta < HEmin_ieta) HEmin_ieta = Calo_ieta;
345 if (Calo_iphi > HEmax_iphi) HEmax_iphi = Calo_iphi;
346 if (Calo_iphi > HEmax_iphi) HEmin_iphi = Calo_iphi;
350 int HFmin_ieta = 99, HFmax_ieta = -99;
351 int HFmin_iphi = 99, HFmax_iphi = -99;
357 for (i = HFids.begin(); i != HFids.end(); i++) {
365 int Calo_ieta = 42 + HcalID.
ieta();
366 int Calo_iphi = HcalID.iphi();
376 if (Calo_ieta > HFmax_ieta) HFmax_ieta = Calo_ieta;
377 if (Calo_ieta < HFmin_ieta) HFmin_ieta = Calo_ieta;
378 if (Calo_iphi > HFmax_iphi) HFmax_iphi = Calo_iphi;
379 if (Calo_iphi > HFmax_iphi) HFmin_iphi = Calo_iphi;
383 int HOmin_ieta = 99, HOmax_ieta = -99;
384 int HOmin_iphi = 99, HOmax_iphi = -99;
390 for (i = HOids.begin(); i != HOids.end(); i++) {
398 int Calo_ieta = 42 + HcalID.
ieta();
399 int Calo_iphi = HcalID.iphi();
409 if (Calo_ieta > HOmax_ieta) HOmax_ieta = Calo_ieta;
410 if (Calo_ieta < HOmin_ieta) HOmin_ieta = Calo_ieta;
411 if (Calo_iphi > HOmax_iphi) HOmax_iphi = Calo_iphi;
412 if (Calo_iphi > HOmax_iphi) HOmin_iphi = Calo_iphi;
417 double currentLowEdge_eta = 0;
418 for (
int ieta = 1; ieta < 42 ; ieta++) {
420 int ieta_ = 42 + ieta;
423 double deta = 2.0*(eta-currentLowEdge_eta);
424 deta = ((float)((
int)(1.0E3*deta + 0.5)))/1.0E3;
425 double dphi = 2.0*
phi;
426 if (ieta==40 || ieta==41) dphi = 20;
427 if (ieta<=39 && ieta>=21) dphi = 10;
428 if (ieta<=20) dphi = 5;
430 if (ieta == 28) deta = 0.218;
431 if (ieta == 29) deta= 0.096;
432 currentLowEdge_eta += deta;
435 if (ieta == 29) currentLowEdge_eta = 2.964;
444 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
445 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
446 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
447 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
448 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
449 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
450 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
451 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
469 if (!HBHERecHitsHandle.
isValid()) {
470 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
471 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
473 HBHERecHits = HBHERecHitsHandle.
product();
477 if (!HORecHitsHandle.
isValid()) {
478 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
479 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
481 HORecHits = HORecHitsHandle.
product();
485 if (!HFRecHitsHandle.
isValid()) {
486 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
487 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
489 HFRecHits = HFRecHitsHandle.
product();
496 TLorentzVector vHBHEMET_EtaRing[83][4];
497 int HBHEActiveRing[83][4];
498 int HBHENActiveCells[83][4];
499 double HBHESET_EtaRing[83][4];
500 double HBHEMinEnergy_EtaRing[83][4];
501 double HBHEMaxEnergy_EtaRing[83][4];
503 for (
int i = 0;
i < 83;
i++) {
504 for (
int j = 0;
j < 4;
j++) {
506 HBHEActiveRing[
i][
j] = 0;
507 HBHENActiveCells[
i][
j] = 0;
508 HBHESET_EtaRing[
i][
j] = 0;
509 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
510 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
516 int nHBrechit = 0, nHErechit = 0;
518 for (hbherechit = HBHERecHits->
begin(); hbherechit != HBHERecHits->
end(); hbherechit++) {
521 double Energy = hbherechit->energy();
523 Int_t ieta = det.
ieta();
524 Int_t iphi = det.
iphi();
525 int EtaRing = 41 + ieta;
528 double theta = 2*TMath::ATan(
exp(-1*eta));
529 double ET = Energy*TMath::Sin(theta);
537 HBHEActiveRing[EtaRing][depth-1] = 1;
538 HBHENActiveCells[EtaRing][depth-1]++;
539 HBHESET_EtaRing[EtaRing][depth-1]+=
ET;
540 v_.SetPtEtaPhiE(ET, 0, phi, ET);
541 vHBHEMET_EtaRing[EtaRing][depth-1]-=v_;
544 DEBUG( EtaRing <<
" " << Energy <<
" " << ET <<
" " << theta <<
" " << eta <<
" " << phi <<
" : " << vHBHEMET_EtaRing[EtaRing][depth-1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][depth-1].
Pt() );
559 if (Energy > HBHEMaxEnergy_EtaRing[EtaRing][depth-1])
560 HBHEMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
561 if (Energy < HBHEMinEnergy_EtaRing[EtaRing][depth-1])
562 HBHEMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
570 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
580 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
589 if (Energy<hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
603 for (
int iEtaRing=0; iEtaRing < 83; iEtaRing++) {
604 for (
int jDepth=0; jDepth < 3; jDepth++) {
621 if (HBHEActiveRing[iEtaRing][jDepth]) {
655 TLorentzVector vHOMET_EtaRing[83];
656 int HOActiveRing[83];
657 int HONActiveCells[83];
658 double HOSET_EtaRing[83];
659 double HOMinEnergy_EtaRing[83];
660 double HOMaxEnergy_EtaRing[83];
662 for (
int i=0;
i<83;
i++) {
665 HONActiveCells[
i] = 0;
666 HOSET_EtaRing[
i] = 0;
667 HOMinEnergy_EtaRing[
i] = 14E3;
668 HOMaxEnergy_EtaRing[
i] = -999;
675 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
680 double Energy = horechit->energy();
682 Int_t ieta = det.
ieta();
683 Int_t iphi = det.
iphi();
684 int EtaRing = 41+ieta;
687 double theta = 2*TMath::ATan(
exp(-1*eta));
688 double ET = Energy*TMath::Sin(theta);
694 HOActiveRing[EtaRing] = 1;
695 HONActiveCells[EtaRing]++;
696 HOSET_EtaRing[EtaRing]+=
ET;
697 v_.SetPtEtaPhiE(ET, 0, phi, ET);
698 vHOMET_EtaRing[EtaRing]-=v_;
703 if (Energy > HOMaxEnergy_EtaRing[EtaRing])
704 HOMaxEnergy_EtaRing[EtaRing] = Energy;
705 if (Energy < HOMinEnergy_EtaRing[EtaRing])
706 HOMinEnergy_EtaRing[EtaRing] = Energy;
713 if (Energy<hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
719 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
723 if (HOActiveRing[iEtaRing]) {
738 TLorentzVector vHFMET_EtaRing[83][2];
739 int HFActiveRing[83][2];
740 int HFNActiveCells[83][2];
741 double HFSET_EtaRing[83][2];
742 double HFMinEnergy_EtaRing[83][2];
743 double HFMaxEnergy_EtaRing[83][2];
745 for (
int i=0;
i<83;
i++) {
746 for (
int j=0;
j<2;
j++) {
748 HFActiveRing[
i][
j] = 0;
749 HFNActiveCells[
i][
j] = 0;
750 HFSET_EtaRing[
i][
j] = 0;
751 HFMinEnergy_EtaRing[
i][
j] = 14E3;
752 HFMaxEnergy_EtaRing[
i][
j] = -999;
761 for (hfrechit = HFRecHits->
begin(); hfrechit != HFRecHits->
end(); hfrechit++) {
766 double Energy = hfrechit->energy();
768 Int_t ieta = det.
ieta();
769 Int_t iphi = det.
iphi();
770 int EtaRing = 41+ieta;
773 double theta = 2*TMath::ATan(
exp(-1*eta));
774 double ET = Energy*TMath::Sin(theta);
779 HFActiveRing[EtaRing][depth-1] = 1;
780 HFNActiveCells[EtaRing][depth-1]++;
781 HFSET_EtaRing[EtaRing][depth-1]+=
ET;
782 v_.SetPtEtaPhiE(ET, 0, phi, ET);
783 vHFMET_EtaRing[EtaRing][depth-1]-=v_;
796 if (Energy > HFMaxEnergy_EtaRing[EtaRing][depth-1])
797 HFMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
798 if (Energy < HFMinEnergy_EtaRing[EtaRing][depth-1])
799 HFMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
809 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
818 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
826 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
827 for (
int jDepth=0; jDepth<2; jDepth++) {
840 if (HFActiveRing[iEtaRing][jDepth]) {
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 * hHCAL_D4_Maxenergy_ieta_iphi
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * hHCAL_ieta_iphi_HFMap
MonitorElement * hHCAL_D3_Maxenergy_ieta_iphi
MonitorElement * hHCAL_D3_Maxenergyvsieta
HcalSubdetector subdet() const
get the subdetector
MonitorElement * hHCAL_ieta_iphi_phiMap
MonitorElement * hHCAL_D1_SETvsieta
MonitorElement * hHCAL_D3_Occvsieta
HCALRecHitAnalyzer(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hHCAL_D2_Minenergy_ieta_iphi
MonitorElement * hHCAL_D4_METvsieta
MonitorElement * hHCAL_D4_energyvsieta
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * hHCAL_D4_Maxenergyvsieta
Geom::Phi< T > phi() const
MonitorElement * hHCAL_D1_Minenergy_ieta_iphi
std::vector< HBHERecHit >::const_iterator const_iterator
Geom::Theta< T > theta() const
MonitorElement * hHCAL_D4_Occvsieta
void FillGeometry(const edm::EventSetup &)
MonitorElement * hHCAL_D3_Minenergyvsieta
MonitorElement * hHCAL_D3_Occ_ieta_iphi
MonitorElement * hHCAL_D4_Occ_ieta_iphi
MonitorElement * hHCAL_D2_Minenergyvsieta
MonitorElement * hHCAL_ieta_iphi_etaMap
MonitorElement * hHCAL_D4_MEyvsieta
MonitorElement * hHCAL_D4_SETvsieta
MonitorElement * hHCAL_ieta_iphi_HBMap
MonitorElement * hHCAL_D3_METvsieta
MonitorElement * hHCAL_ieta_iphi_HOMap
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)
MonitorElement * hHCAL_D3_MExvsieta
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
MonitorElement * hHCAL_D1_Maxenergy_ieta_iphi
MonitorElement * hHCAL_D1_Occ_ieta_iphi
MonitorElement * hHCAL_D4_METPhivsieta
int depth() const
get the tower depth
MonitorElement * hHCAL_D4_Minenergyvsieta
MonitorElement * hHCAL_D2_METvsieta
MonitorElement * hHCAL_D1_Occvsieta
MonitorElement * hHCAL_D1_Minenergyvsieta
MonitorElement * hHCAL_D1_METPhivsieta
MonitorElement * hHCAL_D1_METvsieta
MonitorElement * hHCAL_D1_Maxenergyvsieta
MonitorElement * hHCAL_D3_energyvsieta
MonitorElement * hHCAL_D2_Maxenergyvsieta
MonitorElement * hHCAL_D2_energyvsieta
int ieta() const
get the cell ieta
MonitorElement * book1D(Args &&...args)
edm::EDGetTokenT< HFRecHitCollection > hFRecHitsLabel_
MonitorElement * hHCAL_D2_METPhivsieta
MonitorElement * hHCAL_D2_Occvsieta
MonitorElement * hHCAL_D2_Maxenergy_ieta_iphi
MonitorElement * hHCAL_D3_METPhivsieta
MonitorElement * hHCAL_D1_energyvsieta
MonitorElement * hHCAL_ieta_detaMap
MonitorElement * hHCAL_D2_energy_ieta_iphi
const_iterator end() const
MonitorElement * hHCAL_D1_energy_ieta_iphi
int iphi() const
get the cell iphi
MonitorElement * hHCAL_D4_Minenergy_ieta_iphi
MonitorElement * hHCAL_D3_SETvsieta
edm::EDGetTokenT< HORecHitCollection > hORecHitsLabel_
void setCurrentFolder(const std::string &fullpath)
MonitorElement * hHCAL_D1_MExvsieta
MonitorElement * hHCAL_D4_MExvsieta
MonitorElement * hHCAL_D2_MEyvsieta
T const * product() const
MonitorElement * book2D(Args &&...args)
MonitorElement * hHCAL_D1_MEyvsieta
edm::EDGetTokenT< HBHERecHitCollection > hBHERecHitsLabel_
MonitorElement * hHCAL_D4_energy_ieta_iphi
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * hHCAL_D3_energy_ieta_iphi
MonitorElement * hHCAL_D2_Occ_ieta_iphi
MonitorElement * hHCAL_Nevents
MonitorElement * hHCAL_D3_Minenergy_ieta_iphi
MonitorElement * hHCAL_D2_SETvsieta
MonitorElement * hHCAL_D2_MExvsieta
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
MonitorElement * hHCAL_D3_MEyvsieta
MonitorElement * hHCAL_ieta_iphi_HEMap
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const_iterator begin() const
MonitorElement * hHCAL_ieta_dphiMap