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++)
260 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task " 261 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
277 std::vector<DetId>::iterator
i;
279 int HBmin_ieta = 99, HBmax_ieta = -99;
280 int HBmin_iphi = 99, HBmax_iphi = -99;
286 for (i = HBids.begin(); i != HBids.end(); i++) {
292 int Calo_ieta = 42 + HcalID.
ieta();
293 int Calo_iphi = HcalID.
iphi();
304 if (Calo_ieta > HBmax_ieta) HBmax_ieta = Calo_ieta;
305 if (Calo_ieta < HBmin_ieta) HBmin_ieta = Calo_ieta;
306 if (Calo_iphi > HBmax_iphi) HBmax_iphi = Calo_iphi;
307 if (Calo_iphi > HBmax_iphi) HBmin_iphi = Calo_iphi;
311 int HEmin_ieta = 99, HEmax_ieta = -99;
312 int HEmin_iphi = 99, HEmax_iphi = -99;
318 for (i = HEids.begin(); i != HEids.end(); i++) {
324 int Calo_ieta = 42 + HcalID.
ieta();
325 int Calo_iphi = HcalID.
iphi();
335 if (Calo_ieta > HEmax_ieta) HEmax_ieta = Calo_ieta;
336 if (Calo_ieta < HEmin_ieta) HEmin_ieta = Calo_ieta;
337 if (Calo_iphi > HEmax_iphi) HEmax_iphi = Calo_iphi;
338 if (Calo_iphi > HEmax_iphi) HEmin_iphi = Calo_iphi;
342 int HFmin_ieta = 99, HFmax_ieta = -99;
343 int HFmin_iphi = 99, HFmax_iphi = -99;
349 for (i = HFids.begin(); i != HFids.end(); i++) {
357 int Calo_ieta = 42 + HcalID.
ieta();
358 int Calo_iphi = HcalID.iphi();
359 double Calo_eta = cell->getPosition().eta();
360 double Calo_phi = cell->getPosition().phi();
368 if (Calo_ieta > HFmax_ieta) HFmax_ieta = Calo_ieta;
369 if (Calo_ieta < HFmin_ieta) HFmin_ieta = Calo_ieta;
370 if (Calo_iphi > HFmax_iphi) HFmax_iphi = Calo_iphi;
371 if (Calo_iphi > HFmax_iphi) HFmin_iphi = Calo_iphi;
375 int HOmin_ieta = 99, HOmax_ieta = -99;
376 int HOmin_iphi = 99, HOmax_iphi = -99;
382 for (i = HOids.begin(); i != HOids.end(); i++) {
390 int Calo_ieta = 42 + HcalID.
ieta();
391 int Calo_iphi = HcalID.iphi();
392 double Calo_eta = cell->getPosition().eta();
393 double Calo_phi = cell->getPosition().phi();
401 if (Calo_ieta > HOmax_ieta) HOmax_ieta = Calo_ieta;
402 if (Calo_ieta < HOmin_ieta) HOmin_ieta = Calo_ieta;
403 if (Calo_iphi > HOmax_iphi) HOmax_iphi = Calo_iphi;
404 if (Calo_iphi > HOmax_iphi) HOmin_iphi = Calo_iphi;
409 double currentLowEdge_eta = 0;
410 for (
int ieta = 1; ieta < 42 ; ieta++) {
412 int ieta_ = 42 + ieta;
415 double deta = 2.0*(eta-currentLowEdge_eta);
416 deta = ((
float)((
int)(1.0E3*deta + 0.5)))/1.0E3;
417 double dphi = 2.0*
phi;
418 if (ieta==40 || ieta==41) dphi = 20;
419 if (ieta<=39 && ieta>=21) dphi = 10;
420 if (ieta<=20) dphi = 5;
422 if (ieta == 28) deta = 0.218;
423 if (ieta == 29) deta= 0.096;
424 currentLowEdge_eta += deta;
427 if (ieta == 29) currentLowEdge_eta = 2.964;
436 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
437 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
438 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
439 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
440 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
441 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
442 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
443 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
461 if (!HBHERecHitsHandle.
isValid()) {
462 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 463 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
465 HBHERecHits = HBHERecHitsHandle.
product();
469 if (!HORecHitsHandle.
isValid()) {
470 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 471 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
473 HORecHits = HORecHitsHandle.
product();
477 if (!HFRecHitsHandle.
isValid()) {
478 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 479 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
481 HFRecHits = HFRecHitsHandle.
product();
488 TLorentzVector vHBHEMET_EtaRing[83][4];
489 int HBHEActiveRing[83][4];
490 int HBHENActiveCells[83][4];
491 double HBHESET_EtaRing[83][4];
492 double HBHEMinEnergy_EtaRing[83][4];
493 double HBHEMaxEnergy_EtaRing[83][4];
495 for (
int i = 0;
i < 83;
i++) {
496 for (
int j = 0; j < 4; j++) {
498 HBHEActiveRing[
i][j] = 0;
499 HBHENActiveCells[
i][j] = 0;
500 HBHESET_EtaRing[
i][j] = 0;
501 HBHEMinEnergy_EtaRing[
i][j] = 14E3;
502 HBHEMaxEnergy_EtaRing[
i][j] = -999;
508 int nHBrechit = 0, nHErechit = 0;
510 for (hbherechit = HBHERecHits->
begin(); hbherechit != HBHERecHits->
end(); hbherechit++) {
513 double Energy = hbherechit->energy();
515 Int_t ieta = det.
ieta();
516 Int_t iphi = det.
iphi();
517 int EtaRing = 41 + ieta;
520 double theta = 2*TMath::ATan(
exp(-1*eta));
521 double ET = Energy*TMath::Sin(theta);
529 HBHEActiveRing[EtaRing][depth-1] = 1;
530 HBHENActiveCells[EtaRing][depth-1]++;
531 HBHESET_EtaRing[EtaRing][depth-1]+=
ET;
532 v_.SetPtEtaPhiE(ET, 0, phi, ET);
533 vHBHEMET_EtaRing[EtaRing][depth-1]-=v_;
536 DEBUG( EtaRing <<
" " << Energy <<
" " << ET <<
" " << theta <<
" " << eta <<
" " << phi <<
" : " << vHBHEMET_EtaRing[EtaRing][depth-1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][depth-1].
Pt() );
551 if (Energy > HBHEMaxEnergy_EtaRing[EtaRing][depth-1])
552 HBHEMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
553 if (Energy < HBHEMinEnergy_EtaRing[EtaRing][depth-1])
554 HBHEMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
562 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
572 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
581 if (Energy<hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
595 for (
int iEtaRing=0; iEtaRing < 83; iEtaRing++) {
596 for (
int jDepth=0; jDepth < 3; jDepth++) {
613 if (HBHEActiveRing[iEtaRing][jDepth]) {
647 TLorentzVector vHOMET_EtaRing[83];
648 int HOActiveRing[83];
649 int HONActiveCells[83];
650 double HOSET_EtaRing[83];
651 double HOMinEnergy_EtaRing[83];
652 double HOMaxEnergy_EtaRing[83];
654 for (
int i=0;
i<83;
i++) {
657 HONActiveCells[
i] = 0;
658 HOSET_EtaRing[
i] = 0;
659 HOMinEnergy_EtaRing[
i] = 14E3;
660 HOMaxEnergy_EtaRing[
i] = -999;
667 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
672 double Energy = horechit->energy();
674 Int_t ieta = det.
ieta();
675 Int_t iphi = det.
iphi();
676 int EtaRing = 41+ieta;
679 double theta = 2*TMath::ATan(
exp(-1*eta));
680 double ET = Energy*TMath::Sin(theta);
686 HOActiveRing[EtaRing] = 1;
687 HONActiveCells[EtaRing]++;
688 HOSET_EtaRing[EtaRing]+=
ET;
689 v_.SetPtEtaPhiE(ET, 0, phi, ET);
690 vHOMET_EtaRing[EtaRing]-=v_;
695 if (Energy > HOMaxEnergy_EtaRing[EtaRing])
696 HOMaxEnergy_EtaRing[EtaRing] = Energy;
697 if (Energy < HOMinEnergy_EtaRing[EtaRing])
698 HOMinEnergy_EtaRing[EtaRing] = Energy;
705 if (Energy<hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
711 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
715 if (HOActiveRing[iEtaRing]) {
730 TLorentzVector vHFMET_EtaRing[83][2];
731 int HFActiveRing[83][2];
732 int HFNActiveCells[83][2];
733 double HFSET_EtaRing[83][2];
734 double HFMinEnergy_EtaRing[83][2];
735 double HFMaxEnergy_EtaRing[83][2];
737 for (
int i=0;
i<83;
i++) {
738 for (
int j=0;j<2; j++) {
740 HFActiveRing[
i][j] = 0;
741 HFNActiveCells[
i][j] = 0;
742 HFSET_EtaRing[
i][j] = 0;
743 HFMinEnergy_EtaRing[
i][j] = 14E3;
744 HFMaxEnergy_EtaRing[
i][j] = -999;
753 for (hfrechit = HFRecHits->
begin(); hfrechit != HFRecHits->
end(); hfrechit++) {
758 double Energy = hfrechit->energy();
760 Int_t ieta = det.
ieta();
761 Int_t iphi = det.
iphi();
762 int EtaRing = 41+ieta;
765 double theta = 2*TMath::ATan(
exp(-1*eta));
766 double ET = Energy*TMath::Sin(theta);
771 HFActiveRing[EtaRing][depth-1] = 1;
772 HFNActiveCells[EtaRing][depth-1]++;
773 HFSET_EtaRing[EtaRing][depth-1]+=
ET;
774 v_.SetPtEtaPhiE(ET, 0, phi, ET);
775 vHFMET_EtaRing[EtaRing][depth-1]-=v_;
788 if (Energy > HFMaxEnergy_EtaRing[EtaRing][depth-1])
789 HFMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
790 if (Energy < HFMinEnergy_EtaRing[EtaRing][depth-1])
791 HFMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
801 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
810 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
818 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
819 for (
int jDepth=0; jDepth<2; jDepth++) {
832 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
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
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
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
void setCurrentFolder(std::string const &fullpath)
MonitorElement * hHCAL_D1_METPhivsieta
MonitorElement * hHCAL_D1_METvsieta
MonitorElement * hHCAL_D1_Maxenergyvsieta
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_
MonitorElement * hHCAL_D1_MExvsieta
MonitorElement * hHCAL_D4_MExvsieta
MonitorElement * hHCAL_D2_MEyvsieta
T const * product() const
MonitorElement * book2D(Args &&...args)
virtual std::shared_ptr< 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_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
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