CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalRecHitsAnalyzer.cc
Go to the documentation of this file.
1 
10 using namespace std;
15 
17  fName(""), verbosity(0), frequency(0), label(""), getAllProvenances(false),
18  printProvenanceInfo(false), count(0)
19 {
20  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_GlobalRecHitsAnalyzer";
21 
22  // get information from parameter set
23  fName = iPSet.getUntrackedParameter<std::string>("Name");
24  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
25  frequency = iPSet.getUntrackedParameter<int>("Frequency");
26  edm::ParameterSet m_Prov =
27  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
29  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
31  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
32  hitsProducer = iPSet.getParameter<std::string>("hitsProducer");
33 
34  //get Labels to use to extract information
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  << " GetProv = " << getAllProvenances << "\n"
67  << " PrintProv = " << printProvenanceInfo << "\n"
68  << " ECalEBSrc = " << ECalEBSrc_.label()
69  << ":" << ECalEBSrc_.instance() << "\n"
70  << " ECalUncalEBSrc = " << ECalUncalEBSrc_.label()
71  << ":" << ECalUncalEBSrc_.instance() << "\n"
72  << " ECalEESrc = " << ECalEESrc_.label()
73  << ":" << ECalUncalEESrc_.instance() << "\n"
74  << " ECalUncalEESrc = " << ECalUncalEESrc_.label()
75  << ":" << ECalEESrc_.instance() << "\n"
76  << " ECalESSrc = " << ECalESSrc_.label()
77  << ":" << ECalESSrc_.instance() << "\n"
78  << " HCalSrc = " << HCalSrc_.label()
79  << ":" << HCalSrc_.instance() << "\n"
80  << " SiStripSrc = " << SiStripSrc_.label()
81  << ":" << SiStripSrc_.instance() << "\n"
82  << " SiPixelSrc = " << SiPxlSrc_.label()
83  << ":" << SiPxlSrc_.instance() << "\n"
84  << " MuDTSrc = " << MuDTSrc_.label()
85  << ":" << MuDTSrc_.instance() << "\n"
86  << " MuDTSimSrc = " << MuDTSimSrc_.label()
87  << ":" << MuDTSimSrc_.instance() << "\n"
88  << " MuCSCSrc = " << MuCSCSrc_.label()
89  << ":" << MuCSCSrc_.instance() << "\n"
90  << " MuRPCSrc = " << MuRPCSrc_.label()
91  << ":" << MuRPCSrc_.instance() << "\n"
92  << " MuRPCSimSrc = " << MuRPCSimSrc_.label()
93  << ":" << MuRPCSimSrc_.instance() << "\n"
94  << "===============================\n";
95  }
96  //Put in analyzer stuff here....
97 
98  dbe = 0;
100  if (dbe) {
101  if (verbosity > 0 ) {
102  dbe->setVerbose(1);
103  } else {
104  dbe->setVerbose(0);
105  }
106  }
107  if (dbe) {
108  if (verbosity > 0 ) dbe->showDirStructure();
109  }
110 
111  Char_t hname[100];
112  Char_t htitle[100];
113 
114  //monitor elements
115 
116  //Si Strip
117  if(dbe) {
118  string SiStripString[19] = {"TECW1", "TECW2", "TECW3", "TECW4", "TECW5",
119  "TECW6", "TECW7", "TECW8", "TIBL1", "TIBL2",
120  "TIBL3", "TIBL4", "TIDW1", "TIDW2", "TIDW3",
121  "TOBL1", "TOBL2", "TOBL3", "TOBL4"};
122  for(int i = 0; i<19; ++i) {
123  mehSiStripn[i]=0;
124  mehSiStripResX[i]=0;
125  mehSiStripResY[i]=0;
126  }
127  string hcharname, hchartitle;
128  dbe->setCurrentFolder("GlobalRecHitsV/SiStrips");
129  for(int amend = 0; amend < 19; ++amend) {
130  hcharname = "hSiStripn_"+SiStripString[amend];
131  hchartitle= SiStripString[amend]+" rechits";
132  sprintf(hname, hcharname.c_str());
133  sprintf(htitle, hchartitle.c_str());
134  mehSiStripn[amend] = dbe->book1D(hname,htitle,200,0.,200.);
135  mehSiStripn[amend]->setAxisTitle("Number of hits in "+
136  SiStripString[amend],1);
137  mehSiStripn[amend]->setAxisTitle("Count",2);
138  hcharname = "hSiStripResX_"+SiStripString[amend];
139  hchartitle= SiStripString[amend]+" rechit x resolution";
140  sprintf(hname, hcharname.c_str());
141  sprintf(htitle, hchartitle.c_str());
142  mehSiStripResX[amend] = dbe->book1D(hname,htitle,200,-0.02,.02);
143  mehSiStripResX[amend]->setAxisTitle("X-resolution in "
144  +SiStripString[amend],1);
145  mehSiStripResX[amend]->setAxisTitle("Count",2);
146  hcharname = "hSiStripResY_"+SiStripString[amend];
147  hchartitle= SiStripString[amend]+" rechit y resolution";
148  sprintf(hname, hcharname.c_str());
149  sprintf(htitle, hchartitle.c_str());
150  mehSiStripResY[amend] = dbe->book1D(hname,htitle,200,-0.02,.02);
151  mehSiStripResY[amend]->setAxisTitle("Y-resolution in "+
152  SiStripString[amend],1);
153  mehSiStripResY[amend]->setAxisTitle("Count",2);
154  }
155 
156 
157  //HCal
158  //string hcharname, hchartitle;
159  string HCalString[4]={"HB", "HE", "HF", "HO"};
160  float HCalnUpper[4]={3000.,3000.,3000.,3000.};
161  float HCalnLower[4]={0.,0.,0.,0.};
162  for(int j =0; j <4; ++j) {
163  mehHcaln[j]=0;
164  mehHcalRes[j]=0;
165  }
166 
167  dbe->setCurrentFolder("GlobalRecHitsV/HCals");
168  for(int amend = 0; amend < 4; ++amend) {
169  hcharname = "hHcaln_"+HCalString[amend];
170  hchartitle= HCalString[amend]+" rechits";
171  sprintf(hname, hcharname.c_str());
172  sprintf(htitle, hchartitle.c_str());
173  mehHcaln[amend] = dbe->book1D(hname,htitle, 1000, HCalnLower[amend],
174  HCalnUpper[amend]);
175  mehHcaln[amend]->setAxisTitle("Number of RecHits",1);
176  mehHcaln[amend]->setAxisTitle("Count",2);
177  hcharname = "hHcalRes_"+HCalString[amend];
178  hchartitle= HCalString[amend]+" rechit resolution";
179  sprintf(hname, hcharname.c_str());
180  sprintf(htitle, hchartitle.c_str());
181  mehHcalRes[amend] = dbe->book1D(hname,htitle, 25, -2., 2.);
182  mehHcalRes[amend]->setAxisTitle("RecHit E - SimHit E",1);
183  mehHcalRes[amend]->setAxisTitle("Count",2);
184  }
185 
186 
187  //Ecal
188  string ECalString[3] = {"EB","EE", "ES"};
189  int ECalnBins[3] = {1000,3000,150};
190  float ECalnUpper[3] = {20000., 62000., 3000.};
191  float ECalnLower[3] = {0., 0., 0.};
192  int ECalResBins[3] = {200,200,200};
193  float ECalResUpper[3] = {1., 0.3, .0002};
194  float ECalResLower[3] = {-1., -0.3, -.0002};
195  for(int i =0; i<3; ++i) {
196  mehEcaln[i]=0;
197  mehEcalRes[i]=0;
198  }
199  dbe->setCurrentFolder("GlobalRecHitsV/ECals");
200 
201  for(int amend = 0; amend < 3; ++amend) {
202  hcharname = "hEcaln_"+ECalString[amend];
203  hchartitle= ECalString[amend]+" rechits";
204  sprintf(hname, hcharname.c_str());
205  sprintf(htitle, hchartitle.c_str());
206  mehEcaln[amend] = dbe->book1D(hname,htitle, ECalnBins[amend],
207  ECalnLower[amend], ECalnUpper[amend]);
208  mehEcaln[amend]->setAxisTitle("Number of RecHits",1);
209  mehEcaln[amend]->setAxisTitle("Count",2);
210  hcharname = "hEcalRes_"+ECalString[amend];
211  hchartitle= ECalString[amend]+" rechit resolution";
212  sprintf(hname, hcharname.c_str());
213  sprintf(htitle, hchartitle.c_str());
214  mehEcalRes[amend] = dbe->book1D(hname,htitle,ECalResBins[amend],
215  ECalResLower[amend],
216  ECalResUpper[amend]);
217  mehEcalRes[amend]->setAxisTitle("RecHit E - SimHit E",1);
218  mehEcalRes[amend]->setAxisTitle("Count",2);
219  }
220 
221  //Si Pixels
222  string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p",
223  "FWD2n", "FWD2p"};
224  for(int j =0; j<7; ++j) {
225  mehSiPixeln[j]=0;
226  mehSiPixelResX[j]=0;
227  mehSiPixelResY[j]=0;
228  }
229 
230  dbe->setCurrentFolder("GlobalRecHitsV/SiPixels");
231  for(int amend = 0; amend < 7; ++amend) {
232  hcharname = "hSiPixeln_"+SiPixelString[amend];
233  hchartitle= SiPixelString[amend]+" rechits";
234  sprintf(hname, hcharname.c_str());
235  sprintf(htitle, hchartitle.c_str());
236  mehSiPixeln[amend] = dbe->book1D(hname,htitle,200,0.,200.);
237  mehSiPixeln[amend]->setAxisTitle("Number of hits in "+
238  SiPixelString[amend],1);
239  mehSiPixeln[amend]->setAxisTitle("Count",2);
240  hcharname = "hSiPixelResX_"+SiPixelString[amend];
241  hchartitle= SiPixelString[amend]+" rechit x resolution";
242  sprintf(hname, hcharname.c_str());
243  sprintf(htitle, hchartitle.c_str());
244  mehSiPixelResX[amend] = dbe->book1D(hname,htitle,200,-0.02,.02);
245  mehSiPixelResX[amend]->setAxisTitle("X-resolution in "+
246  SiPixelString[amend],1);
247  mehSiPixelResX[amend]->setAxisTitle("Count",2);
248  hcharname = "hSiPixelResY_"+SiPixelString[amend];
249  hchartitle= SiPixelString[amend]+" rechit y resolution";
250 
251  sprintf(hname, hcharname.c_str());
252  sprintf(htitle, hchartitle.c_str());
253  mehSiPixelResY[amend] = dbe->book1D(hname,htitle,200,-0.02,.02);
254  mehSiPixelResY[amend]->setAxisTitle("Y-resolution in "+
255  SiPixelString[amend],1);
256  mehSiPixelResY[amend]->setAxisTitle("Count",2);
257  }
258 
259  //Muons
260  dbe->setCurrentFolder("GlobalRecHitsV/Muons");
261 
262  mehDtMuonn = 0;
263  mehCSCn = 0;
264  mehRPCn = 0;
265 
266  string n_List[3] = {"hDtMuonn", "hCSCn", "hRPCn"};
267  string hist_string[3] = {"Dt", "CSC", "RPC"};
268 
269  for(int amend=0; amend<3; ++amend) {
270  hchartitle = hist_string[amend]+" rechits";
271  sprintf(hname, n_List[amend].c_str());
272  sprintf(htitle, hchartitle.c_str());
273  if(amend==0) {
274  mehDtMuonn=dbe->book1D(hname,htitle,50, 0., 500.);
275  mehDtMuonn->setAxisTitle("Number of Rechits",1);
276  mehDtMuonn->setAxisTitle("Count",2);
277  }
278  if(amend==1) {
279  mehCSCn=dbe->book1D(hname,htitle,50, 0., 500.);
280  mehCSCn->setAxisTitle("Number of Rechits",1);
281  mehCSCn->setAxisTitle("Count",2);
282  }
283  if(amend==2){
284  mehRPCn=dbe->book1D(hname,htitle,50, 0., 500.);
285  mehRPCn->setAxisTitle("Number of Rechits",1);
286  mehRPCn->setAxisTitle("Count",2);
287  }
288  }
289 
290  mehDtMuonRes=0;
291  mehCSCResRDPhi=0;
292  mehRPCResX=0;
293 
294  sprintf(hname, "hDtMuonRes");
295  sprintf(htitle, "DT wire distance resolution");
296  mehDtMuonRes = dbe->book1D(hname, htitle, 200, -0.2, 0.2);
297  sprintf(hname, "CSCResRDPhi");
298  sprintf(htitle, "CSC perp*dphi resolution");
299  mehCSCResRDPhi = dbe->book1D(hname, htitle, 200, -0.2, 0.2);
300  sprintf(hname,"hRPCResX");
301  sprintf(htitle, "RPC rechits x resolution");
302  mehRPCResX = dbe->book1D(hname, htitle, 50, -5., 5.);
303  }
304 }
305 
307 
309 {
310  return;
311 }
312 
314 {
315  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_endJob";
316  if (verbosity >= 0)
317  edm::LogInfo(MsgLoggerCat)
318  << "Terminating having processed " << count << " events.";
319  return;
320 }
321 
323  const edm::EventSetup& iSetup)
324 {
325  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_analyze";
326 
327  // keep track of number of events processed
328  ++count;
329 
330  // get event id information
331  int nrun = iEvent.id().run();
332  int nevt = iEvent.id().event();
333 
334  if (verbosity > 0) {
335  edm::LogInfo(MsgLoggerCat)
336  << "Processing run " << nrun << ", event " << nevt
337  << " (" << count << " events total)";
338  } else if (verbosity == 0) {
339  if (nevt%frequency == 0 || nevt == 1) {
340  edm::LogInfo(MsgLoggerCat)
341  << "Processing run " << nrun << ", event " << nevt
342  << " (" << count << " events total)";
343  }
344  }
345 
346  // look at information available in the event
347  if (getAllProvenances) {
348 
349  std::vector<const edm::Provenance*> AllProv;
350  iEvent.getAllProvenance(AllProv);
351 
352  if (verbosity >= 0)
353  edm::LogInfo(MsgLoggerCat)
354  << "Number of Provenances = " << AllProv.size();
355 
356  if (printProvenanceInfo && (verbosity >= 0)) {
357  TString eventout("\nProvenance info:\n");
358 
359  for (unsigned int i = 0; i < AllProv.size(); ++i) {
360  eventout += "\n ******************************";
361  eventout += "\n Module : ";
362  eventout += AllProv[i]->moduleLabel();
363  eventout += "\n ProductID : ";
364  eventout += AllProv[i]->productID().id();
365  eventout += "\n ClassName : ";
366  eventout += AllProv[i]->className();
367  eventout += "\n InstanceName : ";
368  eventout += AllProv[i]->productInstanceName();
369  eventout += "\n BranchName : ";
370  eventout += AllProv[i]->branchName();
371  }
372  eventout += "\n ******************************\n";
373  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
374  printProvenanceInfo = false;
375  }
376  getAllProvenances = false;
377  }
378 
379  // call fill functions
380  // gather Ecal information from event
381  fillECal(iEvent, iSetup);
382  // gather Hcal information from event
383  fillHCal(iEvent, iSetup);
384  // gather Track information from event
385  fillTrk(iEvent, iSetup);
386  // gather Muon information from event
387  fillMuon(iEvent, iSetup);
388 
389  if (verbosity > 0)
390  edm::LogInfo (MsgLoggerCat)
391  << "Done gathering data from event.";
392 
393  return;
394 }
395 
397  const edm::EventSetup& iSetup)
398 {
399  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillECal";
400 
401  TString eventout;
402  if (verbosity > 0)
403  eventout = "\nGathering info:";
404 
405  // extract crossing frame from event
406  edm::Handle<CrossingFrame<PCaloHit> > crossingFrame;
407 
409  //extract EB information
412  iEvent.getByLabel(ECalUncalEBSrc_, EcalUncalibRecHitEB);
413  bool validUncalibRecHitEB = true;
414  if (!EcalUncalibRecHitEB.isValid()) {
415  LogDebug(MsgLoggerCat)
416  << "Unable to find EcalUncalRecHitEB in event!";
417  validUncalibRecHitEB = false;
418  }
419 
420  edm::Handle<EBRecHitCollection> EcalRecHitEB;
421  iEvent.getByLabel(ECalEBSrc_, EcalRecHitEB);
422  bool validRecHitEB = true;
423  if (!EcalRecHitEB.isValid()) {
424  LogDebug(MsgLoggerCat)
425  << "Unable to find EcalRecHitEB in event!";
426  validRecHitEB = false;
427  }
428 
429  // loop over simhits
430  const std::string barrelHitsName(hitsProducer+"EcalHitsEB");
431  iEvent.getByLabel("mix",barrelHitsName,crossingFrame);
432  bool validXFrame = true;
433  if (!crossingFrame.isValid()) {
434  LogDebug(MsgLoggerCat)
435  << "Unable to find cal barrel crossingFrame in event!";
436  validXFrame = false;
437  }
438 
439  MapType ebSimMap;
440  if (validXFrame) {
441  std::auto_ptr<MixCollection<PCaloHit> >
442  barrelHits(new MixCollection<PCaloHit>(crossingFrame.product()));
443 
444  // keep track of sum of simhit energy in each crystal
446  = barrelHits->begin();
447  hitItr != barrelHits->end();
448  ++hitItr) {
449 
450  EBDetId ebid = EBDetId(hitItr->id());
451 
452  uint32_t crystid = ebid.rawId();
453  ebSimMap[crystid] += hitItr->energy();
454  }
455  }
456 
457  int nEBRecHits = 0;
458  // loop over RecHits
459  if (validUncalibRecHitEB && validRecHitEB) {
460  const EBUncalibratedRecHitCollection *EBUncalibRecHit =
461  EcalUncalibRecHitEB.product();
462  const EBRecHitCollection *EBRecHit = EcalRecHitEB.product();
463 
465  EBUncalibRecHit->begin();
466  uncalibRecHit != EBUncalibRecHit->end();
467  ++uncalibRecHit) {
468 
469  EBDetId EBid = EBDetId(uncalibRecHit->id());
470 
471  EcalRecHitCollection::const_iterator myRecHit = EBRecHit->find(EBid);
472 
473  if (myRecHit != EBRecHit->end()) {
474  ++nEBRecHits;
475  mehEcalRes[1]->Fill(myRecHit->energy()-ebSimMap[EBid.rawId()]);
476  }
477  }
478 
479  if (verbosity > 1) {
480  eventout += "\n Number of EBRecHits collected:............ ";
481  eventout += nEBRecHits;
482  }
483  mehEcaln[1]->Fill((float)nEBRecHits);
484  }
485 
487  //extract EE information
490  iEvent.getByLabel(ECalUncalEESrc_, EcalUncalibRecHitEE);
491  bool validuncalibRecHitEE = true;
492  if (!EcalUncalibRecHitEE.isValid()) {
493  LogDebug(MsgLoggerCat)
494  << "Unable to find EcalUncalRecHitEE in event!";
495  validuncalibRecHitEE = false;
496  }
497 
498  edm::Handle<EERecHitCollection> EcalRecHitEE;
499  iEvent.getByLabel(ECalEESrc_, EcalRecHitEE);
500  bool validRecHitEE = true;
501  if (!EcalRecHitEE.isValid()) {
502  LogDebug(MsgLoggerCat)
503  << "Unable to find EcalRecHitEE in event!";
504  validRecHitEE = false;
505  }
506 
507  // loop over simhits
508  const std::string endcapHitsName(hitsProducer+"EcalHitsEE");
509  iEvent.getByLabel("mix",endcapHitsName,crossingFrame);
510  validXFrame = true;
511  if (!crossingFrame.isValid()) {
512  LogDebug(MsgLoggerCat)
513  << "Unable to find cal endcap crossingFrame in event!";
514  validXFrame = false;
515  }
516 
517  MapType eeSimMap;
518  if (validXFrame) {
519  std::auto_ptr<MixCollection<PCaloHit> >
520  endcapHits(new MixCollection<PCaloHit>(crossingFrame.product()));
521 
522  // keep track of sum of simhit energy in each crystal
524  = endcapHits->begin();
525  hitItr != endcapHits->end();
526  ++hitItr) {
527 
528  EEDetId eeid = EEDetId(hitItr->id());
529 
530  uint32_t crystid = eeid.rawId();
531  eeSimMap[crystid] += hitItr->energy();
532  }
533  }
534 
535  int nEERecHits = 0;
536  if (validuncalibRecHitEE && validRecHitEE) {
537  // loop over RecHits
538  const EEUncalibratedRecHitCollection *EEUncalibRecHit =
539  EcalUncalibRecHitEE.product();
540  const EERecHitCollection *EERecHit = EcalRecHitEE.product();
541 
543  EEUncalibRecHit->begin();
544  uncalibRecHit != EEUncalibRecHit->end();
545  ++uncalibRecHit) {
546 
547  EEDetId EEid = EEDetId(uncalibRecHit->id());
548 
549  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
550 
551  if (myRecHit != EERecHit->end()) {
552  ++nEERecHits;
553  mehEcalRes[0]->Fill(myRecHit->energy()-eeSimMap[EEid.rawId()]);
554  }
555  }
556 
557  if (verbosity > 1) {
558  eventout += "\n Number of EERecHits collected:............ ";
559  eventout += nEERecHits;
560  }
561  mehEcaln[0]->Fill((float)nEERecHits);
562  }
563 
565  //extract ES information
567  edm::Handle<ESRecHitCollection> EcalRecHitES;
568  iEvent.getByLabel(ECalESSrc_, EcalRecHitES);
569  bool validRecHitES = true;
570  if (!EcalRecHitES.isValid()) {
571  LogDebug(MsgLoggerCat)
572  << "Unable to find EcalRecHitES in event!";
573  validRecHitES = false;
574  }
575 
576  // loop over simhits
577  const std::string preshowerHitsName(hitsProducer+"EcalHitsES");
578  iEvent.getByLabel("mix",preshowerHitsName,crossingFrame);
579  validXFrame = true;
580  if (!crossingFrame.isValid()) {
581  LogDebug(MsgLoggerCat)
582  << "Unable to find cal preshower crossingFrame in event!";
583  validXFrame = false;
584  }
585 
586  MapType esSimMap;
587  if (validXFrame) {
588  std::auto_ptr<MixCollection<PCaloHit> >
589  preshowerHits(new MixCollection<PCaloHit>(crossingFrame.product()));
590 
591  // keep track of sum of simhit energy in each crystal
593  = preshowerHits->begin();
594  hitItr != preshowerHits->end();
595  ++hitItr) {
596 
597  ESDetId esid = ESDetId(hitItr->id());
598 
599  uint32_t crystid = esid.rawId();
600  esSimMap[crystid] += hitItr->energy();
601  }
602  }
603 
604  int nESRecHits = 0;
605  if (validRecHitES) {
606  // loop over RecHits
607  const ESRecHitCollection *ESRecHit = EcalRecHitES.product();
609  ESRecHit->begin();
610  recHit != ESRecHit->end();
611  ++recHit) {
612 
613  ESDetId ESid = ESDetId(recHit->id());
614 
615  ++nESRecHits;
616  mehEcalRes[2]->Fill(recHit->energy()-esSimMap[ESid.rawId()]);
617  }
618 
619  if (verbosity > 1) {
620  eventout += "\n Number of ESRecHits collected:............ ";
621  eventout += nESRecHits;
622  }
623  mehEcaln[2]->Fill(float(nESRecHits));
624  }
625 
626  if (verbosity > 0)
627  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
628 
629  return;
630 }
631 
633  const edm::EventSetup& iSetup)
634 {
635  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillHCal";
636 
637  TString eventout;
638  if (verbosity > 0)
639  eventout = "\nGathering info:";
640 
641  // get geometry
643  iSetup.get<CaloGeometryRecord>().get(geometry);
644  if (!geometry.isValid()) {
645  edm::LogWarning(MsgLoggerCat)
646  << "Unable to find CaloGeometry in event!";
647  return;
648  }
649 
650  // iterator to access containers
651  edm::PCaloHitContainer::const_iterator itHit;
652 
654  // extract simhit info
657  iEvent.getByLabel(HCalSrc_,hcalHits);
658  bool validhcalHits = true;
659  if (!hcalHits.isValid()) {
660  LogDebug(MsgLoggerCat)
661  << "Unable to find hcalHits in event!";
662  validhcalHits = false;
663  }
664 
665  MapType fHBEnergySimHits;
666  MapType fHEEnergySimHits;
667  MapType fHOEnergySimHits;
668  MapType fHFEnergySimHits;
669  if (validhcalHits) {
670  const edm::PCaloHitContainer *simhitResult = hcalHits.product();
671 
672  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
673  simhits != simhitResult->end();
674  ++simhits) {
675 
676  HcalDetId detId(simhits->id());
677  uint32_t cellid = detId.rawId();
678 
679  if (detId.subdet() == sdHcalBrl){
680  fHBEnergySimHits[cellid] += simhits->energy();
681  }
682  if (detId.subdet() == sdHcalEC){
683  fHEEnergySimHits[cellid] += simhits->energy();
684  }
685  if (detId.subdet() == sdHcalOut){
686  fHOEnergySimHits[cellid] += simhits->energy();
687  }
688  if (detId.subdet() == sdHcalFwd){
689  fHFEnergySimHits[cellid] += simhits->energy();
690  }
691  }
692  }
693 
694  // max values to be used (HO is found in HB)
695  Double_t maxHBEnergy = 0.;
696  Double_t maxHEEnergy = 0.;
697  Double_t maxHOEnergy = 0.;
698  Double_t maxHFEnergy = 0.;
699 
700  Double_t maxHBPhi = -1000.;
701  Double_t maxHEPhi = -1000.;
702  Double_t maxHOPhi = -1000.;
703  Double_t maxHFPhi = -1000.;
704 
705  Double_t maxHBEta = -1000.;
706  Double_t maxHEEta = -1000.;
707  Double_t maxHOEta = -1000.;
708 
709  Double_t PI = 3.141592653589;
710 
712  // get HBHE information
714  std::vector<edm::Handle<HBHERecHitCollection> > hbhe;
715  iEvent.getManyByType(hbhe);
716  bool validHBHE = true;
717  if (!hbhe[0].isValid()) {
718  LogDebug(MsgLoggerCat)
719  << "Unable to find any HBHERecHitCollections in event!";
720  validHBHE = false;
721  }
722 
723  if (validHBHE) {
724  std::vector<edm::Handle<HBHERecHitCollection> >::iterator ihbhe;
725 
726  int iHB = 0;
727  int iHE = 0;
728  for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
729 
730  // find max values
731  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin();
732  jhbhe != (*ihbhe)->end(); ++jhbhe) {
733 
734  HcalDetId cell(jhbhe->id());
735 
736  if (cell.subdet() == sdHcalBrl) {
737 
738  const CaloCellGeometry* cellGeometry =
739  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
740  double fEta = cellGeometry->getPosition().eta () ;
741  double fPhi = cellGeometry->getPosition().phi () ;
742  if ( (jhbhe->energy()) > maxHBEnergy ) {
743  maxHBEnergy = jhbhe->energy();
744  maxHOEnergy = maxHBEnergy;
745  maxHBPhi = fPhi;
746  maxHOPhi = maxHBPhi;
747  maxHBEta = fEta;
748  maxHOEta = maxHBEta;
749  }
750  }
751 
752  if (cell.subdet() == sdHcalEC) {
753 
754  const CaloCellGeometry* cellGeometry =
755  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
756  double fEta = cellGeometry->getPosition().eta () ;
757  double fPhi = cellGeometry->getPosition().phi () ;
758  if ( (jhbhe->energy()) > maxHEEnergy ) {
759  maxHEEnergy = jhbhe->energy();
760  maxHEPhi = fPhi;
761  maxHEEta = fEta;
762  }
763  }
764  } // end find max values
765 
766  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin();
767  jhbhe != (*ihbhe)->end(); ++jhbhe) {
768 
769  HcalDetId cell(jhbhe->id());
770 
771  if (cell.subdet() == sdHcalBrl) {
772 
773  ++iHB;
774 
775  const CaloCellGeometry* cellGeometry =
776  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
777  double fPhi = cellGeometry->getPosition().phi () ;
778 
779  float deltaphi = maxHBPhi - fPhi;
780  if (fPhi > maxHBPhi) { deltaphi = fPhi - maxHBPhi;}
781  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
782 
783  mehHcalRes[0]->Fill(jhbhe->energy() -
784  fHBEnergySimHits[cell.rawId()]);
785  }
786 
787  if (cell.subdet() == sdHcalEC) {
788 
789  ++iHE;
790 
791  const CaloCellGeometry* cellGeometry =
792  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
793  double fPhi = cellGeometry->getPosition().phi () ;
794 
795  float deltaphi = maxHEPhi - fPhi;
796  if (fPhi > maxHEPhi) { deltaphi = fPhi - maxHEPhi;}
797  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
798  mehHcalRes[1]->Fill(jhbhe->energy() -
799  fHEEnergySimHits[cell.rawId()]);
800  }
801  }
802  } // end loop through collection
803 
804 
805  if (verbosity > 1) {
806  eventout += "\n Number of HBRecHits collected:............ ";
807  eventout += iHB;
808  }
809 
810  if (verbosity > 1) {
811  eventout += "\n Number of HERecHits collected:............ ";
812  eventout += iHE;
813  }
814  mehHcaln[0]->Fill((float)iHB);
815  mehHcaln[1]->Fill((float)iHE);
816  }
817 
819  // get HF information
821  std::vector<edm::Handle<HFRecHitCollection> > hf;
822  iEvent.getManyByType(hf);
823  bool validHF = true;
824  if (!hf[0].isValid()) {
825  LogDebug(MsgLoggerCat)
826  << "Unable to find any HFRecHitCollections in event!";
827  validHF = false;
828  }
829  if (validHF) {
830  std::vector<edm::Handle<HFRecHitCollection> >::iterator ihf;
831 
832  int iHF = 0;
833  for (ihf = hf.begin(); ihf != hf.end(); ++ihf) {
834 
835  // find max values
836  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin();
837  jhf != (*ihf)->end(); ++jhf) {
838 
839  HcalDetId cell(jhf->id());
840 
841  if (cell.subdet() == sdHcalFwd) {
842 
843  const CaloCellGeometry* cellGeometry =
844  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
845  double fPhi = cellGeometry->getPosition().phi () ;
846  if ( (jhf->energy()) > maxHFEnergy ) {
847  maxHFEnergy = jhf->energy();
848  maxHFPhi = fPhi;
849  }
850  }
851  } // end find max values
852 
853  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin();
854  jhf != (*ihf)->end(); ++jhf) {
855 
856  HcalDetId cell(jhf->id());
857 
858  if (cell.subdet() == sdHcalFwd) {
859 
860  ++iHF;
861 
862  const CaloCellGeometry* cellGeometry =
863  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
864  double fPhi = cellGeometry->getPosition().phi () ;
865 
866  float deltaphi = maxHBPhi - fPhi;
867  if (fPhi > maxHFPhi) { deltaphi = fPhi - maxHFPhi;}
868  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
869 
870  mehHcalRes[2]->Fill(jhf->energy()-fHFEnergySimHits[cell.rawId()]);
871  }
872  }
873  } // end loop through collection
874 
875  if (verbosity > 1) {
876  eventout += "\n Number of HFDigis collected:.............. ";
877  eventout += iHF;
878  }
879  mehHcaln[2]->Fill((float)iHF);
880  }
881 
883  // get HO information
885  std::vector<edm::Handle<HORecHitCollection> > ho;
886  iEvent.getManyByType(ho);
887  bool validHO = true;
888  if (!ho[0].isValid()) {
889  LogDebug(MsgLoggerCat)
890  << "Unable to find any HORecHitCollections in event!";
891  validHO = false;
892  }
893 
894  if (validHO) {
895  std::vector<edm::Handle<HORecHitCollection> >::iterator iho;
896 
897  int iHO = 0;
898  for (iho = ho.begin(); iho != ho.end(); ++iho) {
899 
900  for (HORecHitCollection::const_iterator jho = (*iho)->begin();
901  jho != (*iho)->end(); ++jho) {
902 
903  HcalDetId cell(jho->id());
904 
905  if (cell.subdet() == sdHcalOut) {
906 
907  ++iHO;
908 
909  const CaloCellGeometry* cellGeometry =
910  geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
911  double fPhi = cellGeometry->getPosition().phi () ;
912 
913  float deltaphi = maxHOPhi - fPhi;
914  if (fPhi > maxHOPhi) { deltaphi = fPhi - maxHOPhi;}
915  if (deltaphi > PI) { deltaphi = 2.0 * PI - deltaphi;}
916  mehHcalRes[3]->Fill(jho->energy()-fHOEnergySimHits[cell.rawId()]);
917  }
918  }
919  } // end loop through collection
920 
921  if (verbosity > 1) {
922  eventout += "\n Number of HODigis collected:.............. ";
923  eventout += iHO;
924  }
925  mehHcaln[3]->Fill((float)iHO);
926  }
927 
928  if (verbosity > 0)
929  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
930 
931  return;
932 }
933 
935  const edm::EventSetup& iSetup)
936 {
937  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillTrk";
938 
939  TString eventout;
940  if (verbosity > 0)
941  eventout = "\nGathering info:";
942 
943  // get strip information
945  iEvent.getByLabel(SiStripSrc_, rechitsmatched);
946  bool validstrip = true;
947  if (!rechitsmatched.isValid()) {
948  LogDebug(MsgLoggerCat)
949  << "Unable to find stripmatchedrechits in event!";
950  validstrip = false;
951  }
952 
953  TrackerHitAssociator associate(iEvent,conf_);
954 
956  iSetup.get<TrackerDigiGeometryRecord>().get(pDD);
957  if (!pDD.isValid()) {
958  edm::LogWarning(MsgLoggerCat)
959  << "Unable to find TrackerDigiGeometry in event!";
960  return;
961  }
962  const TrackerGeometry &tracker(*pDD);
963 
964  if (validstrip) {
965  int nStripBrl = 0, nStripFwd = 0;
966 
967  // loop over det units
968  for (TrackerGeometry::DetContainer::const_iterator it =
969  pDD->dets().begin();
970  it != pDD->dets().end(); ++it) {
971 
972  uint32_t myid = ((*it)->geographicalId()).rawId();
973  DetId detid = ((*it)->geographicalId());
974 
975  //loop over rechits-matched in the same subdetector
976  SiStripMatchedRecHit2DCollection::const_iterator rechitmatchedMatch = rechitsmatched->find(detid);
977 
978  if (rechitmatchedMatch != rechitsmatched->end()) {
979  SiStripMatchedRecHit2DCollection::DetSet rechitmatchedRange = *rechitmatchedMatch;
980  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorBegin = rechitmatchedRange.begin();
981  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorEnd = rechitmatchedRange.end();
982  SiStripMatchedRecHit2DCollection::DetSet::const_iterator itermatched = rechitmatchedRangeIteratorBegin;
983 
984  for ( itermatched = rechitmatchedRangeIteratorBegin;
985  itermatched != rechitmatchedRangeIteratorEnd;
986  ++itermatched) {
987 
988  SiStripMatchedRecHit2D const rechit = *itermatched;
989  LocalPoint position = rechit.localPosition();
990 
991  float mindist = 999999.;
992  float distx = 999999.;
993  float disty = 999999.;
994  float dist = 999999.;
995  std::pair<LocalPoint,LocalVector> closestPair;
996  matched.clear();
997 
998  float rechitmatchedx = position.x();
999  float rechitmatchedy = position.y();
1000 
1001  matched = associate.associateHit(rechit);
1002 
1003  if (!matched.empty()) {
1004  //project simhit;
1005  const GluedGeomDet* gluedDet =
1006  (const GluedGeomDet*)tracker.idToDet(rechit.geographicalId());
1007  const StripGeomDetUnit* partnerstripdet =
1008  (StripGeomDetUnit*) gluedDet->stereoDet();
1009  std::pair<LocalPoint,LocalVector> hitPair;
1010 
1011  for(std::vector<PSimHit>::const_iterator m = matched.begin();
1012  m != matched.end(); m++){
1013  //project simhit;
1014  hitPair = projectHit((*m),partnerstripdet,gluedDet->surface());
1015  distx = fabs(rechitmatchedx - hitPair.first.x());
1016  disty = fabs(rechitmatchedy - hitPair.first.y());
1017  dist = sqrt(distx*distx+disty*disty);
1018 
1019  if(dist < mindist){
1020  mindist = dist;
1021  closestPair = hitPair;
1022  }
1023  }
1024 
1025  // get TIB
1026  if (detid.subdetId() == sdSiTIB) {
1027 
1028  TIBDetId tibid(myid);
1029  ++nStripBrl;
1030 
1031  if (tibid.layer() == 1) {
1032  mehSiStripResX[8]->Fill(rechitmatchedx-closestPair.first.x());
1033  mehSiStripResY[8]->Fill(rechitmatchedy-closestPair.first.y());
1034  }
1035  if (tibid.layer() == 2) {
1036  mehSiStripResX[9]->Fill(rechitmatchedx-closestPair.first.x());
1037  mehSiStripResY[9]->Fill(rechitmatchedy-closestPair.first.y());
1038  }
1039  if (tibid.layer() == 3) {
1040  mehSiStripResX[10]->Fill(rechitmatchedx-closestPair.first.x());
1041  mehSiStripResY[10]->Fill(rechitmatchedy-closestPair.first.y());
1042 
1043  }
1044  if (tibid.layer() == 4) {
1045  mehSiStripResX[11]->Fill(rechitmatchedx-closestPair.first.x());
1046  mehSiStripResY[11]->Fill(rechitmatchedy-closestPair.first.y());
1047  }
1048  }
1049 
1050  // get TOB
1051  if (detid.subdetId() == sdSiTOB) {
1052 
1053  TOBDetId tobid(myid);
1054  ++nStripBrl;
1055 
1056  if (tobid.layer() == 1) {
1057  mehSiStripResX[15]->Fill(rechitmatchedx-closestPair.first.x());
1058  mehSiStripResY[15]->Fill(rechitmatchedy-closestPair.first.y());
1059  }
1060  if (tobid.layer() == 2) {
1061  mehSiStripResX[16]->Fill(rechitmatchedx-closestPair.first.x());
1062  mehSiStripResY[16]->Fill(rechitmatchedy-closestPair.first.y());
1063  }
1064  if (tobid.layer() == 3) {
1065  mehSiStripResX[17]->Fill(rechitmatchedx-closestPair.first.x());
1066  mehSiStripResY[17]->Fill(rechitmatchedy-closestPair.first.y());
1067  }
1068  if (tobid.layer() == 4) {
1069  mehSiStripResX[18]->Fill(rechitmatchedx-closestPair.first.x());
1070  mehSiStripResY[18]->Fill(rechitmatchedy-closestPair.first.y());
1071  }
1072  }
1073 
1074  // get TID
1075  if (detid.subdetId() == sdSiTID) {
1076 
1077  TIDDetId tidid(myid);
1078  ++nStripFwd;
1079 
1080  if (tidid.wheel() == 1) {
1081  mehSiStripResX[12]->Fill(rechitmatchedx-closestPair.first.x());
1082  mehSiStripResY[12]->Fill(rechitmatchedy-closestPair.first.y());
1083  }
1084  if (tidid.wheel() == 2) {
1085  mehSiStripResX[13]->Fill(rechitmatchedx-closestPair.first.x());
1086  mehSiStripResY[13]->Fill(rechitmatchedy-closestPair.first.y());
1087  }
1088  if (tidid.wheel() == 3) {
1089  mehSiStripResX[14]->Fill(rechitmatchedx-closestPair.first.x());
1090  mehSiStripResY[14]->Fill(rechitmatchedy-closestPair.first.y());
1091  }
1092  }
1093 
1094  // get TEC
1095  if (detid.subdetId() == sdSiTEC) {
1096 
1097  TECDetId tecid(myid);
1098  ++nStripFwd;
1099 
1100  if (tecid.wheel() == 1) {
1101  mehSiStripResX[0]->Fill(rechitmatchedx-closestPair.first.x());
1102  mehSiStripResY[0]->Fill(rechitmatchedy-closestPair.first.y());
1103  }
1104  if (tecid.wheel() == 2) {
1105  mehSiStripResX[1]->Fill(rechitmatchedx-closestPair.first.x());
1106  mehSiStripResY[1]->Fill(rechitmatchedy-closestPair.first.y());
1107  }
1108  if (tecid.wheel() == 3) {
1109  mehSiStripResX[2]->Fill(rechitmatchedx-closestPair.first.x());
1110  mehSiStripResY[2]->Fill(rechitmatchedy-closestPair.first.y());
1111  }
1112  if (tecid.wheel() == 4) {
1113  mehSiStripResX[3]->Fill(rechitmatchedx-closestPair.first.x());
1114  mehSiStripResY[3]->Fill(rechitmatchedy-closestPair.first.y());
1115 
1116  }
1117  if (tecid.wheel() == 5) {
1118  mehSiStripResX[4]->Fill(rechitmatchedx-closestPair.first.x());
1119  mehSiStripResY[4]->Fill(rechitmatchedy-closestPair.first.y());
1120  }
1121  if (tecid.wheel() == 6) {
1122  mehSiStripResX[5]->Fill(rechitmatchedx-closestPair.first.x());
1123  mehSiStripResY[5]->Fill(rechitmatchedy-closestPair.first.y());
1124  }
1125  if (tecid.wheel() == 7) {
1126  mehSiStripResX[6]->Fill(rechitmatchedx-closestPair.first.x());
1127  mehSiStripResY[6]->Fill(rechitmatchedy-closestPair.first.y());
1128  }
1129  if (tecid.wheel() == 8) {
1130  mehSiStripResX[7]->Fill(rechitmatchedx-closestPair.first.x());
1131  mehSiStripResY[7]->Fill(rechitmatchedy-closestPair.first.y());
1132  }
1133  }
1134 
1135  } // end if matched empty
1136  }
1137  }
1138  } // end loop over det units
1139 
1140  if (verbosity > 1) {
1141  eventout += "\n Number of BrlStripRecHits collected:...... ";
1142  eventout += nStripBrl;
1143  }
1144 
1145  for(int i =8; i<12; ++i)
1146  {mehSiStripn[i]->Fill((float)nStripBrl);}
1147  for(int i =16; i<19; ++i)
1148  {mehSiStripn[i]->Fill((float)nStripBrl);}
1149 
1150  if (verbosity > 1) {
1151  eventout += "\n Number of FrwdStripRecHits collected:..... ";
1152  eventout += nStripFwd;
1153  }
1154  for(int i =0; i<8; ++i)
1155  {mehSiStripn[i]->Fill((float)nStripFwd);}
1156  for(int i =12; i<16; ++i)
1157  {mehSiStripn[i]->Fill((float)nStripFwd);}
1158  }
1159 
1160  // get pixel information
1161  //Get RecHits
1163  iEvent.getByLabel(SiPxlSrc_, recHitColl);
1164  bool validpixel = true;
1165  if (!recHitColl.isValid()) {
1166  LogDebug(MsgLoggerCat)
1167  << "Unable to find SiPixelRecHitCollection in event!";
1168  validpixel = false;
1169  }
1170 
1171  //Get event setup
1173  iSetup.get<TrackerDigiGeometryRecord>().get(geom);
1174  if (!geom.isValid()) {
1175  edm::LogWarning(MsgLoggerCat)
1176  << "Unable to find TrackerDigiGeometry in event!";
1177  return;
1178  }
1179 
1180  if (validpixel) {
1181  int nPxlBrl = 0, nPxlFwd = 0;
1182  //iterate over detunits
1183  for (TrackerGeometry::DetContainer::const_iterator it =
1184  geom->dets().begin();
1185  it != geom->dets().end(); ++it) {
1186 
1187  uint32_t myid = ((*it)->geographicalId()).rawId();
1188  DetId detId = ((*it)->geographicalId());
1189  int subid = detId.subdetId();
1190 
1191  if (! ((subid == sdPxlBrl) || (subid == sdPxlFwd))) continue;
1192 
1193  SiPixelRecHitCollection::const_iterator pixeldet = recHitColl->find(detId);
1194  if (pixeldet == recHitColl->end()) continue;
1195  SiPixelRecHitCollection::DetSet pixelrechitRange = *pixeldet;
1196  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorBegin = pixelrechitRange.begin();
1197  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorEnd = pixelrechitRange.end();
1198  SiPixelRecHitCollection::DetSet::const_iterator pixeliter = pixelrechitRangeIteratorBegin;
1199 
1200 
1201  std::vector<PSimHit> matched;
1202 
1203  //----Loop over rechits for this detId
1204  for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1205 
1206  matched.clear();
1207  matched = associate.associateHit(*pixeliter);
1208 
1209  if ( !matched.empty() ) {
1210 
1211  float closest = 9999.9;
1212  LocalPoint lp = pixeliter->localPosition();
1213  float rechit_x = lp.x();
1214  float rechit_y = lp.y();
1215 
1216  float sim_x = 0.;
1217  float sim_y = 0.;
1218 
1219  //loop over sim hits and fill closet
1220  for (std::vector<PSimHit>::const_iterator m = matched.begin();
1221  m != matched.end(); ++m) {
1222 
1223  float sim_x1 = (*m).entryPoint().x();
1224  float sim_x2 = (*m).exitPoint().x();
1225  float sim_xpos = 0.5*(sim_x1+sim_x2);
1226 
1227  float sim_y1 = (*m).entryPoint().y();
1228  float sim_y2 = (*m).exitPoint().y();
1229  float sim_ypos = 0.5*(sim_y1+sim_y2);
1230 
1231  float x_res = fabs(sim_xpos - rechit_x);
1232  float y_res = fabs(sim_ypos - rechit_y);
1233 
1234  float dist = sqrt(x_res*x_res + y_res*y_res);
1235 
1236  if ( dist < closest ) {
1237  closest = dist;
1238  sim_x = sim_xpos;
1239  sim_y = sim_ypos;
1240  }
1241  } // end sim hit loop
1242 
1243  // get Barrel pixels ***************Pixel STuff******************
1244  if (subid == sdPxlBrl) {
1245  PXBDetId bdetid(myid);
1246  ++nPxlBrl;
1247 
1248  if (bdetid.layer() == 1) {
1249  mehSiPixelResX[0]->Fill(rechit_x-sim_x);
1250  mehSiPixelResY[0]->Fill(rechit_y-sim_y);
1251 
1252  }
1253  if (bdetid.layer() == 2) {
1254  mehSiPixelResX[1]->Fill(rechit_x-sim_x);
1255  mehSiPixelResY[1]->Fill(rechit_y-sim_y);
1256  }
1257  if (bdetid.layer() == 3) {
1258  mehSiPixelResX[2]->Fill(rechit_x-sim_x);
1259  mehSiPixelResY[2]->Fill(rechit_y-sim_y);
1260  }
1261  }
1262 
1263  // get Forward pixels
1264  if (subid == sdPxlFwd) {
1265  PXFDetId fdetid(myid);
1266  ++nPxlFwd;
1267 
1268  if (fdetid.disk() == 1) {
1269  if (fdetid.side() == 1) {
1270  mehSiPixelResX[3]->Fill(rechit_x-sim_x);
1271  mehSiPixelResY[3]->Fill(rechit_y-sim_y);
1272  }
1273  if (fdetid.side() == 2) {
1274  mehSiPixelResX[4]->Fill(rechit_x-sim_x);
1275  mehSiPixelResY[4]->Fill(rechit_y-sim_y);
1276  }
1277  }
1278  if (fdetid.disk() == 2) {
1279  if (fdetid.side() == 1) {
1280  mehSiPixelResX[5]->Fill(rechit_x-sim_x);
1281  mehSiPixelResY[5]->Fill(rechit_y-sim_y);
1282  }
1283  if (fdetid.side() == 2) {
1284  mehSiPixelResX[6]->Fill(rechit_x-sim_x);
1285  mehSiPixelResY[6]->Fill(rechit_y-sim_y);
1286  }
1287  }
1288  }
1289  } // end matched emtpy
1290  } // <-----end rechit loop
1291  } // <------ end detunit loop
1292 
1293 
1294  if (verbosity > 1) {
1295  eventout += "\n Number of BrlPixelRecHits collected:...... ";
1296  eventout += nPxlBrl;
1297  }
1298  for(int i=0; i<3; ++i) {
1299  mehSiPixeln[i]->Fill((float)nPxlBrl);
1300  }
1301 
1302  if (verbosity > 1) {
1303  eventout += "\n Number of FrwdPixelRecHits collected:..... ";
1304  eventout += nPxlFwd;
1305  }
1306 
1307  for(int i=3; i<7; ++i) {
1308  mehSiPixeln[i]->Fill((float)nPxlFwd);
1309  }
1310  }
1311 
1312  if (verbosity > 0)
1313  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1314 
1315  return;
1316 }
1317 
1319  const edm::EventSetup& iSetup)
1320 {
1321  std::string MsgLoggerCat = "GlobalRecHitsAnalyzer_fillMuon";
1322 
1323  TString eventout;
1324  if (verbosity > 0)
1325  eventout = "\nGathering info:";
1326 
1327  // get DT information
1329  iSetup.get<MuonGeometryRecord>().get(dtGeom);
1330  if (!dtGeom.isValid()) {
1331  edm::LogWarning(MsgLoggerCat)
1332  << "Unable to find DTMuonGeometryRecord in event!";
1333  return;
1334  }
1335 
1337  iEvent.getByLabel(MuDTSimSrc_, dtsimHits);
1338  bool validdtsim = true;
1339  if (!dtsimHits.isValid()) {
1340  LogDebug(MsgLoggerCat)
1341  << "Unable to find dtsimHits in event!";
1342  validdtsim = false;
1343  }
1344 
1346  iEvent.getByLabel(MuDTSrc_, dtRecHits);
1347  bool validdtrec = true;
1348  if (!dtRecHits.isValid()) {
1349  LogDebug(MsgLoggerCat)
1350  << "Unable to find dtRecHits in event!";
1351  validdtrec = false;
1352  }
1353 
1354  if (validdtsim && validdtrec) {
1355 
1356  std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1358 
1359  std::map<DTWireId, std::vector<DTRecHit1DPair> > recHitsPerWire =
1360  map1DRecHitsPerWire(dtRecHits.product());
1361 
1362  int nDt = compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 1);
1363 
1364  if (verbosity > 1) {
1365  eventout += "\n Number of DtMuonRecHits collected:........ ";
1366  eventout += nDt;
1367  }
1368  mehDtMuonn->Fill(float(nDt));
1369  }
1370 
1371  // get CSC Strip information
1372  // get map of sim hits
1373  theMap.clear();
1375 
1376  iEvent.getByLabel("mix",hitsProducer+"MuonCSCHits",cf);
1377  bool validXFrame = true;
1378  if (!cf.isValid()) {
1379  LogDebug(MsgLoggerCat)
1380  << "Unable to find muo CSC crossingFrame in event!";
1381  validXFrame = false;
1382  }
1383  if (validXFrame) {
1385 
1386  // arrange the hits by detUnit
1387  for(MixCollection<PSimHit>::MixItr hitItr = simHits.begin();
1388  hitItr != simHits.end(); ++hitItr) {
1389  theMap[hitItr->detUnitId()].push_back(*hitItr);
1390  }
1391  }
1392 
1393  // get geometry
1395  iSetup.get<MuonGeometryRecord>().get(hGeom);
1396  if (!hGeom.isValid()) {
1397  edm::LogWarning(MsgLoggerCat)
1398  << "Unable to find CSCMuonGeometryRecord in event!";
1399  return;
1400  }
1401  const CSCGeometry *theCSCGeometry = &*hGeom;
1402 
1403  // get rechits
1405  iEvent.getByLabel(MuCSCSrc_, hRecHits);
1406  bool validCSC = true;
1407  if (!hRecHits.isValid()) {
1408  LogDebug(MsgLoggerCat)
1409  << "Unable to find CSC RecHits in event!";
1410  validCSC = false;
1411  }
1412 
1413  if (validCSC) {
1414  const CSCRecHit2DCollection *cscRecHits = hRecHits.product();
1415 
1416  int nCSC = 0;
1417  for (CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin();
1418  recHitItr != cscRecHits->end(); ++recHitItr) {
1419 
1420  int detId = (*recHitItr).cscDetId().rawId();
1421 
1423  std::map<int, edm::PSimHitContainer>::const_iterator mapItr =
1424  theMap.find(detId);
1425  if (mapItr != theMap.end()) {
1426  simHits = mapItr->second;
1427  }
1428 
1429  if (simHits.size() == 1) {
1430  ++nCSC;
1431 
1432  const GeomDetUnit* detUnit =
1433  theCSCGeometry->idToDetUnit(CSCDetId(detId));
1434  const CSCLayer *layer = dynamic_cast<const CSCLayer *>(detUnit);
1435 
1436  int chamberType = layer->chamber()->specs()->chamberType();
1437  plotResolution(simHits[0], *recHitItr, layer, chamberType);
1438  }
1439  }
1440 
1441  if (verbosity > 1) {
1442  eventout += "\n Number of CSCRecHits collected:........... ";
1443  eventout += nCSC;
1444  }
1445  mehCSCn->Fill((float)nCSC);
1446  }
1447 
1448  // get RPC information
1449  std::map<double, int> mapsim, maprec;
1450  std::map<int, double> nmapsim, nmaprec;
1451 
1453  iSetup.get<MuonGeometryRecord>().get(rpcGeom);
1454  if (!rpcGeom.isValid()) {
1455  edm::LogWarning(MsgLoggerCat)
1456  << "Unable to find RPCMuonGeometryRecord in event!";
1457  return;
1458  }
1459 
1461  iEvent.getByLabel(MuRPCSimSrc_, simHit);
1462  bool validrpcsim = true;
1463  if (!simHit.isValid()) {
1464  LogDebug(MsgLoggerCat)
1465  << "Unable to find RPCSimHit in event!";
1466  validrpcsim = false;
1467  }
1468 
1470  iEvent.getByLabel(MuRPCSrc_, recHit);
1471  bool validrpc = true;
1472  if (!simHit.isValid()) {
1473  LogDebug(MsgLoggerCat)
1474  << "Unable to find RPCRecHit in event!";
1475  validrpc = false;
1476  }
1477 
1478  if (validrpc) {
1479  int nRPC = 0;
1481  int nrec = 0;
1482  for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1483  RPCDetId Rid = (RPCDetId)(*recIt).rpcId();
1484  const RPCRoll *roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(Rid));
1485  if (roll->isForward()) {
1486 
1487  if (verbosity > 1) {
1488  eventout +=
1489  "\n Number of RPCRecHits collected:........... ";
1490  eventout += nRPC;
1491  }
1492 
1493  if (verbosity > 0)
1494  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1495  return;
1496  }
1497  nrec = nrec + 1;
1498  LocalPoint rhitlocal = (*recIt).localPosition();
1499  double rhitlocalx = rhitlocal.x();
1500  maprec[rhitlocalx] = nrec;
1501  }
1502 
1503  int i = 0;
1504  for (std::map<double,int>::iterator iter = maprec.begin();
1505  iter != maprec.end(); ++iter) {
1506  i = i + 1;
1507  nmaprec[i] = (*iter).first;
1508  }
1509 
1510  int nsim = 0;
1511  if (validrpcsim) {
1512  edm::PSimHitContainer::const_iterator simIt;
1513  for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1514  int ptype = (*simIt).particleType();
1515  if (ptype == 13 || ptype == -13) {
1516  nsim = nsim + 1;
1517  LocalPoint shitlocal = (*simIt).localPosition();
1518  double shitlocalx = shitlocal.x();
1519  mapsim[shitlocalx] = nsim;
1520  }
1521  }
1522 
1523  i = 0;
1524  for (std::map<double,int>::iterator iter = mapsim.begin();
1525  iter != mapsim.end(); ++iter) {
1526  i = i + 1;
1527  nmapsim[i] = (*iter).first;
1528  }
1529  }
1530 
1531  if (nsim == nrec) {
1532  for (int r = 0; r < nsim; r++) {
1533  ++nRPC;
1534  mehRPCResX->Fill(nmaprec[r+1]-nmapsim[r+1]);
1535  }
1536  }
1537 
1538  if (verbosity > 1) {
1539  eventout += "\n Number of RPCRecHits collected:........... ";
1540  eventout += nRPC;
1541  }
1542  mehRPCn->Fill((float)nRPC);
1543  }
1544 
1545  if (verbosity > 0)
1546  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1547 
1548  return;
1549 }
1550 
1551 //needed by to do the residual for matched hits in SiStrip
1552 std::pair<LocalPoint,LocalVector>
1554  const StripGeomDetUnit* stripDet,
1555  const BoundPlane& plane)
1556 {
1557 
1558  const StripTopology& topol = stripDet->specificTopology();
1559  GlobalPoint globalpos= stripDet->surface().toGlobal(hit.localPosition());
1560  LocalPoint localHit = plane.toLocal(globalpos);
1561  //track direction
1562  LocalVector locdir=hit.localDirection();
1563  //rotate track in new frame
1564 
1565  GlobalVector globaldir= stripDet->surface().toGlobal(locdir);
1566  LocalVector dir=plane.toLocal(globaldir);
1567  float scale = -localHit.z() / dir.z();
1568 
1569  LocalPoint projectedPos = localHit + scale*dir;
1570 
1571  float selfAngle = topol.stripAngle( topol.strip( hit.localPosition()));
1572 
1573  // vector along strip in hit frame
1574  LocalVector stripDir( sin(selfAngle), cos(selfAngle), 0);
1575 
1576  LocalVector
1577  localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir)));
1578 
1579  return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1580 }
1581 
1582 // Return a map between DTRecHit1DPair and wireId
1583 std::map<DTWireId, std::vector<DTRecHit1DPair> >
1585  dt1DRecHitPairs) {
1586  std::map<DTWireId, std::vector<DTRecHit1DPair> > ret;
1587 
1588  for(DTRecHitCollection::const_iterator rechit = dt1DRecHitPairs->begin();
1589  rechit != dt1DRecHitPairs->end(); rechit++) {
1590  ret[(*rechit).wireId()].push_back(*rechit);
1591  }
1592 
1593  return ret;
1594 }
1595 
1596 // Compute SimHit distance from wire (cm)
1598  DTWireId wireId,
1599  const PSimHit& hit) {
1600  float xwire = layer->specificTopology().wirePosition(wireId.wire());
1601  LocalPoint entryP = hit.entryPoint();
1602  LocalPoint exitP = hit.exitPoint();
1603  float xEntry = entryP.x()-xwire;
1604  float xExit = exitP.x()-xwire;
1605 
1606  //FIXME: check...
1607  return fabs(xEntry - (entryP.z()*(xExit-xEntry))/(exitP.z()-entryP.z()));
1608 }
1609 
1610 // Find the RecHit closest to the muon SimHit
1611 template <typename type>
1612 const type*
1614  DTWireId wireId,
1615  const std::vector<type>& recHits,
1616  const float simHitDist) {
1617  float res = 99999;
1618  const type* theBestRecHit = 0;
1619  // Loop over RecHits within the cell
1620  for(typename std::vector<type>::const_iterator recHit = recHits.begin();
1621  recHit != recHits.end();
1622  recHit++) {
1623  float distTmp = recHitDistFromWire(*recHit, layer);
1624  if(fabs(distTmp-simHitDist) < res) {
1625  res = fabs(distTmp-simHitDist);
1626  theBestRecHit = &(*recHit);
1627  }
1628  } // End of loop over RecHits within the cell
1629 
1630  return theBestRecHit;
1631 }
1632 
1633 // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
1634 float
1636  const DTLayer* layer) {
1637  // Compute the rechit distance from wire
1638  return fabs(hitPair.localPosition(DTEnums::Left).x() -
1639  hitPair.localPosition(DTEnums::Right).x())/2.;
1640 }
1641 
1642 // Compute the distance from wire (cm) of a hits in a DTRecHit1D
1643 float
1645  const DTLayer* layer) {
1646  return fabs(recHit.localPosition().x() -
1647  layer->specificTopology().wirePosition(recHit.wireId().wire()));
1648 }
1649 
1650 template <typename type>
1652  std::map<DTWireId, std::vector<PSimHit> >
1653  simHitsPerWire,
1654  std::map<DTWireId, std::vector<type> >
1655  recHitsPerWire,
1656  int step) {
1657 
1658  int nDt = 0;
1659  // Loop over cells with a muon SimHit
1660  for(std::map<DTWireId, std::vector<PSimHit> >::const_iterator wireAndSHits =
1661  simHitsPerWire.begin();
1662  wireAndSHits != simHitsPerWire.end();
1663  wireAndSHits++) {
1664  DTWireId wireId = (*wireAndSHits).first;
1665  std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
1666 
1667  // Get the layer
1668  const DTLayer* layer = dtGeom->layer(wireId);
1669 
1670  // Look for a mu hit in the cell
1671  const PSimHit* muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
1672  if (muSimHit==0) {
1673  continue; // Skip this cell
1674  }
1675 
1676  // Find the distance of the simhit from the wire
1677  float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
1678  // Skip simhits out of the cell
1679  if(simHitWireDist>2.1) {
1680  continue; // Skip this cell
1681  }
1682 
1683  // Look for RecHits in the same cell
1684  if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
1685  continue; // No RecHit found in this cell
1686  } else {
1687 
1688  std::vector<type> recHits = recHitsPerWire[wireId];
1689 
1690  // Find the best RecHit
1691  const type* theBestRecHit =
1692  findBestRecHit(layer, wireId, recHits, simHitWireDist);
1693 
1694  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
1695 
1696  ++nDt;
1697 
1698  mehDtMuonRes->Fill(recHitWireDist-simHitWireDist);
1699 
1700  } // find rechits
1701  } // loop over simhits
1702 
1703  return nDt;
1704 }
1705 
1706 void
1708  const CSCRecHit2D & recHit,
1709  const CSCLayer * layer,
1710  int chamberType) {
1711  GlobalPoint simHitPos = layer->toGlobal(simHit.localPosition());
1712  GlobalPoint recHitPos = layer->toGlobal(recHit.localPosition());
1713 
1714  mehCSCResRDPhi->Fill(recHitPos.phi()-simHitPos.phi());
1715 }
1716 
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:42
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:414
type
Definition: HCALResponse.h:22
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
GlobalRecHitsAnalyzer(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:73
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:71
int i
Definition: DBlmapReader.cc:9
MonitorElement * mehCSCResRDPhi
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
std::vector< PCaloHit > PCaloHitContainer
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
const std::string & label
Definition: MVAComputer.cc:186
virtual float stripAngle(float strip) const =0
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
static const int sdHcalOut
std::vector< PSimHit > matched
#define PI
MonitorElement * mehHcalRes[4]
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
static const int sdSiTID
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void fillMuon(const edm::Event &, const edm::EventSetup &)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
std::vector< T >::const_iterator const_iterator
T y() const
Definition: PV3DBase.h:57
static const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
MonitorElement * mehEcalRes[3]
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
MonitorElement * mehSiStripn[19]
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
virtual LocalPoint localPosition() const
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
dictionary map
Definition: Association.py:160
virtual float strip(const LocalPoint &) const =0
void Fill(long long x)
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
Definition: DTGeometry.cc:115
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
std::map< int, edm::PSimHitContainer > theMap
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:45
const DTTopology & specificTopology() const
Definition: DTLayer.cc:44
int iEvent
Definition: GenABIO.cc:243
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
static const int sdSiTIB
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:42
static const int sdPxlBrl
Local3DPoint localPosition() const
Definition: PSimHit.h:44
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:87
int compute(const DTGeometry *dtGeom, std::map< DTWireId, std::vector< PSimHit > > simHitsPerWire, std::map< DTWireId, std::vector< type > > recHitsPerWire, int step)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
T sqrt(T t)
Definition: SSEVec.h:28
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:58
MonitorElement * mehSiPixelResX[7]
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int j
Definition: DBlmapReader.cc:9
MonitorElement * mehEcaln[3]
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
static const int sdSiTOB
void setVerbose(unsigned level)
Definition: DQMStore.cc:201
MonitorElement * mehSiPixelResY[7]
MonitorElement * mehSiStripResY[19]
bool isValid() const
Definition: HandleBase.h:76
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:62
const int verbosity
const_iterator end() const
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:52
int wire() const
Return the wire number.
Definition: DTWireId.h:58
Definition: DetId.h:20
int chamberType() const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
MonitorElement * mehSiPixeln[7]
static const int sdHcalFwd
tuple simHits
Definition: trackerHits.py:16
T const * product() const
Definition: Handle.h:74
std::map< uint32_t, float, std::less< uint32_t > > MapType
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
static const int sdHcalBrl
void fillTrk(const edm::Event &, const edm::EventSetup &)
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
std::string const & label() const
Definition: InputTag.h:25
T eta() const
Definition: PV3DBase.h:70
ESHandle< TrackerGeometry > geometry
edm::EventID id() const
Definition: EventBase.h:56
static const int sdSiTEC
iterator find(key_type k)
MonitorElement * mehHcaln[4]
iterator end()
Definition: DetSetNew.h:59
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
void fillECal(const edm::Event &, const edm::EventSetup &)
std::vector< PSimHit > PSimHitContainer
static const int sdPxlFwd
DetId geographicalId() const
dbl *** dir
Definition: mlp_gen.cc:35
static std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
void showDirStructure(void) const
Definition: DQMStore.cc:2539
LocalPoint localPosition() const
Definition: CSCRecHit2D.h:45
bool isValid() const
Definition: ESHandle.h:37
const GlobalPoint & getPosition() const
bool isForward() const
Definition: RPCRoll.cc:98
T x() const
Definition: PV3DBase.h:56
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * mehSiStripResX[19]
std::string const & instance() const
Definition: InputTag.h:26
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
static const int sdHcalEC
const CSCChamber * chamber() const
Definition: CSCLayer.h:52
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
const_iterator begin() const
virtual LocalPoint localPosition() const
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
void fillHCal(const edm::Event &, const edm::EventSetup &)
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:109
iterator begin()
Definition: DetSetNew.h:56