42 #include <TLorentzVector.h> 45 #define DEBUG(X) { if (debug_) { std::cout << X << std::endl; } } 84 for (
int i = 1;
i <= 83;
i++) {
89 for (
int j = 1; j <= 72; j++) {
124 for (
int i=1;
i<=83;
i++)
125 for (
int j=1; j<=73; j++)
265 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task " 266 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
282 std::vector<DetId>::iterator
i;
284 int HBmin_ieta = 99, HBmax_ieta = -99;
285 int HBmin_iphi = 99, HBmax_iphi = -99;
291 for (i = HBids.begin(); i != HBids.end(); i++) {
297 int Calo_ieta = 42 + HcalID.
ieta();
298 int Calo_iphi = HcalID.
iphi();
309 if (Calo_ieta > HBmax_ieta) HBmax_ieta = Calo_ieta;
310 if (Calo_ieta < HBmin_ieta) HBmin_ieta = Calo_ieta;
311 if (Calo_iphi > HBmax_iphi) HBmax_iphi = Calo_iphi;
312 if (Calo_iphi > HBmax_iphi) HBmin_iphi = Calo_iphi;
316 int HEmin_ieta = 99, HEmax_ieta = -99;
317 int HEmin_iphi = 99, HEmax_iphi = -99;
323 for (i = HEids.begin(); i != HEids.end(); i++) {
329 int Calo_ieta = 42 + HcalID.
ieta();
330 int Calo_iphi = HcalID.
iphi();
340 if (Calo_ieta > HEmax_ieta) HEmax_ieta = Calo_ieta;
341 if (Calo_ieta < HEmin_ieta) HEmin_ieta = Calo_ieta;
342 if (Calo_iphi > HEmax_iphi) HEmax_iphi = Calo_iphi;
343 if (Calo_iphi > HEmax_iphi) HEmin_iphi = Calo_iphi;
347 int HFmin_ieta = 99, HFmax_ieta = -99;
348 int HFmin_iphi = 99, HFmax_iphi = -99;
354 for (i = HFids.begin(); i != HFids.end(); i++) {
362 int Calo_ieta = 42 + HcalID.
ieta();
363 int Calo_iphi = HcalID.iphi();
373 if (Calo_ieta > HFmax_ieta) HFmax_ieta = Calo_ieta;
374 if (Calo_ieta < HFmin_ieta) HFmin_ieta = Calo_ieta;
375 if (Calo_iphi > HFmax_iphi) HFmax_iphi = Calo_iphi;
376 if (Calo_iphi > HFmax_iphi) HFmin_iphi = Calo_iphi;
380 int HOmin_ieta = 99, HOmax_ieta = -99;
381 int HOmin_iphi = 99, HOmax_iphi = -99;
387 for (i = HOids.begin(); i != HOids.end(); i++) {
395 int Calo_ieta = 42 + HcalID.
ieta();
396 int Calo_iphi = HcalID.iphi();
406 if (Calo_ieta > HOmax_ieta) HOmax_ieta = Calo_ieta;
407 if (Calo_ieta < HOmin_ieta) HOmin_ieta = Calo_ieta;
408 if (Calo_iphi > HOmax_iphi) HOmax_iphi = Calo_iphi;
409 if (Calo_iphi > HOmax_iphi) HOmin_iphi = Calo_iphi;
414 double currentLowEdge_eta = 0;
415 for (
int ieta = 1; ieta < 42 ; ieta++) {
417 int ieta_ = 42 + ieta;
420 double deta = 2.0*(eta-currentLowEdge_eta);
421 deta = ((
float)((
int)(1.0E3*deta + 0.5)))/1.0E3;
422 double dphi = 2.0*
phi;
423 if (ieta==40 || ieta==41) dphi = 20;
424 if (ieta<=39 && ieta>=21) dphi = 10;
425 if (ieta<=20) dphi = 5;
427 if (ieta == 28) deta = 0.218;
428 if (ieta == 29) deta= 0.096;
429 currentLowEdge_eta += deta;
432 if (ieta == 29) currentLowEdge_eta = 2.964;
441 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
442 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
443 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
444 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
445 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
446 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
447 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
448 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
466 if (!HBHERecHitsHandle.
isValid()) {
467 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 468 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
470 HBHERecHits = HBHERecHitsHandle.
product();
474 if (!HORecHitsHandle.
isValid()) {
475 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 476 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
478 HORecHits = HORecHitsHandle.
product();
482 if (!HFRecHitsHandle.
isValid()) {
483 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 484 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
486 HFRecHits = HFRecHitsHandle.
product();
493 TLorentzVector vHBHEMET_EtaRing[83][4];
494 int HBHEActiveRing[83][4];
495 int HBHENActiveCells[83][4];
496 double HBHESET_EtaRing[83][4];
497 double HBHEMinEnergy_EtaRing[83][4];
498 double HBHEMaxEnergy_EtaRing[83][4];
500 for (
int i = 0;
i < 83;
i++) {
501 for (
int j = 0; j < 4; j++) {
503 HBHEActiveRing[
i][j] = 0;
504 HBHENActiveCells[
i][j] = 0;
505 HBHESET_EtaRing[
i][j] = 0;
506 HBHEMinEnergy_EtaRing[
i][j] = 14E3;
507 HBHEMaxEnergy_EtaRing[
i][j] = -999;
513 int nHBrechit = 0, nHErechit = 0;
515 for (hbherechit = HBHERecHits->
begin(); hbherechit != HBHERecHits->
end(); hbherechit++) {
518 double Energy = hbherechit->energy();
520 Int_t ieta = det.
ieta();
521 Int_t iphi = det.
iphi();
522 int EtaRing = 41 + ieta;
525 double theta = 2*TMath::ATan(
exp(-1*eta));
526 double ET = Energy*TMath::Sin(theta);
534 HBHEActiveRing[EtaRing][depth-1] = 1;
535 HBHENActiveCells[EtaRing][depth-1]++;
536 HBHESET_EtaRing[EtaRing][depth-1]+=
ET;
537 v_.SetPtEtaPhiE(ET, 0, phi, ET);
538 vHBHEMET_EtaRing[EtaRing][depth-1]-=v_;
541 DEBUG( EtaRing <<
" " << Energy <<
" " << ET <<
" " << theta <<
" " << eta <<
" " << phi <<
" : " << vHBHEMET_EtaRing[EtaRing][depth-1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][depth-1].
Pt() );
556 if (Energy > HBHEMaxEnergy_EtaRing[EtaRing][depth-1])
557 HBHEMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
558 if (Energy < HBHEMinEnergy_EtaRing[EtaRing][depth-1])
559 HBHEMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
567 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
577 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
586 if (Energy<hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
600 for (
int iEtaRing=0; iEtaRing < 83; iEtaRing++) {
601 for (
int jDepth=0; jDepth < 3; jDepth++) {
618 if (HBHEActiveRing[iEtaRing][jDepth]) {
652 TLorentzVector vHOMET_EtaRing[83];
653 int HOActiveRing[83];
654 int HONActiveCells[83];
655 double HOSET_EtaRing[83];
656 double HOMinEnergy_EtaRing[83];
657 double HOMaxEnergy_EtaRing[83];
659 for (
int i=0;
i<83;
i++) {
662 HONActiveCells[
i] = 0;
663 HOSET_EtaRing[
i] = 0;
664 HOMinEnergy_EtaRing[
i] = 14E3;
665 HOMaxEnergy_EtaRing[
i] = -999;
672 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
677 double Energy = horechit->energy();
679 Int_t ieta = det.
ieta();
680 Int_t iphi = det.
iphi();
681 int EtaRing = 41+ieta;
684 double theta = 2*TMath::ATan(
exp(-1*eta));
685 double ET = Energy*TMath::Sin(theta);
691 HOActiveRing[EtaRing] = 1;
692 HONActiveCells[EtaRing]++;
693 HOSET_EtaRing[EtaRing]+=
ET;
694 v_.SetPtEtaPhiE(ET, 0, phi, ET);
695 vHOMET_EtaRing[EtaRing]-=v_;
700 if (Energy > HOMaxEnergy_EtaRing[EtaRing])
701 HOMaxEnergy_EtaRing[EtaRing] = Energy;
702 if (Energy < HOMinEnergy_EtaRing[EtaRing])
703 HOMinEnergy_EtaRing[EtaRing] = Energy;
710 if (Energy<hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
716 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
720 if (HOActiveRing[iEtaRing]) {
735 TLorentzVector vHFMET_EtaRing[83][2];
736 int HFActiveRing[83][2];
737 int HFNActiveCells[83][2];
738 double HFSET_EtaRing[83][2];
739 double HFMinEnergy_EtaRing[83][2];
740 double HFMaxEnergy_EtaRing[83][2];
742 for (
int i=0;
i<83;
i++) {
743 for (
int j=0;j<2; j++) {
745 HFActiveRing[
i][j] = 0;
746 HFNActiveCells[
i][j] = 0;
747 HFSET_EtaRing[
i][j] = 0;
748 HFMinEnergy_EtaRing[
i][j] = 14E3;
749 HFMaxEnergy_EtaRing[
i][j] = -999;
758 for (hfrechit = HFRecHits->
begin(); hfrechit != HFRecHits->
end(); hfrechit++) {
763 double Energy = hfrechit->energy();
765 Int_t ieta = det.
ieta();
766 Int_t iphi = det.
iphi();
767 int EtaRing = 41+ieta;
770 double theta = 2*TMath::ATan(
exp(-1*eta));
771 double ET = Energy*TMath::Sin(theta);
776 HFActiveRing[EtaRing][depth-1] = 1;
777 HFNActiveCells[EtaRing][depth-1]++;
778 HFSET_EtaRing[EtaRing][depth-1]+=
ET;
779 v_.SetPtEtaPhiE(ET, 0, phi, ET);
780 vHFMET_EtaRing[EtaRing][depth-1]-=v_;
793 if (Energy > HFMaxEnergy_EtaRing[EtaRing][depth-1])
794 HFMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
795 if (Energy < HFMinEnergy_EtaRing[EtaRing][depth-1])
796 HFMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
806 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
815 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
823 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
824 for (
int jDepth=0; jDepth<2; jDepth++) {
837 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
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
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
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
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_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
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
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
GlobalPoint getPosition(const DetId &id) const
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
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