39 #include <TLorentzVector.h> 45 std::cout << X << std::endl; \ 77 for (
int i = 1;
i <= 83;
i++) {
81 for (
int j = 1;
j <= 72;
j++) {
113 for (
int i = 1;
i <= 83;
i++)
114 for (
int j = 1;
j <= 73;
j++) {
239 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Setup Handle, Aborting Task " 240 <<
"HCALRecHitAnalyzer::FillGeometry!\n";
255 std::vector<DetId>::iterator
i;
257 int HBmin_ieta = 99, HBmax_ieta = -99;
258 int HBmin_iphi = 99, HBmax_iphi = -99;
264 for (
i = HBids.begin();
i != HBids.end();
i++) {
269 int Calo_ieta = 42 + HcalID.
ieta();
270 int Calo_iphi = HcalID.
iphi();
279 if (Calo_ieta > HBmax_ieta)
280 HBmax_ieta = Calo_ieta;
281 if (Calo_ieta < HBmin_ieta)
282 HBmin_ieta = Calo_ieta;
283 if (Calo_iphi > HBmax_iphi)
284 HBmax_iphi = Calo_iphi;
285 if (Calo_iphi > HBmax_iphi)
286 HBmin_iphi = Calo_iphi;
289 int HEmin_ieta = 99, HEmax_ieta = -99;
290 int HEmin_iphi = 99, HEmax_iphi = -99;
296 for (
i = HEids.begin();
i != HEids.end();
i++) {
301 int Calo_ieta = 42 + HcalID.
ieta();
302 int Calo_iphi = HcalID.
iphi();
312 if (Calo_ieta > HEmax_ieta)
313 HEmax_ieta = Calo_ieta;
314 if (Calo_ieta < HEmin_ieta)
315 HEmin_ieta = Calo_ieta;
316 if (Calo_iphi > HEmax_iphi)
317 HEmax_iphi = Calo_iphi;
318 if (Calo_iphi > HEmax_iphi)
319 HEmin_iphi = Calo_iphi;
322 int HFmin_ieta = 99, HFmax_ieta = -99;
323 int HFmin_iphi = 99, HFmax_iphi = -99;
329 for (
i = HFids.begin();
i != HFids.end();
i++) {
336 int Calo_ieta = 42 + HcalID.
ieta();
337 int Calo_iphi = HcalID.iphi();
338 double Calo_eta = cell->getPosition().eta();
339 double Calo_phi = cell->getPosition().phi();
347 if (Calo_ieta > HFmax_ieta)
348 HFmax_ieta = Calo_ieta;
349 if (Calo_ieta < HFmin_ieta)
350 HFmin_ieta = Calo_ieta;
351 if (Calo_iphi > HFmax_iphi)
352 HFmax_iphi = Calo_iphi;
353 if (Calo_iphi > HFmax_iphi)
354 HFmin_iphi = Calo_iphi;
357 int HOmin_ieta = 99, HOmax_ieta = -99;
358 int HOmin_iphi = 99, HOmax_iphi = -99;
364 for (
i = HOids.begin();
i != HOids.end();
i++) {
371 int Calo_ieta = 42 + HcalID.
ieta();
372 int Calo_iphi = HcalID.iphi();
373 double Calo_eta = cell->getPosition().eta();
374 double Calo_phi = cell->getPosition().phi();
382 if (Calo_ieta > HOmax_ieta)
383 HOmax_ieta = Calo_ieta;
384 if (Calo_ieta < HOmin_ieta)
385 HOmin_ieta = Calo_ieta;
386 if (Calo_iphi > HOmax_iphi)
387 HOmax_iphi = Calo_iphi;
388 if (Calo_iphi > HOmax_iphi)
389 HOmin_iphi = Calo_iphi;
393 double currentLowEdge_eta = 0;
395 int ieta_ = 42 +
ieta;
398 double deta = 2.0 * (
eta - currentLowEdge_eta);
399 deta = ((
float)((
int)(1.0E3 * deta + 0.5))) / 1.0E3;
400 double dphi = 2.0 *
phi;
403 if (ieta <= 39 && ieta >= 21)
412 currentLowEdge_eta += deta;
416 currentLowEdge_eta = 2.964;
425 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
426 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
427 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
428 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
429 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
430 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
431 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
432 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
448 if (!HBHERecHitsHandle.
isValid()) {
449 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 450 <<
"HCALRecHitAnalyzer::analyze!\n";
457 if (!HORecHitsHandle.
isValid()) {
458 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 459 <<
"HCALRecHitAnalyzer::analyze!\n";
462 HORecHits = HORecHitsHandle.
product();
466 if (!HFRecHitsHandle.
isValid()) {
467 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 468 <<
"HCALRecHitAnalyzer::analyze!\n";
478 TLorentzVector vHBHEMET_EtaRing[83][4];
479 int HBHEActiveRing[83][4];
480 int HBHENActiveCells[83][4];
481 double HBHESET_EtaRing[83][4];
482 double HBHEMinEnergy_EtaRing[83][4];
483 double HBHEMaxEnergy_EtaRing[83][4];
485 for (
int i = 0;
i < 83;
i++) {
486 for (
int j = 0;
j < 4;
j++) {
487 HBHEActiveRing[
i][
j] = 0;
488 HBHENActiveCells[
i][
j] = 0;
489 HBHESET_EtaRing[
i][
j] = 0;
490 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
491 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
497 int nHBrechit = 0, nHErechit = 0;
501 double Energy = hbherechit->energy();
505 int EtaRing = 41 +
ieta;
515 HBHEActiveRing[EtaRing][
depth - 1] = 1;
516 HBHENActiveCells[EtaRing][
depth - 1]++;
517 HBHESET_EtaRing[EtaRing][
depth - 1] +=
ET;
518 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
519 vHBHEMET_EtaRing[EtaRing][
depth - 1] -= v_;
522 << vHBHEMET_EtaRing[EtaRing][
depth - 1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][
depth - 1].Pt());
537 if (
Energy > HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1])
538 HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
539 if (
Energy < HBHEMinEnergy_EtaRing[EtaRing][
depth - 1])
540 HBHEMinEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
548 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
558 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
567 if (Energy < hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
580 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
581 for (
int jDepth = 0; jDepth < 3; jDepth++) {
582 switch (jDepth + 1) {
597 if (HBHEActiveRing[iEtaRing][jDepth]) {
598 switch (jDepth + 1) {
629 TLorentzVector vHOMET_EtaRing[83];
630 int HOActiveRing[83];
631 int HONActiveCells[83];
632 double HOSET_EtaRing[83];
633 double HOMinEnergy_EtaRing[83];
634 double HOMaxEnergy_EtaRing[83];
636 for (
int i = 0;
i < 83;
i++) {
638 HONActiveCells[
i] = 0;
639 HOSET_EtaRing[
i] = 0;
640 HOMinEnergy_EtaRing[
i] = 14E3;
641 HOMaxEnergy_EtaRing[
i] = -999;
648 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
652 double Energy = horechit->energy();
656 int EtaRing = 41 +
ieta;
665 HOActiveRing[EtaRing] = 1;
666 HONActiveCells[EtaRing]++;
667 HOSET_EtaRing[EtaRing] +=
ET;
668 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
669 vHOMET_EtaRing[EtaRing] -= v_;
674 if (
Energy > HOMaxEnergy_EtaRing[EtaRing])
675 HOMaxEnergy_EtaRing[EtaRing] =
Energy;
676 if (
Energy < HOMinEnergy_EtaRing[EtaRing])
677 HOMinEnergy_EtaRing[EtaRing] =
Energy;
684 if (Energy < hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
690 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
694 if (HOActiveRing[iEtaRing]) {
706 TLorentzVector vHFMET_EtaRing[83][2];
707 int HFActiveRing[83][2];
708 int HFNActiveCells[83][2];
709 double HFSET_EtaRing[83][2];
710 double HFMinEnergy_EtaRing[83][2];
711 double HFMaxEnergy_EtaRing[83][2];
713 for (
int i = 0;
i < 83;
i++) {
714 for (
int j = 0;
j < 2;
j++) {
715 HFActiveRing[
i][
j] = 0;
716 HFNActiveCells[
i][
j] = 0;
717 HFSET_EtaRing[
i][
j] = 0;
718 HFMinEnergy_EtaRing[
i][
j] = 14E3;
719 HFMaxEnergy_EtaRing[
i][
j] = -999;
731 double Energy = hfrechit->energy();
735 int EtaRing = 41 +
ieta;
744 HFActiveRing[EtaRing][
depth - 1] = 1;
745 HFNActiveCells[EtaRing][
depth - 1]++;
746 HFSET_EtaRing[EtaRing][
depth - 1] +=
ET;
747 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
748 vHFMET_EtaRing[EtaRing][
depth - 1] -= v_;
760 if (
Energy > HFMaxEnergy_EtaRing[EtaRing][
depth - 1])
762 if (
Energy < HFMinEnergy_EtaRing[EtaRing][
depth - 1])
772 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
781 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
789 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
790 for (
int jDepth = 0; jDepth < 2; jDepth++) {
791 switch (jDepth + 1) {
802 if (HFActiveRing[iEtaRing][jDepth]) {
803 switch (jDepth + 1) {
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * hHCAL_D4_Maxenergy_ieta_iphi
T getParameter(std::string const &) const
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 &)
MonitorElement * hHCAL_D2_Minenergy_ieta_iphi
MonitorElement * hHCAL_D4_METvsieta
MonitorElement * hHCAL_D4_energyvsieta
Geom::Phi< T > phi() const
MonitorElement * hHCAL_D4_Maxenergyvsieta
T const * product() const
MonitorElement * hHCAL_D1_Minenergy_ieta_iphi
std::vector< T >::const_iterator const_iterator
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
MonitorElement * hHCAL_D3_MExvsieta
MonitorElement * hHCAL_D1_Maxenergy_ieta_iphi
T getUntrackedParameter(std::string const &, T const &) const
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
MonitorElement * hHCAL_D1_METvsieta
MonitorElement * hHCAL_D1_Maxenergyvsieta
void analyze(const edm::Event &, const edm::EventSetup &) override
constexpr int ieta() const
get the cell ieta
MonitorElement * hHCAL_D3_energyvsieta
MonitorElement * hHCAL_D2_Maxenergyvsieta
MonitorElement * hHCAL_D2_energyvsieta
edm::EDGetTokenT< HFRecHitCollection > hFRecHitsLabel_
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_D2_METPhivsieta
const_iterator begin() const
MonitorElement * hHCAL_D2_Occvsieta
MonitorElement * hHCAL_D2_Maxenergy_ieta_iphi
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * hHCAL_D3_METPhivsieta
MonitorElement * hHCAL_D1_energyvsieta
MonitorElement * hHCAL_ieta_detaMap
MonitorElement * hHCAL_D2_energy_ieta_iphi
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.
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
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
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
edm::EDGetTokenT< HBHERecHitCollection > hBHERecHitsLabel_
MonitorElement * hHCAL_D4_energy_ieta_iphi
MonitorElement * hHCAL_D3_energy_ieta_iphi
GlobalPoint getPosition(const DetId &id) const
MonitorElement * hHCAL_D2_Occ_ieta_iphi
MonitorElement * hHCAL_Nevents
MonitorElement * hHCAL_D3_Minenergy_ieta_iphi
MonitorElement * hHCAL_D2_SETvsieta
MonitorElement * hHCAL_D2_MExvsieta
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Geom::Theta< T > theta() const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
MonitorElement * hHCAL_D3_MEyvsieta
MonitorElement * hHCAL_ieta_iphi_HEMap
constexpr int iphi() const
get the cell iphi
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hHCAL_ieta_dphiMap
virtual double getBinContent(int binx) const
get content of bin (1-D)
constexpr int depth() const
get the tower depth