CMS 3D CMS Logo

GlobalHitsProducer.cc
Go to the documentation of this file.
1 
11 
13  fName(""), verbosity(0), frequency(0), vtxunit(0), label(""),
14  getAllProvenances(false), printProvenanceInfo(false), nRawGenPart(0),
15  G4VtxSrc_Token_( consumes<edm::SimVertexContainer>((iPSet.getParameter<edm::InputTag>("G4VtxSrc"))) ),
16  G4TrkSrc_Token_( consumes<edm::SimTrackContainer>(iPSet.getParameter<edm::InputTag>("G4TrkSrc")) ),
17  //ECalEBSrc_(""), ECalEESrc_(""), ECalESSrc_(""), HCalSrc_(""),
18  //PxlBrlLowSrc_(""), PxlBrlHighSrc_(""), PxlFwdLowSrc_(""),
19  //PxlFwdHighSrc_(""), SiTIBLowSrc_(""), SiTIBHighSrc_(""),
20  //SiTOBLowSrc_(""), SiTOBHighSrc_(""), SiTIDLowSrc_(""),
21  //SiTIDHighSrc_(""), SiTECLowSrc_(""), SiTECHighSrc_(""),
22  //MuonDtSrc_(""), MuonCscSrc_(""), MuonRpcSrc_(""),
23  count(0)
24 {
25  std::string MsgLoggerCat = "GlobalHitsProducer_GlobalHitsProducer";
26 
27  // get information from parameter set
28  fName = iPSet.getUntrackedParameter<std::string>("Name");
29  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
30  frequency = iPSet.getUntrackedParameter<int>("Frequency");
31  vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit");
32  label = iPSet.getParameter<std::string>("Label");
33  edm::ParameterSet m_Prov =
34  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
36  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
38  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
39 
40  //get Labels to use to extract information
41  PxlBrlLowSrc_ = iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc");
42  PxlBrlHighSrc_ = iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc");
43  PxlFwdLowSrc_ = iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc");
44  PxlFwdHighSrc_ = iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc");
45 
46  SiTIBLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTIBLowSrc");
47  SiTIBHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTIBHighSrc");
48  SiTOBLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTOBLowSrc");
49  SiTOBHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTOBHighSrc");
50  SiTIDLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTIDLowSrc");
51  SiTIDHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTIDHighSrc");
52  SiTECLowSrc_ = iPSet.getParameter<edm::InputTag>("SiTECLowSrc");
53  SiTECHighSrc_ = iPSet.getParameter<edm::InputTag>("SiTECHighSrc");
54 
55  MuonCscSrc_ = iPSet.getParameter<edm::InputTag>("MuonCscSrc");
56  MuonDtSrc_ = iPSet.getParameter<edm::InputTag>("MuonDtSrc");
57  MuonRpcSrc_ = iPSet.getParameter<edm::InputTag>("MuonRpcSrc");
58 
59  ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
60  ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
61  ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
62 
63  HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
64 
65  // fix for consumes
66  PxlBrlLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlBrlLowSrc"));
67  PxlBrlHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlBrlHighSrc"));
68  PxlFwdLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlFwdLowSrc"));
69  PxlFwdHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("PxlFwdHighSrc"));
70 
71  SiTIBLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIBLowSrc"));
72  SiTIBHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIBHighSrc"));
73  SiTOBLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTOBLowSrc"));
74  SiTOBHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTOBHighSrc"));
75  SiTIDLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIDLowSrc"));
76  SiTIDHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTIDHighSrc"));
77  SiTECLowSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTECLowSrc"));
78  SiTECHighSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("SiTECHighSrc"));
79 
80  MuonCscSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuonCscSrc"));
81  MuonDtSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuonDtSrc"));
82  MuonRpcSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuonRpcSrc"));
83 
84  ECalEBSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("ECalEBSrc"));
85  ECalEESrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("ECalEESrc"));
86  ECalESSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("ECalESSrc"));
87  HCalSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("HCalSrc"));
88 
89  // use value of first digit to determine default output level (inclusive)
90  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
91  verbosity %= 10;
92 
93  // create persistent object
94  produces<PGlobalSimHit>(label);
95 
96  // print out Parameter Set information being used
97  if (verbosity >= 0) {
98  edm::LogInfo(MsgLoggerCat)
99  << "\n===============================\n"
100  << "Initialized as EDProducer with parameter values:\n"
101  << " Name = " << fName << "\n"
102  << " Verbosity = " << verbosity << "\n"
103  << " Frequency = " << frequency << "\n"
104  << " VtxUnit = " << vtxunit << "\n"
105  << " Label = " << label << "\n"
106  << " GetProv = " << getAllProvenances << "\n"
107  << " PrintProv = " << printProvenanceInfo << "\n"
108  << " PxlBrlLowSrc = " << PxlBrlLowSrc_.label()
109  << ":" << PxlBrlLowSrc_.instance() << "\n"
110  << " PxlBrlHighSrc = " << PxlBrlHighSrc_.label()
111  << ":" << PxlBrlHighSrc_.instance() << "\n"
112  << " PxlFwdLowSrc = " << PxlFwdLowSrc_.label()
113  << ":" << PxlBrlLowSrc_.instance() << "\n"
114  << " PxlFwdHighSrc = " << PxlFwdHighSrc_.label()
115  << ":" << PxlBrlHighSrc_.instance() << "\n"
116  << " SiTIBLowSrc = " << SiTIBLowSrc_.label()
117  << ":" << SiTIBLowSrc_.instance() << "\n"
118  << " SiTIBHighSrc = " << SiTIBHighSrc_.label()
119  << ":" << SiTIBHighSrc_.instance() << "\n"
120  << " SiTOBLowSrc = " << SiTOBLowSrc_.label()
121  << ":" << SiTOBLowSrc_.instance() << "\n"
122  << " SiTOBHighSrc = " << SiTOBHighSrc_.label()
123  << ":" << SiTOBHighSrc_.instance() << "\n"
124  << " SiTIDLowSrc = " << SiTIDLowSrc_.label()
125  << ":" << SiTIDLowSrc_.instance() << "\n"
126  << " SiTIDHighSrc = " << SiTIDHighSrc_.label()
127  << ":" << SiTIDHighSrc_.instance() << "\n"
128  << " SiTECLowSrc = " << SiTECLowSrc_.label()
129  << ":" << SiTECLowSrc_.instance() << "\n"
130  << " SiTECHighSrc = " << SiTECHighSrc_.label()
131  << ":" << SiTECHighSrc_.instance() << "\n"
132  << " MuonCscSrc = " << MuonCscSrc_.label()
133  << ":" << MuonCscSrc_.instance() << "\n"
134  << " MuonDtSrc = " << MuonDtSrc_.label()
135  << ":" << MuonDtSrc_.instance() << "\n"
136  << " MuonRpcSrc = " << MuonRpcSrc_.label()
137  << ":" << MuonRpcSrc_.instance() << "\n"
138  << " ECalEBSrc = " << ECalEBSrc_.label()
139  << ":" << ECalEBSrc_.instance() << "\n"
140  << " ECalEESrc = " << ECalEESrc_.label()
141  << ":" << ECalEESrc_.instance() << "\n"
142  << " ECalESSrc = " << ECalESSrc_.label()
143  << ":" << ECalESSrc_.instance() << "\n"
144  << " HCalSrc = " << HCalSrc_.label()
145  << ":" << HCalSrc_.instance() << "\n"
146  << "===============================\n";
147  }
148 
149  // migrated here from beginJob
150  clear();
151 
152 }
153 
155 {
156 }
157 
159 {
160  return;
161 }
162 
164 {
165  std::string MsgLoggerCat = "GlobalHitsProducer_endJob";
166  if (verbosity >= 0)
167  edm::LogInfo(MsgLoggerCat)
168  << "Terminating having processed " << count << " events.";
169  return;
170 }
171 
173  const edm::EventSetup& iSetup)
174 {
175  std::string MsgLoggerCat = "GlobalHitsProducer_produce";
176 
177  // keep track of number of events processed
178  ++count;
179 
180  // get event id information
181  edm::RunNumber_t nrun = iEvent.id().run();
182  edm::EventNumber_t nevt = iEvent.id().event();
183 
184  if (verbosity > 0) {
185  edm::LogInfo(MsgLoggerCat)
186  << "Processing run " << nrun << ", event " << nevt
187  << " (" << count << " events total)";
188  } else if (verbosity == 0) {
189  if (nevt%frequency == 0 || nevt == 1) {
190  edm::LogInfo(MsgLoggerCat)
191  << "Processing run " << nrun << ", event " << nevt
192  << " (" << count << " events total)";
193  }
194  }
195 
196  // clear event holders
197  clear();
198 
199  // look at information available in the event
200  if (getAllProvenances) {
201 
202  std::vector<const edm::StableProvenance*> AllProv;
203  iEvent.getAllStableProvenance(AllProv);
204 
205  if (verbosity >= 0)
206  edm::LogInfo(MsgLoggerCat)
207  << "Number of Provenances = " << AllProv.size();
208 
209  if (printProvenanceInfo && (verbosity >= 0)) {
210  TString eventout("\nProvenance info:\n");
211 
212  for (unsigned int i = 0; i < AllProv.size(); ++i) {
213  eventout += "\n ******************************";
214  eventout += "\n Module : ";
215  eventout += AllProv[i]->moduleLabel();
216  eventout += "\n ProductID : ";
217  eventout += AllProv[i]->productID().id();
218  eventout += "\n ClassName : ";
219  eventout += AllProv[i]->className();
220  eventout += "\n InstanceName : ";
221  eventout += AllProv[i]->productInstanceName();
222  eventout += "\n BranchName : ";
223  eventout += AllProv[i]->branchName();
224  }
225  eventout += "\n ******************************\n";
226  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
227  printProvenanceInfo = false;
228  }
229  getAllProvenances = false;
230  }
231 
232  // call fill functions
233  //gather G4MC information from event
234  fillG4MC(iEvent);
235  // gather Tracker information from event
236  fillTrk(iEvent,iSetup);
237  // gather muon information from event
238  fillMuon(iEvent, iSetup);
239  // gather Ecal information from event
240  fillECal(iEvent, iSetup);
241  // gather Hcal information from event
242  fillHCal(iEvent, iSetup);
243 
244  if (verbosity > 0)
245  edm::LogInfo (MsgLoggerCat)
246  << "Done gathering data from event.";
247 
248  // produce object to put into event
249  std::unique_ptr<PGlobalSimHit> pOut(new PGlobalSimHit);
250 
251  if (verbosity > 2)
252  edm::LogInfo (MsgLoggerCat)
253  << "Saving event contents:";
254 
255  // call store functions
256  // store G4MC information in product
257  storeG4MC(*pOut);
258  // store Tracker information in produce
259  storeTrk(*pOut);
260  // store Muon information in produce
261  storeMuon(*pOut);
262  // store ECal information in produce
263  storeECal(*pOut);
264  // store HCal information in produce
265  storeHCal(*pOut);
266 
267  // store information in event
268  iEvent.put(std::move(pOut),label);
269 
270  return;
271 }
272 
273 //==================fill and store functions================================
275 {
276 
277  std::string MsgLoggerCat = "GlobalHitsProducer_fillG4MC";
278 
279  TString eventout;
280  if (verbosity > 0)
281  eventout = "\nGathering info:";
282 
284  // get MC information
287  std::vector<edm::Handle<edm::HepMCProduct> > AllHepMCEvt;
288  iEvent.getManyByType(AllHepMCEvt);
289 
290  // loop through products and extract VtxSmearing if available. Any of them
291  // should have the information needed
292  for (unsigned int i = 0; i < AllHepMCEvt.size(); ++i) {
293  HepMCEvt = AllHepMCEvt[i];
294  if ((HepMCEvt.provenance()->branchDescription()).moduleLabel() == "generatorSmeared")
295  break;
296  }
297 
298  if (!HepMCEvt.isValid()) {
299  edm::LogWarning(MsgLoggerCat)
300  << "Unable to find HepMCProduct in event!";
301  return;
302  } else {
303  eventout += "\n Using HepMCProduct: ";
304  eventout += (HepMCEvt.provenance()->branchDescription()).moduleLabel();
305  }
306  const HepMC::GenEvent* MCEvt = HepMCEvt->GetEvent();
307  nRawGenPart = MCEvt->particles_size();
308 
309  if (verbosity > 1) {
310  eventout += "\n Number of Raw Particles collected:......... ";
311  eventout += nRawGenPart;
312  }
313 
315  // get G4Vertex information
317  // convert unit stored in SimVertex to mm
318  float unit = 0.;
319  if (vtxunit == 0) unit = 1.; // already in mm
320  if (vtxunit == 1) unit = 10.; // stored in cm, convert to mm
321 
323  iEvent.getByToken(G4VtxSrc_Token_, G4VtxContainer);
324  if (!G4VtxContainer.isValid()) {
325  edm::LogWarning(MsgLoggerCat)
326  << "Unable to find SimVertex in event!";
327  return;
328  }
329  int i = 0;
330  edm::SimVertexContainer::const_iterator itVtx;
331  for (itVtx = G4VtxContainer->begin(); itVtx != G4VtxContainer->end();
332  ++itVtx) {
333 
334  ++i;
335 
336  const math::XYZTLorentzVector G4Vtx1(itVtx->position().x(),
337  itVtx->position().y(),
338  itVtx->position().z(),
339  itVtx->position().e());
340  double G4Vtx[4];
341  G4Vtx1.GetCoordinates(G4Vtx);
342 
343  G4VtxX.push_back((G4Vtx[0]*unit)/micrometer);
344  G4VtxY.push_back((G4Vtx[1]*unit)/micrometer);
345  G4VtxZ.push_back((G4Vtx[2]*unit)/millimeter);
346  }
347 
348  if (verbosity > 1) {
349  eventout += "\n Number of G4Vertices collected:............ ";
350  eventout += i;
351  }
352 
354  // get G4Track information
357  iEvent.getByToken(G4TrkSrc_Token_, G4TrkContainer);
358 
359  if (!G4TrkContainer.isValid()) {
360  edm::LogWarning(MsgLoggerCat)
361  << "Unable to find SimTrack in event!";
362  return;
363  }
364  i = 0;
365  edm::SimTrackContainer::const_iterator itTrk;
366  for (itTrk = G4TrkContainer->begin(); itTrk != G4TrkContainer->end();
367  ++itTrk) {
368 
369  ++i;
370 
371  const math::XYZTLorentzVector G4Trk1(itTrk->momentum().x(),
372  itTrk->momentum().y(),
373  itTrk->momentum().z(),
374  itTrk->momentum().e());
375  double G4Trk[4];
376  G4Trk1.GetCoordinates(G4Trk);
377 
378  G4TrkPt.push_back(sqrt(G4Trk[0]*G4Trk[0]+G4Trk[1]*G4Trk[1])); //GeV
379  G4TrkE.push_back(G4Trk[3]); //GeV
380  }
381 
382  if (verbosity > 1) {
383  eventout += "\n Number of G4Tracks collected:.............. ";
384  eventout += i;
385  }
386 
387  if (verbosity > 0)
388  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
389 
390  return;
391 }
392 
394 {
395  std::string MsgLoggerCat = "GlobalHitsProducer_storeG4MC";
396 
397  if (verbosity > 2) {
398  TString eventout("\n nRawGenPart = ");
399  eventout += nRawGenPart;
400  eventout += "\n nG4Vtx = ";
401  eventout += G4VtxX.size();
402  for (unsigned int i = 0; i < G4VtxX.size(); ++i) {
403  eventout += "\n (x,y,z) = (";
404  eventout += G4VtxX[i];
405  eventout += ", ";
406  eventout += G4VtxY[i];
407  eventout += ", ";
408  eventout += G4VtxZ[i];
409  eventout += ")";
410  }
411  eventout += "\n nG4Trk = ";
412  eventout += G4TrkPt.size();
413  for (unsigned int i = 0; i < G4TrkPt.size(); ++i) {
414  eventout += "\n (pt,e) = (";
415  eventout += G4TrkPt[i];
416  eventout += ", ";
417  eventout += G4TrkE[i];
418  eventout += ")";
419  }
420  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
421  } // end verbose output
422 
423  product.putRawGenPart(nRawGenPart);
424  product.putG4Vtx(G4VtxX, G4VtxY, G4VtxZ);
425  product.putG4Trk(G4TrkPt, G4TrkE);
426 
427  return;
428 }
429 
431  const edm::EventSetup& iSetup)
432 {
433  std::string MsgLoggerCat = "GlobalHitsProducer_fillTrk";
434 
435  TString eventout;
436  if (verbosity > 0)
437  eventout = "\nGathering info:";
438 
439  // access the tracker geometry
440  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
441  iSetup.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
442  if (!theTrackerGeometry.isValid()) {
443  edm::LogWarning(MsgLoggerCat)
444  << "Unable to find TrackerDigiGeometryRecord in event!";
445  return;
446  }
447  const TrackerGeometry& theTracker(*theTrackerGeometry);
448 
449  // iterator to access containers
450  edm::PSimHitContainer::const_iterator itHit;
451 
453  // get Pixel Barrel information
455  edm::PSimHitContainer thePxlBrlHits;
456  // extract low container
457  edm::Handle<edm::PSimHitContainer> PxlBrlLowContainer;
458  iEvent.getByToken(PxlBrlLowSrc_Token_,PxlBrlLowContainer);
459  if (!PxlBrlLowContainer.isValid()) {
460  edm::LogWarning(MsgLoggerCat)
461  << "Unable to find TrackerHitsPixelBarrelLowTof in event!";
462  return;
463  }
464  // extract high container
465  edm::Handle<edm::PSimHitContainer> PxlBrlHighContainer;
466  iEvent.getByToken(PxlBrlHighSrc_Token_,PxlBrlHighContainer);
467  if (!PxlBrlHighContainer.isValid()) {
468  edm::LogWarning(MsgLoggerCat)
469  << "Unable to find TrackerHitsPixelBarrelHighTof in event!";
470  return;
471  }
472  // place both containers into new container
473  thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlLowContainer->begin(),
474  PxlBrlLowContainer->end());
475  thePxlBrlHits.insert(thePxlBrlHits.end(),PxlBrlHighContainer->begin(),
476  PxlBrlHighContainer->end());
477 
478  // cycle through new container
479  int i = 0, j = 0;
480  for (itHit = thePxlBrlHits.begin(); itHit != thePxlBrlHits.end(); ++itHit) {
481 
482  ++i;
483 
484  // create a DetId from the detUnitId
485  DetId theDetUnitId(itHit->detUnitId());
486  int detector = theDetUnitId.det();
487  int subdetector = theDetUnitId.subdetId();
488 
489  // check that expected detector is returned
490  if ((detector == dTrk) && (subdetector == sdPxlBrl)) {
491 
492  // get the GeomDetUnit from the geometry using theDetUnitID
493  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
494 
495  if (!theDet) {
496  edm::LogWarning(MsgLoggerCat)
497  << "Unable to get GeomDetUnit from PxlBrlHits for Hit " << i;
498  continue;
499  }
500 
501  ++j;
502 
503  // get the Surface of the hit (knows how to go from local <-> global)
504  const BoundPlane& bSurface = theDet->surface();
505 
506  // gather necessary information
507  PxlBrlToF.push_back(itHit->tof());
508  PxlBrlR.push_back(bSurface.toGlobal(itHit->localPosition()).perp());
509  PxlBrlPhi.push_back(bSurface.toGlobal(itHit->localPosition()).phi());
510  PxlBrlEta.push_back(bSurface.toGlobal(itHit->localPosition()).eta());
511 
512  } else {
513  edm::LogWarning(MsgLoggerCat)
514  << "PxlBrl PSimHit " << i
515  << " is expected to be (det,subdet) = ("
516  << dTrk << "," << sdPxlBrl
517  << "); value returned is: ("
518  << detector << "," << subdetector << ")";
519  continue;
520  } // end detector type check
521  } // end loop through PxlBrl Hits
522 
523  if (verbosity > 1) {
524  eventout += "\n Number of Pixel Barrel Hits collected:..... ";
525  eventout += j;
526  }
527 
529  // get Pixel Forward information
531  edm::PSimHitContainer thePxlFwdHits;
532  // extract low container
533  edm::Handle<edm::PSimHitContainer> PxlFwdLowContainer;
534  iEvent.getByToken(PxlFwdLowSrc_Token_,PxlFwdLowContainer);
535  if (!PxlFwdLowContainer.isValid()) {
536  edm::LogWarning(MsgLoggerCat)
537  << "Unable to find TrackerHitsPixelEndcapLowTof in event!";
538  return;
539  }
540  // extract high container
541  edm::Handle<edm::PSimHitContainer> PxlFwdHighContainer;
542  iEvent.getByToken(PxlFwdHighSrc_Token_,PxlFwdHighContainer);
543  if (!PxlFwdHighContainer.isValid()) {
544  edm::LogWarning("GlobalHitsProducer_fillTrk")
545  << "Unable to find TrackerHitsPixelEndcapHighTof in event!";
546  return;
547  }
548  // place both containers into new container
549  thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdLowContainer->begin(),
550  PxlFwdLowContainer->end());
551  thePxlFwdHits.insert(thePxlFwdHits.end(),PxlFwdHighContainer->begin(),
552  PxlFwdHighContainer->end());
553 
554  // cycle through new container
555  i = 0; j = 0;
556  for (itHit = thePxlFwdHits.begin(); itHit != thePxlFwdHits.end(); ++itHit) {
557 
558  ++i;
559 
560  // create a DetId from the detUnitId
561  DetId theDetUnitId(itHit->detUnitId());
562  int detector = theDetUnitId.det();
563  int subdetector = theDetUnitId.subdetId();
564 
565  // check that expected detector is returned
566  if ((detector == dTrk) && (subdetector == sdPxlFwd)) {
567 
568  // get the GeomDetUnit from the geometry using theDetUnitID
569  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
570 
571  if (!theDet) {
572  edm::LogWarning(MsgLoggerCat)
573  << "Unable to get GeomDetUnit from PxlFwdHits for Hit " << i;;
574  continue;
575  }
576 
577  ++j;
578 
579  // get the Surface of the hit (knows how to go from local <-> global)
580  const BoundPlane& bSurface = theDet->surface();
581 
582  // gather necessary information
583  PxlFwdToF.push_back(itHit->tof());
584  PxlFwdZ.push_back(bSurface.toGlobal(itHit->localPosition()).z());
585  PxlFwdPhi.push_back(bSurface.toGlobal(itHit->localPosition()).phi());
586  PxlFwdEta.push_back(bSurface.toGlobal(itHit->localPosition()).eta());
587  } else {
588  edm::LogWarning(MsgLoggerCat)
589  << "PxlFwd PSimHit " << i
590  << " is expected to be (det,subdet) = ("
591  << dTrk << "," << sdPxlFwd
592  << "); value returned is: ("
593  << detector << "," << subdetector << ")";
594  continue;
595  } // end detector type check
596  } // end loop through PxlFwd Hits
597 
598  if (verbosity > 1) {
599  eventout += "\n Number of Pixel Forward Hits collected:.... ";
600  eventout += j;
601  }
602 
604  // get Silicon Barrel information
606  edm::PSimHitContainer theSiBrlHits;
607  // extract TIB low container
608  edm::Handle<edm::PSimHitContainer> SiTIBLowContainer;
609  iEvent.getByToken(SiTIBLowSrc_Token_,SiTIBLowContainer);
610  if (!SiTIBLowContainer.isValid()) {
611  edm::LogWarning(MsgLoggerCat)
612  << "Unable to find TrackerHitsTIBLowTof in event!";
613  return;
614  }
615  // extract TIB high container
616  edm::Handle<edm::PSimHitContainer> SiTIBHighContainer;
617  iEvent.getByToken(SiTIBHighSrc_Token_,SiTIBHighContainer);
618  if (!SiTIBHighContainer.isValid()) {
619  edm::LogWarning(MsgLoggerCat)
620  << "Unable to find TrackerHitsTIBHighTof in event!";
621  return;
622  }
623  // extract TOB low container
624  edm::Handle<edm::PSimHitContainer> SiTOBLowContainer;
625  iEvent.getByToken(SiTOBLowSrc_Token_,SiTOBLowContainer);
626  if (!SiTOBLowContainer.isValid()) {
627  edm::LogWarning(MsgLoggerCat)
628  << "Unable to find TrackerHitsTOBLowTof in event!";
629  return;
630  }
631  // extract TOB high container
632  edm::Handle<edm::PSimHitContainer> SiTOBHighContainer;
633  iEvent.getByToken(SiTOBHighSrc_Token_,SiTOBHighContainer);
634  if (!SiTOBHighContainer.isValid()) {
635  edm::LogWarning(MsgLoggerCat)
636  << "Unable to find TrackerHitsTOBHighTof in event!";
637  return;
638  }
639  // place all containers into new container
640  theSiBrlHits.insert(theSiBrlHits.end(),SiTIBLowContainer->begin(),
641  SiTIBLowContainer->end());
642  theSiBrlHits.insert(theSiBrlHits.end(),SiTIBHighContainer->begin(),
643  SiTIBHighContainer->end());
644  theSiBrlHits.insert(theSiBrlHits.end(),SiTOBLowContainer->begin(),
645  SiTOBLowContainer->end());
646  theSiBrlHits.insert(theSiBrlHits.end(),SiTOBHighContainer->begin(),
647  SiTOBHighContainer->end());
648 
649  // cycle through new container
650  i = 0; j = 0;
651  for (itHit = theSiBrlHits.begin(); itHit != theSiBrlHits.end(); ++itHit) {
652 
653  ++i;
654 
655  // create a DetId from the detUnitId
656  DetId theDetUnitId(itHit->detUnitId());
657  int detector = theDetUnitId.det();
658  int subdetector = theDetUnitId.subdetId();
659 
660  // check that expected detector is returned
661  if ((detector == dTrk) &&
662  ((subdetector == sdSiTIB) ||
663  (subdetector == sdSiTOB))) {
664 
665  // get the GeomDetUnit from the geometry using theDetUnitID
666  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
667 
668  if (!theDet) {
669  edm::LogWarning(MsgLoggerCat)
670  << "Unable to get GeomDetUnit from SiBrlHits for Hit " << i;
671  continue;
672  }
673 
674  ++j;
675 
676  // get the Surface of the hit (knows how to go from local <-> global)
677  const BoundPlane& bSurface = theDet->surface();
678 
679  // gather necessary information
680  SiBrlToF.push_back(itHit->tof());
681  SiBrlR.push_back(bSurface.toGlobal(itHit->localPosition()).perp());
682  SiBrlPhi.push_back(bSurface.toGlobal(itHit->localPosition()).phi());
683  SiBrlEta.push_back(bSurface.toGlobal(itHit->localPosition()).eta());
684  } else {
685  edm::LogWarning(MsgLoggerCat)
686  << "SiBrl PSimHit " << i
687  << " is expected to be (det,subdet) = ("
688  << dTrk << "," << sdSiTIB
689  << " || " << sdSiTOB << "); value returned is: ("
690  << detector << "," << subdetector << ")";
691  continue;
692  } // end detector type check
693  } // end loop through SiBrl Hits
694 
695  if (verbosity > 1) {
696  eventout += "\n Number of Silicon Barrel Hits collected:... ";
697  eventout += j;
698  }
699 
701  // get Silicon Forward information
703  edm::PSimHitContainer theSiFwdHits;
704  // extract TID low container
705  edm::Handle<edm::PSimHitContainer> SiTIDLowContainer;
706  iEvent.getByToken(SiTIDLowSrc_Token_,SiTIDLowContainer);
707  if (!SiTIDLowContainer.isValid()) {
708  edm::LogWarning(MsgLoggerCat)
709  << "Unable to find TrackerHitsTIDLowTof in event!";
710  return;
711  }
712  // extract TID high container
713  edm::Handle<edm::PSimHitContainer> SiTIDHighContainer;
714  iEvent.getByToken(SiTIDHighSrc_Token_,SiTIDHighContainer);
715  if (!SiTIDHighContainer.isValid()) {
716  edm::LogWarning("GlobalHitsProducer_fillTrk")
717  << "Unable to find TrackerHitsTIDHighTof in event!";
718  return;
719  }
720  // extract TEC low container
721  edm::Handle<edm::PSimHitContainer> SiTECLowContainer;
722  iEvent.getByToken(SiTECLowSrc_Token_,SiTECLowContainer);
723  if (!SiTECLowContainer.isValid()) {
724  edm::LogWarning(MsgLoggerCat)
725  << "Unable to find TrackerHitsTECLowTof in event!";
726  return;
727  }
728  // extract TEC high container
729  edm::Handle<edm::PSimHitContainer> SiTECHighContainer;
730  iEvent.getByToken(SiTECHighSrc_Token_,SiTECHighContainer);
731  if (!SiTECHighContainer.isValid()) {
732  edm::LogWarning(MsgLoggerCat)
733  << "Unable to find TrackerHitsTECHighTof in event!";
734  return;
735  }
736  // place all containers into new container
737  theSiFwdHits.insert(theSiFwdHits.end(),SiTIDLowContainer->begin(),
738  SiTIDLowContainer->end());
739  theSiFwdHits.insert(theSiFwdHits.end(),SiTIDHighContainer->begin(),
740  SiTIDHighContainer->end());
741  theSiFwdHits.insert(theSiFwdHits.end(),SiTECLowContainer->begin(),
742  SiTECLowContainer->end());
743  theSiFwdHits.insert(theSiFwdHits.end(),SiTECHighContainer->begin(),
744  SiTECHighContainer->end());
745 
746  // cycle through container
747  i = 0; j = 0;
748  for (itHit = theSiFwdHits.begin(); itHit != theSiFwdHits.end(); ++itHit) {
749 
750  ++i;
751 
752  // create a DetId from the detUnitId
753  DetId theDetUnitId(itHit->detUnitId());
754  int detector = theDetUnitId.det();
755  int subdetector = theDetUnitId.subdetId();
756 
757  // check that expected detector is returned
758  if ((detector == dTrk) &&
759  ((subdetector == sdSiTID) ||
760  (subdetector == sdSiTEC))) {
761 
762  // get the GeomDetUnit from the geometry using theDetUnitID
763  const GeomDetUnit *theDet = theTracker.idToDetUnit(theDetUnitId);
764 
765  if (!theDet) {
766  edm::LogWarning(MsgLoggerCat)
767  << "Unable to get GeomDetUnit from SiFwdHits Hit " << i;
768  return;
769  }
770 
771  ++j;
772 
773  // get the Surface of the hit (knows how to go from local <-> global)
774  const BoundPlane& bSurface = theDet->surface();
775 
776  // gather necessary information
777  SiFwdToF.push_back(itHit->tof());
778  SiFwdZ.push_back(bSurface.toGlobal(itHit->localPosition()).z());
779  SiFwdPhi.push_back(bSurface.toGlobal(itHit->localPosition()).phi());
780  SiFwdEta.push_back(bSurface.toGlobal(itHit->localPosition()).eta());
781  } else {
782  edm::LogWarning(MsgLoggerCat)
783  << "SiFwd PSimHit " << i
784  << " is expected to be (det,subdet) = ("
785  << dTrk << "," << sdSiTOB
786  << " || " << sdSiTEC << "); value returned is: ("
787  << detector << "," << subdetector << ")";
788  continue;
789  } // end check detector type
790  } // end loop through SiFwd Hits
791 
792  if (verbosity > 1) {
793  eventout += "\n Number of Silicon Forward Hits collected:.. ";
794  eventout += j;
795  }
796 
797  if (verbosity > 0)
798  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
799 
800  return;
801  }
802 
804 {
805  std::string MsgLoggerCat = "GlobalHitsProducer_storeTrk";
806 
807  if (verbosity > 2) {
808  TString eventout("\n nPxlBrlHits = ");
809  eventout += PxlBrlToF.size();
810  for (unsigned int i = 0; i < PxlBrlToF.size(); ++i) {
811  eventout += "\n (tof,r,phi,eta) = (";
812  eventout += PxlBrlToF[i];
813  eventout += ", ";
814  eventout += PxlBrlR[i];
815  eventout += ", ";
816  eventout += PxlBrlPhi[i];
817  eventout += ", ";
818  eventout += PxlBrlEta[i];
819  eventout += ")";
820  } // end PxlBrl output
821  eventout += "\n nPxlFwdHits = ";
822  eventout += PxlFwdToF.size();
823  for (unsigned int i = 0; i < PxlFwdToF.size(); ++i) {
824  eventout += "\n (tof,z,phi,eta) = (";
825  eventout += PxlFwdToF[i];
826  eventout += ", ";
827  eventout += PxlFwdZ[i];
828  eventout += ", ";
829  eventout += PxlFwdPhi[i];
830  eventout += ", ";
831  eventout += PxlFwdEta[i];
832  eventout += ")";
833  } // end PxlFwd output
834  eventout += "\n nSiBrlHits = ";
835  eventout += SiBrlToF.size();
836  for (unsigned int i = 0; i < SiBrlToF.size(); ++i) {
837  eventout += "\n (tof,r,phi,eta) = (";
838  eventout += SiBrlToF[i];
839  eventout += ", ";
840  eventout += SiBrlR[i];
841  eventout += ", ";
842  eventout += SiBrlPhi[i];
843  eventout += ", ";
844  eventout += SiBrlEta[i];
845  eventout += ")";
846  } // end SiBrl output
847  eventout += "\n nSiFwdHits = ";
848  eventout += SiFwdToF.size();
849  for (unsigned int i = 0; i < SiFwdToF.size(); ++i) {
850  eventout += "\n (tof,z,phi,eta) = (";
851  eventout += SiFwdToF[i];
852  eventout += ", ";
853  eventout += SiFwdZ[i];
854  eventout += ", ";
855  eventout += SiFwdPhi[i];
856  eventout += ", ";
857  eventout += SiFwdEta[i];
858  eventout += ")";
859  } // end SiFwd output
860  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
861  } // end verbose output
862 
867 
868  return;
869 }
870 
872  const edm::EventSetup& iSetup)
873 {
874  std::string MsgLoggerCat = "GlobalHitsProducer_fillMuon";
875 
876  TString eventout;
877  if (verbosity > 0)
878  eventout = "\nGathering info:";
879 
880  // iterator to access containers
881  edm::PSimHitContainer::const_iterator itHit;
882 
883  //int i = 0, j = 0;
885  // access the CSC Muon
887  // access the CSC Muon geometry
888  edm::ESHandle<CSCGeometry> theCSCGeometry;
889  iSetup.get<MuonGeometryRecord>().get(theCSCGeometry);
890  if (!theCSCGeometry.isValid()) {
891  edm::LogWarning(MsgLoggerCat)
892  << "Unable to find MuonGeometryRecord for the CSCGeometry in event!";
893  return;
894  }
895  const CSCGeometry& theCSCMuon(*theCSCGeometry);
896 
897  // get Muon CSC information
898  edm::Handle<edm::PSimHitContainer> MuonCSCContainer;
899  iEvent.getByToken(MuonCscSrc_Token_,MuonCSCContainer);
900  if (!MuonCSCContainer.isValid()) {
901  edm::LogWarning(MsgLoggerCat)
902  << "Unable to find MuonCSCHits in event!";
903  return;
904  }
905 
906  // cycle through container
907  int i = 0, j = 0;
908  for (itHit = MuonCSCContainer->begin(); itHit != MuonCSCContainer->end();
909  ++itHit) {
910 
911  ++i;
912 
913  // create a DetId from the detUnitId
914  DetId theDetUnitId(itHit->detUnitId());
915  int detector = theDetUnitId.det();
916  int subdetector = theDetUnitId.subdetId();
917 
918  // check that expected detector is returned
919  if ((detector == dMuon) &&
920  (subdetector == sdMuonCSC)) {
921 
922  // get the GeomDetUnit from the geometry using theDetUnitID
923  const GeomDetUnit *theDet = theCSCMuon.idToDetUnit(theDetUnitId);
924 
925  if (!theDet) {
926  edm::LogWarning(MsgLoggerCat)
927  << "Unable to get GeomDetUnit from theCSCMuon for hit " << i;
928  continue;
929  }
930 
931  ++j;
932 
933  // get the Surface of the hit (knows how to go from local <-> global)
934  const BoundPlane& bSurface = theDet->surface();
935 
936  // gather necessary information
937  MuonCscToF.push_back(itHit->tof());
938  MuonCscZ.push_back(bSurface.toGlobal(itHit->localPosition()).z());
939  MuonCscPhi.push_back(bSurface.toGlobal(itHit->localPosition()).phi());
940  MuonCscEta.push_back(bSurface.toGlobal(itHit->localPosition()).eta());
941  } else {
942  edm::LogWarning(MsgLoggerCat)
943  << "MuonCsc PSimHit " << i
944  << " is expected to be (det,subdet) = ("
945  << dMuon << "," << sdMuonCSC
946  << "); value returned is: ("
947  << detector << "," << subdetector << ")";
948  continue;
949  } // end detector type check
950  } // end loop through CSC Hits
951 
952  if (verbosity > 1) {
953  eventout += "\n Number of CSC muon Hits collected:......... ";
954  eventout += j;
955  }
956 
957  //i = 0, j = 0;
959  // access the DT Muon
961  // access the DT Muon geometry
962  edm::ESHandle<DTGeometry> theDTGeometry;
963  iSetup.get<MuonGeometryRecord>().get(theDTGeometry);
964  if (!theDTGeometry.isValid()) {
965  edm::LogWarning(MsgLoggerCat)
966  << "Unable to find MuonGeometryRecord for the DTGeometry in event!";
967  return;
968  }
969  const DTGeometry& theDTMuon(*theDTGeometry);
970 
971  // get Muon DT information
972  edm::Handle<edm::PSimHitContainer> MuonDtContainer;
973  iEvent.getByToken(MuonDtSrc_Token_,MuonDtContainer);
974  if (!MuonDtContainer.isValid()) {
975  edm::LogWarning(MsgLoggerCat)
976  << "Unable to find MuonDTHits in event!";
977  return;
978  }
979 
980  // cycle through container
981  i = 0, j = 0;
982  for (itHit = MuonDtContainer->begin(); itHit != MuonDtContainer->end();
983  ++itHit) {
984 
985  ++i;
986 
987  // create a DetId from the detUnitId
988  DetId theDetUnitId(itHit->detUnitId());
989  int detector = theDetUnitId.det();
990  int subdetector = theDetUnitId.subdetId();
991 
992  // check that expected detector is returned
993  if ((detector == dMuon) &&
994  (subdetector == sdMuonDT)) {
995 
996  // CSC uses wires and layers rather than the full detID
997  // get the wireId
998  DTWireId wireId(itHit->detUnitId());
999 
1000  // get the DTLayer from the geometry using the wireID
1001  const DTLayer *theDet = theDTMuon.layer(wireId.layerId());
1002 
1003  if (!theDet) {
1004  edm::LogWarning(MsgLoggerCat)
1005  << "Unable to get GeomDetUnit from theDtMuon for hit " << i;
1006  continue;
1007  }
1008 
1009  ++j;
1010 
1011  // get the Surface of the hit (knows how to go from local <-> global)
1012  const BoundPlane& bSurface = theDet->surface();
1013 
1014  // gather necessary information
1015  MuonDtToF.push_back(itHit->tof());
1016  MuonDtR.push_back(bSurface.toGlobal(itHit->localPosition()).perp());
1017  MuonDtPhi.push_back(bSurface.toGlobal(itHit->localPosition()).phi());
1018  MuonDtEta.push_back(bSurface.toGlobal(itHit->localPosition()).eta());
1019  } else {
1020  edm::LogWarning(MsgLoggerCat)
1021  << "MuonDt PSimHit " << i
1022  << " is expected to be (det,subdet) = ("
1023  << dMuon << "," << sdMuonDT
1024  << "); value returned is: ("
1025  << detector << "," << subdetector << ")";
1026  continue;
1027  } // end detector type check
1028  } // end loop through DT Hits
1029 
1030  if (verbosity > 1) {
1031  eventout += "\n Number of DT muon Hits collected:.......... ";
1032  eventout += j;
1033  }
1034 
1035  //i = 0, j = 0;
1036  //int RPCBrl = 0, RPCFwd = 0;
1038  // access the RPC Muon
1040  // access the RPC Muon geometry
1041  edm::ESHandle<RPCGeometry> theRPCGeometry;
1042  iSetup.get<MuonGeometryRecord>().get(theRPCGeometry);
1043  if (!theRPCGeometry.isValid()) {
1044  edm::LogWarning(MsgLoggerCat)
1045  << "Unable to find MuonGeometryRecord for the RPCGeometry in event!";
1046  return;
1047  }
1048  const RPCGeometry& theRPCMuon(*theRPCGeometry);
1049 
1050  // get Muon RPC information
1051  edm::Handle<edm::PSimHitContainer> MuonRPCContainer;
1052  iEvent.getByToken(MuonRpcSrc_Token_,MuonRPCContainer);
1053  if (!MuonRPCContainer.isValid()) {
1054  edm::LogWarning(MsgLoggerCat)
1055  << "Unable to find MuonRPCHits in event!";
1056  return;
1057  }
1058 
1059  // cycle through container
1060  i = 0, j = 0;
1061  int RPCBrl =0, RPCFwd = 0;
1062  for (itHit = MuonRPCContainer->begin(); itHit != MuonRPCContainer->end();
1063  ++itHit) {
1064 
1065  ++i;
1066 
1067  // create a DetID from the detUnitId
1068  DetId theDetUnitId(itHit->detUnitId());
1069  int detector = theDetUnitId.det();
1070  int subdetector = theDetUnitId.subdetId();
1071 
1072  // check that expected detector is returned
1073  if ((detector == dMuon) &&
1074  (subdetector == sdMuonRPC)) {
1075 
1076  // get an RPCDetID from the detUnitID
1077  RPCDetId RPCId(itHit->detUnitId());
1078 
1079  // find the region of the RPC hit
1080  int region = RPCId.region();
1081 
1082  // get the GeomDetUnit from the geometry using the RPCDetId
1083  const GeomDetUnit *theDet = theRPCMuon.idToDetUnit(theDetUnitId);
1084 
1085  if (!theDet) {
1086  edm::LogWarning(MsgLoggerCat)
1087  << "Unable to get GeomDetUnit from theRPCMuon for hit " << i;
1088  continue;
1089  }
1090 
1091  ++j;
1092 
1093  // get the Surface of the hit (knows how to go from local <-> global)
1094  const BoundPlane& bSurface = theDet->surface();
1095 
1096  // gather necessary information
1097  if ((region == sdMuonRPCRgnFwdp) || (region == sdMuonRPCRgnFwdn)) {
1098  ++RPCFwd;
1099 
1100  MuonRpcFwdToF.push_back(itHit->tof());
1101  MuonRpcFwdZ.push_back(bSurface.toGlobal(itHit->localPosition()).z());
1102  MuonRpcFwdPhi.
1103  push_back(bSurface.toGlobal(itHit->localPosition()).phi());
1104  MuonRpcFwdEta.
1105  push_back(bSurface.toGlobal(itHit->localPosition()).eta());
1106  } else if (region == sdMuonRPCRgnBrl) {
1107  ++RPCBrl;
1108 
1109  MuonRpcBrlToF.push_back(itHit->tof());
1110  MuonRpcBrlR.
1111  push_back(bSurface.toGlobal(itHit->localPosition()).perp());
1112  MuonRpcBrlPhi.
1113  push_back(bSurface.toGlobal(itHit->localPosition()).phi());
1114  MuonRpcBrlEta.
1115  push_back(bSurface.toGlobal(itHit->localPosition()).eta());
1116  } else {
1117  edm::LogWarning(MsgLoggerCat)
1118  << "Invalid region for RPC Muon hit" << i;
1119  continue;
1120  } // end check of region
1121  } else {
1122  edm::LogWarning(MsgLoggerCat)
1123  << "MuonRpc PSimHit " << i
1124  << " is expected to be (det,subdet) = ("
1125  << dMuon << "," << sdMuonRPC
1126  << "); value returned is: ("
1127  << detector << "," << subdetector << ")";
1128  continue;
1129  } // end detector type check
1130  } // end loop through RPC Hits
1131 
1132  if (verbosity > 1) {
1133  eventout += "\n Number of RPC muon Hits collected:......... ";
1134  eventout += j;
1135  eventout += "\n RPC Barrel muon Hits:............ ";
1136  eventout += RPCBrl;
1137  eventout += "\n RPC Forward muon Hits:........... ";
1138  eventout += RPCFwd;
1139  }
1140 
1141  if (verbosity > 0)
1142  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1143 
1144  return;
1145 }
1146 
1148 {
1149  std::string MsgLoggerCat = "GlobalHitsProducer_storeMuon";
1150 
1151  if (verbosity > 2) {
1152  TString eventout("\n nMuonCSCHits = ");
1153  eventout += MuonCscToF.size();
1154  for (unsigned int i = 0; i < MuonCscToF.size(); ++i) {
1155  eventout += "\n (tof,z,phi,eta) = (";
1156  eventout += MuonCscToF[i];
1157  eventout += ", ";
1158  eventout += MuonCscZ[i];
1159  eventout += ", ";
1160  eventout += MuonCscPhi[i];
1161  eventout += ", ";
1162  eventout += MuonCscEta[i];
1163  eventout += ")";
1164  } // end MuonCsc output
1165  eventout += "\n nMuonDtHits = ";
1166  eventout += MuonDtToF.size();
1167  for (unsigned int i = 0; i < MuonDtToF.size(); ++i) {
1168  eventout += "\n (tof,r,phi,eta) = (";
1169  eventout += MuonDtToF[i];
1170  eventout += ", ";
1171  eventout += MuonDtR[i];
1172  eventout += ", ";
1173  eventout += MuonDtPhi[i];
1174  eventout += ", ";
1175  eventout += MuonDtEta[i];
1176  eventout += ")";
1177  } // end MuonDt output
1178  eventout += "\n nMuonRpcBrlHits = ";
1179  eventout += MuonRpcBrlToF.size();
1180  for (unsigned int i = 0; i < MuonRpcBrlToF.size(); ++i) {
1181  eventout += "\n (tof,r,phi,eta) = (";
1182  eventout += MuonRpcBrlToF[i];
1183  eventout += ", ";
1184  eventout += MuonRpcBrlR[i];
1185  eventout += ", ";
1186  eventout += MuonRpcBrlPhi[i];
1187  eventout += ", ";
1188  eventout += MuonRpcBrlEta[i];
1189  eventout += ")";
1190  } // end MuonRpcBrl output
1191  eventout += "\n nMuonRpcFwdHits = ";
1192  eventout += MuonRpcFwdToF.size();
1193  for (unsigned int i = 0; i < MuonRpcFwdToF.size(); ++i) {
1194  eventout += "\n (tof,z,phi,eta) = (";
1195  eventout += MuonRpcFwdToF[i];
1196  eventout += ", ";
1197  eventout += MuonRpcFwdZ[i];
1198  eventout += ", ";
1199  eventout += MuonRpcFwdPhi[i];
1200  eventout += ", ";
1201  eventout += MuonRpcFwdEta[i];
1202  eventout += ")";
1203  } // end MuonRpcFwd output
1204  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1205  } // end verbose output
1206 
1210  MuonRpcBrlEta);
1212  MuonRpcFwdEta);
1213 
1214  return;
1215 }
1216 
1218  const edm::EventSetup& iSetup)
1219 {
1220  std::string MsgLoggerCat = "GlobalHitsProducer_fillECal";
1221 
1222  TString eventout;
1223  if (verbosity > 0)
1224  eventout = "\nGathering info:";
1225 
1226  // access the calorimeter geometry
1227  edm::ESHandle<CaloGeometry> theCaloGeometry;
1228  iSetup.get<CaloGeometryRecord>().get(theCaloGeometry);
1229  if (!theCaloGeometry.isValid()) {
1230  edm::LogWarning(MsgLoggerCat)
1231  << "Unable to find CaloGeometryRecord in event!";
1232  return;
1233  }
1234  const CaloGeometry& theCalo(*theCaloGeometry);
1235 
1236  // iterator to access containers
1237  edm::PCaloHitContainer::const_iterator itHit;
1238 
1240  // get ECal information
1242  edm::PCaloHitContainer theECalHits;
1243  // extract EB container
1245  iEvent.getByToken(ECalEBSrc_Token_,EBContainer);
1246  if (!EBContainer.isValid()) {
1247  edm::LogWarning(MsgLoggerCat)
1248  << "Unable to find EcalHitsEB in event!";
1249  return;
1250  }
1251  // extract EE container
1253  iEvent.getByToken(ECalEESrc_Token_,EEContainer);
1254  if (!EEContainer.isValid()) {
1255  edm::LogWarning(MsgLoggerCat)
1256  << "Unable to find EcalHitsEE in event!";
1257  return;
1258  }
1259  // place both containers into new container
1260  theECalHits.insert(theECalHits.end(),EBContainer->begin(),
1261  EBContainer->end());
1262  theECalHits.insert(theECalHits.end(),EEContainer->begin(),
1263  EEContainer->end());
1264 
1265  // cycle through new container
1266  int i = 0, j = 0;
1267  for (itHit = theECalHits.begin(); itHit != theECalHits.end(); ++itHit) {
1268 
1269  ++i;
1270 
1271  // create a DetId from the detUnitId
1272  DetId theDetUnitId(itHit->id());
1273  int detector = theDetUnitId.det();
1274  int subdetector = theDetUnitId.subdetId();
1275 
1276  // check that expected detector is returned
1277  if ((detector == dEcal) &&
1278  ((subdetector == sdEcalBrl) ||
1279  (subdetector == sdEcalFwd))) {
1280 
1281  // get the Cell geometry
1282  auto theDet = (theCalo.getSubdetectorGeometry(theDetUnitId))->getGeometry(theDetUnitId);
1283 
1284  if (!theDet) {
1285  edm::LogWarning(MsgLoggerCat)
1286  << "Unable to get CaloCellGeometry from ECalHits for Hit " << i;
1287  continue;
1288  }
1289 
1290  ++j;
1291 
1292  // get the global position of the cell
1293  const GlobalPoint& globalposition = theDet->getPosition();
1294 
1295  // gather necessary information
1296  ECalE.push_back(itHit->energy());
1297  ECalToF.push_back(itHit->time());
1298  ECalPhi.push_back(globalposition.phi());
1299  ECalEta.push_back(globalposition.eta());
1300 
1301  } else {
1302  edm::LogWarning(MsgLoggerCat)
1303  << "ECal PCaloHit " << i
1304  << " is expected to be (det,subdet) = ("
1305  << dEcal << "," << sdEcalBrl
1306  << " || " << sdEcalFwd << "); value returned is: ("
1307  << detector << "," << subdetector << ")";
1308  continue;
1309  } // end detector type check
1310  } // end loop through ECal Hits
1311 
1312  if (verbosity > 1) {
1313  eventout += "\n Number of ECal Hits collected:............. ";
1314  eventout += j;
1315  }
1316 
1318  // Get Preshower information
1320  // extract PreShower container
1321  edm::Handle<edm::PCaloHitContainer> PreShContainer;
1322  iEvent.getByToken(ECalESSrc_Token_,PreShContainer);
1323  if (!PreShContainer.isValid()) {
1324  edm::LogWarning(MsgLoggerCat)
1325  << "Unable to find EcalHitsES in event!";
1326  return;
1327  }
1328 
1329  // cycle through container
1330  i = 0, j = 0;
1331  for (itHit = PreShContainer->begin();
1332  itHit != PreShContainer->end(); ++itHit) {
1333 
1334  ++i;
1335 
1336  // create a DetId from the detUnitId
1337  DetId theDetUnitId(itHit->id());
1338  int detector = theDetUnitId.det();
1339  int subdetector = theDetUnitId.subdetId();
1340 
1341  // check that expected detector is returned
1342  if ((detector == dEcal) &&
1343  (subdetector == sdEcalPS)) {
1344 
1345  // get the Cell geometry
1346  auto theDet = (theCalo.getSubdetectorGeometry(theDetUnitId))->getGeometry(theDetUnitId);
1347 
1348  if (!theDet) {
1349  edm::LogWarning(MsgLoggerCat)
1350  << "Unable to get CaloCellGeometry from PreShContainer for Hit "
1351  << i;
1352  continue;
1353  }
1354 
1355  ++j;
1356 
1357  // get the global position of the cell
1358  const GlobalPoint& globalposition = theDet->getPosition();
1359 
1360  // gather necessary information
1361  PreShE.push_back(itHit->energy());
1362  PreShToF.push_back(itHit->time());
1363  PreShPhi.push_back(globalposition.phi());
1364  PreShEta.push_back(globalposition.eta());
1365 
1366  } else {
1367  edm::LogWarning(MsgLoggerCat)
1368  << "PreSh PCaloHit " << i
1369  << " is expected to be (det,subdet) = ("
1370  << dEcal << "," << sdEcalPS
1371  << "); value returned is: ("
1372  << detector << "," << subdetector << ")";
1373  continue;
1374  } // end detector type check
1375  } // end loop through PreShower Hits
1376 
1377  if (verbosity > 1) {
1378  eventout += "\n Number of PreSh Hits collected:............ ";
1379  eventout += j;
1380  }
1381 
1382  if (verbosity > 0)
1383  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1384 
1385  return;
1386 }
1387 
1389 {
1390  std::string MsgLoggerCat = "GlobalHitsProducer_storeECal";
1391 
1392  if (verbosity > 2) {
1393  TString eventout("\n nECalHits = ");
1394  eventout += ECalE.size();
1395  for (unsigned int i = 0; i < ECalE.size(); ++i) {
1396  eventout += "\n (e,tof,phi,eta) = (";
1397  eventout += ECalE[i];
1398  eventout += ", ";
1399  eventout += ECalToF[i];
1400  eventout += ", ";
1401  eventout += ECalPhi[i];
1402  eventout += ", ";
1403  eventout += ECalEta[i];
1404  eventout += ")";
1405  } // end ECal output
1406  eventout += "\n nPreShHits = ";
1407  eventout += PreShE.size();
1408  for (unsigned int i = 0; i < PreShE.size(); ++i) {
1409  eventout += "\n (e,tof,phi,eta) = (";
1410  eventout += PreShE[i];
1411  eventout += ", ";
1412  eventout += PreShToF[i];
1413  eventout += ", ";
1414  eventout += PreShPhi[i];
1415  eventout += ", ";
1416  eventout += PreShEta[i];
1417  eventout += ")";
1418  } // end PreShower output
1419  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1420  } // end verbose output
1421 
1424 
1425  return;
1426 }
1427 
1429  const edm::EventSetup& iSetup)
1430 {
1431  std::string MsgLoggerCat = "GlobalHitsProducer_fillHCal";
1432 
1433  TString eventout;
1434  if (verbosity > 0)
1435  eventout = "\nGathering info:";
1436 
1437  // access the calorimeter geometry
1438  edm::ESHandle<CaloGeometry> theCaloGeometry;
1439  iSetup.get<CaloGeometryRecord>().get(theCaloGeometry);
1440  if (!theCaloGeometry.isValid()) {
1441  edm::LogWarning(MsgLoggerCat)
1442  << "Unable to find CaloGeometryRecord in event!";
1443  return;
1444  }
1445  const CaloGeometry& theCalo(*theCaloGeometry);
1446 
1447  // iterator to access containers
1448  edm::PCaloHitContainer::const_iterator itHit;
1449 
1451  // get HCal information
1453  // extract HCal container
1455  iEvent.getByToken(HCalSrc_Token_,HCalContainer);
1456  if (!HCalContainer.isValid()) {
1457  edm::LogWarning(MsgLoggerCat)
1458  << "Unable to find HCalHits in event!";
1459  return;
1460  }
1461 
1462  // cycle through container
1463  int i = 0, j = 0;
1464  for (itHit = HCalContainer->begin();
1465  itHit != HCalContainer->end(); ++itHit) {
1466 
1467  ++i;
1468 
1469  // create a DetId from the detUnitId
1470  DetId theDetUnitId(itHit->id());
1471  int detector = theDetUnitId.det();
1472  int subdetector = theDetUnitId.subdetId();
1473 
1474  // check that expected detector is returned
1475  if ((detector == dHcal) &&
1476  ((subdetector == sdHcalBrl) ||
1477  (subdetector == sdHcalEC) ||
1478  (subdetector == sdHcalOut) ||
1479  (subdetector == sdHcalFwd))) {
1480 
1481  // get the Cell geometry
1482  const HcalGeometry *theDet = dynamic_cast<const HcalGeometry*>
1483  (theCalo.getSubdetectorGeometry(theDetUnitId));
1484 
1485  if (!theDet) {
1486  edm::LogWarning(MsgLoggerCat)
1487  << "Unable to get CaloCellGeometry from HCalContainer for Hit " << i;
1488  continue;
1489  }
1490 
1491  ++j;
1492 
1493  // get the global position of the cell
1494  const GlobalPoint& globalposition = theDet->getPosition(theDetUnitId);
1495 
1496  // gather necessary information
1497  HCalE.push_back(itHit->energy());
1498  HCalToF.push_back(itHit->time());
1499  HCalPhi.push_back(globalposition.phi());
1500  HCalEta.push_back(globalposition.eta());
1501 
1502  } else {
1503  edm::LogWarning(MsgLoggerCat)
1504  << "HCal PCaloHit " << i
1505  << " is expected to be (det,subdet) = ("
1506  << dHcal << "," << sdHcalBrl
1507  << " || " << sdHcalEC << " || " << sdHcalOut << " || " << sdHcalFwd
1508  << "); value returned is: ("
1509  << detector << "," << subdetector << ")";
1510  continue;
1511  } // end detector type check
1512  } // end loop through HCal Hits
1513 
1514  if (verbosity > 1) {
1515  eventout += "\n Number of HCal Hits collected:............. ";
1516  eventout += j;
1517  }
1518 
1519  if (verbosity > 0)
1520  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1521 
1522  return;
1523 }
1524 
1526 {
1527  std::string MsgLoggerCat = "GlobalHitsProducer_storeHCal";
1528 
1529  if (verbosity > 2) {
1530  TString eventout("\n nHCalHits = ");
1531  eventout += HCalE.size();
1532  for (unsigned int i = 0; i < HCalE.size(); ++i) {
1533  eventout += "\n (e,tof,phi,eta) = (";
1534  eventout += HCalE[i];
1535  eventout += ", ";
1536  eventout += HCalToF[i];
1537  eventout += ", ";
1538  eventout += HCalPhi[i];
1539  eventout += ", ";
1540  eventout += HCalEta[i];
1541  eventout += ")";
1542  } // end HCal output
1543  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1544  } // end verbose output
1545 
1547 
1548  return;
1549 }
1550 
1552 {
1553  std::string MsgLoggerCat = "GlobalHitsProducer_clear";
1554 
1555  if (verbosity > 0)
1556  edm::LogInfo(MsgLoggerCat)
1557  << "Clearing event holders";
1558 
1559  // reset G4MC info
1560  nRawGenPart = 0;
1561  G4VtxX.clear();
1562  G4VtxY.clear();
1563  G4VtxZ.clear();
1564  G4TrkPt.clear();
1565  G4TrkE.clear();
1566 
1567  // reset electromagnetic info
1568  // reset ECal info
1569  ECalE.clear();
1570  ECalToF.clear();
1571  ECalPhi.clear();
1572  ECalEta.clear();
1573  // reset Preshower info
1574  PreShE.clear();
1575  PreShToF.clear();
1576  PreShPhi.clear();
1577  PreShEta.clear();
1578 
1579  // reset hadronic info
1580  // reset HCal info
1581  HCalE.clear();
1582  HCalToF.clear();
1583  HCalPhi.clear();
1584  HCalEta.clear();
1585 
1586  // reset tracker info
1587  // reset Pixel info
1588  PxlBrlToF.clear();
1589  PxlBrlR.clear();
1590  PxlBrlPhi.clear();
1591  PxlBrlEta.clear();
1592  PxlFwdToF.clear();
1593  PxlFwdZ.clear();
1594  PxlFwdPhi.clear();
1595  PxlFwdEta.clear();
1596  // reset strip info
1597  SiBrlToF.clear();
1598  SiBrlR.clear();
1599  SiBrlPhi.clear();
1600  SiBrlEta.clear();
1601  SiFwdToF.clear();
1602  SiFwdZ.clear();
1603  SiFwdPhi.clear();
1604  SiFwdEta.clear();
1605 
1606  // reset muon info
1607  // reset muon DT info
1608  MuonDtToF.clear();
1609  MuonDtR.clear();
1610  MuonDtPhi.clear();
1611  MuonDtEta.clear();
1612  // reset muon CSC info
1613  MuonCscToF.clear();
1614  MuonCscZ.clear();
1615  MuonCscPhi.clear();
1616  MuonCscEta.clear();
1617  // rest muon RPC info
1618  MuonRpcBrlToF.clear();
1619  MuonRpcBrlR.clear();
1620  MuonRpcBrlPhi.clear();
1621  MuonRpcBrlEta.clear();
1622  MuonRpcFwdToF.clear();
1623  MuonRpcFwdZ.clear();
1624  MuonRpcFwdPhi.clear();
1625  MuonRpcFwdEta.clear();
1626 
1627  return;
1628 }
edm::InputTag ECalESSrc_
RunNumber_t run() const
Definition: EventID.h:39
void storeECal(PGlobalSimHit &)
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBHighSrc_Token_
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:569
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
static const int dEcal
static const int dTrk
edm::EDGetTokenT< edm::PSimHitContainer > SiTECHighSrc_Token_
std::vector< PCaloHit > PCaloHitContainer
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:48
static const int sdMuonRPCRgnFwdn
void produce(edm::Event &, const edm::EventSetup &) override
static const int sdHcalOut
edm::InputTag ECalEESrc_
void putHCalHits(const std::vector< float > &e, const std::vector< float > &tof, const std::vector< float > &phi, const std::vector< float > &eta)
static const int sdMuonDT
edm::EDGetTokenT< edm::PSimHitContainer > MuonRpcSrc_Token_
edm::InputTag MuonCscSrc_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
void putMuonRpcFwdHits(const std::vector< float > &tof, const std::vector< float > &z, const std::vector< float > &phi, const std::vector< float > &eta)
TString subdetector
edm::InputTag MuonDtSrc_
void putMuonRpcBrlHits(const std::vector< float > &tof, const std::vector< float > &r, const std::vector< float > &phi, const std::vector< float > &eta)
static const int sdSiTID
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
edm::InputTag SiTOBHighSrc_
edm::InputTag PxlBrlHighSrc_
edm::InputTag PxlBrlLowSrc_
unsigned long long EventNumber_t
static const int sdEcalPS
void putMuonCscHits(const std::vector< float > &tof, const std::vector< float > &z, const std::vector< float > &phi, const std::vector< float > &eta)
void putECalHits(const std::vector< float > &e, const std::vector< float > &tof, const std::vector< float > &phi, const std::vector< float > &eta)
void storeMuon(PGlobalSimHit &)
edm::InputTag PxlFwdLowSrc_
static const int sdMuonRPC
void storeG4MC(PGlobalSimHit &)
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlHighSrc_Token_
CaloGeometry const * getGeometry()
edm::InputTag SiTIDLowSrc_
void storeTrk(PGlobalSimHit &)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
void beginJob(void) override
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdHighSrc_Token_
edm::InputTag SiTECHighSrc_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::EDGetTokenT< edm::PSimHitContainer > SiTIBLowSrc_Token_
edm::InputTag ECalEBSrc_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void fillMuon(edm::Event &, const edm::EventSetup &)
void putG4Trk(const std::vector< float > &pt, const std::vector< float > &e)
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
edm::EDGetTokenT< edm::PSimHitContainer > MuonCscSrc_Token_
int iEvent
Definition: GenABIO.cc:230
GlobalHitsProducer(const edm::ParameterSet &)
static const int sdSiTIB
static const int sdPxlBrl
void endJob() override
T sqrt(T t)
Definition: SSEVec.h:18
void putSiBrlHits(const std::vector< float > &tof, const std::vector< float > &r, const std::vector< float > &phi, const std::vector< float > &eta)
static const int sdMuonCSC
void putPxlFwdHits(const std::vector< float > &tof, const std::vector< float > &z, const std::vector< float > &phi, const std::vector< float > &eta)
static const int sdEcalFwd
void fillTrk(edm::Event &, const edm::EventSetup &)
edm::InputTag SiTIBLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDLowSrc_Token_
edm::InputTag SiTECLowSrc_
static const int sdSiTOB
static const int sdEcalBrl
static const int sdMuonRPCRgnFwdp
static const int sdMuonRPCRgnBrl
bool isValid() const
Definition: HandleBase.h:74
edm::InputTag SiTIDHighSrc_
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBLowSrc_Token_
void putSiFwdHits(const std::vector< float > &tof, const std::vector< float > &z, const std::vector< float > &phi, const std::vector< float > &eta)
edm::EDGetTokenT< edm::SimTrackContainer > G4TrkSrc_Token_
edm::InputTag PxlFwdHighSrc_
GlobalPoint getPosition(const DetId &id) const
edm::EDGetTokenT< edm::PCaloHitContainer > ECalESSrc_Token_
Definition: DetId.h:18
static const int dHcal
edm::EDGetTokenT< edm::PSimHitContainer > SiTOBHighSrc_Token_
void putPreShHits(const std::vector< float > &e, const std::vector< float > &tof, const std::vector< float > &phi, const std::vector< float > &eta)
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
BranchDescription const & branchDescription() const
Definition: Provenance.h:43
void fillECal(edm::Event &, const edm::EventSetup &)
void fillHCal(edm::Event &, const edm::EventSetup &)
std::vector< SimVertex > SimVertexContainer
edm::EDGetTokenT< edm::PSimHitContainer > SiTIDHighSrc_Token_
static const int sdHcalFwd
static const int sdHcalBrl
void storeHCal(PGlobalSimHit &)
edm::InputTag SiTOBLowSrc_
edm::EDGetTokenT< edm::PSimHitContainer > PxlFwdLowSrc_Token_
std::string const & label() const
Definition: InputTag.h:36
T eta() const
Definition: PV3DBase.h:76
edm::EDGetTokenT< edm::PSimHitContainer > MuonDtSrc_Token_
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:93
edm::EDGetTokenT< edm::PSimHitContainer > PxlBrlLowSrc_Token_
edm::EventID id() const
Definition: EventBase.h:60
edm::EDGetTokenT< edm::SimVertexContainer > G4VtxSrc_Token_
static const int sdSiTEC
T perp() const
Magnitude of transverse component.
static const int dMuon
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEBSrc_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > ECalEESrc_Token_
HLT enums.
void putPxlBrlHits(const std::vector< float > &tof, const std::vector< float > &r, const std::vector< float > &phi, const std::vector< float > &eta)
T get() const
Definition: EventSetup.h:63
void putRawGenPart(int n)
void putG4Vtx(const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &z)
void fillG4MC(edm::Event &)
void putMuonDtHits(const std::vector< float > &tof, const std::vector< float > &r, const std::vector< float > &phi, const std::vector< float > &eta)
std::vector< PSimHit > PSimHitContainer
edm::EDGetTokenT< edm::PSimHitContainer > SiTECLowSrc_Token_
unsigned int RunNumber_t
static const int sdPxlFwd
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:109
bool isValid() const
Definition: ESHandle.h:47
edm::InputTag SiTIBHighSrc_
std::vector< SimTrack > SimTrackContainer
std::string const & instance() const
Definition: InputTag.h:37
edm::InputTag MuonRpcSrc_
static const int sdHcalEC
def move(src, dest)
Definition: eostools.py:510
Provenance const * provenance() const
Definition: HandleBase.h:83
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:144
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63