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