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++) {
245 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task "
246 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
261 std::vector<DetId>::iterator
i;
263 int HBmin_ieta = 99, HBmax_ieta = -99;
264 int HBmin_iphi = 99, HBmax_iphi = -99;
270 for (i = HBids.begin(); i != HBids.end(); i++) {
275 int Calo_ieta = 42 + HcalID.
ieta();
276 int Calo_iphi = HcalID.
iphi();
285 if (Calo_ieta > HBmax_ieta)
286 HBmax_ieta = Calo_ieta;
287 if (Calo_ieta < HBmin_ieta)
288 HBmin_ieta = Calo_ieta;
289 if (Calo_iphi > HBmax_iphi)
290 HBmax_iphi = Calo_iphi;
291 if (Calo_iphi > HBmax_iphi)
292 HBmin_iphi = Calo_iphi;
295 int HEmin_ieta = 99, HEmax_ieta = -99;
296 int HEmin_iphi = 99, HEmax_iphi = -99;
302 for (i = HEids.begin(); i != HEids.end(); i++) {
307 int Calo_ieta = 42 + HcalID.
ieta();
308 int Calo_iphi = HcalID.
iphi();
318 if (Calo_ieta > HEmax_ieta)
319 HEmax_ieta = Calo_ieta;
320 if (Calo_ieta < HEmin_ieta)
321 HEmin_ieta = Calo_ieta;
322 if (Calo_iphi > HEmax_iphi)
323 HEmax_iphi = Calo_iphi;
324 if (Calo_iphi > HEmax_iphi)
325 HEmin_iphi = Calo_iphi;
328 int HFmin_ieta = 99, HFmax_ieta = -99;
329 int HFmin_iphi = 99, HFmax_iphi = -99;
335 for (i = HFids.begin(); i != HFids.end(); i++) {
342 int Calo_ieta = 42 + HcalID.
ieta();
343 int Calo_iphi = HcalID.iphi();
344 double Calo_eta = cell->getPosition().eta();
345 double Calo_phi = cell->getPosition().phi();
353 if (Calo_ieta > HFmax_ieta)
354 HFmax_ieta = Calo_ieta;
355 if (Calo_ieta < HFmin_ieta)
356 HFmin_ieta = Calo_ieta;
357 if (Calo_iphi > HFmax_iphi)
358 HFmax_iphi = Calo_iphi;
359 if (Calo_iphi > HFmax_iphi)
360 HFmin_iphi = Calo_iphi;
363 int HOmin_ieta = 99, HOmax_ieta = -99;
364 int HOmin_iphi = 99, HOmax_iphi = -99;
370 for (i = HOids.begin(); i != HOids.end(); i++) {
377 int Calo_ieta = 42 + HcalID.
ieta();
378 int Calo_iphi = HcalID.iphi();
379 double Calo_eta = cell->getPosition().eta();
380 double Calo_phi = cell->getPosition().phi();
388 if (Calo_ieta > HOmax_ieta)
389 HOmax_ieta = Calo_ieta;
390 if (Calo_ieta < HOmin_ieta)
391 HOmin_ieta = Calo_ieta;
392 if (Calo_iphi > HOmax_iphi)
393 HOmax_iphi = Calo_iphi;
394 if (Calo_iphi > HOmax_iphi)
395 HOmin_iphi = Calo_iphi;
399 double currentLowEdge_eta = 0;
400 for (
int ieta = 1; ieta < 42; ieta++) {
401 int ieta_ = 42 + ieta;
404 double deta = 2.0 * (eta - currentLowEdge_eta);
405 deta = ((float)((
int)(1.0E3 * deta + 0.5))) / 1.0E3;
406 double dphi = 2.0 *
phi;
407 if (ieta == 40 || ieta == 41)
409 if (ieta <= 39 && ieta >= 21)
418 currentLowEdge_eta += deta;
422 currentLowEdge_eta = 2.964;
431 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
432 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
433 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
434 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
435 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
436 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
437 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
438 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
454 if (!HBHERecHitsHandle.
isValid()) {
455 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
456 <<
"HCALRecHitAnalyzer::analyze!\n";
459 HBHERecHits = HBHERecHitsHandle.
product();
463 if (!HORecHitsHandle.
isValid()) {
464 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
465 <<
"HCALRecHitAnalyzer::analyze!\n";
468 HORecHits = HORecHitsHandle.
product();
472 if (!HFRecHitsHandle.
isValid()) {
473 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task "
474 <<
"HCALRecHitAnalyzer::analyze!\n";
477 HFRecHits = HFRecHitsHandle.
product();
484 TLorentzVector vHBHEMET_EtaRing[83][4];
485 int HBHEActiveRing[83][4];
486 int HBHENActiveCells[83][4];
487 double HBHESET_EtaRing[83][4];
488 double HBHEMinEnergy_EtaRing[83][4];
489 double HBHEMaxEnergy_EtaRing[83][4];
491 for (
int i = 0;
i < 83;
i++) {
492 for (
int j = 0;
j < 4;
j++) {
493 HBHEActiveRing[
i][
j] = 0;
494 HBHENActiveCells[
i][
j] = 0;
495 HBHESET_EtaRing[
i][
j] = 0;
496 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
497 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
503 int nHBrechit = 0, nHErechit = 0;
505 for (hbherechit = HBHERecHits->
begin(); hbherechit != HBHERecHits->
end(); hbherechit++) {
507 double Energy = hbherechit->energy();
509 Int_t ieta = det.
ieta();
510 Int_t iphi = det.
iphi();
511 int EtaRing = 41 + ieta;
514 double theta = 2 * TMath::ATan(
exp(-1 * eta));
515 double ET = Energy * TMath::Sin(theta);
521 HBHEActiveRing[EtaRing][depth - 1] = 1;
522 HBHENActiveCells[EtaRing][depth - 1]++;
523 HBHESET_EtaRing[EtaRing][depth - 1] +=
ET;
524 v_.SetPtEtaPhiE(ET, 0, phi, ET);
525 vHBHEMET_EtaRing[EtaRing][depth - 1] -= v_;
527 DEBUG(EtaRing <<
" " << Energy <<
" " << ET <<
" " << theta <<
" " << eta <<
" " << phi <<
" : "
528 << vHBHEMET_EtaRing[EtaRing][depth - 1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][depth - 1].Pt());
543 if (Energy > HBHEMaxEnergy_EtaRing[EtaRing][depth - 1])
544 HBHEMaxEnergy_EtaRing[EtaRing][depth - 1] = Energy;
545 if (Energy < HBHEMinEnergy_EtaRing[EtaRing][depth - 1])
546 HBHEMinEnergy_EtaRing[EtaRing][depth - 1] = Energy;
554 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
564 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
573 if (Energy < hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
586 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
587 for (
int jDepth = 0; jDepth < 3; jDepth++) {
588 switch (jDepth + 1) {
603 if (HBHEActiveRing[iEtaRing][jDepth]) {
604 switch (jDepth + 1) {
635 TLorentzVector vHOMET_EtaRing[83];
636 int HOActiveRing[83];
637 int HONActiveCells[83];
638 double HOSET_EtaRing[83];
639 double HOMinEnergy_EtaRing[83];
640 double HOMaxEnergy_EtaRing[83];
642 for (
int i = 0;
i < 83;
i++) {
644 HONActiveCells[
i] = 0;
645 HOSET_EtaRing[
i] = 0;
646 HOMinEnergy_EtaRing[
i] = 14E3;
647 HOMaxEnergy_EtaRing[
i] = -999;
654 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
658 double Energy = horechit->energy();
660 Int_t ieta = det.
ieta();
661 Int_t iphi = det.
iphi();
662 int EtaRing = 41 + ieta;
665 double theta = 2 * TMath::ATan(
exp(-1 * eta));
666 double ET = Energy * TMath::Sin(theta);
671 HOActiveRing[EtaRing] = 1;
672 HONActiveCells[EtaRing]++;
673 HOSET_EtaRing[EtaRing] +=
ET;
674 v_.SetPtEtaPhiE(ET, 0, phi, ET);
675 vHOMET_EtaRing[EtaRing] -= v_;
680 if (Energy > HOMaxEnergy_EtaRing[EtaRing])
681 HOMaxEnergy_EtaRing[EtaRing] = Energy;
682 if (Energy < HOMinEnergy_EtaRing[EtaRing])
683 HOMinEnergy_EtaRing[EtaRing] = Energy;
690 if (Energy < hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
696 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
700 if (HOActiveRing[iEtaRing]) {
712 TLorentzVector vHFMET_EtaRing[83][2];
713 int HFActiveRing[83][2];
714 int HFNActiveCells[83][2];
715 double HFSET_EtaRing[83][2];
716 double HFMinEnergy_EtaRing[83][2];
717 double HFMaxEnergy_EtaRing[83][2];
719 for (
int i = 0;
i < 83;
i++) {
720 for (
int j = 0;
j < 2;
j++) {
721 HFActiveRing[
i][
j] = 0;
722 HFNActiveCells[
i][
j] = 0;
723 HFSET_EtaRing[
i][
j] = 0;
724 HFMinEnergy_EtaRing[
i][
j] = 14E3;
725 HFMaxEnergy_EtaRing[
i][
j] = -999;
733 for (hfrechit = HFRecHits->
begin(); hfrechit != HFRecHits->
end(); hfrechit++) {
737 double Energy = hfrechit->energy();
739 Int_t ieta = det.
ieta();
740 Int_t iphi = det.
iphi();
741 int EtaRing = 41 + ieta;
744 double theta = 2 * TMath::ATan(
exp(-1 * eta));
745 double ET = Energy * TMath::Sin(theta);
750 HFActiveRing[EtaRing][depth - 1] = 1;
751 HFNActiveCells[EtaRing][depth - 1]++;
752 HFSET_EtaRing[EtaRing][depth - 1] +=
ET;
753 v_.SetPtEtaPhiE(ET, 0, phi, ET);
754 vHFMET_EtaRing[EtaRing][depth - 1] -= v_;
766 if (Energy > HFMaxEnergy_EtaRing[EtaRing][depth - 1])
767 HFMaxEnergy_EtaRing[EtaRing][depth - 1] = Energy;
768 if (Energy < HFMinEnergy_EtaRing[EtaRing][depth - 1])
769 HFMinEnergy_EtaRing[EtaRing][depth - 1] = Energy;
778 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
787 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
795 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
796 for (
int jDepth = 0; jDepth < 2; jDepth++) {
797 switch (jDepth + 1) {
808 if (HFActiveRing[iEtaRing][jDepth]) {
809 switch (jDepth + 1) {
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
MonitorElement * hHCAL_ieta_iphi_HFMap
MonitorElement * hHCAL_D3_Maxenergy_ieta_iphi
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
MonitorElement * hHCAL_D3_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)
MonitorElement * hHCAL_ieta_iphi_phiMap
MonitorElement * hHCAL_D1_SETvsieta
virtual void setCurrentFolder(std::string const &fullpath)
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< T >::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
Exp< T >::type exp(const T &t)
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
constexpr HcalSubdetector subdet() const
get the subdetector
MonitorElement * hHCAL_D1_Occ_ieta_iphi
MonitorElement * hHCAL_D4_METPhivsieta
MonitorElement * hHCAL_D4_Minenergyvsieta
MonitorElement * hHCAL_D2_METvsieta
MonitorElement * hHCAL_D1_Occvsieta
MonitorElement * hHCAL_D1_Minenergyvsieta
MonitorElement * hHCAL_D1_METPhivsieta
constexpr int iphi() const
get the cell iphi
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
edm::EDGetTokenT< HFRecHitCollection > hFRecHitsLabel_
constexpr int ieta() const
get the cell ieta
MonitorElement * hHCAL_D2_METPhivsieta
MonitorElement * hHCAL_D2_Occvsieta
virtual double getBinContent(int binx) const
get content of bin (1-D)
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
Log< level::Info, false > LogInfo
MonitorElement * hHCAL_D1_energy_ieta_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
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
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 * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * hHCAL_D1_MEyvsieta
T getParameter(std::string const &) const
edm::EDGetTokenT< HBHERecHitCollection > hBHERecHitsLabel_
MonitorElement * hHCAL_D4_energy_ieta_iphi
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
constexpr int depth() const
get the tower depth
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
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