CMS 3D CMS Logo

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