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.getByToken(GlobalRecHitSrc_Token_,srcGlobalRecHits);
348  if (!srcGlobalRecHits.isValid()) {
349  edm::LogWarning(MsgLoggerCat)
350  << "Unable to find PGlobalRecHit in event!";
351  return;
352  }
353 
354  int nEBCalRecHits = srcGlobalRecHits->getnEBCalRecHits();
355  int nEECalRecHits = srcGlobalRecHits->getnEECalRecHits();
356  int nESCalRecHits = srcGlobalRecHits->getnESCalRecHits();
357 
358  int nHBCalRecHits = srcGlobalRecHits->getnHBCalRecHits();
359  int nHECalRecHits = srcGlobalRecHits->getnHECalRecHits();
360  int nHOCalRecHits = srcGlobalRecHits->getnHOCalRecHits();
361  int nHFCalRecHits = srcGlobalRecHits->getnHFCalRecHits();
362 
363  int nTIBL1RecHits = srcGlobalRecHits->getnTIBL1RecHits();
364  int nTIBL2RecHits = srcGlobalRecHits->getnTIBL2RecHits();
365  int nTIBL3RecHits = srcGlobalRecHits->getnTIBL3RecHits();
366  int nTIBL4RecHits = srcGlobalRecHits->getnTIBL4RecHits();
367  int nTOBL1RecHits = srcGlobalRecHits->getnTOBL1RecHits();
368  int nTOBL2RecHits = srcGlobalRecHits->getnTOBL2RecHits();
369  int nTOBL3RecHits = srcGlobalRecHits->getnTOBL3RecHits();
370  int nTOBL4RecHits = srcGlobalRecHits->getnTOBL4RecHits();
371  int nTIDW1RecHits = srcGlobalRecHits->getnTIDW1RecHits();
372  int nTIDW2RecHits = srcGlobalRecHits->getnTIDW2RecHits();
373  int nTIDW3RecHits = srcGlobalRecHits->getnTIDW3RecHits();
374  int nTECW1RecHits = srcGlobalRecHits->getnTECW1RecHits();
375  int nTECW2RecHits = srcGlobalRecHits->getnTECW2RecHits();
376  int nTECW3RecHits = srcGlobalRecHits->getnTECW3RecHits();
377  int nTECW4RecHits = srcGlobalRecHits->getnTECW4RecHits();
378  int nTECW5RecHits = srcGlobalRecHits->getnTECW5RecHits();
379  int nTECW6RecHits = srcGlobalRecHits->getnTECW6RecHits();
380  int nTECW7RecHits = srcGlobalRecHits->getnTECW7RecHits();
381  int nTECW8RecHits = srcGlobalRecHits->getnTECW8RecHits();
382 
383  int nBRL1RecHits = srcGlobalRecHits->getnBRL1RecHits();
384  int nBRL2RecHits = srcGlobalRecHits->getnBRL2RecHits();
385  int nBRL3RecHits = srcGlobalRecHits->getnBRL3RecHits();
386  int nFWD1nRecHits = srcGlobalRecHits->getnFWD1nRecHits();
387  int nFWD1pRecHits = srcGlobalRecHits->getnFWD1pRecHits();
388  int nFWD2nRecHits = srcGlobalRecHits->getnFWD2nRecHits();
389  int nFWD2pRecHits = srcGlobalRecHits->getnFWD2pRecHits();
390 
391  int nDTRecHits = srcGlobalRecHits->getnDTRecHits();
392 
393  int nCSCRecHits = srcGlobalRecHits->getnCSCRecHits();
394 
395  int nRPCRecHits = srcGlobalRecHits->getnRPCRecHits();
396 
397  // get Ecal info
398  std::vector<PGlobalRecHit::ECalRecHit> EECalRecHits =
399  srcGlobalRecHits->getEECalRecHits();
400  mehEcaln[0]->Fill((float)nEECalRecHits);
401  for (unsigned int i = 0; i < EECalRecHits.size(); ++i) {
402  mehEcalRes[0]->Fill(EECalRecHits[i].RE - EECalRecHits[i].SHE);
403  }
404 
405  std::vector<PGlobalRecHit::ECalRecHit> EBCalRecHits =
406  srcGlobalRecHits->getEBCalRecHits();
407  mehEcaln[1]->Fill((float)nEBCalRecHits);
408  for (unsigned int i = 0; i < EBCalRecHits.size(); ++i) {
409  mehEcalRes[1]->Fill(EBCalRecHits[i].RE - EBCalRecHits[i].SHE);
410  }
411 
412  std::vector<PGlobalRecHit::ECalRecHit> ESCalRecHits =
413  srcGlobalRecHits->getESCalRecHits();
414  mehEcaln[2]->Fill((float)nESCalRecHits);
415  for (unsigned int i = 0; i < ESCalRecHits.size(); ++i) {
416  mehEcalRes[2]->Fill(ESCalRecHits[i].RE - ESCalRecHits[i].SHE);
417  }
418 
419  // Get HCal info
420  std::vector<PGlobalRecHit::HCalRecHit> HBCalRecHits =
421  srcGlobalRecHits->getHBCalRecHits();
422  mehHcaln[0]->Fill((float)nHBCalRecHits);
423  for (unsigned int i = 0; i < HBCalRecHits.size(); ++i) {
424  mehHcalRes[0]->Fill(HBCalRecHits[i].REC - HBCalRecHits[i].SHE);
425  }
426 
427  std::vector<PGlobalRecHit::HCalRecHit> HECalRecHits =
428  srcGlobalRecHits->getHECalRecHits();
429  mehHcaln[1]->Fill((float)nHECalRecHits);
430  for (unsigned int i = 0; i < HECalRecHits.size(); ++i) {
431  mehHcalRes[1]->Fill(HECalRecHits[i].REC - HECalRecHits[i].SHE);
432  }
433 
434  std::vector<PGlobalRecHit::HCalRecHit> HOCalRecHits =
435  srcGlobalRecHits->getHOCalRecHits();
436  mehHcaln[2]->Fill((float)nHOCalRecHits);
437  for (unsigned int i = 0; i < HOCalRecHits.size(); ++i) {
438  mehHcalRes[2]->Fill(HOCalRecHits[i].REC - HOCalRecHits[i].SHE);
439  }
440 
441  std::vector<PGlobalRecHit::HCalRecHit> HFCalRecHits =
442  srcGlobalRecHits->getHFCalRecHits();
443  mehHcaln[3]->Fill((float)nHFCalRecHits);
444  for (unsigned int i = 0; i < HFCalRecHits.size(); ++i) {
445  mehHcalRes[3]->Fill(HFCalRecHits[i].REC - HFCalRecHits[i].SHE);
446  }
447 
448  // get SiStrip info
449  std::vector<PGlobalRecHit::SiStripRecHit> TIBL1RecHits =
450  srcGlobalRecHits->getTIBL1RecHits();
451  mehSiStripn[0]->Fill((float)nTIBL1RecHits);
452  for (unsigned int i = 0; i < TIBL1RecHits.size(); ++i) {
453  mehSiStripResX[0]->Fill(TIBL1RecHits[i].RX - TIBL1RecHits[i].SX);
454  mehSiStripResY[0]->Fill(TIBL1RecHits[i].RY - TIBL1RecHits[i].SY);
455  }
456 
457  std::vector<PGlobalRecHit::SiStripRecHit> TIBL2RecHits =
458  srcGlobalRecHits->getTIBL2RecHits();
459  mehSiStripn[1]->Fill((float)nTIBL2RecHits);
460  for (unsigned int i = 0; i < TIBL2RecHits.size(); ++i) {
461  mehSiStripResX[1]->Fill(TIBL2RecHits[i].RX - TIBL2RecHits[i].SX);
462  mehSiStripResY[1]->Fill(TIBL2RecHits[i].RY - TIBL2RecHits[i].SY);
463  }
464 
465  std::vector<PGlobalRecHit::SiStripRecHit> TIBL3RecHits =
466  srcGlobalRecHits->getTIBL3RecHits();
467  mehSiStripn[2]->Fill((float)nTIBL3RecHits);
468  for (unsigned int i = 0; i < TIBL3RecHits.size(); ++i) {
469  mehSiStripResX[2]->Fill(TIBL3RecHits[i].RX - TIBL3RecHits[i].SX);
470  mehSiStripResY[2]->Fill(TIBL3RecHits[i].RY - TIBL3RecHits[i].SY);
471  }
472 
473  std::vector<PGlobalRecHit::SiStripRecHit> TIBL4RecHits =
474  srcGlobalRecHits->getTIBL4RecHits();
475  mehSiStripn[3]->Fill((float)nTIBL4RecHits);
476  for (unsigned int i = 0; i < TIBL4RecHits.size(); ++i) {
477  mehSiStripResX[3]->Fill(TIBL4RecHits[i].RX - TIBL4RecHits[i].SX);
478  mehSiStripResY[3]->Fill(TIBL4RecHits[i].RY - TIBL4RecHits[i].SY);
479  }
480 
481  std::vector<PGlobalRecHit::SiStripRecHit> TOBL1RecHits =
482  srcGlobalRecHits->getTOBL1RecHits();
483  mehSiStripn[4]->Fill((float)nTOBL1RecHits);
484  for (unsigned int i = 0; i < TOBL1RecHits.size(); ++i) {
485  mehSiStripResX[4]->Fill(TOBL1RecHits[i].RX - TOBL1RecHits[i].SX);
486  mehSiStripResY[4]->Fill(TOBL1RecHits[i].RY - TOBL1RecHits[i].SY);
487  }
488 
489  std::vector<PGlobalRecHit::SiStripRecHit> TOBL2RecHits =
490  srcGlobalRecHits->getTOBL2RecHits();
491  mehSiStripn[5]->Fill((float)nTOBL2RecHits);
492  for (unsigned int i = 0; i < TOBL2RecHits.size(); ++i) {
493  mehSiStripResX[5]->Fill(TOBL2RecHits[i].RX - TOBL2RecHits[i].SX);
494  mehSiStripResY[5]->Fill(TOBL2RecHits[i].RY - TOBL2RecHits[i].SY);
495  }
496 
497  std::vector<PGlobalRecHit::SiStripRecHit> TOBL3RecHits =
498  srcGlobalRecHits->getTOBL3RecHits();
499  mehSiStripn[6]->Fill((float)nTOBL3RecHits);
500  for (unsigned int i = 0; i < TOBL3RecHits.size(); ++i) {
501  mehSiStripResX[6]->Fill(TOBL3RecHits[i].RX - TOBL3RecHits[i].SX);
502  mehSiStripResY[6]->Fill(TOBL3RecHits[i].RY - TOBL3RecHits[i].SY);
503  }
504 
505  std::vector<PGlobalRecHit::SiStripRecHit> TOBL4RecHits =
506  srcGlobalRecHits->getTOBL4RecHits();
507  mehSiStripn[7]->Fill((float)nTOBL4RecHits);
508  for (unsigned int i = 0; i < TOBL4RecHits.size(); ++i) {
509  mehSiStripResX[7]->Fill(TOBL4RecHits[i].RX - TOBL4RecHits[i].SX);
510  mehSiStripResY[7]->Fill(TOBL4RecHits[i].RY - TOBL4RecHits[i].SY);
511  }
512 
513  std::vector<PGlobalRecHit::SiStripRecHit> TIDW1RecHits =
514  srcGlobalRecHits->getTIDW1RecHits();
515  mehSiStripn[8]->Fill((float)nTIDW1RecHits);
516  for (unsigned int i = 0; i < TIDW1RecHits.size(); ++i) {
517  mehSiStripResX[8]->Fill(TIDW1RecHits[i].RX - TIDW1RecHits[i].SX);
518  mehSiStripResY[8]->Fill(TIDW1RecHits[i].RY - TIDW1RecHits[i].SY);
519  }
520 
521  std::vector<PGlobalRecHit::SiStripRecHit> TIDW2RecHits =
522  srcGlobalRecHits->getTIDW2RecHits();
523  mehSiStripn[9]->Fill((float)nTIDW2RecHits);
524  for (unsigned int i = 0; i < TIDW2RecHits.size(); ++i) {
525  mehSiStripResX[9]->Fill(TIDW2RecHits[i].RX - TIDW2RecHits[i].SX);
526  mehSiStripResY[9]->Fill(TIDW2RecHits[i].RY - TIDW2RecHits[i].SY);
527  }
528 
529  std::vector<PGlobalRecHit::SiStripRecHit> TIDW3RecHits =
530  srcGlobalRecHits->getTIDW3RecHits();
531  mehSiStripn[10]->Fill((float)nTIDW3RecHits);
532  for (unsigned int i = 0; i < TIDW3RecHits.size(); ++i) {
533  mehSiStripResX[10]->Fill(TIDW3RecHits[i].RX - TIDW3RecHits[i].SX);
534  mehSiStripResY[10]->Fill(TIDW3RecHits[i].RY - TIDW3RecHits[i].SY);
535  }
536 
537  std::vector<PGlobalRecHit::SiStripRecHit> TECW1RecHits =
538  srcGlobalRecHits->getTECW1RecHits();
539  mehSiStripn[11]->Fill((float)nTECW1RecHits);
540  for (unsigned int i = 0; i < TECW1RecHits.size(); ++i) {
541  mehSiStripResX[11]->Fill(TECW1RecHits[i].RX - TECW1RecHits[i].SX);
542  mehSiStripResY[11]->Fill(TECW1RecHits[i].RY - TECW1RecHits[i].SY);
543  }
544 
545  std::vector<PGlobalRecHit::SiStripRecHit> TECW2RecHits =
546  srcGlobalRecHits->getTECW2RecHits();
547  mehSiStripn[12]->Fill((float)nTECW2RecHits);
548  for (unsigned int i = 0; i < TECW2RecHits.size(); ++i) {
549  mehSiStripResX[12]->Fill(TECW2RecHits[i].RX - TECW2RecHits[i].SX);
550  mehSiStripResY[12]->Fill(TECW2RecHits[i].RY - TECW2RecHits[i].SY);
551  }
552 
553  std::vector<PGlobalRecHit::SiStripRecHit> TECW3RecHits =
554  srcGlobalRecHits->getTECW3RecHits();
555  mehSiStripn[13]->Fill((float)nTECW3RecHits);
556  for (unsigned int i = 0; i < TECW3RecHits.size(); ++i) {
557  mehSiStripResX[13]->Fill(TECW3RecHits[i].RX - TECW3RecHits[i].SX);
558  mehSiStripResY[13]->Fill(TECW3RecHits[i].RY - TECW3RecHits[i].SY);
559  }
560 
561  std::vector<PGlobalRecHit::SiStripRecHit> TECW4RecHits =
562  srcGlobalRecHits->getTECW4RecHits();
563  mehSiStripn[14]->Fill((float)nTECW4RecHits);
564  for (unsigned int i = 0; i < TECW4RecHits.size(); ++i) {
565  mehSiStripResX[14]->Fill(TECW4RecHits[i].RX - TECW4RecHits[i].SX);
566  mehSiStripResY[14]->Fill(TECW4RecHits[i].RY - TECW4RecHits[i].SY);
567  }
568 
569  std::vector<PGlobalRecHit::SiStripRecHit> TECW5RecHits =
570  srcGlobalRecHits->getTECW5RecHits();
571  mehSiStripn[15]->Fill((float)nTECW5RecHits);
572  for (unsigned int i = 0; i < TECW5RecHits.size(); ++i) {
573  mehSiStripResX[15]->Fill(TECW5RecHits[i].RX - TECW5RecHits[i].SX);
574  mehSiStripResY[15]->Fill(TECW5RecHits[i].RY - TECW5RecHits[i].SY);
575  }
576 
577  std::vector<PGlobalRecHit::SiStripRecHit> TECW6RecHits =
578  srcGlobalRecHits->getTECW6RecHits();
579  mehSiStripn[16]->Fill((float)nTECW6RecHits);
580  for (unsigned int i = 0; i < TECW6RecHits.size(); ++i) {
581  mehSiStripResX[16]->Fill(TECW6RecHits[i].RX - TECW6RecHits[i].SX);
582  mehSiStripResY[16]->Fill(TECW6RecHits[i].RY - TECW6RecHits[i].SY);
583  }
584 
585  std::vector<PGlobalRecHit::SiStripRecHit> TECW7RecHits =
586  srcGlobalRecHits->getTECW7RecHits();
587  mehSiStripn[17]->Fill((float)nTECW7RecHits);
588  for (unsigned int i = 0; i < TECW7RecHits.size(); ++i) {
589  mehSiStripResX[17]->Fill(TECW7RecHits[i].RX - TECW7RecHits[i].SX);
590  mehSiStripResY[17]->Fill(TECW7RecHits[i].RY - TECW7RecHits[i].SY);
591  }
592 
593  std::vector<PGlobalRecHit::SiStripRecHit> TECW8RecHits =
594  srcGlobalRecHits->getTECW8RecHits();
595  mehSiStripn[18]->Fill((float)nTECW8RecHits);
596  for (unsigned int i = 0; i < TECW8RecHits.size(); ++i) {
597  mehSiStripResX[18]->Fill(TECW8RecHits[i].RX - TECW8RecHits[i].SX);
598  mehSiStripResY[18]->Fill(TECW8RecHits[i].RY - TECW8RecHits[i].SY);
599  }
600 
601  // get SiPixel info
602  std::vector<PGlobalRecHit::SiPixelRecHit> BRL1RecHits =
603  srcGlobalRecHits->getBRL1RecHits();
604  mehSiPixeln[0]->Fill((float)nBRL1RecHits);
605  for (unsigned int i = 0; i < BRL1RecHits.size(); ++i) {
606  mehSiPixelResX[0]->Fill(BRL1RecHits[i].RX - BRL1RecHits[i].SX);
607  mehSiPixelResY[0]->Fill(BRL1RecHits[i].RY - BRL1RecHits[i].SY);
608  }
609 
610  std::vector<PGlobalRecHit::SiPixelRecHit> BRL2RecHits =
611  srcGlobalRecHits->getBRL2RecHits();
612  mehSiPixeln[1]->Fill((float)nBRL2RecHits);
613  for (unsigned int i = 0; i < BRL2RecHits.size(); ++i) {
614  mehSiPixelResX[1]->Fill(BRL2RecHits[i].RX - BRL2RecHits[i].SX);
615  mehSiPixelResY[1]->Fill(BRL2RecHits[i].RY - BRL2RecHits[i].SY);
616  }
617 
618  std::vector<PGlobalRecHit::SiPixelRecHit> BRL3RecHits =
619  srcGlobalRecHits->getBRL3RecHits();
620  mehSiPixeln[2]->Fill((float)nBRL3RecHits);
621  for (unsigned int i = 0; i < BRL3RecHits.size(); ++i) {
622  mehSiPixelResX[2]->Fill(BRL3RecHits[i].RX - BRL3RecHits[i].SX);
623  mehSiPixelResY[2]->Fill(BRL3RecHits[i].RY - BRL3RecHits[i].SY);
624  }
625 
626  std::vector<PGlobalRecHit::SiPixelRecHit> FWD1pRecHits =
627  srcGlobalRecHits->getFWD1pRecHits();
628  mehSiPixeln[3]->Fill((float)nFWD1pRecHits);
629  for (unsigned int i = 0; i < FWD1pRecHits.size(); ++i) {
630  mehSiPixelResX[3]->Fill(FWD1pRecHits[i].RX - FWD1pRecHits[i].SX);
631  mehSiPixelResY[3]->Fill(FWD1pRecHits[i].RY - FWD1pRecHits[i].SY);
632  }
633 
634  std::vector<PGlobalRecHit::SiPixelRecHit> FWD1nRecHits =
635  srcGlobalRecHits->getFWD1nRecHits();
636  mehSiPixeln[4]->Fill((float)nFWD1nRecHits);
637  for (unsigned int i = 0; i < FWD1nRecHits.size(); ++i) {
638  mehSiPixelResX[4]->Fill(FWD1nRecHits[i].RX - FWD1nRecHits[i].SX);
639  mehSiPixelResY[4]->Fill(FWD1nRecHits[i].RY - FWD1nRecHits[i].SY);
640  }
641 
642  std::vector<PGlobalRecHit::SiPixelRecHit> FWD2pRecHits =
643  srcGlobalRecHits->getFWD2pRecHits();
644  mehSiPixeln[5]->Fill((float)nFWD2pRecHits);
645  for (unsigned int i = 0; i < FWD2pRecHits.size(); ++i) {
646  mehSiPixelResX[5]->Fill(FWD2pRecHits[i].RX - FWD2pRecHits[i].SX);
647  mehSiPixelResY[5]->Fill(FWD2pRecHits[i].RY - FWD2pRecHits[i].SY);
648  }
649 
650  std::vector<PGlobalRecHit::SiPixelRecHit> FWD2nRecHits =
651  srcGlobalRecHits->getFWD2nRecHits();
652  mehSiPixeln[6]->Fill((float)nFWD2nRecHits);
653  for (unsigned int i = 0; i < FWD2nRecHits.size(); ++i) {
654  mehSiPixelResX[6]->Fill(FWD2nRecHits[i].RX - FWD2nRecHits[i].SX);
655  mehSiPixelResY[6]->Fill(FWD2nRecHits[i].RY - FWD2nRecHits[i].SY);
656  }
657 
658  // get DtMuon info
659  std::vector<PGlobalRecHit::DTRecHit> DTRecHits =
660  srcGlobalRecHits->getDTRecHits();
661  mehDtMuonn->Fill((float)nDTRecHits);
662  for (unsigned int i = 0; i < DTRecHits.size(); ++i) {
663  mehDtMuonRes->Fill(DTRecHits[i].RHD - DTRecHits[i].SHD);
664  }
665 
666  // get CSC info
667  std::vector<PGlobalRecHit::CSCRecHit> CSCRecHits =
668  srcGlobalRecHits->getCSCRecHits();
669  mehCSCn->Fill((float)nCSCRecHits);
670  for (unsigned int i = 0; i < CSCRecHits.size(); ++i) {
671  mehCSCResRDPhi->Fill(CSCRecHits[i].RHPERP *
672  (CSCRecHits[i].RHPHI - CSCRecHits[i].SHPHI));
673  }
674 
675  // get RPC info
676  std::vector<PGlobalRecHit::RPCRecHit> RPCRecHits =
677  srcGlobalRecHits->getRPCRecHits();
678  mehRPCn->Fill((float)nRPCRecHits);
679  for (unsigned int i = 0; i < RPCRecHits.size(); ++i) {
680  mehRPCResX->Fill(RPCRecHits[i].RHX - RPCRecHits[i].SHX);
681  }
682 
683  if (verbosity > 0)
684  edm::LogInfo (MsgLoggerCat)
685  << "Done gathering data from event.";
686 
687 }
688 
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:954
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:230
int j
Definition: DBlmapReader.cc:9
GlobalRecHitsHistogrammer(const edm::ParameterSet &)
void setVerbose(unsigned level)
Definition: DQMStore.cc:631
bool isValid() const
Definition: HandleBase.h:76
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EventID id() const
Definition: EventBase.h:56
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2540
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
Definition: DQMStore.cc:3332
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:667