CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalRecHitsHistogrammer.cc
Go to the documentation of this file.
1 
8 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  //Put in analyzer stuff here....
75 
76  dbe = 0;
78 if (dbe) {
79  if (verbosity > 0 ) {
80  dbe->setVerbose(1);
81  } else {
82  dbe->setVerbose(0);
83  }
84 }
85 if (dbe) {
86  if (verbosity > 0 ) dbe->showDirStructure();
87  }
88 
89 //monitor elements
90 
91 //Si Strip
92  if(dbe)
93  {
94 string SiStripString[19] = {"TECW1", "TECW2", "TECW3", "TECW4", "TECW5", "TECW6", "TECW7", "TECW8", "TIBL1", "TIBL2", "TIBL3", "TIBL4", "TIDW1", "TIDW2", "TIDW3", "TOBL1", "TOBL2", "TOBL3", "TOBL4"};
95 for(int i = 0; i<19; ++i)
96 {
97  mehSiStripn[i]=0;
98  mehSiStripResX[i]=0;
99  mehSiStripResY[i]=0;
100 }
101  string hcharname, hchartitle;
102 dbe->setCurrentFolder("GlobalRecHitsV/SiStrips");
103 for(int amend = 0; amend < 19; ++amend)
104 {
105  hcharname = "hSiStripn_"+SiStripString[amend];
106  hchartitle= SiStripString[amend]+" rechits";
107  mehSiStripn[amend] = dbe->book1D(hcharname,hchartitle,20,0.,20.);
108  mehSiStripn[amend]->setAxisTitle("Number of hits in "+SiStripString[amend],1);
109  mehSiStripn[amend]->setAxisTitle("Count",2);
110  hcharname = "hSiStripResX_"+SiStripString[amend];
111  hchartitle= SiStripString[amend]+" rechit x resolution";
112  mehSiStripResX[amend] = dbe->book1D(hcharname,hchartitle,200,-0.02,.02);
113  mehSiStripResX[amend]->setAxisTitle("X-resolution in "+SiStripString[amend],1);
114  mehSiStripResX[amend]->setAxisTitle("Count",2);
115  hcharname = "hSiStripResY_"+SiStripString[amend];
116  hchartitle= SiStripString[amend]+" rechit y resolution";
117  mehSiStripResY[amend] = dbe->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 
123 //HCal
124 //string hcharname, hchartitle;
125 string HCalString[4]={"HB", "HE", "HF", "HO"};
126 float HCalnUpper[4]={3000.,3000.,3000.,2000.}; float HCalnLower[4]={2000.,2000.,2000.,1000.};
127 for(int j =0; j <4; ++j)
128 {
129  mehHcaln[j]=0;
130  mehHcalRes[j]=0;
131 }
132 
133 dbe->setCurrentFolder("GlobalRecHitsV/HCals");
134 for(int amend = 0; amend < 4; ++amend)
135 {
136  hcharname = "hHcaln_"+HCalString[amend];
137  hchartitle= HCalString[amend]+" rechits";
138  mehHcaln[amend] = dbe->book1D(hcharname,hchartitle, 500, HCalnLower[amend], HCalnUpper[amend]);
139  mehHcaln[amend]->setAxisTitle("Number of RecHits",1);
140  mehHcaln[amend]->setAxisTitle("Count",2);
141  hcharname = "hHcalRes_"+HCalString[amend];
142  hchartitle= HCalString[amend]+" rechit resolution";
143  mehHcalRes[amend] = dbe->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 {
159  mehEcaln[i]=0;
160  mehEcalRes[i]=0;
161 }
162 dbe->setCurrentFolder("GlobalRecHitsV/ECals");
163 
164 for(int amend = 0; amend < 3; ++amend)
165 {
166  hcharname = "hEcaln_"+ECalString[amend];
167  hchartitle= ECalString[amend]+" rechits";
168  mehEcaln[amend] = dbe->book1D(hcharname,hchartitle, ECalnBins[amend], ECalnLower[amend], ECalnUpper[amend]);
169  mehEcaln[amend]->setAxisTitle("Number of RecHits",1);
170  mehEcaln[amend]->setAxisTitle("Count",2);
171  hcharname = "hEcalRes_"+ECalString[amend];
172  hchartitle= ECalString[amend]+" rechit resolution";
173  mehEcalRes[amend] = dbe->book1D(hcharname,hchartitle,ECalResBins[amend], ECalResLower[amend], ECalResUpper[amend]);
174  mehEcalRes[amend]->setAxisTitle("RecHit E - SimHit E",1);
175  mehEcalRes[amend]->setAxisTitle("Count",2);
176 }
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 {
183  mehSiPixeln[j]=0;
184  mehSiPixelResX[j]=0;
185  mehSiPixelResY[j]=0;
186 }
187 
188 dbe->setCurrentFolder("GlobalRecHitsV/SiPixels");
189 for(int amend = 0; amend < 7; ++amend)
190 {
191  hcharname = "hSiPixeln_"+SiPixelString[amend];
192  hchartitle= SiPixelString[amend]+" rechits";
193  mehSiPixeln[amend] = dbe->book1D(hcharname,hchartitle,20,0.,20.);
194  mehSiPixeln[amend]->setAxisTitle("Number of hits in "+SiPixelString[amend],1);
195  mehSiPixeln[amend]->setAxisTitle("Count",2);
196  hcharname = "hSiPixelResX_"+SiPixelString[amend];
197  hchartitle= SiPixelString[amend]+" rechit x resolution";
198  mehSiPixelResX[amend] = dbe->book1D(hcharname,hchartitle,200,-0.02,.02);
199  mehSiPixelResX[amend]->setAxisTitle("X-resolution in "+SiPixelString[amend],1);
200  mehSiPixelResX[amend]->setAxisTitle("Count",2);
201  hcharname = "hSiPixelResY_"+SiPixelString[amend];
202  hchartitle= SiPixelString[amend]+" rechit y resolution";
203 
204  mehSiPixelResY[amend] = dbe->book1D(hcharname,hchartitle,200,-0.02,.02);
205  mehSiPixelResY[amend]->setAxisTitle("Y-resolution in "+SiPixelString[amend],1);
206  mehSiPixelResY[amend]->setAxisTitle("Count",2);
207 }
208 //Muons
209 dbe->setCurrentFolder("GlobalRecHitsV/Muons");
210 
211 mehDtMuonn = 0;
212 mehCSCn = 0;
213 mehRPCn = 0;
214 
215 //std::vector<MonitorElement *> me_List = {mehDtMuonn, mehCSCn, mehRPCn};
216 string n_List[3] = {"hDtMuonn", "hCSCn", "hRPCn"};
217 //float hist_prop[3] = [25., 0., 50.];
218 string hist_string[3] = {"Dt", "CSC", "RPC"};
219 
220 for(int amend=0; amend<3; ++amend)
221 {
222  hchartitle = hist_string[amend]+" rechits";
223  if(amend==0)
224  {
225  mehDtMuonn=dbe->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  {
231  mehCSCn=dbe->book1D(n_List[amend],hchartitle,25, 0., 50.);
232  mehCSCn->setAxisTitle("Number of Rechits",1);
233  mehCSCn->setAxisTitle("Count",2);
234  }
235 if(amend==2)
236  {
237  mehRPCn=dbe->book1D(n_List[amend],hchartitle,25, 0., 50.);
238  mehRPCn->setAxisTitle("Number of Rechits",1);
239  mehRPCn->setAxisTitle("Count",2);
240  }
241 }
242 
243 mehDtMuonRes=0;
245 mehRPCResX=0;
246 
247 hcharname= "hDtMuonRes";
248 hchartitle= "DT wire distance resolution";
249 mehDtMuonRes = dbe->book1D(hcharname, hchartitle, 200, -0.2, 0.2);
250 hcharname= "CSCResRDPhi";
251 hchartitle= "CSC perp*dphi resolution";
252 mehCSCResRDPhi = dbe->book1D(hcharname, hchartitle, 200, -0.2, 0.2);
253 hcharname = "hRPCResX";
254 hchartitle = "RPC rechits x resolution";
255 mehRPCResX = dbe->book1D(hcharname, hchartitle, 50, -5., 5.);
256 }
257 
258 }
259 
260 
262 {
263  if (doOutput)
264  if (outputfile.size() != 0 && dbe) dbe->save(outputfile);
265 }
266 
268 {
269  return;
270 }
271 
273 {
274  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_endJob";
275  if (verbosity >= 0)
276  edm::LogInfo(MsgLoggerCat)
277  << "Terminating having processed " << count << " events.";
278  return;
279 }
280 
282  const edm::EventSetup& iSetup)
283 {
284  std::string MsgLoggerCat = "GlobalRecHitsHistogrammer_analyze";
285 
286  // keep track of number of events processed
287  ++count;
288 
289  // get event id information
290  int nrun = iEvent.id().run();
291  int nevt = iEvent.id().event();
292 
293  if (verbosity > 0) {
294  edm::LogInfo(MsgLoggerCat)
295  << "Processing run " << nrun << ", event " << nevt
296  << " (" << count << " events total)";
297  } else if (verbosity == 0) {
298  if (nevt%frequency == 0 || nevt == 1) {
299  edm::LogInfo(MsgLoggerCat)
300  << "Processing run " << nrun << ", event " << nevt
301  << " (" << count << " events total)";
302  }
303  }
304 
305  // clear event holders
306  //clear(); Not in example I'm using, thus I comment it out.
307 
308  // look at information available in the event
309  if (getAllProvenances) {
310 
311  std::vector<const edm::Provenance*> AllProv;
312  iEvent.getAllProvenance(AllProv);
313 
314  if (verbosity >= 0)
315  edm::LogInfo(MsgLoggerCat)
316  << "Number of Provenances = " << AllProv.size();
317 
318  if (printProvenanceInfo && (verbosity >= 0)) {
319  TString eventout("\nProvenance info:\n");
320 
321  for (unsigned int i = 0; i < AllProv.size(); ++i) {
322  eventout += "\n ******************************";
323  eventout += "\n Module : ";
324  //eventout += (AllProv[i]->product).moduleLabel();
325  eventout += AllProv[i]->moduleLabel();
326  eventout += "\n ProductID : ";
327  //eventout += (AllProv[i]->product).productID_.id_;
328  eventout += AllProv[i]->productID().id();
329  eventout += "\n ClassName : ";
330  //eventout += (AllProv[i]->product).fullClassName_;
331  eventout += AllProv[i]->className();
332  eventout += "\n InstanceName : ";
333  //eventout += (AllProv[i]->product).productInstanceName_;
334  eventout += AllProv[i]->productInstanceName();
335  eventout += "\n BranchName : ";
336  //eventout += (AllProv[i]->product).branchName_;
337  eventout += AllProv[i]->branchName();
338  }
339  eventout += "\n ******************************\n";
340  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
341  printProvenanceInfo = false;
342  }
343  getAllProvenances = false;
344  }
345 
346 edm::Handle<PGlobalRecHit> srcGlobalRecHits;
347 // iEvent.getByLabel(GlobalRecHitSrc_,srcGlobalRecHits);
348  iEvent.getByToken(GlobalRecHitSrc_Token_,srcGlobalRecHits);
349  if (!srcGlobalRecHits.isValid()) {
350  edm::LogWarning(MsgLoggerCat)
351  << "Unable to find PGlobalRecHit in event!";
352  return;
353  }
354 
355  int nEBCalRecHits = srcGlobalRecHits->getnEBCalRecHits();
356  int nEECalRecHits = srcGlobalRecHits->getnEECalRecHits();
357  int nESCalRecHits = srcGlobalRecHits->getnESCalRecHits();
358 
359  int nHBCalRecHits = srcGlobalRecHits->getnHBCalRecHits();
360  int nHECalRecHits = srcGlobalRecHits->getnHECalRecHits();
361  int nHOCalRecHits = srcGlobalRecHits->getnHOCalRecHits();
362  int nHFCalRecHits = srcGlobalRecHits->getnHFCalRecHits();
363 
364  int nTIBL1RecHits = srcGlobalRecHits->getnTIBL1RecHits();
365  int nTIBL2RecHits = srcGlobalRecHits->getnTIBL2RecHits();
366  int nTIBL3RecHits = srcGlobalRecHits->getnTIBL3RecHits();
367  int nTIBL4RecHits = srcGlobalRecHits->getnTIBL4RecHits();
368  int nTOBL1RecHits = srcGlobalRecHits->getnTOBL1RecHits();
369  int nTOBL2RecHits = srcGlobalRecHits->getnTOBL2RecHits();
370  int nTOBL3RecHits = srcGlobalRecHits->getnTOBL3RecHits();
371  int nTOBL4RecHits = srcGlobalRecHits->getnTOBL4RecHits();
372  int nTIDW1RecHits = srcGlobalRecHits->getnTIDW1RecHits();
373  int nTIDW2RecHits = srcGlobalRecHits->getnTIDW2RecHits();
374  int nTIDW3RecHits = srcGlobalRecHits->getnTIDW3RecHits();
375  int nTECW1RecHits = srcGlobalRecHits->getnTECW1RecHits();
376  int nTECW2RecHits = srcGlobalRecHits->getnTECW2RecHits();
377  int nTECW3RecHits = srcGlobalRecHits->getnTECW3RecHits();
378  int nTECW4RecHits = srcGlobalRecHits->getnTECW4RecHits();
379  int nTECW5RecHits = srcGlobalRecHits->getnTECW5RecHits();
380  int nTECW6RecHits = srcGlobalRecHits->getnTECW6RecHits();
381  int nTECW7RecHits = srcGlobalRecHits->getnTECW7RecHits();
382  int nTECW8RecHits = srcGlobalRecHits->getnTECW8RecHits();
383 
384  int nBRL1RecHits = srcGlobalRecHits->getnBRL1RecHits();
385  int nBRL2RecHits = srcGlobalRecHits->getnBRL2RecHits();
386  int nBRL3RecHits = srcGlobalRecHits->getnBRL3RecHits();
387  int nFWD1nRecHits = srcGlobalRecHits->getnFWD1nRecHits();
388  int nFWD1pRecHits = srcGlobalRecHits->getnFWD1pRecHits();
389  int nFWD2nRecHits = srcGlobalRecHits->getnFWD2nRecHits();
390  int nFWD2pRecHits = srcGlobalRecHits->getnFWD2pRecHits();
391 
392  int nDTRecHits = srcGlobalRecHits->getnDTRecHits();
393 
394  int nCSCRecHits = srcGlobalRecHits->getnCSCRecHits();
395 
396  int nRPCRecHits = srcGlobalRecHits->getnRPCRecHits();
397 
398  // get Ecal info
399  std::vector<PGlobalRecHit::ECalRecHit> EECalRecHits =
400  srcGlobalRecHits->getEECalRecHits();
401  mehEcaln[0]->Fill((float)nEECalRecHits);
402  for (unsigned int i = 0; i < EECalRecHits.size(); ++i) {
403  mehEcalRes[0]->Fill(EECalRecHits[i].RE - EECalRecHits[i].SHE);
404  }
405 
406  std::vector<PGlobalRecHit::ECalRecHit> EBCalRecHits =
407  srcGlobalRecHits->getEBCalRecHits();
408  mehEcaln[1]->Fill((float)nEBCalRecHits);
409  for (unsigned int i = 0; i < EBCalRecHits.size(); ++i) {
410  mehEcalRes[1]->Fill(EBCalRecHits[i].RE - EBCalRecHits[i].SHE);
411  }
412 
413  std::vector<PGlobalRecHit::ECalRecHit> ESCalRecHits =
414  srcGlobalRecHits->getESCalRecHits();
415  mehEcaln[2]->Fill((float)nESCalRecHits);
416  for (unsigned int i = 0; i < ESCalRecHits.size(); ++i) {
417  mehEcalRes[2]->Fill(ESCalRecHits[i].RE - ESCalRecHits[i].SHE);
418  }
419 
420  // Get HCal info
421  std::vector<PGlobalRecHit::HCalRecHit> HBCalRecHits =
422  srcGlobalRecHits->getHBCalRecHits();
423  mehHcaln[0]->Fill((float)nHBCalRecHits);
424  for (unsigned int i = 0; i < HBCalRecHits.size(); ++i) {
425  mehHcalRes[0]->Fill(HBCalRecHits[i].REC - HBCalRecHits[i].SHE);
426  }
427 
428  std::vector<PGlobalRecHit::HCalRecHit> HECalRecHits =
429  srcGlobalRecHits->getHECalRecHits();
430  mehHcaln[1]->Fill((float)nHECalRecHits);
431  for (unsigned int i = 0; i < HECalRecHits.size(); ++i) {
432  mehHcalRes[1]->Fill(HECalRecHits[i].REC - HECalRecHits[i].SHE);
433  }
434 
435  std::vector<PGlobalRecHit::HCalRecHit> HOCalRecHits =
436  srcGlobalRecHits->getHOCalRecHits();
437  mehHcaln[2]->Fill((float)nHOCalRecHits);
438  for (unsigned int i = 0; i < HOCalRecHits.size(); ++i) {
439  mehHcalRes[2]->Fill(HOCalRecHits[i].REC - HOCalRecHits[i].SHE);
440  }
441 
442  std::vector<PGlobalRecHit::HCalRecHit> HFCalRecHits =
443  srcGlobalRecHits->getHFCalRecHits();
444  mehHcaln[3]->Fill((float)nHFCalRecHits);
445  for (unsigned int i = 0; i < HFCalRecHits.size(); ++i) {
446  mehHcalRes[3]->Fill(HFCalRecHits[i].REC - HFCalRecHits[i].SHE);
447  }
448 
449  // get SiStrip info
450  std::vector<PGlobalRecHit::SiStripRecHit> TIBL1RecHits =
451  srcGlobalRecHits->getTIBL1RecHits();
452  mehSiStripn[0]->Fill((float)nTIBL1RecHits);
453  for (unsigned int i = 0; i < TIBL1RecHits.size(); ++i) {
454  mehSiStripResX[0]->Fill(TIBL1RecHits[i].RX - TIBL1RecHits[i].SX);
455  mehSiStripResY[0]->Fill(TIBL1RecHits[i].RY - TIBL1RecHits[i].SY);
456  }
457 
458  std::vector<PGlobalRecHit::SiStripRecHit> TIBL2RecHits =
459  srcGlobalRecHits->getTIBL2RecHits();
460  mehSiStripn[1]->Fill((float)nTIBL2RecHits);
461  for (unsigned int i = 0; i < TIBL2RecHits.size(); ++i) {
462  mehSiStripResX[1]->Fill(TIBL2RecHits[i].RX - TIBL2RecHits[i].SX);
463  mehSiStripResY[1]->Fill(TIBL2RecHits[i].RY - TIBL2RecHits[i].SY);
464  }
465 
466  std::vector<PGlobalRecHit::SiStripRecHit> TIBL3RecHits =
467  srcGlobalRecHits->getTIBL3RecHits();
468  mehSiStripn[2]->Fill((float)nTIBL3RecHits);
469  for (unsigned int i = 0; i < TIBL3RecHits.size(); ++i) {
470  mehSiStripResX[2]->Fill(TIBL3RecHits[i].RX - TIBL3RecHits[i].SX);
471  mehSiStripResY[2]->Fill(TIBL3RecHits[i].RY - TIBL3RecHits[i].SY);
472  }
473 
474  std::vector<PGlobalRecHit::SiStripRecHit> TIBL4RecHits =
475  srcGlobalRecHits->getTIBL4RecHits();
476  mehSiStripn[3]->Fill((float)nTIBL4RecHits);
477  for (unsigned int i = 0; i < TIBL4RecHits.size(); ++i) {
478  mehSiStripResX[3]->Fill(TIBL4RecHits[i].RX - TIBL4RecHits[i].SX);
479  mehSiStripResY[3]->Fill(TIBL4RecHits[i].RY - TIBL4RecHits[i].SY);
480  }
481 
482  std::vector<PGlobalRecHit::SiStripRecHit> TOBL1RecHits =
483  srcGlobalRecHits->getTOBL1RecHits();
484  mehSiStripn[4]->Fill((float)nTOBL1RecHits);
485  for (unsigned int i = 0; i < TOBL1RecHits.size(); ++i) {
486  mehSiStripResX[4]->Fill(TOBL1RecHits[i].RX - TOBL1RecHits[i].SX);
487  mehSiStripResY[4]->Fill(TOBL1RecHits[i].RY - TOBL1RecHits[i].SY);
488  }
489 
490  std::vector<PGlobalRecHit::SiStripRecHit> TOBL2RecHits =
491  srcGlobalRecHits->getTOBL2RecHits();
492  mehSiStripn[5]->Fill((float)nTOBL2RecHits);
493  for (unsigned int i = 0; i < TOBL2RecHits.size(); ++i) {
494  mehSiStripResX[5]->Fill(TOBL2RecHits[i].RX - TOBL2RecHits[i].SX);
495  mehSiStripResY[5]->Fill(TOBL2RecHits[i].RY - TOBL2RecHits[i].SY);
496  }
497 
498  std::vector<PGlobalRecHit::SiStripRecHit> TOBL3RecHits =
499  srcGlobalRecHits->getTOBL3RecHits();
500  mehSiStripn[6]->Fill((float)nTOBL3RecHits);
501  for (unsigned int i = 0; i < TOBL3RecHits.size(); ++i) {
502  mehSiStripResX[6]->Fill(TOBL3RecHits[i].RX - TOBL3RecHits[i].SX);
503  mehSiStripResY[6]->Fill(TOBL3RecHits[i].RY - TOBL3RecHits[i].SY);
504  }
505 
506  std::vector<PGlobalRecHit::SiStripRecHit> TOBL4RecHits =
507  srcGlobalRecHits->getTOBL4RecHits();
508  mehSiStripn[7]->Fill((float)nTOBL4RecHits);
509  for (unsigned int i = 0; i < TOBL4RecHits.size(); ++i) {
510  mehSiStripResX[7]->Fill(TOBL4RecHits[i].RX - TOBL4RecHits[i].SX);
511  mehSiStripResY[7]->Fill(TOBL4RecHits[i].RY - TOBL4RecHits[i].SY);
512  }
513 
514  std::vector<PGlobalRecHit::SiStripRecHit> TIDW1RecHits =
515  srcGlobalRecHits->getTIDW1RecHits();
516  mehSiStripn[8]->Fill((float)nTIDW1RecHits);
517  for (unsigned int i = 0; i < TIDW1RecHits.size(); ++i) {
518  mehSiStripResX[8]->Fill(TIDW1RecHits[i].RX - TIDW1RecHits[i].SX);
519  mehSiStripResY[8]->Fill(TIDW1RecHits[i].RY - TIDW1RecHits[i].SY);
520  }
521 
522  std::vector<PGlobalRecHit::SiStripRecHit> TIDW2RecHits =
523  srcGlobalRecHits->getTIDW2RecHits();
524  mehSiStripn[9]->Fill((float)nTIDW2RecHits);
525  for (unsigned int i = 0; i < TIDW2RecHits.size(); ++i) {
526  mehSiStripResX[9]->Fill(TIDW2RecHits[i].RX - TIDW2RecHits[i].SX);
527  mehSiStripResY[9]->Fill(TIDW2RecHits[i].RY - TIDW2RecHits[i].SY);
528  }
529 
530  std::vector<PGlobalRecHit::SiStripRecHit> TIDW3RecHits =
531  srcGlobalRecHits->getTIDW3RecHits();
532  mehSiStripn[10]->Fill((float)nTIDW3RecHits);
533  for (unsigned int i = 0; i < TIDW3RecHits.size(); ++i) {
534  mehSiStripResX[10]->Fill(TIDW3RecHits[i].RX - TIDW3RecHits[i].SX);
535  mehSiStripResY[10]->Fill(TIDW3RecHits[i].RY - TIDW3RecHits[i].SY);
536  }
537 
538  std::vector<PGlobalRecHit::SiStripRecHit> TECW1RecHits =
539  srcGlobalRecHits->getTECW1RecHits();
540  mehSiStripn[11]->Fill((float)nTECW1RecHits);
541  for (unsigned int i = 0; i < TECW1RecHits.size(); ++i) {
542  mehSiStripResX[11]->Fill(TECW1RecHits[i].RX - TECW1RecHits[i].SX);
543  mehSiStripResY[11]->Fill(TECW1RecHits[i].RY - TECW1RecHits[i].SY);
544  }
545 
546  std::vector<PGlobalRecHit::SiStripRecHit> TECW2RecHits =
547  srcGlobalRecHits->getTECW2RecHits();
548  mehSiStripn[12]->Fill((float)nTECW2RecHits);
549  for (unsigned int i = 0; i < TECW2RecHits.size(); ++i) {
550  mehSiStripResX[12]->Fill(TECW2RecHits[i].RX - TECW2RecHits[i].SX);
551  mehSiStripResY[12]->Fill(TECW2RecHits[i].RY - TECW2RecHits[i].SY);
552  }
553 
554  std::vector<PGlobalRecHit::SiStripRecHit> TECW3RecHits =
555  srcGlobalRecHits->getTECW3RecHits();
556  mehSiStripn[13]->Fill((float)nTECW3RecHits);
557  for (unsigned int i = 0; i < TECW3RecHits.size(); ++i) {
558  mehSiStripResX[13]->Fill(TECW3RecHits[i].RX - TECW3RecHits[i].SX);
559  mehSiStripResY[13]->Fill(TECW3RecHits[i].RY - TECW3RecHits[i].SY);
560  }
561 
562  std::vector<PGlobalRecHit::SiStripRecHit> TECW4RecHits =
563  srcGlobalRecHits->getTECW4RecHits();
564  mehSiStripn[14]->Fill((float)nTECW4RecHits);
565  for (unsigned int i = 0; i < TECW4RecHits.size(); ++i) {
566  mehSiStripResX[14]->Fill(TECW4RecHits[i].RX - TECW4RecHits[i].SX);
567  mehSiStripResY[14]->Fill(TECW4RecHits[i].RY - TECW4RecHits[i].SY);
568  }
569 
570  std::vector<PGlobalRecHit::SiStripRecHit> TECW5RecHits =
571  srcGlobalRecHits->getTECW5RecHits();
572  mehSiStripn[15]->Fill((float)nTECW5RecHits);
573  for (unsigned int i = 0; i < TECW5RecHits.size(); ++i) {
574  mehSiStripResX[15]->Fill(TECW5RecHits[i].RX - TECW5RecHits[i].SX);
575  mehSiStripResY[15]->Fill(TECW5RecHits[i].RY - TECW5RecHits[i].SY);
576  }
577 
578  std::vector<PGlobalRecHit::SiStripRecHit> TECW6RecHits =
579  srcGlobalRecHits->getTECW6RecHits();
580  mehSiStripn[16]->Fill((float)nTECW6RecHits);
581  for (unsigned int i = 0; i < TECW6RecHits.size(); ++i) {
582  mehSiStripResX[16]->Fill(TECW6RecHits[i].RX - TECW6RecHits[i].SX);
583  mehSiStripResY[16]->Fill(TECW6RecHits[i].RY - TECW6RecHits[i].SY);
584  }
585 
586  std::vector<PGlobalRecHit::SiStripRecHit> TECW7RecHits =
587  srcGlobalRecHits->getTECW7RecHits();
588  mehSiStripn[17]->Fill((float)nTECW7RecHits);
589  for (unsigned int i = 0; i < TECW7RecHits.size(); ++i) {
590  mehSiStripResX[17]->Fill(TECW7RecHits[i].RX - TECW7RecHits[i].SX);
591  mehSiStripResY[17]->Fill(TECW7RecHits[i].RY - TECW7RecHits[i].SY);
592  }
593 
594  std::vector<PGlobalRecHit::SiStripRecHit> TECW8RecHits =
595  srcGlobalRecHits->getTECW8RecHits();
596  mehSiStripn[18]->Fill((float)nTECW8RecHits);
597  for (unsigned int i = 0; i < TECW8RecHits.size(); ++i) {
598  mehSiStripResX[18]->Fill(TECW8RecHits[i].RX - TECW8RecHits[i].SX);
599  mehSiStripResY[18]->Fill(TECW8RecHits[i].RY - TECW8RecHits[i].SY);
600  }
601 
602  // get SiPixel info
603  std::vector<PGlobalRecHit::SiPixelRecHit> BRL1RecHits =
604  srcGlobalRecHits->getBRL1RecHits();
605  mehSiPixeln[0]->Fill((float)nBRL1RecHits);
606  for (unsigned int i = 0; i < BRL1RecHits.size(); ++i) {
607  mehSiPixelResX[0]->Fill(BRL1RecHits[i].RX - BRL1RecHits[i].SX);
608  mehSiPixelResY[0]->Fill(BRL1RecHits[i].RY - BRL1RecHits[i].SY);
609  }
610 
611  std::vector<PGlobalRecHit::SiPixelRecHit> BRL2RecHits =
612  srcGlobalRecHits->getBRL2RecHits();
613  mehSiPixeln[1]->Fill((float)nBRL2RecHits);
614  for (unsigned int i = 0; i < BRL2RecHits.size(); ++i) {
615  mehSiPixelResX[1]->Fill(BRL2RecHits[i].RX - BRL2RecHits[i].SX);
616  mehSiPixelResY[1]->Fill(BRL2RecHits[i].RY - BRL2RecHits[i].SY);
617  }
618 
619  std::vector<PGlobalRecHit::SiPixelRecHit> BRL3RecHits =
620  srcGlobalRecHits->getBRL3RecHits();
621  mehSiPixeln[2]->Fill((float)nBRL3RecHits);
622  for (unsigned int i = 0; i < BRL3RecHits.size(); ++i) {
623  mehSiPixelResX[2]->Fill(BRL3RecHits[i].RX - BRL3RecHits[i].SX);
624  mehSiPixelResY[2]->Fill(BRL3RecHits[i].RY - BRL3RecHits[i].SY);
625  }
626 
627  std::vector<PGlobalRecHit::SiPixelRecHit> FWD1pRecHits =
628  srcGlobalRecHits->getFWD1pRecHits();
629  mehSiPixeln[3]->Fill((float)nFWD1pRecHits);
630  for (unsigned int i = 0; i < FWD1pRecHits.size(); ++i) {
631  mehSiPixelResX[3]->Fill(FWD1pRecHits[i].RX - FWD1pRecHits[i].SX);
632  mehSiPixelResY[3]->Fill(FWD1pRecHits[i].RY - FWD1pRecHits[i].SY);
633  }
634 
635  std::vector<PGlobalRecHit::SiPixelRecHit> FWD1nRecHits =
636  srcGlobalRecHits->getFWD1nRecHits();
637  mehSiPixeln[4]->Fill((float)nFWD1nRecHits);
638  for (unsigned int i = 0; i < FWD1nRecHits.size(); ++i) {
639  mehSiPixelResX[4]->Fill(FWD1nRecHits[i].RX - FWD1nRecHits[i].SX);
640  mehSiPixelResY[4]->Fill(FWD1nRecHits[i].RY - FWD1nRecHits[i].SY);
641  }
642 
643  std::vector<PGlobalRecHit::SiPixelRecHit> FWD2pRecHits =
644  srcGlobalRecHits->getFWD2pRecHits();
645  mehSiPixeln[5]->Fill((float)nFWD2pRecHits);
646  for (unsigned int i = 0; i < FWD2pRecHits.size(); ++i) {
647  mehSiPixelResX[5]->Fill(FWD2pRecHits[i].RX - FWD2pRecHits[i].SX);
648  mehSiPixelResY[5]->Fill(FWD2pRecHits[i].RY - FWD2pRecHits[i].SY);
649  }
650 
651  std::vector<PGlobalRecHit::SiPixelRecHit> FWD2nRecHits =
652  srcGlobalRecHits->getFWD2nRecHits();
653  mehSiPixeln[6]->Fill((float)nFWD2nRecHits);
654  for (unsigned int i = 0; i < FWD2nRecHits.size(); ++i) {
655  mehSiPixelResX[6]->Fill(FWD2nRecHits[i].RX - FWD2nRecHits[i].SX);
656  mehSiPixelResY[6]->Fill(FWD2nRecHits[i].RY - FWD2nRecHits[i].SY);
657  }
658 
659  // get DtMuon info
660  std::vector<PGlobalRecHit::DTRecHit> DTRecHits =
661  srcGlobalRecHits->getDTRecHits();
662  mehDtMuonn->Fill((float)nDTRecHits);
663  for (unsigned int i = 0; i < DTRecHits.size(); ++i) {
664  mehDtMuonRes->Fill(DTRecHits[i].RHD - DTRecHits[i].SHD);
665  }
666 
667  // get CSC info
668  std::vector<PGlobalRecHit::CSCRecHit> CSCRecHits =
669  srcGlobalRecHits->getCSCRecHits();
670  mehCSCn->Fill((float)nCSCRecHits);
671  for (unsigned int i = 0; i < CSCRecHits.size(); ++i) {
672  mehCSCResRDPhi->Fill(CSCRecHits[i].RHPERP *
673  (CSCRecHits[i].RHPHI - CSCRecHits[i].SHPHI));
674  }
675 
676  // get RPC info
677  std::vector<PGlobalRecHit::RPCRecHit> RPCRecHits =
678  srcGlobalRecHits->getRPCRecHits();
679  mehRPCn->Fill((float)nRPCRecHits);
680  for (unsigned int i = 0; i < RPCRecHits.size(); ++i) {
681  mehRPCResX->Fill(RPCRecHits[i].RHX - RPCRecHits[i].SHX);
682  }
683 
684  if (verbosity > 0)
685  edm::LogInfo (MsgLoggerCat)
686  << "Done gathering data from event.";
687 
688 }
689 
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:86
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< PGlobalRecHit > GlobalRecHitSrc_Token_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:243
int j
Definition: DBlmapReader.cc:9
GlobalRecHitsHistogrammer(const edm::ParameterSet &)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2297
void setVerbose(unsigned level)
Definition: DQMStore.cc:549
bool isValid() const
Definition: HandleBase.h:76
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EventID id() const
Definition: EventBase.h:56
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
Definition: DQMStore.cc:2962
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585