CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPCRechitProbabilityClient.cc
Go to the documentation of this file.
1 // Original Author: Anna Cimmino
4 
5 #include <string>
6 #include <fmt/format.h>
7 
9  edm::LogVerbatim("rpcdqmclient") << "[RPCRecHitProbabilityClient]: Constructor";
10 
11  const std::string subsystemFolder = iConfig.getUntrackedParameter<std::string>("RPCFolder", "RPC");
12  const std::string recHitTypeFolder = iConfig.getUntrackedParameter<std::string>("MuonFolder", "Muon");
13 
14  const std::string summaryFolder = iConfig.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
15 
16  globalFolder_ = subsystemFolder + "/" + recHitTypeFolder + "/" + summaryFolder;
17 }
18 
20  edm::LogVerbatim("rpcrechitprobabilityclient") << "[RPCRecHitProbabilityClient]: Begin Job";
21 }
22 
25  edm::LuminosityBlock const &,
26  edm::EventSetup const &) {}
27 
29  edm::LogVerbatim("rpcrechitprobabilityclient") << "[RPCRecHitProbabilityClient]: End Run";
30 
31  MonitorElement *NumberOfMuonEta = igetter.get(globalFolder_ + "/NumberOfMuonEta");
32  MonitorElement *NumberOfMuonPt_B = igetter.get(globalFolder_ + "/NumberOfMuonPt_Barrel");
33  MonitorElement *NumberOfMuonPt_EP = igetter.get(globalFolder_ + "/NumberOfMuonPt_EndcapP");
34  MonitorElement *NumberOfMuonPt_EM = igetter.get(globalFolder_ + "/NumberOfMuonPt_EndcapM");
35  MonitorElement *NumberOfMuonPhi_B = igetter.get(globalFolder_ + "/NumberOfMuonPhi_Barrel");
36  MonitorElement *NumberOfMuonPhi_EP = igetter.get(globalFolder_ + "/NumberOfMuonPhi_EndcapP");
37  MonitorElement *NumberOfMuonPhi_EM = igetter.get(globalFolder_ + "/NumberOfMuonPhi_EndcapM");
38 
39  if (NumberOfMuonEta == nullptr || NumberOfMuonPt_B == nullptr || NumberOfMuonPt_EP == nullptr ||
40  NumberOfMuonPt_EM == nullptr || NumberOfMuonPhi_B == nullptr || NumberOfMuonPhi_EP == nullptr ||
41  NumberOfMuonPhi_EM == nullptr)
42  return;
43 
44  TH1F *NumberOfMuonEtaTH1F = NumberOfMuonEta->getTH1F();
45  TH1F *NumberOfMuonPtBTH1F = NumberOfMuonPt_B->getTH1F();
46  TH1F *NumberOfMuonPtEPTH1F = NumberOfMuonPt_EP->getTH1F();
47  TH1F *NumberOfMuonPtEMTH1F = NumberOfMuonPt_EM->getTH1F();
48  TH1F *NumberOfMuonPhiBTH1F = NumberOfMuonPhi_B->getTH1F();
49  TH1F *NumberOfMuonPhiEPTH1F = NumberOfMuonPhi_EP->getTH1F();
50  TH1F *NumberOfMuonPhiEMTH1F = NumberOfMuonPhi_EM->getTH1F();
51 
52  MonitorElement *recHit;
53  for (int i = 1; i <= 6; i++) {
54  recHit = igetter.get(fmt::format("{}/{}RecHitMuonEta", globalFolder_, i));
55  if (recHit)
56  recHit->getTH1F()->Divide(NumberOfMuonEtaTH1F);
57 
58  recHit = igetter.get(fmt::format("{}/{}RecHitMuonPtB", globalFolder_, i));
59  if (recHit) {
60  recHit->getTH1F()->Divide(NumberOfMuonPtBTH1F);
61  }
62 
63  recHit = igetter.get(fmt::format("{}/{}RecHitMuonPhiB", globalFolder_, i));
64  if (recHit) {
65  recHit->getTH1F()->Divide(NumberOfMuonPhiBTH1F);
66  }
67 
68  recHit = igetter.get(fmt::format("{}/{}RecHitMuonPtEP", globalFolder_, i));
69  if (recHit) {
70  recHit->getTH1F()->Divide(NumberOfMuonPtEPTH1F);
71  }
72 
73  recHit = igetter.get(fmt::format("{}/{}RecHitMuonPhiEP", globalFolder_, i));
74  if (recHit) {
75  recHit->getTH1F()->Divide(NumberOfMuonPhiEPTH1F);
76  }
77 
78  recHit = igetter.get(fmt::format("{}/{}RecHitMuonPtEM", globalFolder_, i));
79  if (recHit) {
80  recHit->getTH1F()->Divide(NumberOfMuonPtEMTH1F);
81  }
82 
83  recHit = igetter.get(fmt::format("{}/{}RecHitMuonPhiEM", globalFolder_, i));
84  if (recHit) {
85  recHit->getTH1F()->Divide(NumberOfMuonPhiEMTH1F);
86  }
87  }
88 }
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
virtual TH1F * getTH1F() const
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
RPCRecHitProbabilityClient(const edm::ParameterSet &ps)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override