45 #include <TLorentzVector.h>
48 #define DEBUG(X) { if (debug_) { std::cout << X << std::endl; } }
90 for (
int i = 1;
i <= 83;
i++) {
95 for (
int j = 1;
j <= 72;
j++) {
130 for (
int i=1;
i<=83;
i++)
131 for (
int j=1;
j<=73;
j++)
275 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task "
276 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
292 std::vector<DetId>::iterator
i;
294 int HBmin_ieta = 99, HBmax_ieta = -99;
295 int HBmin_iphi = 99, HBmax_iphi = -99;
301 for (i = HBids.begin(); i != HBids.end(); i++) {
309 int Calo_ieta = 42 + HcalID.
ieta();
310 int Calo_iphi = HcalID.iphi();
321 if (Calo_ieta > HBmax_ieta) HBmax_ieta = Calo_ieta;
322 if (Calo_ieta < HBmin_ieta) HBmin_ieta = Calo_ieta;
323 if (Calo_iphi > HBmax_iphi) HBmax_iphi = Calo_iphi;
324 if (Calo_iphi > HBmax_iphi) HBmin_iphi = Calo_iphi;
328 int HEmin_ieta = 99, HEmax_ieta = -99;
329 int HEmin_iphi = 99, HEmax_iphi = -99;
335 for (i = HEids.begin(); i != HEids.end(); i++) {
343 int Calo_ieta = 42 + HcalID.
ieta();
344 int Calo_iphi = HcalID.iphi();
354 if (Calo_ieta > HEmax_ieta) HEmax_ieta = Calo_ieta;
355 if (Calo_ieta < HEmin_ieta) HEmin_ieta = Calo_ieta;
356 if (Calo_iphi > HEmax_iphi) HEmax_iphi = Calo_iphi;
357 if (Calo_iphi > HEmax_iphi) HEmin_iphi = Calo_iphi;
361 int HFmin_ieta = 99, HFmax_ieta = -99;
362 int HFmin_iphi = 99, HFmax_iphi = -99;
368 for (i = HFids.begin(); i != HFids.end(); i++) {
376 int Calo_ieta = 42 + HcalID.
ieta();
377 int Calo_iphi = HcalID.iphi();
387 if (Calo_ieta > HFmax_ieta) HFmax_ieta = Calo_ieta;
388 if (Calo_ieta < HFmin_ieta) HFmin_ieta = Calo_ieta;
389 if (Calo_iphi > HFmax_iphi) HFmax_iphi = Calo_iphi;
390 if (Calo_iphi > HFmax_iphi) HFmin_iphi = Calo_iphi;
394 int HOmin_ieta = 99, HOmax_ieta = -99;
395 int HOmin_iphi = 99, HOmax_iphi = -99;
401 for (i = HOids.begin(); i != HOids.end(); i++) {
409 int Calo_ieta = 42 + HcalID.
ieta();
410 int Calo_iphi = HcalID.iphi();
420 if (Calo_ieta > HOmax_ieta) HOmax_ieta = Calo_ieta;
421 if (Calo_ieta < HOmin_ieta) HOmin_ieta = Calo_ieta;
422 if (Calo_iphi > HOmax_iphi) HOmax_iphi = Calo_iphi;
423 if (Calo_iphi > HOmax_iphi) HOmin_iphi = Calo_iphi;
428 double currentLowEdge_eta = 0;
429 for (
int ieta = 1; ieta < 42 ; ieta++) {
431 int ieta_ = 42 + ieta;
434 double deta = 2.0*(eta-currentLowEdge_eta);
435 deta = ((float)((
int)(1.0E3*deta + 0.5)))/1.0E3;
436 double dphi = 2.0*
phi;
437 if (ieta==40 || ieta==41) dphi = 20;
438 if (ieta<=39 && ieta>=21) dphi = 10;
439 if (ieta<=20) dphi = 5;
441 if (ieta == 28) deta = 0.218;
442 if (ieta == 29) deta= 0.096;
443 currentLowEdge_eta += deta;
446 if (ieta == 29) currentLowEdge_eta = 2.964;
455 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
456 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
457 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
458 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
459 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
460 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
461 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
462 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
480 if (!HBHERecHitsHandle.
isValid()) {
481 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
482 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
484 HBHERecHits = HBHERecHitsHandle.
product();
488 if (!HORecHitsHandle.
isValid()) {
489 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
490 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
492 HORecHits = HORecHitsHandle.
product();
496 if (!HFRecHitsHandle.
isValid()) {
497 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
498 <<
"HCALRecHitAnalyzer::analyze!\n";
return;
500 HFRecHits = HFRecHitsHandle.
product();
507 TLorentzVector vHBHEMET_EtaRing[83][4];
508 int HBHEActiveRing[83][4];
509 int HBHENActiveCells[83][4];
510 double HBHESET_EtaRing[83][4];
511 double HBHEMinEnergy_EtaRing[83][4];
512 double HBHEMaxEnergy_EtaRing[83][4];
514 for (
int i = 0;
i < 83;
i++) {
515 for (
int j = 0;
j < 4;
j++) {
517 HBHEActiveRing[
i][
j] = 0;
518 HBHENActiveCells[
i][
j] = 0;
519 HBHESET_EtaRing[
i][
j] = 0;
520 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
521 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
527 int nHBrechit = 0, nHErechit = 0;
529 for (hbherechit = HBHERecHits->
begin(); hbherechit != HBHERecHits->
end(); hbherechit++) {
532 double Energy = hbherechit->energy();
533 Int_t depth = det.
depth();
534 Int_t ieta = det.
ieta();
535 Int_t iphi = det.
iphi();
536 int EtaRing = 41 + ieta;
539 double theta = 2*TMath::ATan(
exp(-1*eta));
540 double ET = Energy*TMath::Sin(theta);
548 HBHEActiveRing[EtaRing][depth-1] = 1;
549 HBHENActiveCells[EtaRing][depth-1]++;
550 HBHESET_EtaRing[EtaRing][depth-1]+=
ET;
551 v_.SetPtEtaPhiE(ET, 0, phi, ET);
552 vHBHEMET_EtaRing[EtaRing][depth-1]-=v_;
555 DEBUG( EtaRing <<
" " << Energy <<
" " << ET <<
" " << theta <<
" " << eta <<
" " << phi <<
" : " << vHBHEMET_EtaRing[EtaRing][depth-1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][depth-1].
Pt() );
570 if (Energy > HBHEMaxEnergy_EtaRing[EtaRing][depth-1])
571 HBHEMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
572 if (Energy < HBHEMinEnergy_EtaRing[EtaRing][depth-1])
573 HBHEMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
581 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
591 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
600 if (Energy<hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
614 for (
int iEtaRing=0; iEtaRing < 83; iEtaRing++) {
615 for (
int jDepth=0; jDepth < 3; jDepth++) {
632 if (HBHEActiveRing[iEtaRing][jDepth]) {
666 TLorentzVector vHOMET_EtaRing[83];
667 int HOActiveRing[83];
668 int HONActiveCells[83];
669 double HOSET_EtaRing[83];
670 double HOMinEnergy_EtaRing[83];
671 double HOMaxEnergy_EtaRing[83];
673 for (
int i=0;
i<83;
i++) {
676 HONActiveCells[
i] = 0;
677 HOSET_EtaRing[
i] = 0;
678 HOMinEnergy_EtaRing[
i] = 14E3;
679 HOMaxEnergy_EtaRing[
i] = -999;
686 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
691 double Energy = horechit->energy();
693 Int_t ieta = det.
ieta();
694 Int_t iphi = det.
iphi();
695 int EtaRing = 41+ieta;
698 double theta = 2*TMath::ATan(
exp(-1*eta));
699 double ET = Energy*TMath::Sin(theta);
705 HOActiveRing[EtaRing] = 1;
706 HONActiveCells[EtaRing]++;
707 HOSET_EtaRing[EtaRing]+=
ET;
708 v_.SetPtEtaPhiE(ET, 0, phi, ET);
709 vHOMET_EtaRing[EtaRing]-=v_;
714 if (Energy > HOMaxEnergy_EtaRing[EtaRing])
715 HOMaxEnergy_EtaRing[EtaRing] = Energy;
716 if (Energy < HOMinEnergy_EtaRing[EtaRing])
717 HOMinEnergy_EtaRing[EtaRing] = Energy;
724 if (Energy<hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
730 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
734 if (HOActiveRing[iEtaRing]) {
749 TLorentzVector vHFMET_EtaRing[83][2];
750 int HFActiveRing[83][2];
751 int HFNActiveCells[83][2];
752 double HFSET_EtaRing[83][2];
753 double HFMinEnergy_EtaRing[83][2];
754 double HFMaxEnergy_EtaRing[83][2];
756 for (
int i=0;
i<83;
i++) {
757 for (
int j=0;
j<2;
j++) {
759 HFActiveRing[
i][
j] = 0;
760 HFNActiveCells[
i][
j] = 0;
761 HFSET_EtaRing[
i][
j] = 0;
762 HFMinEnergy_EtaRing[
i][
j] = 14E3;
763 HFMaxEnergy_EtaRing[
i][
j] = -999;
772 for (hfrechit = HFRecHits->
begin(); hfrechit != HFRecHits->
end(); hfrechit++) {
777 double Energy = hfrechit->energy();
778 Int_t depth = det.
depth();
779 Int_t ieta = det.
ieta();
780 Int_t iphi = det.
iphi();
781 int EtaRing = 41+ieta;
784 double theta = 2*TMath::ATan(
exp(-1*eta));
785 double ET = Energy*TMath::Sin(theta);
790 HFActiveRing[EtaRing][depth-1] = 1;
791 HFNActiveCells[EtaRing][depth-1]++;
792 HFSET_EtaRing[EtaRing][depth-1]+=
ET;
793 v_.SetPtEtaPhiE(ET, 0, phi, ET);
794 vHFMET_EtaRing[EtaRing][depth-1]-=v_;
807 if (Energy > HFMaxEnergy_EtaRing[EtaRing][depth-1])
808 HFMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
809 if (Energy < HFMinEnergy_EtaRing[EtaRing][depth-1])
810 HFMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
820 if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
829 if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
837 for (
int iEtaRing=0; iEtaRing<83; iEtaRing++) {
838 for (
int jDepth=0; jDepth<2; jDepth++) {
851 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 * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * hHCAL_D1_SETvsieta
MonitorElement * hHCAL_D3_Occvsieta
HCALRecHitAnalyzer(const edm::ParameterSet &)
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
edm::InputTag hORecHitsLabel_
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
edm::InputTag hBHERecHitsLabel_
MonitorElement * hHCAL_D1_Occ_ieta_iphi
MonitorElement * hHCAL_D4_METPhivsieta
int depth() const
get the tower depth
MonitorElement * hHCAL_D4_Minenergyvsieta
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
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 * hHCAL_D2_METPhivsieta
MonitorElement * hHCAL_D2_Occvsieta
MonitorElement * hHCAL_D2_Maxenergy_ieta_iphi
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
MonitorElement * hHCAL_D1_MExvsieta
MonitorElement * hHCAL_D4_MExvsieta
MonitorElement * hHCAL_D2_MEyvsieta
MonitorElement * hHCAL_D1_MEyvsieta
T const * product() const
virtual void BookHistos()
MonitorElement * hHCAL_D4_energy_ieta_iphi
edm::InputTag hFRecHitsLabel_
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 &)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
MonitorElement * hHCAL_D3_MEyvsieta
MonitorElement * hHCAL_ieta_iphi_HEMap
void setCurrentFolder(const std::string &fullpath)
const_iterator begin() const
MonitorElement * hHCAL_ieta_dphiMap