CMS 3D CMS Logo

GlobalRecHitsHistogrammer.cc
Go to the documentation of this file.
1 
10 using namespace std;
11 
13  : fName(""), verbosity(0), frequency(0), label(""), getAllProvenances(false), printProvenanceInfo(false), count(0) {
14  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
15 
16  // get information from parameter set
17  fName = iPSet.getUntrackedParameter<std::string>("Name");
18  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
19  frequency = iPSet.getUntrackedParameter<int>("Frequency");
20  outputfile = iPSet.getParameter<std::string>("outputFile");
21  doOutput = iPSet.getParameter<bool>("DoOutput");
22  edm::ParameterSet m_Prov = iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
23  getAllProvenances = m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
24  printProvenanceInfo = m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
25 
26  //get Labels to use to extract information
27  GlobalRecHitSrc_ = iPSet.getParameter<edm::InputTag>("GlobalRecHitSrc");
28  GlobalRecHitSrc_Token_ = consumes<PGlobalRecHit>(iPSet.getParameter<edm::InputTag>("GlobalRecHitSrc"));
29  // ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
30  //ECalUncalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc");
31  //ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
32  //ECalUncalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEESrc");
33  //ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
34  //HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
35  //SiStripSrc_ = iPSet.getParameter<edm::InputTag>("SiStripSrc");
36  //SiPxlSrc_ = iPSet.getParameter<edm::InputTag>("SiPxlSrc");
37  //MuDTSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSrc");
38  //MuDTSimSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSimSrc");
39  //MuCSCSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCSrc");
40  //MuRPCSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSrc");
41  //MuRPCSimSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSimSrc");
42 
43  //conf_ = iPSet;
44 
45  // use value of first digit to determine default output level (inclusive)
46  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
47  verbosity %= 10;
48 
49  // create persistent object
50  // produces<PGlobalRecHit>(label);
51 
52  // print out Parameter Set information being used
53  if (verbosity >= 0) {
54  edm::LogInfo(MsgLoggerCat) << "\n===============================\n"
55  << "Initialized as EDProducer with parameter values:\n"
56  << " Name = " << fName << "\n"
57  << " Verbosity = " << verbosity << "\n"
58  << " Frequency = " << frequency << "\n"
59  << " OutputFile = " << outputfile << "\n"
60  << " DoOutput = " << doOutput << "\n"
61  << " GetProv = " << getAllProvenances << "\n"
62  << " PrintProv = " << printProvenanceInfo << "\n"
63  << " Global Src = " << GlobalRecHitSrc_ << "\n"
64  << "===============================\n";
65  }
66 }
67 
69 
71  //monitor elements
72 
73  //Si Strip
74  string SiStripString[19] = {"TECW1",
75  "TECW2",
76  "TECW3",
77  "TECW4",
78  "TECW5",
79  "TECW6",
80  "TECW7",
81  "TECW8",
82  "TIBL1",
83  "TIBL2",
84  "TIBL3",
85  "TIBL4",
86  "TIDW1",
87  "TIDW2",
88  "TIDW3",
89  "TOBL1",
90  "TOBL2",
91  "TOBL3",
92  "TOBL4"};
93 
94  for (int i = 0; i < 19; ++i) {
95  mehSiStripn[i] = nullptr;
96  mehSiStripResX[i] = nullptr;
97  mehSiStripResY[i] = nullptr;
98  }
99 
100  string hcharname, hchartitle;
101  ibooker.setCurrentFolder("GlobalRecHitsV/SiStrips");
102  for (int amend = 0; amend < 19; ++amend) {
103  hcharname = "hSiStripn_" + SiStripString[amend];
104  hchartitle = SiStripString[amend] + " rechits";
105  mehSiStripn[amend] = ibooker.book1D(hcharname, hchartitle, 20, 0., 20.);
106  mehSiStripn[amend]->setAxisTitle("Number of hits in " + SiStripString[amend], 1);
107  mehSiStripn[amend]->setAxisTitle("Count", 2);
108 
109  hcharname = "hSiStripResX_" + SiStripString[amend];
110  hchartitle = SiStripString[amend] + " rechit x resolution";
111  mehSiStripResX[amend] = ibooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
112  mehSiStripResX[amend]->setAxisTitle("X-resolution in " + SiStripString[amend], 1);
113  mehSiStripResX[amend]->setAxisTitle("Count", 2);
114 
115  hcharname = "hSiStripResY_" + SiStripString[amend];
116  hchartitle = SiStripString[amend] + " rechit y resolution";
117  mehSiStripResY[amend] = ibooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
118  mehSiStripResY[amend]->setAxisTitle("Y-resolution in " + SiStripString[amend], 1);
119  mehSiStripResY[amend]->setAxisTitle("Count", 2);
120  }
121 
122  //HCal
123  //string hcharname, hchartitle;
124  string HCalString[4] = {"HB", "HE", "HF", "HO"};
125  float HCalnUpper[4] = {3000., 3000., 3000., 2000.};
126  float HCalnLower[4] = {2000., 2000., 2000., 1000.};
127  for (int j = 0; j < 4; ++j) {
128  mehHcaln[j] = nullptr;
129  mehHcalRes[j] = nullptr;
130  }
131 
132  ibooker.setCurrentFolder("GlobalRecHitsV/HCals");
133  for (int amend = 0; amend < 4; ++amend) {
134  hcharname = "hHcaln_" + HCalString[amend];
135  hchartitle = HCalString[amend] + " rechits";
136  mehHcaln[amend] = ibooker.book1D(hcharname, hchartitle, 500, HCalnLower[amend], HCalnUpper[amend]);
137 
138  mehHcaln[amend]->setAxisTitle("Number of RecHits", 1);
139  mehHcaln[amend]->setAxisTitle("Count", 2);
140 
141  hcharname = "hHcalRes_" + HCalString[amend];
142  hchartitle = HCalString[amend] + " rechit resolution";
143  mehHcalRes[amend] = ibooker.book1D(hcharname, hchartitle, 25, -2., 2.);
144  mehHcalRes[amend]->setAxisTitle("RecHit E - SimHit E", 1);
145  mehHcalRes[amend]->setAxisTitle("Count", 2);
146  }
147 
148  //Ecal
149  string ECalString[3] = {"EB", "EE", "ES"};
150  int ECalnBins[3] = {700, 100, 50};
151  float ECalnUpper[3] = {20000., 62000., 300.};
152  float ECalnLower[3] = {6000., 60000., 100.};
153  int ECalResBins[3] = {200, 200, 200};
154  float ECalResUpper[3] = {1., 0.3, .0002};
155  float ECalResLower[3] = {-1., -0.3, -.0002};
156  for (int i = 0; i < 3; ++i) {
157  mehEcaln[i] = nullptr;
158  mehEcalRes[i] = nullptr;
159  }
160 
161  ibooker.setCurrentFolder("GlobalRecHitsV/ECals");
162  for (int amend = 0; amend < 3; ++amend) {
163  hcharname = "hEcaln_" + ECalString[amend];
164  hchartitle = ECalString[amend] + " rechits";
165  mehEcaln[amend] = ibooker.book1D(hcharname, hchartitle, ECalnBins[amend], ECalnLower[amend], ECalnUpper[amend]);
166 
167  mehEcaln[amend]->setAxisTitle("Number of RecHits", 1);
168  mehEcaln[amend]->setAxisTitle("Count", 2);
169 
170  hcharname = "hEcalRes_" + ECalString[amend];
171  hchartitle = ECalString[amend] + " rechit resolution";
172  mehEcalRes[amend] =
173  ibooker.book1D(hcharname, hchartitle, ECalResBins[amend], ECalResLower[amend], ECalResUpper[amend]);
174 
175  mehEcalRes[amend]->setAxisTitle("RecHit E - SimHit E", 1);
176  mehEcalRes[amend]->setAxisTitle("Count", 2);
177  }
178 
179  //Si Pixels
180  string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p", "FWD2n", "FWD2p"};
181  for (int j = 0; j < 7; ++j) {
182  mehSiPixeln[j] = nullptr;
183  mehSiPixelResX[j] = nullptr;
184  mehSiPixelResY[j] = nullptr;
185  }
186 
187  ibooker.setCurrentFolder("GlobalRecHitsV/SiPixels");
188  for (int amend = 0; amend < 7; ++amend) {
189  hcharname = "hSiPixeln_" + SiPixelString[amend];
190  hchartitle = SiPixelString[amend] + " rechits";
191  mehSiPixeln[amend] = ibooker.book1D(hcharname, hchartitle, 20, 0., 20.);
192  mehSiPixeln[amend]->setAxisTitle("Number of hits in " + SiPixelString[amend], 1);
193  mehSiPixeln[amend]->setAxisTitle("Count", 2);
194 
195  hcharname = "hSiPixelResX_" + SiPixelString[amend];
196  hchartitle = SiPixelString[amend] + " rechit x resolution";
197  mehSiPixelResX[amend] = ibooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
198  mehSiPixelResX[amend]->setAxisTitle("X-resolution in " + SiPixelString[amend], 1);
199  mehSiPixelResX[amend]->setAxisTitle("Count", 2);
200 
201  hcharname = "hSiPixelResY_" + SiPixelString[amend];
202  hchartitle = SiPixelString[amend] + " rechit y resolution";
203  mehSiPixelResY[amend] = ibooker.book1D(hcharname, hchartitle, 200, -0.02, .02);
204  mehSiPixelResY[amend]->setAxisTitle("Y-resolution in " + SiPixelString[amend], 1);
205  mehSiPixelResY[amend]->setAxisTitle("Count", 2);
206  }
207 
208  //Muons
209  ibooker.setCurrentFolder("GlobalRecHitsV/Muons");
210  mehDtMuonn = nullptr;
211  mehCSCn = nullptr;
212  mehRPCn = nullptr;
213 
214  //std::vector<MonitorElement *> me_List = {mehDtMuonn, mehCSCn, mehRPCn};
215  string n_List[3] = {"hDtMuonn", "hCSCn", "hRPCn"};
216  //float hist_prop[3] = [25., 0., 50.];
217  string hist_string[3] = {"Dt", "CSC", "RPC"};
218 
219  for (int amend = 0; amend < 3; ++amend) {
220  hchartitle = hist_string[amend] + " rechits";
221  if (amend == 0) {
222  mehDtMuonn = ibooker.book1D(n_List[amend], hchartitle, 25, 0., 50.);
223  mehDtMuonn->setAxisTitle("Number of Rechits", 1);
224  mehDtMuonn->setAxisTitle("Count", 2);
225  }
226  if (amend == 1) {
227  mehCSCn = ibooker.book1D(n_List[amend], hchartitle, 25, 0., 50.);
228  mehCSCn->setAxisTitle("Number of Rechits", 1);
229  mehCSCn->setAxisTitle("Count", 2);
230  }
231  if (amend == 2) {
232  mehRPCn = ibooker.book1D(n_List[amend], hchartitle, 25, 0., 50.);
233  mehRPCn->setAxisTitle("Number of Rechits", 1);
234  mehRPCn->setAxisTitle("Count", 2);
235  }
236  }
237 
238  mehDtMuonRes = nullptr;
239  mehCSCResRDPhi = nullptr;
240  mehRPCResX = nullptr;
241 
242  hcharname = "hDtMuonRes";
243  hchartitle = "DT wire distance resolution";
244  mehDtMuonRes = ibooker.book1D(hcharname, hchartitle, 200, -0.2, 0.2);
245 
246  hcharname = "CSCResRDPhi";
247  hchartitle = "CSC perp*dphi resolution";
248  mehCSCResRDPhi = ibooker.book1D(hcharname, hchartitle, 200, -0.2, 0.2);
249 
250  hcharname = "hRPCResX";
251  hchartitle = "RPC rechits x resolution";
252  mehRPCResX = ibooker.book1D(hcharname, hchartitle, 50, -5., 5.);
253 }
254 
256  std::string MsgLoggerCat = "GlobalRecHitsHistogrammer_analyze";
257 
258  // keep track of number of events processed
259  ++count;
260 
261  // get event id information
262  edm::RunNumber_t nrun = iEvent.id().run();
263  edm::EventNumber_t nevt = iEvent.id().event();
264 
265  if (verbosity > 0) {
266  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count << " events total)";
267  } else if (verbosity == 0) {
268  if (nevt % frequency == 0 || nevt == 1) {
269  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count
270  << " events total)";
271  }
272  }
273 
274  // clear event holders
275  //clear(); Not in example I'm using, thus I comment it out.
276 
277  // look at information available in the event
278  if (getAllProvenances) {
279  std::vector<const edm::StableProvenance*> AllProv;
280  iEvent.getAllStableProvenance(AllProv);
281 
282  if (verbosity >= 0)
283  edm::LogInfo(MsgLoggerCat) << "Number of Provenances = " << AllProv.size();
284 
285  if (printProvenanceInfo && (verbosity >= 0)) {
286  TString eventout("\nProvenance info:\n");
287 
288  for (unsigned int i = 0; i < AllProv.size(); ++i) {
289  eventout += "\n ******************************";
290  eventout += "\n Module : ";
291  //eventout += (AllProv[i]->product).moduleLabel();
292  eventout += AllProv[i]->moduleLabel();
293  eventout += "\n ProductID : ";
294  //eventout += (AllProv[i]->product).productID_.id_;
295  eventout += AllProv[i]->productID().id();
296  eventout += "\n ClassName : ";
297  //eventout += (AllProv[i]->product).fullClassName_;
298  eventout += AllProv[i]->className();
299  eventout += "\n InstanceName : ";
300  //eventout += (AllProv[i]->product).productInstanceName_;
301  eventout += AllProv[i]->productInstanceName();
302  eventout += "\n BranchName : ";
303  //eventout += (AllProv[i]->product).branchName_;
304  eventout += AllProv[i]->branchName();
305  }
306  eventout += "\n ******************************\n";
307  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
308  printProvenanceInfo = false;
309  }
310  getAllProvenances = false;
311  }
312 
313  edm::Handle<PGlobalRecHit> srcGlobalRecHits;
314  iEvent.getByToken(GlobalRecHitSrc_Token_, srcGlobalRecHits);
315  if (!srcGlobalRecHits.isValid()) {
316  edm::LogWarning(MsgLoggerCat) << "Unable to find PGlobalRecHit in event!";
317  return;
318  }
319 
320  int nEBCalRecHits = srcGlobalRecHits->getnEBCalRecHits();
321  int nEECalRecHits = srcGlobalRecHits->getnEECalRecHits();
322  int nESCalRecHits = srcGlobalRecHits->getnESCalRecHits();
323 
324  int nHBCalRecHits = srcGlobalRecHits->getnHBCalRecHits();
325  int nHECalRecHits = srcGlobalRecHits->getnHECalRecHits();
326  int nHOCalRecHits = srcGlobalRecHits->getnHOCalRecHits();
327  int nHFCalRecHits = srcGlobalRecHits->getnHFCalRecHits();
328 
329  int nTIBL1RecHits = srcGlobalRecHits->getnTIBL1RecHits();
330  int nTIBL2RecHits = srcGlobalRecHits->getnTIBL2RecHits();
331  int nTIBL3RecHits = srcGlobalRecHits->getnTIBL3RecHits();
332  int nTIBL4RecHits = srcGlobalRecHits->getnTIBL4RecHits();
333  int nTOBL1RecHits = srcGlobalRecHits->getnTOBL1RecHits();
334  int nTOBL2RecHits = srcGlobalRecHits->getnTOBL2RecHits();
335  int nTOBL3RecHits = srcGlobalRecHits->getnTOBL3RecHits();
336  int nTOBL4RecHits = srcGlobalRecHits->getnTOBL4RecHits();
337  int nTIDW1RecHits = srcGlobalRecHits->getnTIDW1RecHits();
338  int nTIDW2RecHits = srcGlobalRecHits->getnTIDW2RecHits();
339  int nTIDW3RecHits = srcGlobalRecHits->getnTIDW3RecHits();
340  int nTECW1RecHits = srcGlobalRecHits->getnTECW1RecHits();
341  int nTECW2RecHits = srcGlobalRecHits->getnTECW2RecHits();
342  int nTECW3RecHits = srcGlobalRecHits->getnTECW3RecHits();
343  int nTECW4RecHits = srcGlobalRecHits->getnTECW4RecHits();
344  int nTECW5RecHits = srcGlobalRecHits->getnTECW5RecHits();
345  int nTECW6RecHits = srcGlobalRecHits->getnTECW6RecHits();
346  int nTECW7RecHits = srcGlobalRecHits->getnTECW7RecHits();
347  int nTECW8RecHits = srcGlobalRecHits->getnTECW8RecHits();
348 
349  int nBRL1RecHits = srcGlobalRecHits->getnBRL1RecHits();
350  int nBRL2RecHits = srcGlobalRecHits->getnBRL2RecHits();
351  int nBRL3RecHits = srcGlobalRecHits->getnBRL3RecHits();
352  int nFWD1nRecHits = srcGlobalRecHits->getnFWD1nRecHits();
353  int nFWD1pRecHits = srcGlobalRecHits->getnFWD1pRecHits();
354  int nFWD2nRecHits = srcGlobalRecHits->getnFWD2nRecHits();
355  int nFWD2pRecHits = srcGlobalRecHits->getnFWD2pRecHits();
356 
357  int nDTRecHits = srcGlobalRecHits->getnDTRecHits();
358 
359  int nCSCRecHits = srcGlobalRecHits->getnCSCRecHits();
360 
361  int nRPCRecHits = srcGlobalRecHits->getnRPCRecHits();
362 
363  // get Ecal info
364  std::vector<PGlobalRecHit::ECalRecHit> EECalRecHits = srcGlobalRecHits->getEECalRecHits();
365  mehEcaln[0]->Fill((float)nEECalRecHits);
366  for (unsigned int i = 0; i < EECalRecHits.size(); ++i) {
367  mehEcalRes[0]->Fill(EECalRecHits[i].RE - EECalRecHits[i].SHE);
368  }
369 
370  std::vector<PGlobalRecHit::ECalRecHit> EBCalRecHits = srcGlobalRecHits->getEBCalRecHits();
371  mehEcaln[1]->Fill((float)nEBCalRecHits);
372  for (unsigned int i = 0; i < EBCalRecHits.size(); ++i) {
373  mehEcalRes[1]->Fill(EBCalRecHits[i].RE - EBCalRecHits[i].SHE);
374  }
375 
376  std::vector<PGlobalRecHit::ECalRecHit> ESCalRecHits = srcGlobalRecHits->getESCalRecHits();
377  mehEcaln[2]->Fill((float)nESCalRecHits);
378  for (unsigned int i = 0; i < ESCalRecHits.size(); ++i) {
379  mehEcalRes[2]->Fill(ESCalRecHits[i].RE - ESCalRecHits[i].SHE);
380  }
381 
382  // Get HCal info
383  std::vector<PGlobalRecHit::HCalRecHit> HBCalRecHits = srcGlobalRecHits->getHBCalRecHits();
384  mehHcaln[0]->Fill((float)nHBCalRecHits);
385  for (unsigned int i = 0; i < HBCalRecHits.size(); ++i) {
386  mehHcalRes[0]->Fill(HBCalRecHits[i].REC - HBCalRecHits[i].SHE);
387  }
388 
389  std::vector<PGlobalRecHit::HCalRecHit> HECalRecHits = srcGlobalRecHits->getHECalRecHits();
390  mehHcaln[1]->Fill((float)nHECalRecHits);
391  for (unsigned int i = 0; i < HECalRecHits.size(); ++i) {
392  mehHcalRes[1]->Fill(HECalRecHits[i].REC - HECalRecHits[i].SHE);
393  }
394 
395  std::vector<PGlobalRecHit::HCalRecHit> HOCalRecHits = srcGlobalRecHits->getHOCalRecHits();
396  mehHcaln[2]->Fill((float)nHOCalRecHits);
397  for (unsigned int i = 0; i < HOCalRecHits.size(); ++i) {
398  mehHcalRes[2]->Fill(HOCalRecHits[i].REC - HOCalRecHits[i].SHE);
399  }
400 
401  std::vector<PGlobalRecHit::HCalRecHit> HFCalRecHits = srcGlobalRecHits->getHFCalRecHits();
402  mehHcaln[3]->Fill((float)nHFCalRecHits);
403  for (unsigned int i = 0; i < HFCalRecHits.size(); ++i) {
404  mehHcalRes[3]->Fill(HFCalRecHits[i].REC - HFCalRecHits[i].SHE);
405  }
406 
407  // get SiStrip info
408  std::vector<PGlobalRecHit::SiStripRecHit> TIBL1RecHits = srcGlobalRecHits->getTIBL1RecHits();
409  mehSiStripn[0]->Fill((float)nTIBL1RecHits);
410  for (unsigned int i = 0; i < TIBL1RecHits.size(); ++i) {
411  mehSiStripResX[0]->Fill(TIBL1RecHits[i].RX - TIBL1RecHits[i].SX);
412  mehSiStripResY[0]->Fill(TIBL1RecHits[i].RY - TIBL1RecHits[i].SY);
413  }
414 
415  std::vector<PGlobalRecHit::SiStripRecHit> TIBL2RecHits = srcGlobalRecHits->getTIBL2RecHits();
416  mehSiStripn[1]->Fill((float)nTIBL2RecHits);
417  for (unsigned int i = 0; i < TIBL2RecHits.size(); ++i) {
418  mehSiStripResX[1]->Fill(TIBL2RecHits[i].RX - TIBL2RecHits[i].SX);
419  mehSiStripResY[1]->Fill(TIBL2RecHits[i].RY - TIBL2RecHits[i].SY);
420  }
421 
422  std::vector<PGlobalRecHit::SiStripRecHit> TIBL3RecHits = srcGlobalRecHits->getTIBL3RecHits();
423  mehSiStripn[2]->Fill((float)nTIBL3RecHits);
424  for (unsigned int i = 0; i < TIBL3RecHits.size(); ++i) {
425  mehSiStripResX[2]->Fill(TIBL3RecHits[i].RX - TIBL3RecHits[i].SX);
426  mehSiStripResY[2]->Fill(TIBL3RecHits[i].RY - TIBL3RecHits[i].SY);
427  }
428 
429  std::vector<PGlobalRecHit::SiStripRecHit> TIBL4RecHits = srcGlobalRecHits->getTIBL4RecHits();
430  mehSiStripn[3]->Fill((float)nTIBL4RecHits);
431  for (unsigned int i = 0; i < TIBL4RecHits.size(); ++i) {
432  mehSiStripResX[3]->Fill(TIBL4RecHits[i].RX - TIBL4RecHits[i].SX);
433  mehSiStripResY[3]->Fill(TIBL4RecHits[i].RY - TIBL4RecHits[i].SY);
434  }
435 
436  std::vector<PGlobalRecHit::SiStripRecHit> TOBL1RecHits = srcGlobalRecHits->getTOBL1RecHits();
437  mehSiStripn[4]->Fill((float)nTOBL1RecHits);
438  for (unsigned int i = 0; i < TOBL1RecHits.size(); ++i) {
439  mehSiStripResX[4]->Fill(TOBL1RecHits[i].RX - TOBL1RecHits[i].SX);
440  mehSiStripResY[4]->Fill(TOBL1RecHits[i].RY - TOBL1RecHits[i].SY);
441  }
442 
443  std::vector<PGlobalRecHit::SiStripRecHit> TOBL2RecHits = srcGlobalRecHits->getTOBL2RecHits();
444  mehSiStripn[5]->Fill((float)nTOBL2RecHits);
445  for (unsigned int i = 0; i < TOBL2RecHits.size(); ++i) {
446  mehSiStripResX[5]->Fill(TOBL2RecHits[i].RX - TOBL2RecHits[i].SX);
447  mehSiStripResY[5]->Fill(TOBL2RecHits[i].RY - TOBL2RecHits[i].SY);
448  }
449 
450  std::vector<PGlobalRecHit::SiStripRecHit> TOBL3RecHits = srcGlobalRecHits->getTOBL3RecHits();
451  mehSiStripn[6]->Fill((float)nTOBL3RecHits);
452  for (unsigned int i = 0; i < TOBL3RecHits.size(); ++i) {
453  mehSiStripResX[6]->Fill(TOBL3RecHits[i].RX - TOBL3RecHits[i].SX);
454  mehSiStripResY[6]->Fill(TOBL3RecHits[i].RY - TOBL3RecHits[i].SY);
455  }
456 
457  std::vector<PGlobalRecHit::SiStripRecHit> TOBL4RecHits = srcGlobalRecHits->getTOBL4RecHits();
458  mehSiStripn[7]->Fill((float)nTOBL4RecHits);
459  for (unsigned int i = 0; i < TOBL4RecHits.size(); ++i) {
460  mehSiStripResX[7]->Fill(TOBL4RecHits[i].RX - TOBL4RecHits[i].SX);
461  mehSiStripResY[7]->Fill(TOBL4RecHits[i].RY - TOBL4RecHits[i].SY);
462  }
463 
464  std::vector<PGlobalRecHit::SiStripRecHit> TIDW1RecHits = srcGlobalRecHits->getTIDW1RecHits();
465  mehSiStripn[8]->Fill((float)nTIDW1RecHits);
466  for (unsigned int i = 0; i < TIDW1RecHits.size(); ++i) {
467  mehSiStripResX[8]->Fill(TIDW1RecHits[i].RX - TIDW1RecHits[i].SX);
468  mehSiStripResY[8]->Fill(TIDW1RecHits[i].RY - TIDW1RecHits[i].SY);
469  }
470 
471  std::vector<PGlobalRecHit::SiStripRecHit> TIDW2RecHits = srcGlobalRecHits->getTIDW2RecHits();
472  mehSiStripn[9]->Fill((float)nTIDW2RecHits);
473  for (unsigned int i = 0; i < TIDW2RecHits.size(); ++i) {
474  mehSiStripResX[9]->Fill(TIDW2RecHits[i].RX - TIDW2RecHits[i].SX);
475  mehSiStripResY[9]->Fill(TIDW2RecHits[i].RY - TIDW2RecHits[i].SY);
476  }
477 
478  std::vector<PGlobalRecHit::SiStripRecHit> TIDW3RecHits = srcGlobalRecHits->getTIDW3RecHits();
479  mehSiStripn[10]->Fill((float)nTIDW3RecHits);
480  for (unsigned int i = 0; i < TIDW3RecHits.size(); ++i) {
481  mehSiStripResX[10]->Fill(TIDW3RecHits[i].RX - TIDW3RecHits[i].SX);
482  mehSiStripResY[10]->Fill(TIDW3RecHits[i].RY - TIDW3RecHits[i].SY);
483  }
484 
485  std::vector<PGlobalRecHit::SiStripRecHit> TECW1RecHits = srcGlobalRecHits->getTECW1RecHits();
486  mehSiStripn[11]->Fill((float)nTECW1RecHits);
487  for (unsigned int i = 0; i < TECW1RecHits.size(); ++i) {
488  mehSiStripResX[11]->Fill(TECW1RecHits[i].RX - TECW1RecHits[i].SX);
489  mehSiStripResY[11]->Fill(TECW1RecHits[i].RY - TECW1RecHits[i].SY);
490  }
491 
492  std::vector<PGlobalRecHit::SiStripRecHit> TECW2RecHits = srcGlobalRecHits->getTECW2RecHits();
493  mehSiStripn[12]->Fill((float)nTECW2RecHits);
494  for (unsigned int i = 0; i < TECW2RecHits.size(); ++i) {
495  mehSiStripResX[12]->Fill(TECW2RecHits[i].RX - TECW2RecHits[i].SX);
496  mehSiStripResY[12]->Fill(TECW2RecHits[i].RY - TECW2RecHits[i].SY);
497  }
498 
499  std::vector<PGlobalRecHit::SiStripRecHit> TECW3RecHits = srcGlobalRecHits->getTECW3RecHits();
500  mehSiStripn[13]->Fill((float)nTECW3RecHits);
501  for (unsigned int i = 0; i < TECW3RecHits.size(); ++i) {
502  mehSiStripResX[13]->Fill(TECW3RecHits[i].RX - TECW3RecHits[i].SX);
503  mehSiStripResY[13]->Fill(TECW3RecHits[i].RY - TECW3RecHits[i].SY);
504  }
505 
506  std::vector<PGlobalRecHit::SiStripRecHit> TECW4RecHits = srcGlobalRecHits->getTECW4RecHits();
507  mehSiStripn[14]->Fill((float)nTECW4RecHits);
508  for (unsigned int i = 0; i < TECW4RecHits.size(); ++i) {
509  mehSiStripResX[14]->Fill(TECW4RecHits[i].RX - TECW4RecHits[i].SX);
510  mehSiStripResY[14]->Fill(TECW4RecHits[i].RY - TECW4RecHits[i].SY);
511  }
512 
513  std::vector<PGlobalRecHit::SiStripRecHit> TECW5RecHits = srcGlobalRecHits->getTECW5RecHits();
514  mehSiStripn[15]->Fill((float)nTECW5RecHits);
515  for (unsigned int i = 0; i < TECW5RecHits.size(); ++i) {
516  mehSiStripResX[15]->Fill(TECW5RecHits[i].RX - TECW5RecHits[i].SX);
517  mehSiStripResY[15]->Fill(TECW5RecHits[i].RY - TECW5RecHits[i].SY);
518  }
519 
520  std::vector<PGlobalRecHit::SiStripRecHit> TECW6RecHits = srcGlobalRecHits->getTECW6RecHits();
521  mehSiStripn[16]->Fill((float)nTECW6RecHits);
522  for (unsigned int i = 0; i < TECW6RecHits.size(); ++i) {
523  mehSiStripResX[16]->Fill(TECW6RecHits[i].RX - TECW6RecHits[i].SX);
524  mehSiStripResY[16]->Fill(TECW6RecHits[i].RY - TECW6RecHits[i].SY);
525  }
526 
527  std::vector<PGlobalRecHit::SiStripRecHit> TECW7RecHits = srcGlobalRecHits->getTECW7RecHits();
528  mehSiStripn[17]->Fill((float)nTECW7RecHits);
529  for (unsigned int i = 0; i < TECW7RecHits.size(); ++i) {
530  mehSiStripResX[17]->Fill(TECW7RecHits[i].RX - TECW7RecHits[i].SX);
531  mehSiStripResY[17]->Fill(TECW7RecHits[i].RY - TECW7RecHits[i].SY);
532  }
533 
534  std::vector<PGlobalRecHit::SiStripRecHit> TECW8RecHits = srcGlobalRecHits->getTECW8RecHits();
535  mehSiStripn[18]->Fill((float)nTECW8RecHits);
536  for (unsigned int i = 0; i < TECW8RecHits.size(); ++i) {
537  mehSiStripResX[18]->Fill(TECW8RecHits[i].RX - TECW8RecHits[i].SX);
538  mehSiStripResY[18]->Fill(TECW8RecHits[i].RY - TECW8RecHits[i].SY);
539  }
540 
541  // get SiPixel info
542  std::vector<PGlobalRecHit::SiPixelRecHit> BRL1RecHits = srcGlobalRecHits->getBRL1RecHits();
543  mehSiPixeln[0]->Fill((float)nBRL1RecHits);
544  for (unsigned int i = 0; i < BRL1RecHits.size(); ++i) {
545  mehSiPixelResX[0]->Fill(BRL1RecHits[i].RX - BRL1RecHits[i].SX);
546  mehSiPixelResY[0]->Fill(BRL1RecHits[i].RY - BRL1RecHits[i].SY);
547  }
548 
549  std::vector<PGlobalRecHit::SiPixelRecHit> BRL2RecHits = srcGlobalRecHits->getBRL2RecHits();
550  mehSiPixeln[1]->Fill((float)nBRL2RecHits);
551  for (unsigned int i = 0; i < BRL2RecHits.size(); ++i) {
552  mehSiPixelResX[1]->Fill(BRL2RecHits[i].RX - BRL2RecHits[i].SX);
553  mehSiPixelResY[1]->Fill(BRL2RecHits[i].RY - BRL2RecHits[i].SY);
554  }
555 
556  std::vector<PGlobalRecHit::SiPixelRecHit> BRL3RecHits = srcGlobalRecHits->getBRL3RecHits();
557  mehSiPixeln[2]->Fill((float)nBRL3RecHits);
558  for (unsigned int i = 0; i < BRL3RecHits.size(); ++i) {
559  mehSiPixelResX[2]->Fill(BRL3RecHits[i].RX - BRL3RecHits[i].SX);
560  mehSiPixelResY[2]->Fill(BRL3RecHits[i].RY - BRL3RecHits[i].SY);
561  }
562 
563  std::vector<PGlobalRecHit::SiPixelRecHit> FWD1pRecHits = srcGlobalRecHits->getFWD1pRecHits();
564  mehSiPixeln[3]->Fill((float)nFWD1pRecHits);
565  for (unsigned int i = 0; i < FWD1pRecHits.size(); ++i) {
566  mehSiPixelResX[3]->Fill(FWD1pRecHits[i].RX - FWD1pRecHits[i].SX);
567  mehSiPixelResY[3]->Fill(FWD1pRecHits[i].RY - FWD1pRecHits[i].SY);
568  }
569 
570  std::vector<PGlobalRecHit::SiPixelRecHit> FWD1nRecHits = srcGlobalRecHits->getFWD1nRecHits();
571  mehSiPixeln[4]->Fill((float)nFWD1nRecHits);
572  for (unsigned int i = 0; i < FWD1nRecHits.size(); ++i) {
573  mehSiPixelResX[4]->Fill(FWD1nRecHits[i].RX - FWD1nRecHits[i].SX);
574  mehSiPixelResY[4]->Fill(FWD1nRecHits[i].RY - FWD1nRecHits[i].SY);
575  }
576 
577  std::vector<PGlobalRecHit::SiPixelRecHit> FWD2pRecHits = srcGlobalRecHits->getFWD2pRecHits();
578  mehSiPixeln[5]->Fill((float)nFWD2pRecHits);
579  for (unsigned int i = 0; i < FWD2pRecHits.size(); ++i) {
580  mehSiPixelResX[5]->Fill(FWD2pRecHits[i].RX - FWD2pRecHits[i].SX);
581  mehSiPixelResY[5]->Fill(FWD2pRecHits[i].RY - FWD2pRecHits[i].SY);
582  }
583 
584  std::vector<PGlobalRecHit::SiPixelRecHit> FWD2nRecHits = srcGlobalRecHits->getFWD2nRecHits();
585  mehSiPixeln[6]->Fill((float)nFWD2nRecHits);
586  for (unsigned int i = 0; i < FWD2nRecHits.size(); ++i) {
587  mehSiPixelResX[6]->Fill(FWD2nRecHits[i].RX - FWD2nRecHits[i].SX);
588  mehSiPixelResY[6]->Fill(FWD2nRecHits[i].RY - FWD2nRecHits[i].SY);
589  }
590 
591  // get DtMuon info
592  std::vector<PGlobalRecHit::DTRecHit> DTRecHits = srcGlobalRecHits->getDTRecHits();
593  mehDtMuonn->Fill((float)nDTRecHits);
594  for (unsigned int i = 0; i < DTRecHits.size(); ++i) {
595  mehDtMuonRes->Fill(DTRecHits[i].RHD - DTRecHits[i].SHD);
596  }
597 
598  // get CSC info
599  std::vector<PGlobalRecHit::CSCRecHit> CSCRecHits = srcGlobalRecHits->getCSCRecHits();
600  mehCSCn->Fill((float)nCSCRecHits);
601  for (unsigned int i = 0; i < CSCRecHits.size(); ++i) {
602  mehCSCResRDPhi->Fill(CSCRecHits[i].RHPERP * (CSCRecHits[i].RHPHI - CSCRecHits[i].SHPHI));
603  }
604 
605  // get RPC info
606  std::vector<PGlobalRecHit::RPCRecHit> RPCRecHits = srcGlobalRecHits->getRPCRecHits();
607  mehRPCn->Fill((float)nRPCRecHits);
608  for (unsigned int i = 0; i < RPCRecHits.size(); ++i) {
609  mehRPCResX->Fill(RPCRecHits[i].RHX - RPCRecHits[i].SHX);
610  }
611 
612  if (verbosity > 0)
613  edm::LogInfo(MsgLoggerCat) << "Done gathering data from event.";
614 }
int getnFWD2nRecHits() const
SiStripRecHitVector getTECW1RecHits() const
int getnCSCRecHits() const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelRecHitVector getBRL1RecHits() const
SiStripRecHitVector getTIDW2RecHits() const
int getnTIBL1RecHits() const
int getnRPCRecHits() const
HCalRecHitVector getHOCalRecHits() const
int getnBRL3RecHits() const
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
int getnTECW4RecHits() const
int getnEECalRecHits() const
SiStripRecHitVector getTECW4RecHits() const
unsigned long long EventNumber_t
SiStripRecHitVector getTIBL3RecHits() const
DTRecHitVector getDTRecHits() const
int getnTIBL4RecHits() const
edm::EDGetTokenT< PGlobalRecHit > GlobalRecHitSrc_Token_
int getnTECW1RecHits() const
SiPixelRecHitVector getFWD1nRecHits() const
T getUntrackedParameter(std::string const &, T const &) const
int getnTECW2RecHits() const
void Fill(long long x)
char const * label
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
SiStripRecHitVector getTECW6RecHits() const
int iEvent
Definition: GenABIO.cc:224
int getnTECW8RecHits() const
HCalRecHitVector getHFCalRecHits() const
int getnHBCalRecHits() const
int getnHFCalRecHits() const
int getnHECalRecHits() const
SiStripRecHitVector getTIBL2RecHits() const
int getnTIBL3RecHits() const
GlobalRecHitsHistogrammer(const edm::ParameterSet &)
int getnTOBL1RecHits() const
SiStripRecHitVector getTECW8RecHits() const
int getnFWD1pRecHits() const
SiStripRecHitVector getTECW2RecHits() const
int getnBRL2RecHits() const
SiStripRecHitVector getTIDW1RecHits() const
int getnTECW7RecHits() const
const int verbosity
Log< level::Info, false > LogInfo
SiStripRecHitVector getTECW7RecHits() const
SiStripRecHitVector getTIBL1RecHits() const
ECalRecHitVector getEECalRecHits() const
SiStripRecHitVector getTOBL4RecHits() const
int getnFWD1nRecHits() const
int getnTOBL3RecHits() const
CSCRecHitVector getCSCRecHits() const
SiStripRecHitVector getTOBL3RecHits() const
int getnHOCalRecHits() const
int getnTECW3RecHits() const
SiStripRecHitVector getTECW3RecHits() const
int getnTOBL4RecHits() const
bool isValid() const
Definition: HandleBase.h:70
SiPixelRecHitVector getFWD1pRecHits() const
HCalRecHitVector getHBCalRecHits() const
int getnTECW5RecHits() const
SiStripRecHitVector getTIBL4RecHits() const
RPCRecHitVector getRPCRecHits() const
SiStripRecHitVector getTOBL2RecHits() const
SiPixelRecHitVector getBRL2RecHits() const
int getnDTRecHits() const
int getnEBCalRecHits() const
int getnTOBL2RecHits() const
int getnBRL1RecHits() const
SiPixelRecHitVector getFWD2nRecHits() const
ECalRecHitVector getEBCalRecHits() const
SiStripRecHitVector getTECW5RecHits() const
int getnFWD2pRecHits() const
int getnTIBL2RecHits() const
SiPixelRecHitVector getFWD2pRecHits() const
int getnTECW6RecHits() const
int getnTIDW3RecHits() const
unsigned int RunNumber_t
Log< level::Warning, false > LogWarning
int getnTIDW2RecHits() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
SiStripRecHitVector getTIDW3RecHits() const
ECalRecHitVector getESCalRecHits() const
SiStripRecHitVector getTOBL1RecHits() const
int getnTIDW1RecHits() const
int getnESCalRecHits() const
Definition: Run.h:45
HCalRecHitVector getHECalRecHits() const
void analyze(const edm::Event &, const edm::EventSetup &) override
SiPixelRecHitVector getBRL3RecHits() const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)