CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCRechitProbabilityClient.cc
Go to the documentation of this file.
1 // Original Author: Anna Cimmino
2 
4 //Framework
7 //DQMServices
9 
10 #include <string>
11 
13 
14  edm::LogVerbatim ("rpcdqmclient") << "[RPCRecHitProbabilityClient]: Constructor";
15 
16 
17  std::string subsystemFolder= iConfig.getUntrackedParameter<std::string>("RPCFolder", "RPC");
18  std::string recHitTypeFolder= iConfig.getUntrackedParameter<std::string>("MuonFolder", "Muon");
19 
20  std::string summaryFolder = iConfig.getUntrackedParameter<std::string>("GlobalFolder", "SummaryHistograms");
21 
22  globalFolder_ = subsystemFolder + "/"+ recHitTypeFolder + "/"+ summaryFolder ;
23 
24 }
25 
27 
29 
30  edm::LogVerbatim ("rpcrechitprobabilityclient") << "[RPCRecHitProbabilityClient]: Begin Job";
31 
33  dbe_->setVerbose(0);
34 
35 }
36 
37 
39 
41 
43 
45 
47 
48  edm::LogVerbatim ("rpcrechitprobabilityclient") << "[RPCRecHitProbabilityClient]: End Run";
49 
50  MonitorElement * NumberOfMuonEta = dbe_->get( globalFolder_ +"/NumberOfMuonEta");
51  MonitorElement * NumberOfMuonPt_B = dbe_->get( globalFolder_ + "/NumberOfMuonPt_Barrel");
52  MonitorElement * NumberOfMuonPt_EP = dbe_->get( globalFolder_ + "/NumberOfMuonPt_EndcapP");
53  MonitorElement * NumberOfMuonPt_EM = dbe_->get( globalFolder_ + "/NumberOfMuonPt_EndcapM");
54  MonitorElement * NumberOfMuonPhi_B = dbe_->get( globalFolder_ + "/NumberOfMuonPhi_Barrel");
55  MonitorElement * NumberOfMuonPhi_EP = dbe_->get( globalFolder_ + "/NumberOfMuonPhi_EndcapP");
56  MonitorElement * NumberOfMuonPhi_EM = dbe_->get( globalFolder_ + "/NumberOfMuonPhi_EndcapM");
57 
58  if(NumberOfMuonEta == 0 ||
59  NumberOfMuonPt_B == 0 || NumberOfMuonPt_EP == 0 || NumberOfMuonPt_EM == 0 ||
60  NumberOfMuonPhi_B == 0 || NumberOfMuonPhi_EP == 0 || NumberOfMuonPhi_EM == 0 ) return;
61 
62 
63  TH1F * NumberOfMuonEtaTH1F = NumberOfMuonEta->getTH1F();
64  TH1F * NumberOfMuonPtBTH1F = NumberOfMuonPt_B->getTH1F();
65  TH1F * NumberOfMuonPtEPTH1F = NumberOfMuonPt_EP->getTH1F();
66  TH1F * NumberOfMuonPtEMTH1F = NumberOfMuonPt_EM->getTH1F();
67  TH1F * NumberOfMuonPhiBTH1F = NumberOfMuonPhi_B->getTH1F();
68  TH1F * NumberOfMuonPhiEPTH1F = NumberOfMuonPhi_EP->getTH1F();
69  TH1F * NumberOfMuonPhiEMTH1F = NumberOfMuonPhi_EM->getTH1F();
70 
71  MonitorElement * recHit;
72  TH1F * recHitTH1F;
73  std::stringstream name;
74 
75  for(int i = 1 ; i<= 6 ; i++) {
76 
77  recHit = NULL;
78  recHitTH1F = NULL;
79 
80  name.str("");
81  name<< globalFolder_ <<"/"<<i<<"RecHitMuonEta";
82  recHit = dbe_->get(name.str());
83 
84  if(recHit){
85 
86  recHitTH1F = recHit->getTH1F();
87  recHitTH1F->Divide(NumberOfMuonEtaTH1F);
88  }
89 
90  recHit = NULL;
91  recHitTH1F = NULL;
92 
93  name.str("");
94  name<< globalFolder_ <<"/"<<i<<"RecHitMuonPtB";
95  recHit = dbe_->get(name.str());
96 
97  if(recHit){
98  recHitTH1F = recHit->getTH1F();
99  recHitTH1F->Divide(NumberOfMuonPtBTH1F);
100  }
101 
102  recHit = NULL;
103  recHitTH1F = NULL;
104 
105  name.str("");
106  name<< globalFolder_ <<"/"<<i<<"RecHitMuonPhiB";
107  recHit = dbe_->get(name.str());
108 
109  if(recHit){
110  recHitTH1F = recHit->getTH1F();
111  recHitTH1F->Divide(NumberOfMuonPhiBTH1F);
112  }
113 
114  recHit = NULL;
115  recHitTH1F = NULL;
116 
117  name.str("");
118  name<< globalFolder_ <<"/"<<i<<"RecHitMuonPtEP";
119  recHit = dbe_->get(name.str());
120 
121  if(recHit){
122  recHitTH1F = recHit->getTH1F();
123  recHitTH1F->Divide(NumberOfMuonPtEPTH1F);
124  }
125 
126  recHit = NULL;
127  recHitTH1F = NULL;
128 
129  name.str("");
130  name<< globalFolder_ <<"/"<<i<<"RecHitMuonPhiEP";
131  recHit = dbe_->get(name.str());
132 
133  if(recHit){
134  recHitTH1F = recHit->getTH1F();
135  recHitTH1F->Divide(NumberOfMuonPhiEPTH1F);
136  }
137 
138 
139  recHit = NULL;
140  recHitTH1F = NULL;
141 
142  name.str("");
143  name<< globalFolder_ <<"/"<<i<<"RecHitMuonPtEM";
144  recHit = dbe_->get(name.str());
145 
146  if(recHit){
147  recHitTH1F = recHit->getTH1F();
148  recHitTH1F->Divide(NumberOfMuonPtEMTH1F);
149  }
150 
151  recHit = NULL;
152  recHitTH1F = NULL;
153 
154  name.str("");
155  name<< globalFolder_ <<"/"<<i<<"RecHitMuonPhiEM";
156  recHit = dbe_->get(name.str());
157 
158  if(recHit){
159  recHitTH1F = recHit->getTH1F();
160  recHitTH1F->Divide(NumberOfMuonPhiEMTH1F);
161  }
162 
163 
164 
165  }
166 
167 }
168 
170 
171 
virtual ~RPCRecHitProbabilityClient()
Destructor.
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void beginRun(const edm::Run &, const edm::EventSetup &)
#define NULL
Definition: scimark2.h:8
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
End Lumi Block.
void analyze(const edm::Event &, const edm::EventSetup &)
Analyze.
void endRun(const edm::Run &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:243
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
TH1F * getTH1F(void) const
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Begin Lumi block.
RPCRecHitProbabilityClient(const edm::ParameterSet &ps)
Constructor.
Definition: Run.h:33