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;
263 for (
i = HBids.begin();
i != HBids.end();
i++) {
266 int Calo_ieta = 42 + HcalID.
ieta();
267 int Calo_iphi = HcalID.
iphi();
276 if (Calo_ieta > HBmax_ieta)
277 HBmax_ieta = Calo_ieta;
278 if (Calo_ieta < HBmin_ieta)
279 HBmin_ieta = Calo_ieta;
280 if (Calo_iphi > HBmax_iphi)
281 HBmax_iphi = Calo_iphi;
282 if (Calo_iphi > HBmax_iphi)
283 HBmin_iphi = Calo_iphi;
286 int HEmin_ieta = 99, HEmax_ieta = -99;
287 int HEmin_iphi = 99, HEmax_iphi = -99;
292 for (
i = HEids.begin();
i != HEids.end();
i++) {
295 int Calo_ieta = 42 + HcalID.
ieta();
296 int Calo_iphi = HcalID.
iphi();
306 if (Calo_ieta > HEmax_ieta)
307 HEmax_ieta = Calo_ieta;
308 if (Calo_ieta < HEmin_ieta)
309 HEmin_ieta = Calo_ieta;
310 if (Calo_iphi > HEmax_iphi)
311 HEmax_iphi = Calo_iphi;
312 if (Calo_iphi > HEmax_iphi)
313 HEmin_iphi = Calo_iphi;
316 int HFmin_ieta = 99, HFmax_ieta = -99;
317 int HFmin_iphi = 99, HFmax_iphi = -99;
322 for (
i = HFids.begin();
i != HFids.end();
i++) {
327 int Calo_ieta = 42 + HcalID.
ieta();
328 int Calo_iphi = HcalID.iphi();
329 double Calo_eta = cell->getPosition().eta();
330 double Calo_phi = cell->getPosition().phi();
338 if (Calo_ieta > HFmax_ieta)
339 HFmax_ieta = Calo_ieta;
340 if (Calo_ieta < HFmin_ieta)
341 HFmin_ieta = Calo_ieta;
342 if (Calo_iphi > HFmax_iphi)
343 HFmax_iphi = Calo_iphi;
344 if (Calo_iphi > HFmax_iphi)
345 HFmin_iphi = Calo_iphi;
348 int HOmin_ieta = 99, HOmax_ieta = -99;
349 int HOmin_iphi = 99, HOmax_iphi = -99;
354 for (
i = HOids.begin();
i != HOids.end();
i++) {
359 int Calo_ieta = 42 + HcalID.
ieta();
360 int Calo_iphi = HcalID.iphi();
361 double Calo_eta = cell->getPosition().eta();
362 double Calo_phi = cell->getPosition().phi();
370 if (Calo_ieta > HOmax_ieta)
371 HOmax_ieta = Calo_ieta;
372 if (Calo_ieta < HOmin_ieta)
373 HOmin_ieta = Calo_ieta;
374 if (Calo_iphi > HOmax_iphi)
375 HOmax_iphi = Calo_iphi;
376 if (Calo_iphi > HOmax_iphi)
377 HOmin_iphi = Calo_iphi;
381 double currentLowEdge_eta = 0;
383 int ieta_ = 42 +
ieta;
386 double deta = 2.0 * (
eta - currentLowEdge_eta);
387 deta = ((
float)((
int)(1.0E3 * deta + 0.5))) / 1.0E3;
388 double dphi = 2.0 *
phi;
391 if (ieta <= 39 && ieta >= 21)
400 currentLowEdge_eta += deta;
404 currentLowEdge_eta = 2.964;
413 edm::LogInfo(
"OutputInfo") <<
"HB ieta range: " << HBmin_ieta <<
" " << HBmax_ieta;
414 edm::LogInfo(
"OutputInfo") <<
"HB iphi range: " << HBmin_iphi <<
" " << HBmax_iphi;
415 edm::LogInfo(
"OutputInfo") <<
"HE ieta range: " << HEmin_ieta <<
" " << HEmax_ieta;
416 edm::LogInfo(
"OutputInfo") <<
"HE iphi range: " << HEmin_iphi <<
" " << HEmax_iphi;
417 edm::LogInfo(
"OutputInfo") <<
"HF ieta range: " << HFmin_ieta <<
" " << HFmax_ieta;
418 edm::LogInfo(
"OutputInfo") <<
"HF iphi range: " << HFmin_iphi <<
" " << HFmax_iphi;
419 edm::LogInfo(
"OutputInfo") <<
"HO ieta range: " << HOmin_ieta <<
" " << HOmax_ieta;
420 edm::LogInfo(
"OutputInfo") <<
"HO iphi range: " << HOmin_iphi <<
" " << HOmax_iphi;
436 if (!HBHERecHitsHandle.
isValid()) {
437 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 438 <<
"HCALRecHitAnalyzer::analyze!\n";
445 if (!HORecHitsHandle.
isValid()) {
446 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 447 <<
"HCALRecHitAnalyzer::analyze!\n";
450 HORecHits = HORecHitsHandle.
product();
454 if (!HFRecHitsHandle.
isValid()) {
455 edm::LogInfo(
"OutputInfo") <<
"Failed to retrieve an Event Handle, Aborting Task " 456 <<
"HCALRecHitAnalyzer::analyze!\n";
466 TLorentzVector vHBHEMET_EtaRing[83][4];
467 int HBHEActiveRing[83][4];
468 int HBHENActiveCells[83][4];
469 double HBHESET_EtaRing[83][4];
470 double HBHEMinEnergy_EtaRing[83][4];
471 double HBHEMaxEnergy_EtaRing[83][4];
473 for (
int i = 0;
i < 83;
i++) {
474 for (
int j = 0;
j < 4;
j++) {
475 HBHEActiveRing[
i][
j] = 0;
476 HBHENActiveCells[
i][
j] = 0;
477 HBHESET_EtaRing[
i][
j] = 0;
478 HBHEMinEnergy_EtaRing[
i][
j] = 14E3;
479 HBHEMaxEnergy_EtaRing[
i][
j] = -999;
488 double Energy = hbherechit->energy();
492 int EtaRing = 41 +
ieta;
501 HBHEActiveRing[EtaRing][
depth - 1] = 1;
502 HBHENActiveCells[EtaRing][
depth - 1]++;
503 HBHESET_EtaRing[EtaRing][
depth - 1] +=
ET;
504 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
505 vHBHEMET_EtaRing[EtaRing][
depth - 1] -= v_;
508 << vHBHEMET_EtaRing[EtaRing][
depth - 1].
Phi() <<
" " << vHBHEMET_EtaRing[EtaRing][
depth - 1].Pt());
523 if (
Energy > HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1])
524 HBHEMaxEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
525 if (
Energy < HBHEMinEnergy_EtaRing[EtaRing][
depth - 1])
526 HBHEMinEnergy_EtaRing[EtaRing][
depth - 1] =
Energy;
534 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
544 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
553 if (Energy < hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
560 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
561 for (
int jDepth = 0; jDepth < 3; jDepth++) {
562 switch (jDepth + 1) {
577 if (HBHEActiveRing[iEtaRing][jDepth]) {
578 switch (jDepth + 1) {
609 TLorentzVector vHOMET_EtaRing[83];
610 int HOActiveRing[83];
611 int HONActiveCells[83];
612 double HOSET_EtaRing[83];
613 double HOMinEnergy_EtaRing[83];
614 double HOMaxEnergy_EtaRing[83];
616 for (
int i = 0;
i < 83;
i++) {
618 HONActiveCells[
i] = 0;
619 HOSET_EtaRing[
i] = 0;
620 HOMinEnergy_EtaRing[
i] = 14E3;
621 HOMaxEnergy_EtaRing[
i] = -999;
627 for (horechit = HORecHits->
begin(); horechit != HORecHits->
end(); horechit++) {
629 double Energy = horechit->energy();
633 int EtaRing = 41 +
ieta;
642 HOActiveRing[EtaRing] = 1;
643 HONActiveCells[EtaRing]++;
644 HOSET_EtaRing[EtaRing] +=
ET;
645 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
646 vHOMET_EtaRing[EtaRing] -= v_;
651 if (
Energy > HOMaxEnergy_EtaRing[EtaRing])
652 HOMaxEnergy_EtaRing[EtaRing] =
Energy;
653 if (
Energy < HOMinEnergy_EtaRing[EtaRing])
654 HOMinEnergy_EtaRing[EtaRing] =
Energy;
661 if (Energy < hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
667 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
671 if (HOActiveRing[iEtaRing]) {
683 TLorentzVector vHFMET_EtaRing[83][2];
684 int HFActiveRing[83][2];
685 int HFNActiveCells[83][2];
686 double HFSET_EtaRing[83][2];
687 double HFMinEnergy_EtaRing[83][2];
688 double HFMaxEnergy_EtaRing[83][2];
690 for (
int i = 0;
i < 83;
i++) {
691 for (
int j = 0;
j < 2;
j++) {
692 HFActiveRing[
i][
j] = 0;
693 HFNActiveCells[
i][
j] = 0;
694 HFSET_EtaRing[
i][
j] = 0;
695 HFMinEnergy_EtaRing[
i][
j] = 14E3;
696 HFMaxEnergy_EtaRing[
i][
j] = -999;
705 double Energy = hfrechit->energy();
709 int EtaRing = 41 +
ieta;
718 HFActiveRing[EtaRing][
depth - 1] = 1;
719 HFNActiveCells[EtaRing][
depth - 1]++;
720 HFSET_EtaRing[EtaRing][
depth - 1] +=
ET;
721 v_.SetPtEtaPhiE(
ET, 0,
phi,
ET);
722 vHFMET_EtaRing[EtaRing][
depth - 1] -= v_;
734 if (
Energy > HFMaxEnergy_EtaRing[EtaRing][
depth - 1])
736 if (
Energy < HFMinEnergy_EtaRing[EtaRing][
depth - 1])
746 if (Energy < hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
755 if (Energy < hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing + 1,
iphi))
763 for (
int iEtaRing = 0; iEtaRing < 83; iEtaRing++) {
764 for (
int jDepth = 0; jDepth < 2; jDepth++) {
765 switch (jDepth + 1) {
776 if (HFActiveRing[iEtaRing][jDepth]) {
777 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
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