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++) {
246 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task " 247 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
262 std::vector<DetId>::iterator
i;
264 int HBmin_ieta = 99, HBmax_ieta = -99;
265 int HBmin_iphi = 99, HBmax_iphi = -99;
271 for (i = HBids.begin(); i != HBids.end(); i++) {
276 int Calo_ieta = 42 + HcalID.
ieta();
277 int Calo_iphi = HcalID.
iphi();
286 if (Calo_ieta > HBmax_ieta)
287 HBmax_ieta = Calo_ieta;
288 if (Calo_ieta < HBmin_ieta)
289 HBmin_ieta = Calo_ieta;
290 if (Calo_iphi > HBmax_iphi)
291 HBmax_iphi = Calo_iphi;
292 if (Calo_iphi > HBmax_iphi)
293 HBmin_iphi = Calo_iphi;
296 int HEmin_ieta = 99, HEmax_ieta = -99;
297 int HEmin_iphi = 99, HEmax_iphi = -99;
303 for (i = HEids.begin(); i != HEids.end(); i++) {
308 int Calo_ieta = 42 + HcalID.
ieta();
309 int Calo_iphi = HcalID.
iphi();
319 if (Calo_ieta > HEmax_ieta)
320 HEmax_ieta = Calo_ieta;
321 if (Calo_ieta < HEmin_ieta)
322 HEmin_ieta = Calo_ieta;
323 if (Calo_iphi > HEmax_iphi)
324 HEmax_iphi = Calo_iphi;
325 if (Calo_iphi > HEmax_iphi)
326 HEmin_iphi = Calo_iphi;
329 int HFmin_ieta = 99, HFmax_ieta = -99;
330 int HFmin_iphi = 99, HFmax_iphi = -99;
336 for (i = HFids.begin(); i != HFids.end(); i++) {
343 int Calo_ieta = 42 + HcalID.
ieta();
344 int Calo_iphi = HcalID.iphi();
345 double Calo_eta = cell->getPosition().eta();
346 double Calo_phi = cell->getPosition().phi();
354 if (Calo_ieta > HFmax_ieta)
355 HFmax_ieta = Calo_ieta;
356 if (Calo_ieta < HFmin_ieta)
357 HFmin_ieta = Calo_ieta;
358 if (Calo_iphi > HFmax_iphi)
359 HFmax_iphi = Calo_iphi;
360 if (Calo_iphi > HFmax_iphi)
361 HFmin_iphi = Calo_iphi;
364 int HOmin_ieta = 99, HOmax_ieta = -99;
365 int HOmin_iphi = 99, HOmax_iphi = -99;
371 for (i = HOids.begin(); i != HOids.end(); i++) {
378 int Calo_ieta = 42 + HcalID.
ieta();
379 int Calo_iphi = HcalID.iphi();
380 double Calo_eta = cell->getPosition().eta();
381 double Calo_phi = cell->getPosition().phi();
389 if (Calo_ieta > HOmax_ieta)
390 HOmax_ieta = Calo_ieta;
391 if (Calo_ieta < HOmin_ieta)
392 HOmin_ieta = Calo_ieta;
393 if (Calo_iphi > HOmax_iphi)
394 HOmax_iphi = Calo_iphi;
395 if (Calo_iphi > HOmax_iphi)
396 HOmin_iphi = Calo_iphi;
400 double currentLowEdge_eta = 0;
402 int ieta_ = 42 +
ieta;
405 double deta = 2.0 * (eta - currentLowEdge_eta);
406 deta = ((
float)((
int)(1.0E3 * deta + 0.5))) / 1.0E3;
407 double dphi = 2.0 *
phi;
410 if (ieta <= 39 && ieta >= 21)
419 currentLowEdge_eta += deta;
423 currentLowEdge_eta = 2.964;
432 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
433 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
434 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
435 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
436 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
437 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
438 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
439 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
455 if (!HBHERecHitsHandle.
isValid()) {
456 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 457 <<
"HCALRecHitAnalyzer::analyze!\n";
460 HBHERecHits = HBHERecHitsHandle.
product();
464 if (!HORecHitsHandle.
isValid()) {
465 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 466 <<
"HCALRecHitAnalyzer::analyze!\n";
469 HORecHits = HORecHitsHandle.
product();
473 if (!HFRecHitsHandle.
isValid()) {
474 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 475 <<
"HCALRecHitAnalyzer::analyze!\n";
478 HFRecHits = HFRecHitsHandle.
product();
485 TLorentzVector vHBHEMET_EtaRing[83][4];
486 int HBHEActiveRing[83][4];
487 int HBHENActiveCells[83][4];
488 double HBHESET_EtaRing[83][4];
489 double HBHEMinEnergy_EtaRing[83][4];
490 double HBHEMaxEnergy_EtaRing[83][4];
492 for (
int i = 0;
i < 83;
i++) {
493 for (
int j = 0;
j < 4;
j++) {
494 HBHEActiveRing[
i][
j] = 0;
495 HBHENActiveCells[
i][
j] = 0;
496 HBHESET_EtaRing[
i][
j] = 0;
497 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
498 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
504 int nHBrechit = 0, nHErechit = 0;
506 for (hbherechit = HBHERecHits->
begin(); hbherechit != HBHERecHits->
end(); hbherechit++) {
508 double Energy = hbherechit->energy();
512 int EtaRing = 41 +
ieta;
515 double theta = 2 * TMath::ATan(
exp(-1 * eta));
516 double ET = Energy * TMath::Sin(theta);
522 HBHEActiveRing[EtaRing][depth - 1] = 1;
523 HBHENActiveCells[EtaRing][depth - 1]++;
524 HBHESET_EtaRing[EtaRing][depth - 1] +=
ET;
525 v_.SetPtEtaPhiE(ET, 0, phi, ET);
526 vHBHEMET_EtaRing[EtaRing][depth - 1] -= v_;
528 DEBUG(EtaRing <<
" " << Energy <<
" " << ET <<
" " << theta <<
" " << eta <<
" " << phi <<
" : " 529 << vHBHEMET_EtaRing[EtaRing][depth - 1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][depth - 1].Pt());
544 if (Energy > HBHEMaxEnergy_EtaRing[EtaRing][depth - 1])
545 HBHEMaxEnergy_EtaRing[EtaRing][depth - 1] =
Energy;
546 if (Energy < HBHEMinEnergy_EtaRing[EtaRing][depth - 1])
547 HBHEMinEnergy_EtaRing[EtaRing][depth - 1] =
Energy;
555 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
565 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
574 if (Energy < hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
587 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
588 for (
int jDepth = 0; jDepth < 3; jDepth++) {
589 switch (jDepth + 1) {
604 if (HBHEActiveRing[iEtaRing][jDepth]) {
605 switch (jDepth + 1) {
636 TLorentzVector vHOMET_EtaRing[83];
637 int HOActiveRing[83];
638 int HONActiveCells[83];
639 double HOSET_EtaRing[83];
640 double HOMinEnergy_EtaRing[83];
641 double HOMaxEnergy_EtaRing[83];
643 for (
int i = 0;
i < 83;
i++) {
645 HONActiveCells[
i] = 0;
646 HOSET_EtaRing[
i] = 0;
647 HOMinEnergy_EtaRing[
i] = 14E3;
648 HOMaxEnergy_EtaRing[
i] = -999;
655 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
659 double Energy = horechit->energy();
663 int EtaRing = 41 +
ieta;
666 double theta = 2 * TMath::ATan(
exp(-1 * eta));
667 double ET = Energy * TMath::Sin(theta);
672 HOActiveRing[EtaRing] = 1;
673 HONActiveCells[EtaRing]++;
674 HOSET_EtaRing[EtaRing] +=
ET;
675 v_.SetPtEtaPhiE(ET, 0, phi, ET);
676 vHOMET_EtaRing[EtaRing] -= v_;
681 if (Energy > HOMaxEnergy_EtaRing[EtaRing])
682 HOMaxEnergy_EtaRing[EtaRing] =
Energy;
683 if (Energy < HOMinEnergy_EtaRing[EtaRing])
684 HOMinEnergy_EtaRing[EtaRing] =
Energy;
691 if (Energy < hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
697 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
701 if (HOActiveRing[iEtaRing]) {
713 TLorentzVector vHFMET_EtaRing[83][2];
714 int HFActiveRing[83][2];
715 int HFNActiveCells[83][2];
716 double HFSET_EtaRing[83][2];
717 double HFMinEnergy_EtaRing[83][2];
718 double HFMaxEnergy_EtaRing[83][2];
720 for (
int i = 0;
i < 83;
i++) {
721 for (
int j = 0;
j < 2;
j++) {
722 HFActiveRing[
i][
j] = 0;
723 HFNActiveCells[
i][
j] = 0;
724 HFSET_EtaRing[
i][
j] = 0;
725 HFMinEnergy_EtaRing[
i][
j] = 14E3;
726 HFMaxEnergy_EtaRing[
i][
j] = -999;
734 for (hfrechit = HFRecHits->
begin(); hfrechit != HFRecHits->
end(); hfrechit++) {
738 double Energy = hfrechit->energy();
742 int EtaRing = 41 +
ieta;
745 double theta = 2 * TMath::ATan(
exp(-1 * eta));
746 double ET = Energy * TMath::Sin(theta);
751 HFActiveRing[EtaRing][depth - 1] = 1;
752 HFNActiveCells[EtaRing][depth - 1]++;
753 HFSET_EtaRing[EtaRing][depth - 1] +=
ET;
754 v_.SetPtEtaPhiE(ET, 0, phi, ET);
755 vHFMET_EtaRing[EtaRing][depth - 1] -= v_;
767 if (Energy > HFMaxEnergy_EtaRing[EtaRing][depth - 1])
768 HFMaxEnergy_EtaRing[EtaRing][depth - 1] =
Energy;
769 if (Energy < HFMinEnergy_EtaRing[EtaRing][depth - 1])
770 HFMinEnergy_EtaRing[EtaRing][depth - 1] =
Energy;
779 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
788 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1, iphi))
796 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
797 for (
int jDepth = 0; jDepth < 2; jDepth++) {
798 switch (jDepth + 1) {
809 if (HFActiveRing[iEtaRing][jDepth]) {
810 switch (jDepth + 1) {
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
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
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 setCurrentFolder(std::string const &fullpath)
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< 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
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
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
edm::EDGetTokenT< HFRecHitCollection > hFRecHitsLabel_
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
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
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 * hHCAL_D1_MEyvsieta
edm::EDGetTokenT< HBHERecHitCollection > hBHERecHitsLabel_
MonitorElement * hHCAL_D4_energy_ieta_iphi
MonitorElement * hHCAL_D3_energy_ieta_iphi
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
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