CMS 3D CMS Logo

GlobalRecHitsProducer.cc
Go to the documentation of this file.
1 
14 
16  : fName(""),
17  verbosity(0),
18  frequency(0),
19  label(""),
20  getAllProvenances(false),
21  printProvenanceInfo(false),
22  trackerHitAssociatorConfig_(iPSet, consumesCollector()),
23  caloGeomToken_(esConsumes()),
24  tTopoToken_(esConsumes()),
25  tGeomToken_(esConsumes()),
26  dtGeomToken_(esConsumes()),
27  cscGeomToken_(esConsumes()),
28  rpcGeomToken_(esConsumes()),
29  count(0) {
30  std::string MsgLoggerCat = "GlobalRecHitsProducer_GlobalRecHitsProducer";
31 
32  // get information from parameter set
33  fName = iPSet.getUntrackedParameter<std::string>("Name");
34  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
35  frequency = iPSet.getUntrackedParameter<int>("Frequency");
36  label = iPSet.getParameter<std::string>("Label");
37  edm::ParameterSet m_Prov = iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
38  getAllProvenances = m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
39  printProvenanceInfo = m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
40 
41  //get Labels to use to extract information
42  ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
43  ECalUncalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc");
44  ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
45  ECalUncalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalUncalEESrc");
46  ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
47  HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
48  SiStripSrc_ = iPSet.getParameter<edm::InputTag>("SiStripSrc");
49  SiPxlSrc_ = iPSet.getParameter<edm::InputTag>("SiPxlSrc");
50  MuDTSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSrc");
51  MuDTSimSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSimSrc");
52  MuCSCSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCSrc");
53  MuRPCSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSrc");
54  MuRPCSimSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSimSrc");
55 
56  // fix for consumes
57  ECalUncalEBSrc_Token_ = consumes<EBUncalibratedRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalUncalEBSrc"));
58  ECalUncalEESrc_Token_ = consumes<EEUncalibratedRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalUncalEESrc"));
59  ECalEBSrc_Token_ = consumes<EBRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalEBSrc"));
60  ECalEESrc_Token_ = consumes<EERecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalEESrc"));
61  ECalESSrc_Token_ = consumes<ESRecHitCollection>(iPSet.getParameter<edm::InputTag>("ECalESSrc"));
62  HCalSrc_Token_ = consumes<edm::PCaloHitContainer>(iPSet.getParameter<edm::InputTag>("HCalSrc"));
63  SiStripSrc_Token_ = consumes<SiStripMatchedRecHit2DCollection>(iPSet.getParameter<edm::InputTag>("SiStripSrc"));
64  SiPxlSrc_Token_ = consumes<SiPixelRecHitCollection>(iPSet.getParameter<edm::InputTag>("SiPxlSrc"));
65 
66  MuDTSrc_Token_ = consumes<DTRecHitCollection>(iPSet.getParameter<edm::InputTag>("MuDTSrc"));
67  MuDTSimSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuDTSimSrc"));
68 
69  MuCSCSrc_Token_ = consumes<CSCRecHit2DCollection>(iPSet.getParameter<edm::InputTag>("MuCSCSrc"));
70  MuCSCHits_Token_ = consumes<CrossingFrame<PSimHit>>(
71  edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("MuonCSCHits")));
72 
73  MuRPCSrc_Token_ = consumes<RPCRecHitCollection>(iPSet.getParameter<edm::InputTag>("MuRPCSrc"));
74  MuRPCSimSrc_Token_ = consumes<edm::PSimHitContainer>(iPSet.getParameter<edm::InputTag>("MuRPCSimSrc"));
75 
76  EBHits_Token_ = consumes<CrossingFrame<PCaloHit>>(
77  edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProducer") + std::string("EcalHitsEB")));
79  consumes<CrossingFrame<PCaloHit>>(edm::InputTag(std::string("mix"), iPSet.getParameter<std::string>("hitsProduc\
80 er") + std::string("EcalHitsEE")));
81 
82  // use value of first digit to determine default output level (inclusive)
83  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
84  verbosity %= 10;
85 
86  // create persistent object
87  produces<PGlobalRecHit>(label);
88 
89  // print out Parameter Set information being used
90  if (verbosity >= 0) {
91  edm::LogInfo(MsgLoggerCat) << "\n===============================\n"
92  << "Initialized as EDProducer with parameter values:\n"
93  << " Name = " << fName << "\n"
94  << " Verbosity = " << verbosity << "\n"
95  << " Frequency = " << frequency << "\n"
96  << " Label = " << label << "\n"
97  << " GetProv = " << getAllProvenances << "\n"
98  << " PrintProv = " << printProvenanceInfo << "\n"
99  << " ECalEBSrc = " << ECalEBSrc_.label() << ":" << ECalEBSrc_.instance() << "\n"
100  << " ECalUncalEBSrc = " << ECalUncalEBSrc_.label() << ":"
101  << ECalUncalEBSrc_.instance() << "\n"
102  << " ECalEESrc = " << ECalEESrc_.label() << ":" << ECalUncalEESrc_.instance()
103  << "\n"
104  << " ECalUncalEESrc = " << ECalUncalEESrc_.label() << ":" << ECalEESrc_.instance()
105  << "\n"
106  << " ECalESSrc = " << ECalESSrc_.label() << ":" << ECalESSrc_.instance() << "\n"
107  << " HCalSrc = " << HCalSrc_.label() << ":" << HCalSrc_.instance() << "\n"
108  << " SiStripSrc = " << SiStripSrc_.label() << ":" << SiStripSrc_.instance()
109  << "\n"
110  << " SiPixelSrc = " << SiPxlSrc_.label() << ":" << SiPxlSrc_.instance() << "\n"
111  << " MuDTSrc = " << MuDTSrc_.label() << ":" << MuDTSrc_.instance() << "\n"
112  << " MuDTSimSrc = " << MuDTSimSrc_.label() << ":" << MuDTSimSrc_.instance()
113  << "\n"
114  << " MuCSCSrc = " << MuCSCSrc_.label() << ":" << MuCSCSrc_.instance() << "\n"
115  << " MuRPCSrc = " << MuRPCSrc_.label() << ":" << MuRPCSrc_.instance() << "\n"
116  << " MuRPCSimSrc = " << MuRPCSimSrc_.label() << ":" << MuRPCSimSrc_.instance()
117  << "\n"
118  << "===============================\n";
119  }
120 }
121 
123 
125  std::string MsgLoggerCat = "GlobalRecHitsProducer_beginJob";
126 
127  // clear storage vectors
128  clear();
129  return;
130 }
131 
133  std::string MsgLoggerCat = "GlobalRecHitsProducer_endJob";
134  if (verbosity >= 0)
135  edm::LogInfo(MsgLoggerCat) << "Terminating having processed " << count << " events.";
136  return;
137 }
138 
140  std::string MsgLoggerCat = "GlobalRecHitsProducer_produce";
141 
142  // keep track of number of events processed
143  ++count;
144 
145  // get event id information
146  edm::RunNumber_t nrun = iEvent.id().run();
147  edm::EventNumber_t nevt = iEvent.id().event();
148 
149  if (verbosity > 0) {
150  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count << " events total)";
151  } else if (verbosity == 0) {
152  if (nevt % frequency == 0 || nevt == 1) {
153  edm::LogInfo(MsgLoggerCat) << "Processing run " << nrun << ", event " << nevt << " (" << count
154  << " events total)";
155  }
156  }
157 
158  // clear event holders
159  clear();
160 
161  // look at information available in the event
162  if (getAllProvenances) {
163  std::vector<const edm::StableProvenance*> AllProv;
164  iEvent.getAllStableProvenance(AllProv);
165 
166  if (verbosity >= 0)
167  edm::LogInfo(MsgLoggerCat) << "Number of Provenances = " << AllProv.size();
168 
169  if (printProvenanceInfo && (verbosity >= 0)) {
170  TString eventout("\nProvenance info:\n");
171 
172  for (unsigned int i = 0; i < AllProv.size(); ++i) {
173  eventout += "\n ******************************";
174  eventout += "\n Module : ";
175  //eventout += (AllProv[i]->product).moduleLabel();
176  eventout += AllProv[i]->moduleLabel();
177  eventout += "\n ProductID : ";
178  //eventout += (AllProv[i]->product).productID_.id_;
179  eventout += AllProv[i]->productID().id();
180  eventout += "\n ClassName : ";
181  //eventout += (AllProv[i]->product).fullClassName_;
182  eventout += AllProv[i]->className();
183  eventout += "\n InstanceName : ";
184  //eventout += (AllProv[i]->product).productInstanceName_;
185  eventout += AllProv[i]->productInstanceName();
186  eventout += "\n BranchName : ";
187  //eventout += (AllProv[i]->product).branchName_;
188  eventout += AllProv[i]->branchName();
189  }
190  eventout += "\n ******************************\n";
191  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
192  printProvenanceInfo = false;
193  }
194  getAllProvenances = false;
195  }
196 
197  // call fill functions
198  // gather Ecal information from event
199  fillECal(iEvent, iSetup);
200  // gather Hcal information from event
201  fillHCal(iEvent, iSetup);
202  // gather Track information from event
203  fillTrk(iEvent, iSetup);
204  // gather Muon information from event
205  fillMuon(iEvent, iSetup);
206 
207  if (verbosity > 0)
208  edm::LogInfo(MsgLoggerCat) << "Done gathering data from event.";
209 
210  // produce object to put into event
211  std::unique_ptr<PGlobalRecHit> pOut(new PGlobalRecHit);
212 
213  if (verbosity > 2)
214  edm::LogInfo(MsgLoggerCat) << "Saving event contents:";
215 
216  // call store functions
217  // store ECal information in produce
218  storeECal(*pOut);
219  // store HCal information in produce
220  storeHCal(*pOut);
221  // store Track information in produce
222  storeTrk(*pOut);
223  // store Muon information in produce
224  storeMuon(*pOut);
225 
226  // store information in event
227  iEvent.put(std::move(pOut), label);
228 
229  return;
230 }
231 
233  std::string MsgLoggerCat = "GlobalRecHitsProducer_fillECal";
234 
235  TString eventout;
236  if (verbosity > 0)
237  eventout = "\nGathering info:";
238 
239  // extract crossing frame from event
240  //edm::Handle<CrossingFrame> crossingFrame;
242  //iEvent.getByType(crossingFrame);
243  //if (!crossingFrame.isValid()) {
244  // edm::LogWarning(MsgLoggerCat)
245  // << "Unable to find crossingFrame in event!";
246  // return;
247  //}
248 
250  //extract EB information
253  iEvent.getByToken(ECalUncalEBSrc_Token_, EcalUncalibRecHitEB);
254  if (!EcalUncalibRecHitEB.isValid()) {
255  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalUncalRecHitEB in event!";
256  return;
257  }
258 
259  edm::Handle<EBRecHitCollection> EcalRecHitEB;
260  iEvent.getByToken(ECalEBSrc_Token_, EcalRecHitEB);
261  if (!EcalRecHitEB.isValid()) {
262  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalRecHitEB in event!";
263  return;
264  }
265 
266  // loop over simhits
267  iEvent.getByToken(EBHits_Token_, crossingFrame);
268  if (!crossingFrame.isValid()) {
269  edm::LogWarning(MsgLoggerCat) << "Unable to find cal barrel crossingFrame in event!";
270  return;
271  }
272  //std::unique_ptr<MixCollection<PCaloHit> >
273  // barrelHits(new MixCollection<PCaloHit>
274  // (crossingFrame.product(), barrelHitsName));
275  std::unique_ptr<MixCollection<PCaloHit>> barrelHits(new MixCollection<PCaloHit>(crossingFrame.product()));
276 
277  // keep track of sum of simhit energy in each crystal
278  MapType ebSimMap;
279  for (MixCollection<PCaloHit>::MixItr hitItr = barrelHits->begin(); hitItr != barrelHits->end(); ++hitItr) {
280  EBDetId ebid = EBDetId(hitItr->id());
281 
282  uint32_t crystid = ebid.rawId();
283  ebSimMap[crystid] += hitItr->energy();
284  }
285 
286  int nEBRecHits = 0;
287  // loop over RecHits
288  const EBUncalibratedRecHitCollection* EBUncalibRecHit = EcalUncalibRecHitEB.product();
289  const EBRecHitCollection* EBRecHit = EcalRecHitEB.product();
290 
292  uncalibRecHit != EBUncalibRecHit->end();
293  ++uncalibRecHit) {
294  EBDetId EBid = EBDetId(uncalibRecHit->id());
295 
296  EcalRecHitCollection::const_iterator myRecHit = EBRecHit->find(EBid);
297 
298  if (myRecHit != EBRecHit->end()) {
299  ++nEBRecHits;
300  EBRE.push_back(myRecHit->energy());
301  EBSHE.push_back(ebSimMap[EBid.rawId()]);
302  }
303  }
304 
305  if (verbosity > 1) {
306  eventout += "\n Number of EBRecHits collected:............ ";
307  eventout += nEBRecHits;
308  }
309 
311  //extract EE information
314  iEvent.getByToken(ECalUncalEESrc_Token_, EcalUncalibRecHitEE);
315  if (!EcalUncalibRecHitEE.isValid()) {
316  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalUncalRecHitEE in event!";
317  return;
318  }
319 
320  edm::Handle<EERecHitCollection> EcalRecHitEE;
321  iEvent.getByToken(ECalEESrc_Token_, EcalRecHitEE);
322  if (!EcalRecHitEE.isValid()) {
323  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalRecHitEE in event!";
324  return;
325  }
326 
327  // loop over simhits
328  iEvent.getByToken(EEHits_Token_, crossingFrame);
329  if (!crossingFrame.isValid()) {
330  edm::LogWarning(MsgLoggerCat) << "Unable to find cal endcap crossingFrame in event!";
331  return;
332  }
333  //std::unique_ptr<MixCollection<PCaloHit> >
334  // endcapHits(new MixCollection<PCaloHit>
335  // (crossingFrame.product(), endcapHitsName));
336  std::unique_ptr<MixCollection<PCaloHit>> endcapHits(new MixCollection<PCaloHit>(crossingFrame.product()));
337 
338  // keep track of sum of simhit energy in each crystal
339  MapType eeSimMap;
340  for (MixCollection<PCaloHit>::MixItr hitItr = endcapHits->begin(); hitItr != endcapHits->end(); ++hitItr) {
341  EEDetId eeid = EEDetId(hitItr->id());
342 
343  uint32_t crystid = eeid.rawId();
344  eeSimMap[crystid] += hitItr->energy();
345  }
346 
347  int nEERecHits = 0;
348  // loop over RecHits
349  const EEUncalibratedRecHitCollection* EEUncalibRecHit = EcalUncalibRecHitEE.product();
350  const EERecHitCollection* EERecHit = EcalRecHitEE.product();
351 
353  uncalibRecHit != EEUncalibRecHit->end();
354  ++uncalibRecHit) {
355  EEDetId EEid = EEDetId(uncalibRecHit->id());
356 
357  EcalRecHitCollection::const_iterator myRecHit = EERecHit->find(EEid);
358 
359  if (myRecHit != EERecHit->end()) {
360  ++nEERecHits;
361  EERE.push_back(myRecHit->energy());
362  EESHE.push_back(eeSimMap[EEid.rawId()]);
363  }
364  }
365 
366  if (verbosity > 1) {
367  eventout += "\n Number of EERecHits collected:............ ";
368  eventout += nEERecHits;
369  }
370 
372  //extract ES information
374  edm::Handle<ESRecHitCollection> EcalRecHitES;
375  iEvent.getByToken(ECalESSrc_Token_, EcalRecHitES);
376  if (!EcalRecHitES.isValid()) {
377  edm::LogWarning(MsgLoggerCat) << "Unable to find EcalRecHitES in event!";
378  return;
379  }
380 
381  // loop over simhits
382  iEvent.getByToken(ESHits_Token_, crossingFrame);
383  if (!crossingFrame.isValid()) {
384  edm::LogWarning(MsgLoggerCat) << "Unable to find cal preshower crossingFrame in event!";
385  return;
386  }
387  //std::unique_ptr<MixCollection<PCaloHit> >
388  // preshowerHits(new MixCollection<PCaloHit>
389  // (crossingFrame.product(), preshowerHitsName));
390  std::unique_ptr<MixCollection<PCaloHit>> preshowerHits(new MixCollection<PCaloHit>(crossingFrame.product()));
391 
392  // keep track of sum of simhit energy in each crystal
393  MapType esSimMap;
394  for (MixCollection<PCaloHit>::MixItr hitItr = preshowerHits->begin(); hitItr != preshowerHits->end(); ++hitItr) {
395  ESDetId esid = ESDetId(hitItr->id());
396 
397  uint32_t crystid = esid.rawId();
398  esSimMap[crystid] += hitItr->energy();
399  }
400 
401  int nESRecHits = 0;
402  // loop over RecHits
403  const ESRecHitCollection* ESRecHit = EcalRecHitES.product();
404  for (EcalRecHitCollection::const_iterator recHit = ESRecHit->begin(); recHit != ESRecHit->end(); ++recHit) {
405  ESDetId ESid = ESDetId(recHit->id());
406 
407  ++nESRecHits;
408  ESRE.push_back(recHit->energy());
409  ESSHE.push_back(esSimMap[ESid.rawId()]);
410  }
411 
412  if (verbosity > 1) {
413  eventout += "\n Number of ESRecHits collected:............ ";
414  eventout += nESRecHits;
415  }
416 
417  if (verbosity > 0)
418  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
419 
420  return;
421 }
422 
424  std::string MsgLoggerCat = "GlobalRecHitsProducer_storeECal";
425 
426  if (verbosity > 2) {
427  TString eventout("\n nEBRecHits = ");
428  eventout += EBRE.size();
429  for (unsigned int i = 0; i < EBRE.size(); ++i) {
430  eventout += "\n (RE, SHE) = (";
431  eventout += EBRE[i];
432  eventout += ", ";
433  eventout += EBSHE[i];
434  eventout += ")";
435  }
436  eventout += "\n nEERecHits = ";
437  eventout += EERE.size();
438  for (unsigned int i = 0; i < EERE.size(); ++i) {
439  eventout += "\n (RE, SHE) = (";
440  eventout += EERE[i];
441  eventout += ", ";
442  eventout += EESHE[i];
443  eventout += ")";
444  }
445  eventout += "\n nESRecHits = ";
446  eventout += ESRE.size();
447  for (unsigned int i = 0; i < ESRE.size(); ++i) {
448  eventout += "\n (RE, SHE) = (";
449  eventout += ESRE[i];
450  eventout += ", ";
451  eventout += ESSHE[i];
452  eventout += ")";
453  }
454  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
455  }
456 
457  product.putEBCalRecHits(EBRE, EBSHE);
458  product.putEECalRecHits(EERE, EESHE);
459  product.putESCalRecHits(ESRE, ESSHE);
460 
461  return;
462 }
463 
465  std::string MsgLoggerCat = "GlobalRecHitsProducer_fillHCal";
466 
467  TString eventout;
468  if (verbosity > 0)
469  eventout = "\nGathering info:";
470 
471  // get geometry
472  const auto& geometry = iSetup.getHandle(caloGeomToken_);
473  if (!geometry.isValid()) {
474  edm::LogWarning(MsgLoggerCat) << "Unable to find CaloGeometry in event!";
475  return;
476  }
477 
479  // extract simhit info
482  iEvent.getByToken(HCalSrc_Token_, hcalHits);
483  if (!hcalHits.isValid()) {
484  edm::LogWarning(MsgLoggerCat) << "Unable to find hcalHits in event!";
485  return;
486  }
487  const edm::PCaloHitContainer* simhitResult = hcalHits.product();
488 
489  MapType fHBEnergySimHits;
490  MapType fHEEnergySimHits;
491  MapType fHOEnergySimHits;
492  MapType fHFEnergySimHits;
493  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin(); simhits != simhitResult->end();
494  ++simhits) {
495  HcalDetId detId(simhits->id());
496  uint32_t cellid = detId.rawId();
497 
498  if (detId.subdet() == sdHcalBrl) {
499  fHBEnergySimHits[cellid] += simhits->energy();
500  }
501  if (detId.subdet() == sdHcalEC) {
502  fHEEnergySimHits[cellid] += simhits->energy();
503  }
504  if (detId.subdet() == sdHcalOut) {
505  fHOEnergySimHits[cellid] += simhits->energy();
506  }
507  if (detId.subdet() == sdHcalFwd) {
508  fHFEnergySimHits[cellid] += simhits->energy();
509  }
510  }
511 
512  // max values to be used (HO is found in HB)
513  Double_t maxHBEnergy = 0.;
514  Double_t maxHEEnergy = 0.;
515  Double_t maxHFEnergy = 0.;
516 
517  Double_t maxHBPhi = -1000.;
518  Double_t maxHEPhi = -1000.;
519  Double_t maxHOPhi = -1000.;
520  Double_t maxHFPhi = -1000.;
521 
522  Double_t maxHBEta = -1000.;
523  Double_t maxHEEta = -1000.;
524  Double_t maxHOEta = -1000.;
525  Double_t maxHFEta = -1000.;
526 
527  Double_t PI = 3.141592653589;
528 
530  // get HBHE information
532  std::vector<edm::Handle<HBHERecHitCollection>> hbhe;
533 
534  //iEvent.getManyByType(hbhe);
535  throw cms::Exception("UnsupportedFunction") << "GlobalRecHitsProducer::fillHCal: "
536  << "getManyByType has not been supported by the Framework since 2015. "
537  << "This module has been broken since then. Maybe it should be deleted. "
538  << "Another possibility is to upgrade to use GetterOfProducts instead.";
539 
540  if (!hbhe[0].isValid()) {
541  edm::LogWarning(MsgLoggerCat) << "Unable to find any HBHERecHitCollections in event!";
542  return;
543  }
544  std::vector<edm::Handle<HBHERecHitCollection>>::iterator ihbhe;
545  const CaloGeometry* geo = geometry.product();
546 
547  int iHB = 0;
548  int iHE = 0;
549  for (ihbhe = hbhe.begin(); ihbhe != hbhe.end(); ++ihbhe) {
550  // find max values
551  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin(); jhbhe != (*ihbhe)->end(); ++jhbhe) {
552  HcalDetId cell(jhbhe->id());
553 
554  if (cell.subdet() == sdHcalBrl) {
555  const HcalGeometry* cellGeometry =
556  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
557  double fEta = cellGeometry->getPosition(cell).eta();
558  double fPhi = cellGeometry->getPosition(cell).phi();
559  if ((jhbhe->energy()) > maxHBEnergy) {
560  maxHBEnergy = jhbhe->energy();
561  maxHBPhi = fPhi;
562  maxHOPhi = maxHBPhi;
563  maxHBEta = fEta;
564  maxHOEta = maxHBEta;
565  }
566  }
567 
568  if (cell.subdet() == sdHcalEC) {
569  const HcalGeometry* cellGeometry =
570  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
571  double fEta = cellGeometry->getPosition(cell).eta();
572  double fPhi = cellGeometry->getPosition(cell).phi();
573  if ((jhbhe->energy()) > maxHEEnergy) {
574  maxHEEnergy = jhbhe->energy();
575  maxHEPhi = fPhi;
576  maxHEEta = fEta;
577  }
578  }
579  } // end find max values
580 
581  for (HBHERecHitCollection::const_iterator jhbhe = (*ihbhe)->begin(); jhbhe != (*ihbhe)->end(); ++jhbhe) {
582  HcalDetId cell(jhbhe->id());
583 
584  if (cell.subdet() == sdHcalBrl) {
585  ++iHB;
586 
587  const HcalGeometry* cellGeometry =
588  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
589  double fEta = cellGeometry->getPosition(cell).eta();
590  double fPhi = cellGeometry->getPosition(cell).phi();
591 
592  float deltaphi = maxHBPhi - fPhi;
593  if (fPhi > maxHBPhi) {
594  deltaphi = fPhi - maxHBPhi;
595  }
596  if (deltaphi > PI) {
597  deltaphi = 2.0 * PI - deltaphi;
598  }
599  float deltaeta = fEta - maxHBEta;
600  Double_t r = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
601 
602  HBCalREC.push_back(jhbhe->energy());
603  HBCalR.push_back(r);
604  HBCalSHE.push_back(fHBEnergySimHits[cell.rawId()]);
605  }
606 
607  if (cell.subdet() == sdHcalEC) {
608  ++iHE;
609 
610  const HcalGeometry* cellGeometry =
611  dynamic_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(DetId::Hcal, cell.subdet()));
612  double fEta = cellGeometry->getPosition(cell).eta();
613  double fPhi = cellGeometry->getPosition(cell).phi();
614 
615  float deltaphi = maxHEPhi - fPhi;
616  if (fPhi > maxHEPhi) {
617  deltaphi = fPhi - maxHEPhi;
618  }
619  if (deltaphi > PI) {
620  deltaphi = 2.0 * PI - deltaphi;
621  }
622  float deltaeta = fEta - maxHEEta;
623  Double_t r = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
624 
625  HECalREC.push_back(jhbhe->energy());
626  HECalR.push_back(r);
627  HECalSHE.push_back(fHEEnergySimHits[cell.rawId()]);
628  }
629  }
630  } // end loop through collection
631 
632  if (verbosity > 1) {
633  eventout += "\n Number of HBRecHits collected:............ ";
634  eventout += iHB;
635  }
636 
637  if (verbosity > 1) {
638  eventout += "\n Number of HERecHits collected:............ ";
639  eventout += iHE;
640  }
641 
643  // get HF information
645  std::vector<edm::Handle<HFRecHitCollection>> hf;
646 
647  //iEvent.getManyByType(hf);
648  throw cms::Exception("UnsupportedFunction") << "GlobalRecHitsProducer::fillHCal: "
649  << "getManyByType has not been supported by the Framework since 2015. "
650  << "This module has been broken since then. Maybe it should be deleted. "
651  << "Another possibility is to upgrade to use GetterOfProducts instead.";
652 
653  if (!hf[0].isValid()) {
654  edm::LogWarning(MsgLoggerCat) << "Unable to find any HFRecHitCollections in event!";
655  return;
656  }
657  std::vector<edm::Handle<HFRecHitCollection>>::iterator ihf;
658 
659  int iHF = 0;
660  for (ihf = hf.begin(); ihf != hf.end(); ++ihf) {
661  // find max values
662  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin(); jhf != (*ihf)->end(); ++jhf) {
663  HcalDetId cell(jhf->id());
664 
665  if (cell.subdet() == sdHcalFwd) {
666  auto cellGeometry = geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
667  double fEta = cellGeometry->getPosition().eta();
668  double fPhi = cellGeometry->getPosition().phi();
669  if ((jhf->energy()) > maxHFEnergy) {
670  maxHFEnergy = jhf->energy();
671  maxHFPhi = fPhi;
672  maxHFEta = fEta;
673  }
674  }
675  } // end find max values
676 
677  for (HFRecHitCollection::const_iterator jhf = (*ihf)->begin(); jhf != (*ihf)->end(); ++jhf) {
678  HcalDetId cell(jhf->id());
679 
680  if (cell.subdet() == sdHcalFwd) {
681  ++iHF;
682 
683  auto cellGeometry = geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
684  double fEta = cellGeometry->getPosition().eta();
685  double fPhi = cellGeometry->getPosition().phi();
686 
687  float deltaphi = maxHBPhi - fPhi;
688  if (fPhi > maxHFPhi) {
689  deltaphi = fPhi - maxHFPhi;
690  }
691  if (deltaphi > PI) {
692  deltaphi = 2.0 * PI - deltaphi;
693  }
694  float deltaeta = fEta - maxHFEta;
695  Double_t r = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
696 
697  HFCalREC.push_back(jhf->energy());
698  HFCalR.push_back(r);
699  HFCalSHE.push_back(fHFEnergySimHits[cell.rawId()]);
700  }
701  }
702  } // end loop through collection
703 
704  if (verbosity > 1) {
705  eventout += "\n Number of HFDigis collected:.............. ";
706  eventout += iHF;
707  }
708 
710  // get HO information
712  std::vector<edm::Handle<HORecHitCollection>> ho;
713 
714  //iEvent.getManyByType(ho);
715  throw cms::Exception("UnsupportedFunction") << "GlobalRecHitsProducer::fillHCal: "
716  << "getManyByType has not been supported by the Framework since 2015. "
717  << "This module has been broken since then. Maybe it should be deleted. "
718  << "Another possibility is to upgrade to use GetterOfProducts instead.";
719 
720  if (!ho[0].isValid()) {
721  edm::LogWarning(MsgLoggerCat) << "Unable to find any HORecHitCollections in event!";
722  return;
723  }
724  std::vector<edm::Handle<HORecHitCollection>>::iterator iho;
725 
726  int iHO = 0;
727  for (iho = ho.begin(); iho != ho.end(); ++iho) {
728  for (HORecHitCollection::const_iterator jho = (*iho)->begin(); jho != (*iho)->end(); ++jho) {
729  HcalDetId cell(jho->id());
730 
731  if (cell.subdet() == sdHcalOut) {
732  ++iHO;
733 
734  auto cellGeometry = geometry->getSubdetectorGeometry(cell)->getGeometry(cell);
735  double fEta = cellGeometry->getPosition().eta();
736  double fPhi = cellGeometry->getPosition().phi();
737 
738  float deltaphi = maxHOPhi - fPhi;
739  if (fPhi > maxHOPhi) {
740  deltaphi = fPhi - maxHOPhi;
741  }
742  if (deltaphi > PI) {
743  deltaphi = 2.0 * PI - deltaphi;
744  }
745  float deltaeta = fEta - maxHOEta;
746  Double_t r = sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
747 
748  HOCalREC.push_back(jho->energy());
749  HOCalR.push_back(r);
750  HOCalSHE.push_back(fHOEnergySimHits[cell.rawId()]);
751  }
752  }
753  } // end loop through collection
754 
755  if (verbosity > 1) {
756  eventout += "\n Number of HODigis collected:.............. ";
757  eventout += iHO;
758  }
759 
760  if (verbosity > 0)
761  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
762 
763  return;
764 }
765 
767  std::string MsgLoggerCat = "GlobalRecHitsProducer_storeHCal";
768 
769  if (verbosity > 2) {
770  TString eventout("\n nHBRecHits = ");
771  eventout += HBCalREC.size();
772  for (unsigned int i = 0; i < HBCalREC.size(); ++i) {
773  eventout += "\n (REC, R, SHE) = (";
774  eventout += HBCalREC[i];
775  eventout += ", ";
776  eventout += HBCalR[i];
777  eventout += ", ";
778  eventout += HBCalSHE[i];
779  eventout += ")";
780  }
781  eventout += "\n nHERecHits = ";
782  eventout += HECalREC.size();
783  for (unsigned int i = 0; i < HECalREC.size(); ++i) {
784  eventout += "\n (REC, R, SHE) = (";
785  eventout += HECalREC[i];
786  eventout += ", ";
787  eventout += HECalR[i];
788  eventout += ", ";
789  eventout += HECalSHE[i];
790  eventout += ")";
791  }
792  eventout += "\n nHFRecHits = ";
793  eventout += HFCalREC.size();
794  for (unsigned int i = 0; i < HFCalREC.size(); ++i) {
795  eventout += "\n (REC, R, SHE) = (";
796  eventout += HFCalREC[i];
797  eventout += ", ";
798  eventout += HFCalR[i];
799  eventout += ", ";
800  eventout += HFCalSHE[i];
801  eventout += ")";
802  }
803  eventout += "\n nHORecHits = ";
804  eventout += HOCalREC.size();
805  for (unsigned int i = 0; i < HOCalREC.size(); ++i) {
806  eventout += "\n (REC, R, SHE) = (";
807  eventout += HOCalREC[i];
808  eventout += ", ";
809  eventout += HOCalR[i];
810  eventout += ", ";
811  eventout += HOCalSHE[i];
812  eventout += ")";
813  }
814 
815  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
816  }
817 
822 
823  return;
824 }
825 
827  //Retrieve tracker topology from geometry
828  const TrackerTopology* const tTopo = &iSetup.getData(tTopoToken_);
829  ;
830  std::string MsgLoggerCat = "GlobalRecHitsProducer_fillTrk";
831  TString eventout;
832  if (verbosity > 0)
833  eventout = "\nGathering info:";
834 
835  // get strip information
837  iEvent.getByToken(SiStripSrc_Token_, rechitsmatched);
838  if (!rechitsmatched.isValid()) {
839  edm::LogWarning(MsgLoggerCat) << "Unable to find stripmatchedrechits in event!";
840  return;
841  }
842 
844 
845  const auto& tGeomHandle = iSetup.getHandle(tGeomToken_);
846  if (!tGeomHandle.isValid()) {
847  edm::LogWarning(MsgLoggerCat) << "Unable to find TrackerDigiGeometry in event!";
848  return;
849  }
850  const TrackerGeometry& tracker(*tGeomHandle);
851 
852  int nStripBrl = 0, nStripFwd = 0;
853 
854  // loop over det units
855  for (TrackerGeometry::DetContainer::const_iterator it = tGeomHandle->dets().begin(); it != tGeomHandle->dets().end();
856  ++it) {
857  uint32_t myid = ((*it)->geographicalId()).rawId();
858  DetId detid = ((*it)->geographicalId());
859 
860  //loop over rechits-matched in the same subdetector
861  SiStripMatchedRecHit2DCollection::const_iterator rechitmatchedMatch = rechitsmatched->find(detid);
862 
863  if (rechitmatchedMatch != rechitsmatched->end()) {
864  SiStripMatchedRecHit2DCollection::DetSet rechitmatchedRange = *rechitmatchedMatch;
865  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorBegin =
866  rechitmatchedRange.begin();
867  SiStripMatchedRecHit2DCollection::DetSet::const_iterator rechitmatchedRangeIteratorEnd = rechitmatchedRange.end();
869 
870  for (itermatched = rechitmatchedRangeIteratorBegin; itermatched != rechitmatchedRangeIteratorEnd; ++itermatched) {
871  SiStripMatchedRecHit2D const rechit = *itermatched;
872  LocalPoint position = rechit.localPosition();
873 
874  float mindist = 999999.;
875  float distx = 999999.;
876  float disty = 999999.;
877  float dist = 999999.;
878  std::pair<LocalPoint, LocalVector> closestPair;
879  matched.clear();
880 
881  float rechitmatchedx = position.x();
882  float rechitmatchedy = position.y();
883 
884  matched = associate.associateHit(rechit);
885 
886  if (!matched.empty()) {
887  //project simhit;
888  const GluedGeomDet* gluedDet = (const GluedGeomDet*)tracker.idToDet(rechit.geographicalId());
889  const StripGeomDetUnit* partnerstripdet = (StripGeomDetUnit*)gluedDet->stereoDet();
890  std::pair<LocalPoint, LocalVector> hitPair;
891 
892  for (std::vector<PSimHit>::const_iterator m = matched.begin(); m != matched.end(); m++) {
893  //project simhit;
894  hitPair = projectHit((*m), partnerstripdet, gluedDet->surface());
895  distx = fabs(rechitmatchedx - hitPair.first.x());
896  disty = fabs(rechitmatchedy - hitPair.first.y());
897  dist = sqrt(distx * distx + disty * disty);
898 
899  if (dist < mindist) {
900  mindist = dist;
901  closestPair = hitPair;
902  }
903  }
904 
905  // get TIB
906  if (detid.subdetId() == sdSiTIB) {
907  ++nStripBrl;
908 
909  if (tTopo->tibLayer(myid) == 1) {
910  TIBL1RX.push_back(rechitmatchedx);
911  TIBL1RY.push_back(rechitmatchedy);
912  TIBL1SX.push_back(closestPair.first.x());
913  TIBL1SY.push_back(closestPair.first.y());
914  }
915  if (tTopo->tibLayer(myid) == 2) {
916  TIBL2RX.push_back(rechitmatchedx);
917  TIBL2RY.push_back(rechitmatchedy);
918  TIBL2SX.push_back(closestPair.first.x());
919  TIBL2SY.push_back(closestPair.first.y());
920  }
921  if (tTopo->tibLayer(myid) == 3) {
922  TIBL3RX.push_back(rechitmatchedx);
923  TIBL3RY.push_back(rechitmatchedy);
924  TIBL3SX.push_back(closestPair.first.x());
925  TIBL3SY.push_back(closestPair.first.y());
926  }
927  if (tTopo->tibLayer(myid) == 4) {
928  TIBL4RX.push_back(rechitmatchedx);
929  TIBL4RY.push_back(rechitmatchedy);
930  TIBL4SX.push_back(closestPair.first.x());
931  TIBL4SY.push_back(closestPair.first.y());
932  }
933  }
934 
935  // get TOB
936  if (detid.subdetId() == sdSiTOB) {
937  ++nStripBrl;
938 
939  if (tTopo->tobLayer(myid) == 1) {
940  TOBL1RX.push_back(rechitmatchedx);
941  TOBL1RY.push_back(rechitmatchedy);
942  TOBL1SX.push_back(closestPair.first.x());
943  TOBL1SY.push_back(closestPair.first.y());
944  }
945  if (tTopo->tobLayer(myid) == 2) {
946  TOBL2RX.push_back(rechitmatchedx);
947  TOBL2RY.push_back(rechitmatchedy);
948  TOBL2SX.push_back(closestPair.first.x());
949  TOBL2SY.push_back(closestPair.first.y());
950  }
951  if (tTopo->tobLayer(myid) == 3) {
952  TOBL3RX.push_back(rechitmatchedx);
953  TOBL3RY.push_back(rechitmatchedy);
954  TOBL3SX.push_back(closestPair.first.x());
955  TOBL3SY.push_back(closestPair.first.y());
956  }
957  if (tTopo->tobLayer(myid) == 4) {
958  TOBL4RX.push_back(rechitmatchedx);
959  TOBL4RY.push_back(rechitmatchedy);
960  TOBL4SX.push_back(closestPair.first.x());
961  TOBL4SY.push_back(closestPair.first.y());
962  }
963  }
964 
965  // get TID
966  if (detid.subdetId() == sdSiTID) {
967  ++nStripFwd;
968 
969  if (tTopo->tidWheel(myid) == 1) {
970  TIDW1RX.push_back(rechitmatchedx);
971  TIDW1RY.push_back(rechitmatchedy);
972  TIDW1SX.push_back(closestPair.first.x());
973  TIDW1SY.push_back(closestPair.first.y());
974  }
975  if (tTopo->tidWheel(myid) == 2) {
976  TIDW2RX.push_back(rechitmatchedx);
977  TIDW2RY.push_back(rechitmatchedy);
978  TIDW2SX.push_back(closestPair.first.x());
979  TIDW2SY.push_back(closestPair.first.y());
980  }
981  if (tTopo->tidWheel(myid) == 3) {
982  TIDW3RX.push_back(rechitmatchedx);
983  TIDW3RY.push_back(rechitmatchedy);
984  TIDW3SX.push_back(closestPair.first.x());
985  TIDW3SY.push_back(closestPair.first.y());
986  }
987  }
988 
989  // get TEC
990  if (detid.subdetId() == sdSiTEC) {
991  ++nStripFwd;
992 
993  if (tTopo->tecWheel(myid) == 1) {
994  TECW1RX.push_back(rechitmatchedx);
995  TECW1RY.push_back(rechitmatchedy);
996  TECW1SX.push_back(closestPair.first.x());
997  TECW1SY.push_back(closestPair.first.y());
998  }
999  if (tTopo->tecWheel(myid) == 2) {
1000  TECW2RX.push_back(rechitmatchedx);
1001  TECW2RY.push_back(rechitmatchedy);
1002  TECW2SX.push_back(closestPair.first.x());
1003  TECW2SY.push_back(closestPair.first.y());
1004  }
1005  if (tTopo->tecWheel(myid) == 3) {
1006  TECW3RX.push_back(rechitmatchedx);
1007  TECW3RY.push_back(rechitmatchedy);
1008  TECW3SX.push_back(closestPair.first.x());
1009  TECW3SY.push_back(closestPair.first.y());
1010  }
1011  if (tTopo->tecWheel(myid) == 4) {
1012  TECW4RX.push_back(rechitmatchedx);
1013  TECW4RY.push_back(rechitmatchedy);
1014  TECW4SX.push_back(closestPair.first.x());
1015  TECW4SY.push_back(closestPair.first.y());
1016  }
1017  if (tTopo->tecWheel(myid) == 5) {
1018  TECW5RX.push_back(rechitmatchedx);
1019  TECW5RY.push_back(rechitmatchedy);
1020  TECW5SX.push_back(closestPair.first.x());
1021  TECW5SY.push_back(closestPair.first.y());
1022  }
1023  if (tTopo->tecWheel(myid) == 6) {
1024  TECW6RX.push_back(rechitmatchedx);
1025  TECW6RY.push_back(rechitmatchedy);
1026  TECW6SX.push_back(closestPair.first.x());
1027  TECW6SY.push_back(closestPair.first.y());
1028  }
1029  if (tTopo->tecWheel(myid) == 7) {
1030  TECW7RX.push_back(rechitmatchedx);
1031  TECW7RY.push_back(rechitmatchedy);
1032  TECW7SX.push_back(closestPair.first.x());
1033  TECW7SY.push_back(closestPair.first.y());
1034  }
1035  if (tTopo->tecWheel(myid) == 8) {
1036  TECW8RX.push_back(rechitmatchedx);
1037  TECW8RY.push_back(rechitmatchedy);
1038  TECW8SX.push_back(closestPair.first.x());
1039  TECW8SY.push_back(closestPair.first.y());
1040  }
1041  }
1042 
1043  } // end if matched empty
1044  }
1045  }
1046  } // end loop over det units
1047 
1048  if (verbosity > 1) {
1049  eventout += "\n Number of BrlStripRecHits collected:...... ";
1050  eventout += nStripBrl;
1051  }
1052 
1053  if (verbosity > 1) {
1054  eventout += "\n Number of FrwdStripRecHits collected:..... ";
1055  eventout += nStripFwd;
1056  }
1057 
1058  // get pixel information
1059  //Get RecHits
1061  iEvent.getByToken(SiPxlSrc_Token_, recHitColl);
1062  if (!recHitColl.isValid()) {
1063  edm::LogWarning(MsgLoggerCat) << "Unable to find SiPixelRecHitCollection in event!";
1064  return;
1065  }
1066 
1067  int nPxlBrl = 0, nPxlFwd = 0;
1068  //iterate over detunits
1069  for (TrackerGeometry::DetContainer::const_iterator it = tGeomHandle->dets().begin(); it != tGeomHandle->dets().end();
1070  ++it) {
1071  uint32_t myid = ((*it)->geographicalId()).rawId();
1072  DetId detId = ((*it)->geographicalId());
1073  int subid = detId.subdetId();
1074 
1075  if (!((subid == sdPxlBrl) || (subid == sdPxlFwd)))
1076  continue;
1077 
1078  //const PixelGeomDetUnit * theGeomDet =
1079  // dynamic_cast<const PixelGeomDetUnit*>(theTracker.idToDet(detId) );
1080 
1081  SiPixelRecHitCollection::const_iterator pixeldet = recHitColl->find(detId);
1082  if (pixeldet == recHitColl->end())
1083  continue;
1084  SiPixelRecHitCollection::DetSet pixelrechitRange = *pixeldet;
1085  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorBegin = pixelrechitRange.begin();
1086  SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorEnd = pixelrechitRange.end();
1087  SiPixelRecHitCollection::DetSet::const_iterator pixeliter = pixelrechitRangeIteratorBegin;
1088  std::vector<PSimHit> matched;
1089 
1090  //----Loop over rechits for this detId
1091  for (; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) {
1092  matched.clear();
1093  matched = associate.associateHit(*pixeliter);
1094 
1095  if (!matched.empty()) {
1096  float closest = 9999.9;
1097  //std::vector<PSimHit>::const_iterator closestit = matched.begin();
1098  LocalPoint lp = pixeliter->localPosition();
1099  float rechit_x = lp.x();
1100  float rechit_y = lp.y();
1101 
1102  float sim_x = 0.;
1103  float sim_y = 0.;
1104 
1105  //loop over sim hits and fill closet
1106  for (std::vector<PSimHit>::const_iterator m = matched.begin(); m != matched.end(); ++m) {
1107  float sim_x1 = (*m).entryPoint().x();
1108  float sim_x2 = (*m).exitPoint().x();
1109  float sim_xpos = 0.5 * (sim_x1 + sim_x2);
1110 
1111  float sim_y1 = (*m).entryPoint().y();
1112  float sim_y2 = (*m).exitPoint().y();
1113  float sim_ypos = 0.5 * (sim_y1 + sim_y2);
1114 
1115  float x_res = fabs(sim_xpos - rechit_x);
1116  float y_res = fabs(sim_ypos - rechit_y);
1117 
1118  float dist = sqrt(x_res * x_res + y_res * y_res);
1119 
1120  if (dist < closest) {
1121  closest = dist;
1122  sim_x = sim_xpos;
1123  sim_y = sim_ypos;
1124  }
1125  } // end sim hit loop
1126 
1127  // get Barrel pixels
1128  if (subid == sdPxlBrl) {
1129  ++nPxlBrl;
1130 
1131  if (tTopo->pxbLayer(myid) == 1) {
1132  BRL1RX.push_back(rechit_x);
1133  BRL1RY.push_back(rechit_y);
1134  BRL1SX.push_back(sim_x);
1135  BRL1SY.push_back(sim_y);
1136  }
1137  if (tTopo->pxbLayer(myid) == 2) {
1138  BRL2RX.push_back(rechit_x);
1139  BRL2RY.push_back(rechit_y);
1140  BRL2SX.push_back(sim_x);
1141  BRL2SY.push_back(sim_y);
1142  }
1143  if (tTopo->pxbLayer(myid) == 3) {
1144  BRL3RX.push_back(rechit_x);
1145  BRL3RY.push_back(rechit_y);
1146  BRL3SX.push_back(sim_x);
1147  BRL3SY.push_back(sim_y);
1148  }
1149  }
1150 
1151  // get Forward pixels
1152  if (subid == sdPxlFwd) {
1153  ++nPxlFwd;
1154 
1155  if (tTopo->pxfDisk(myid) == 1) {
1156  if (tTopo->pxfSide(myid) == 1) {
1157  FWD1nRX.push_back(rechit_x);
1158  FWD1nRY.push_back(rechit_y);
1159  FWD1nSX.push_back(sim_x);
1160  FWD1nSY.push_back(sim_y);
1161  }
1162  if (tTopo->pxfSide(myid) == 2) {
1163  FWD1pRX.push_back(rechit_x);
1164  FWD1pRY.push_back(rechit_y);
1165  FWD1pSX.push_back(sim_x);
1166  FWD1pSY.push_back(sim_y);
1167  }
1168  }
1169  if (tTopo->pxfDisk(myid) == 2) {
1170  if (tTopo->pxfSide(myid) == 1) {
1171  FWD2nRX.push_back(rechit_x);
1172  FWD2nRY.push_back(rechit_y);
1173  FWD2nSX.push_back(sim_x);
1174  FWD2nSY.push_back(sim_y);
1175  }
1176  if (tTopo->pxfSide(myid) == 2) {
1177  FWD2pRX.push_back(rechit_x);
1178  FWD2pRY.push_back(rechit_y);
1179  FWD2pSX.push_back(sim_x);
1180  FWD2pSY.push_back(sim_y);
1181  }
1182  }
1183  }
1184  } // end matched emtpy
1185  } // <-----end rechit loop
1186  } // <------ end detunit loop
1187 
1188  if (verbosity > 1) {
1189  eventout += "\n Number of BrlPixelRecHits collected:...... ";
1190  eventout += nPxlBrl;
1191  }
1192 
1193  if (verbosity > 1) {
1194  eventout += "\n Number of FrwdPixelRecHits collected:..... ";
1195  eventout += nPxlFwd;
1196  }
1197 
1198  if (verbosity > 0)
1199  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1200 
1201  return;
1202 }
1203 
1205  std::string MsgLoggerCat = "GlobalRecHitsProducer_storeTrk";
1206 
1207  if (verbosity > 2) {
1208  // strip output
1209  TString eventout("\n nTIBL1 = ");
1210  eventout += TIBL1RX.size();
1211  for (unsigned int i = 0; i < TIBL1RX.size(); ++i) {
1212  eventout += "\n (RX, RY, SX, SY) = (";
1213  eventout += TIBL1RX[i];
1214  eventout += ", ";
1215  eventout += TIBL1RY[i];
1216  eventout += ", ";
1217  eventout += TIBL1SX[i];
1218  eventout += ", ";
1219  eventout += TIBL1SY[i];
1220  eventout += ")";
1221  }
1222  eventout += "\n nTIBL2 = ";
1223  eventout += TIBL2RX.size();
1224  for (unsigned int i = 0; i < TIBL2RX.size(); ++i) {
1225  eventout += "\n (RX, RY, SX, SY) = (";
1226  eventout += TIBL2RX[i];
1227  eventout += ", ";
1228  eventout += TIBL2RY[i];
1229  eventout += ", ";
1230  eventout += TIBL2SX[i];
1231  eventout += ", ";
1232  eventout += TIBL2SY[i];
1233  eventout += ")";
1234  }
1235  eventout += "\n nTIBL3 = ";
1236  eventout += TIBL3RX.size();
1237  for (unsigned int i = 0; i < TIBL3RX.size(); ++i) {
1238  eventout += "\n (RX, RY, SX, SY) = (";
1239  eventout += TIBL3RX[i];
1240  eventout += ", ";
1241  eventout += TIBL3RY[i];
1242  eventout += ", ";
1243  eventout += TIBL3SX[i];
1244  eventout += ", ";
1245  eventout += TIBL3SY[i];
1246  eventout += ")";
1247  }
1248  eventout += "\n nTIBL4 = ";
1249  eventout += TIBL4RX.size();
1250  for (unsigned int i = 0; i < TIBL4RX.size(); ++i) {
1251  eventout += "\n (RX, RY, SX, SY) = (";
1252  eventout += TIBL4RX[i];
1253  eventout += ", ";
1254  eventout += TIBL4RY[i];
1255  eventout += ", ";
1256  eventout += TIBL4SX[i];
1257  eventout += ", ";
1258  eventout += TIBL4SY[i];
1259  eventout += ")";
1260  }
1261  eventout += "\n nTOBL1 = ";
1262  eventout += TOBL1RX.size();
1263  for (unsigned int i = 0; i < TOBL1RX.size(); ++i) {
1264  eventout += "\n (RX, RY, SX, SY) = (";
1265  eventout += TOBL1RX[i];
1266  eventout += ", ";
1267  eventout += TOBL1RY[i];
1268  eventout += ", ";
1269  eventout += TOBL1SX[i];
1270  eventout += ", ";
1271  eventout += TOBL1SY[i];
1272  eventout += ")";
1273  }
1274  eventout += "\n nTOBL2 = ";
1275  eventout += TOBL2RX.size();
1276  for (unsigned int i = 0; i < TOBL2RX.size(); ++i) {
1277  eventout += "\n (RX, RY, SX, SY) = (";
1278  eventout += TOBL2RX[i];
1279  eventout += ", ";
1280  eventout += TOBL2RY[i];
1281  eventout += ", ";
1282  eventout += TOBL2SX[i];
1283  eventout += ", ";
1284  eventout += TOBL2SY[i];
1285  eventout += ")";
1286  }
1287  eventout += "\n nTOBL3 = ";
1288  eventout += TOBL3RX.size();
1289  for (unsigned int i = 0; i < TOBL3RX.size(); ++i) {
1290  eventout += "\n (RX, RY, SX, SY) = (";
1291  eventout += TOBL3RX[i];
1292  eventout += ", ";
1293  eventout += TOBL3RY[i];
1294  eventout += ", ";
1295  eventout += TOBL3SX[i];
1296  eventout += ", ";
1297  eventout += TOBL3SY[i];
1298  eventout += ")";
1299  }
1300  eventout += "\n nTOBL4 = ";
1301  eventout += TOBL4RX.size();
1302  for (unsigned int i = 0; i < TOBL4RX.size(); ++i) {
1303  eventout += "\n (RX, RY, SX, SY) = (";
1304  eventout += TOBL4RX[i];
1305  eventout += ", ";
1306  eventout += TOBL4RY[i];
1307  eventout += ", ";
1308  eventout += TOBL4SX[i];
1309  eventout += ", ";
1310  eventout += TOBL4SY[i];
1311  eventout += ")";
1312  }
1313  eventout += "\n nTIDW1 = ";
1314  eventout += TIDW1RX.size();
1315  for (unsigned int i = 0; i < TIDW1RX.size(); ++i) {
1316  eventout += "\n (RX, RY, SX, SY) = (";
1317  eventout += TIDW1RX[i];
1318  eventout += ", ";
1319  eventout += TIDW1RY[i];
1320  eventout += ", ";
1321  eventout += TIDW1SX[i];
1322  eventout += ", ";
1323  eventout += TIDW1SY[i];
1324  eventout += ")";
1325  }
1326  eventout += "\n nTIDW2 = ";
1327  eventout += TIDW2RX.size();
1328  for (unsigned int i = 0; i < TIDW2RX.size(); ++i) {
1329  eventout += "\n (RX, RY, SX, SY) = (";
1330  eventout += TIDW2RX[i];
1331  eventout += ", ";
1332  eventout += TIDW2RY[i];
1333  eventout += ", ";
1334  eventout += TIDW2SX[i];
1335  eventout += ", ";
1336  eventout += TIDW2SY[i];
1337  eventout += ")";
1338  }
1339  eventout += "\n nTIDW3 = ";
1340  eventout += TIDW3RX.size();
1341  for (unsigned int i = 0; i < TIDW3RX.size(); ++i) {
1342  eventout += "\n (RX, RY, SX, SY) = (";
1343  eventout += TIDW3RX[i];
1344  eventout += ", ";
1345  eventout += TIDW3RY[i];
1346  eventout += ", ";
1347  eventout += TIDW3SX[i];
1348  eventout += ", ";
1349  eventout += TIDW3SY[i];
1350  eventout += ")";
1351  }
1352  eventout += "\n nTECW1 = ";
1353  eventout += TECW1RX.size();
1354  for (unsigned int i = 0; i < TECW1RX.size(); ++i) {
1355  eventout += "\n (RX, RY, SX, SY) = (";
1356  eventout += TECW1RX[i];
1357  eventout += ", ";
1358  eventout += TECW1RY[i];
1359  eventout += ", ";
1360  eventout += TECW1SX[i];
1361  eventout += ", ";
1362  eventout += TECW1SY[i];
1363  eventout += ")";
1364  }
1365  eventout += "\n nTECW2 = ";
1366  eventout += TECW2RX.size();
1367  for (unsigned int i = 0; i < TECW2RX.size(); ++i) {
1368  eventout += "\n (RX, RY, SX, SY) = (";
1369  eventout += TECW2RX[i];
1370  eventout += ", ";
1371  eventout += TECW2RY[i];
1372  eventout += ", ";
1373  eventout += TECW2SX[i];
1374  eventout += ", ";
1375  eventout += TECW2SY[i];
1376  eventout += ")";
1377  }
1378  eventout += "\n nTECW3 = ";
1379  eventout += TECW3RX.size();
1380  for (unsigned int i = 0; i < TECW3RX.size(); ++i) {
1381  eventout += "\n (RX, RY, SX, SY) = (";
1382  eventout += TECW3RX[i];
1383  eventout += ", ";
1384  eventout += TECW3RY[i];
1385  eventout += ", ";
1386  eventout += TECW3SX[i];
1387  eventout += ", ";
1388  eventout += TECW3SY[i];
1389  eventout += ")";
1390  }
1391  eventout += "\n nTECW4 = ";
1392  eventout += TECW4RX.size();
1393  for (unsigned int i = 0; i < TECW4RX.size(); ++i) {
1394  eventout += "\n (RX, RY, SX, SY) = (";
1395  eventout += TECW4RX[i];
1396  eventout += ", ";
1397  eventout += TECW4RY[i];
1398  eventout += ", ";
1399  eventout += TECW4SX[i];
1400  eventout += ", ";
1401  eventout += TECW4SY[i];
1402  eventout += ")";
1403  }
1404  eventout += "\n nTECW5 = ";
1405  eventout += TECW5RX.size();
1406  for (unsigned int i = 0; i < TECW5RX.size(); ++i) {
1407  eventout += "\n (RX, RY, SX, SY) = (";
1408  eventout += TECW5RX[i];
1409  eventout += ", ";
1410  eventout += TECW5RY[i];
1411  eventout += ", ";
1412  eventout += TECW5SX[i];
1413  eventout += ", ";
1414  eventout += TECW5SY[i];
1415  eventout += ")";
1416  }
1417  eventout += "\n nTECW6 = ";
1418  eventout += TECW6RX.size();
1419  for (unsigned int i = 0; i < TECW6RX.size(); ++i) {
1420  eventout += "\n (RX, RY, SX, SY) = (";
1421  eventout += TECW6RX[i];
1422  eventout += ", ";
1423  eventout += TECW6RY[i];
1424  eventout += ", ";
1425  eventout += TECW6SX[i];
1426  eventout += ", ";
1427  eventout += TECW6SY[i];
1428  eventout += ")";
1429  }
1430  eventout += "\n nTECW7 = ";
1431  eventout += TECW7RX.size();
1432  for (unsigned int i = 0; i < TECW7RX.size(); ++i) {
1433  eventout += "\n (RX, RY, SX, SY) = (";
1434  eventout += TECW7RX[i];
1435  eventout += ", ";
1436  eventout += TECW7RY[i];
1437  eventout += ", ";
1438  eventout += TECW7SX[i];
1439  eventout += ", ";
1440  eventout += TECW7SY[i];
1441  eventout += ")";
1442  }
1443  eventout += "\n nTECW8 = ";
1444  eventout += TECW8RX.size();
1445  for (unsigned int i = 0; i < TECW8RX.size(); ++i) {
1446  eventout += "\n (RX, RY, SX, SY) = (";
1447  eventout += TECW8RX[i];
1448  eventout += ", ";
1449  eventout += TECW8RY[i];
1450  eventout += ", ";
1451  eventout += TECW8SX[i];
1452  eventout += ", ";
1453  eventout += TECW8SY[i];
1454  eventout += ")";
1455  }
1456 
1457  // pixel output
1458  eventout += "\n nBRL1 = ";
1459  eventout += BRL1RX.size();
1460  for (unsigned int i = 0; i < BRL1RX.size(); ++i) {
1461  eventout += "\n (RX, RY, SX, SY) = (";
1462  eventout += BRL1RX[i];
1463  eventout += ", ";
1464  eventout += BRL1RY[i];
1465  eventout += ", ";
1466  eventout += BRL1SX[i];
1467  eventout += ", ";
1468  eventout += BRL1SY[i];
1469  eventout += ")";
1470  }
1471  eventout += "\n nBRL2 = ";
1472  eventout += BRL2RX.size();
1473  for (unsigned int i = 0; i < BRL2RX.size(); ++i) {
1474  eventout += "\n (RX, RY, SX, SY) = (";
1475  eventout += BRL2RX[i];
1476  eventout += ", ";
1477  eventout += BRL2RY[i];
1478  eventout += ", ";
1479  eventout += BRL2SX[i];
1480  eventout += ", ";
1481  eventout += BRL2SY[i];
1482  eventout += ")";
1483  }
1484  eventout += "\n nBRL3 = ";
1485  eventout += BRL3RX.size();
1486  for (unsigned int i = 0; i < BRL3RX.size(); ++i) {
1487  eventout += "\n (RX, RY, SX, SY) = (";
1488  eventout += BRL3RX[i];
1489  eventout += ", ";
1490  eventout += BRL3RY[i];
1491  eventout += ", ";
1492  eventout += BRL3SX[i];
1493  eventout += ", ";
1494  eventout += BRL3SY[i];
1495  eventout += ")";
1496  }
1497  eventout += "\n nFWD1p = ";
1498  eventout += FWD1pRX.size();
1499  for (unsigned int i = 0; i < FWD1pRX.size(); ++i) {
1500  eventout += "\n (RX, RY, SX, SY) = (";
1501  eventout += FWD1pRX[i];
1502  eventout += ", ";
1503  eventout += FWD1pRY[i];
1504  eventout += ", ";
1505  eventout += FWD1pSX[i];
1506  eventout += ", ";
1507  eventout += FWD1pSY[i];
1508  eventout += ")";
1509  }
1510  eventout += "\n nFWD1n = ";
1511  eventout += FWD1nRX.size();
1512  for (unsigned int i = 0; i < FWD1nRX.size(); ++i) {
1513  eventout += "\n (RX, RY, SX, SY) = (";
1514  eventout += FWD1nRX[i];
1515  eventout += ", ";
1516  eventout += FWD1nRY[i];
1517  eventout += ", ";
1518  eventout += FWD1nSX[i];
1519  eventout += ", ";
1520  eventout += FWD1nSY[i];
1521  eventout += ")";
1522  }
1523  eventout += "\n nFWD2p = ";
1524  eventout += FWD2pRX.size();
1525  for (unsigned int i = 0; i < FWD2pRX.size(); ++i) {
1526  eventout += "\n (RX, RY, SX, SY) = (";
1527  eventout += FWD2pRX[i];
1528  eventout += ", ";
1529  eventout += FWD2pRY[i];
1530  eventout += ", ";
1531  eventout += FWD2pSX[i];
1532  eventout += ", ";
1533  eventout += FWD2pSY[i];
1534  eventout += ")";
1535  }
1536  eventout += "\n nFWD2p = ";
1537  eventout += FWD2nRX.size();
1538  for (unsigned int i = 0; i < FWD2nRX.size(); ++i) {
1539  eventout += "\n (RX, RY, SX, SY) = (";
1540  eventout += FWD2nRX[i];
1541  eventout += ", ";
1542  eventout += FWD2nRY[i];
1543  eventout += ", ";
1544  eventout += FWD2nSX[i];
1545  eventout += ", ";
1546  eventout += FWD2nSY[i];
1547  eventout += ")";
1548  }
1549 
1550  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1551  }
1552 
1553  // strip output
1573 
1574  // pixel output
1582 
1583  return;
1584 }
1585 
1587  std::string MsgLoggerCat = "GlobalRecHitsProducer_fillMuon";
1588 
1589  TString eventout;
1590  if (verbosity > 0)
1591  eventout = "\nGathering info:";
1592 
1593  // get DT information
1594  const auto& dtGeom = iSetup.getHandle(dtGeomToken_);
1595  if (!dtGeom.isValid()) {
1596  edm::LogWarning(MsgLoggerCat) << "Unable to find DTMuonGeometryRecord in event!";
1597  return;
1598  }
1599 
1601  iEvent.getByToken(MuDTSimSrc_Token_, dtsimHits);
1602  if (!dtsimHits.isValid()) {
1603  edm::LogWarning(MsgLoggerCat) << "Unable to find dtsimHits in event!";
1604  return;
1605  }
1606 
1607  std::map<DTWireId, edm::PSimHitContainer> simHitsPerWire =
1609 
1611  iEvent.getByToken(MuDTSrc_Token_, dtRecHits);
1612  if (!dtRecHits.isValid()) {
1613  edm::LogWarning(MsgLoggerCat) << "Unable to find dtRecHits in event!";
1614  return;
1615  }
1616 
1617  std::map<DTWireId, std::vector<DTRecHit1DPair>> recHitsPerWire = map1DRecHitsPerWire(dtRecHits.product());
1618 
1619  int nDt = compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 1);
1620 
1621  if (verbosity > 1) {
1622  eventout += "\n Number of DtMuonRecHits collected:........ ";
1623  eventout += nDt;
1624  }
1625 
1626  // get CSC Strip information
1627  // get map of sim hits
1628  theMap.clear();
1629  //edm::Handle<CrossingFrame> cf;
1631  //iEvent.getByType(cf);
1632  //if (!cf.isValid()) {
1633  // edm::LogWarning(MsgLoggerCat)
1634  // << "Unable to find CrossingFrame in event!";
1635  // return;
1636  //}
1637  //MixCollection<PSimHit> simHits(cf.product(), "MuonCSCHits");
1638  iEvent.getByToken(MuCSCHits_Token_, cf);
1639  if (!cf.isValid()) {
1640  edm::LogWarning(MsgLoggerCat) << "Unable to find muo CSC crossingFrame in event!";
1641  return;
1642  }
1644 
1645  // arrange the hits by detUnit
1646  for (MixCollection<PSimHit>::MixItr hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr) {
1647  theMap[hitItr->detUnitId()].push_back(*hitItr);
1648  }
1649 
1650  // get geometry
1651  const auto& hGeom = iSetup.getHandle(cscGeomToken_);
1652  if (!hGeom.isValid()) {
1653  edm::LogWarning(MsgLoggerCat) << "Unable to find CSCMuonGeometryRecord in event!";
1654  return;
1655  }
1656  const CSCGeometry* theCSCGeometry = &*hGeom;
1657 
1658  // get rechits
1660  iEvent.getByToken(MuCSCSrc_Token_, hRecHits);
1661  if (!hRecHits.isValid()) {
1662  edm::LogWarning(MsgLoggerCat) << "Unable to find CSC RecHits in event!";
1663  return;
1664  }
1665  const CSCRecHit2DCollection* cscRecHits = hRecHits.product();
1666 
1667  int nCSC = 0;
1668  for (CSCRecHit2DCollection::const_iterator recHitItr = cscRecHits->begin(); recHitItr != cscRecHits->end();
1669  ++recHitItr) {
1670  int detId = (*recHitItr).cscDetId().rawId();
1671 
1673  std::map<int, edm::PSimHitContainer>::const_iterator mapItr = theMap.find(detId);
1674  if (mapItr != theMap.end()) {
1675  simHits = mapItr->second;
1676  }
1677 
1678  if (simHits.size() == 1) {
1679  ++nCSC;
1680 
1681  const GeomDetUnit* detUnit = theCSCGeometry->idToDetUnit(CSCDetId(detId));
1682  const CSCLayer* layer = dynamic_cast<const CSCLayer*>(detUnit);
1683 
1684  int chamberType = layer->chamber()->specs()->chamberType();
1685  plotResolution(simHits[0], *recHitItr, layer, chamberType);
1686  }
1687  }
1688 
1689  if (verbosity > 1) {
1690  eventout += "\n Number of CSCRecHits collected:........... ";
1691  eventout += nCSC;
1692  }
1693 
1694  // get RPC information
1695  std::map<double, int> mapsim, maprec;
1696  std::map<int, double> nmapsim, nmaprec;
1697 
1698  const auto& rpcGeom = iSetup.getHandle(rpcGeomToken_);
1699  if (!rpcGeom.isValid()) {
1700  edm::LogWarning(MsgLoggerCat) << "Unable to find RPCMuonGeometryRecord in event!";
1701  return;
1702  }
1703 
1705  iEvent.getByToken(MuRPCSimSrc_Token_, simHit);
1706  if (!simHit.isValid()) {
1707  edm::LogWarning(MsgLoggerCat) << "Unable to find RPCSimHit in event!";
1708  return;
1709  }
1710 
1712  iEvent.getByToken(MuRPCSrc_Token_, recHit);
1713  if (!simHit.isValid()) {
1714  edm::LogWarning(MsgLoggerCat) << "Unable to find RPCRecHit in event!";
1715  return;
1716  }
1717 
1718  int nRPC = 0;
1720  int nrec = 0;
1721  for (recIt = recHit->begin(); recIt != recHit->end(); ++recIt) {
1722  RPCDetId Rid = (RPCDetId)(*recIt).rpcId();
1723  const RPCRoll* roll = dynamic_cast<const RPCRoll*>(rpcGeom->roll(Rid));
1724  if (roll->isForward()) {
1725  if (verbosity > 1) {
1726  eventout += "\n Number of RPCRecHits collected:........... ";
1727  eventout += nRPC;
1728  }
1729 
1730  if (verbosity > 0)
1731  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1732  return;
1733  }
1734  nrec = nrec + 1;
1735  LocalPoint rhitlocal = (*recIt).localPosition();
1736  double rhitlocalx = rhitlocal.x();
1737  maprec[rhitlocalx] = nrec;
1738  }
1739 
1740  int i = 0;
1741  for (std::map<double, int>::iterator iter = maprec.begin(); iter != maprec.end(); ++iter) {
1742  i = i + 1;
1743  nmaprec[i] = (*iter).first;
1744  }
1745 
1746  edm::PSimHitContainer::const_iterator simIt;
1747  int nsim = 0;
1748  for (simIt = simHit->begin(); simIt != simHit->end(); simIt++) {
1749  int ptype = (*simIt).particleType();
1750  //RPCDetId Rsid = (RPCDetId)(*simIt).detUnitId();
1751  if (ptype == 13 || ptype == -13) {
1752  nsim = nsim + 1;
1753  LocalPoint shitlocal = (*simIt).localPosition();
1754  double shitlocalx = shitlocal.x();
1755  mapsim[shitlocalx] = nsim;
1756  }
1757  }
1758 
1759  i = 0;
1760  for (std::map<double, int>::iterator iter = mapsim.begin(); iter != mapsim.end(); ++iter) {
1761  i = i + 1;
1762  nmapsim[i] = (*iter).first;
1763  }
1764 
1765  if (nsim == nrec) {
1766  for (int r = 0; r < nsim; r++) {
1767  ++nRPC;
1768  RPCRHX.push_back(nmaprec[r + 1]);
1769  RPCSHX.push_back(nmapsim[r + 1]);
1770  }
1771  }
1772 
1773  if (verbosity > 1) {
1774  eventout += "\n Number of RPCRecHits collected:........... ";
1775  eventout += nRPC;
1776  }
1777 
1778  if (verbosity > 0)
1779  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1780 
1781  return;
1782 }
1783 
1785  std::string MsgLoggerCat = "GlobalRecHitsProducer_storeMuon";
1786 
1787  if (verbosity > 2) {
1788  // dt output
1789  TString eventout("\n nDT = ");
1790  eventout += DTRHD.size();
1791  for (unsigned int i = 0; i < DTRHD.size(); ++i) {
1792  eventout += "\n (RHD, SHD) = (";
1793  eventout += DTRHD[i];
1794  eventout += ", ";
1795  eventout += DTSHD[i];
1796  eventout += ")";
1797  }
1798 
1799  // CSC Strip
1800  eventout += "\n nCSC = ";
1801  eventout += CSCRHPHI.size();
1802  for (unsigned int i = 0; i < CSCRHPHI.size(); ++i) {
1803  eventout += "\n (rhphi, rhperp, shphi) = (";
1804  eventout += CSCRHPHI[i];
1805  eventout += ", ";
1806  eventout += CSCRHPERP[i];
1807  eventout += ", ";
1808  eventout += CSCSHPHI[i];
1809  eventout += ")";
1810  }
1811 
1812  // RPC
1813  eventout += "\n nRPC = ";
1814  eventout += RPCRHX.size();
1815  for (unsigned int i = 0; i < RPCRHX.size(); ++i) {
1816  eventout += "\n (rhx, shx) = (";
1817  eventout += RPCRHX[i];
1818  eventout += ", ";
1819  eventout += RPCSHX[i];
1820  eventout += ")";
1821  }
1822 
1823  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1824  }
1825 
1826  product.putDTRecHits(DTRHD, DTSHD);
1827 
1829 
1830  product.putRPCRecHits(RPCRHX, RPCSHX);
1831 
1832  return;
1833 }
1834 
1836  std::string MsgLoggerCat = "GlobalRecHitsProducer_clear";
1837 
1838  if (verbosity > 0)
1839  edm::LogInfo(MsgLoggerCat) << "Clearing event holders";
1840 
1841  // reset electromagnetic info
1842  // EE info
1843  EERE.clear();
1844  EESHE.clear();
1845  // EB info
1846  EBRE.clear();
1847  EBSHE.clear();
1848  // ES info
1849  ESRE.clear();
1850  ESSHE.clear();
1851 
1852  // reset HCal Info
1853  HBCalREC.clear();
1854  HBCalR.clear();
1855  HBCalSHE.clear();
1856  HECalREC.clear();
1857  HECalR.clear();
1858  HECalSHE.clear();
1859  HOCalREC.clear();
1860  HOCalR.clear();
1861  HOCalSHE.clear();
1862  HFCalREC.clear();
1863  HFCalR.clear();
1864  HFCalSHE.clear();
1865 
1866  // reset Track Info
1867  TIBL1RX.clear();
1868  TIBL2RX.clear();
1869  TIBL3RX.clear();
1870  TIBL4RX.clear();
1871  TIBL1RY.clear();
1872  TIBL2RY.clear();
1873  TIBL3RY.clear();
1874  TIBL4RY.clear();
1875  TIBL1SX.clear();
1876  TIBL2SX.clear();
1877  TIBL3SX.clear();
1878  TIBL4SX.clear();
1879  TIBL1SY.clear();
1880  TIBL2SY.clear();
1881  TIBL3SY.clear();
1882  TIBL4SY.clear();
1883 
1884  TOBL1RX.clear();
1885  TOBL2RX.clear();
1886  TOBL3RX.clear();
1887  TOBL4RX.clear();
1888  TOBL1RY.clear();
1889  TOBL2RY.clear();
1890  TOBL3RY.clear();
1891  TOBL4RY.clear();
1892  TOBL1SX.clear();
1893  TOBL2SX.clear();
1894  TOBL3SX.clear();
1895  TOBL4SX.clear();
1896  TOBL1SY.clear();
1897  TOBL2SY.clear();
1898  TOBL3SY.clear();
1899  TOBL4SY.clear();
1900 
1901  TIDW1RX.clear();
1902  TIDW2RX.clear();
1903  TIDW3RX.clear();
1904  TIDW1RY.clear();
1905  TIDW2RY.clear();
1906  TIDW3RY.clear();
1907  TIDW1SX.clear();
1908  TIDW2SX.clear();
1909  TIDW3SX.clear();
1910  TIDW1SY.clear();
1911  TIDW2SY.clear();
1912  TIDW3SY.clear();
1913 
1914  TECW1RX.clear();
1915  TECW2RX.clear();
1916  TECW3RX.clear();
1917  TECW4RX.clear();
1918  TECW5RX.clear();
1919  TECW6RX.clear();
1920  TECW7RX.clear();
1921  TECW8RX.clear();
1922  TECW1RY.clear();
1923  TECW2RY.clear();
1924  TECW3RY.clear();
1925  TECW4RY.clear();
1926  TECW5RY.clear();
1927  TECW6RY.clear();
1928  TECW7RY.clear();
1929  TECW8RY.clear();
1930  TECW1SX.clear();
1931  TECW2SX.clear();
1932  TECW3SX.clear();
1933  TECW4SX.clear();
1934  TECW5SX.clear();
1935  TECW6SX.clear();
1936  TECW7SX.clear();
1937  TECW8SX.clear();
1938  TECW1SY.clear();
1939  TECW2SY.clear();
1940  TECW3SY.clear();
1941  TECW4SY.clear();
1942  TECW5SY.clear();
1943  TECW6SY.clear();
1944  TECW7SY.clear();
1945  TECW8SY.clear();
1946 
1947  BRL1RX.clear();
1948  BRL1RY.clear();
1949  BRL1SX.clear();
1950  BRL1SY.clear();
1951  BRL2RX.clear();
1952  BRL2RY.clear();
1953  BRL2SX.clear();
1954  BRL2SY.clear();
1955  BRL3RX.clear();
1956  BRL3RY.clear();
1957  BRL3SX.clear();
1958  BRL3SY.clear();
1959 
1960  FWD1pRX.clear();
1961  FWD1pRY.clear();
1962  FWD1pSX.clear();
1963  FWD1pSY.clear();
1964  FWD1nRX.clear();
1965  FWD1nRY.clear();
1966  FWD1nSX.clear();
1967  FWD1nSY.clear();
1968  FWD2pRX.clear();
1969  FWD2pRY.clear();
1970  FWD2pSX.clear();
1971  FWD2pSY.clear();
1972  FWD2nRX.clear();
1973  FWD2nRY.clear();
1974  FWD2nSX.clear();
1975  FWD2nSY.clear();
1976 
1977  //muon clear
1978  DTRHD.clear();
1979  DTSHD.clear();
1980 
1981  CSCRHPHI.clear();
1982  CSCRHPERP.clear();
1983  CSCSHPHI.clear();
1984 
1985  RPCRHX.clear();
1986  RPCSHX.clear();
1987 
1988  return;
1989 }
1990 
1991 //needed by to do the residual for matched hits in SiStrip
1992 std::pair<LocalPoint, LocalVector> GlobalRecHitsProducer::projectHit(const PSimHit& hit,
1993  const StripGeomDetUnit* stripDet,
1994  const BoundPlane& plane) {
1995  const StripTopology& topol = stripDet->specificTopology();
1996  GlobalPoint globalpos = stripDet->surface().toGlobal(hit.localPosition());
1997  LocalPoint localHit = plane.toLocal(globalpos);
1998  //track direction
1999  LocalVector locdir = hit.localDirection();
2000  //rotate track in new frame
2001 
2002  GlobalVector globaldir = stripDet->surface().toGlobal(locdir);
2003  LocalVector dir = plane.toLocal(globaldir);
2004  float scale = -localHit.z() / dir.z();
2005 
2006  LocalPoint projectedPos = localHit + scale * dir;
2007 
2008  float selfAngle = topol.stripAngle(topol.strip(hit.localPosition()));
2009 
2010  // vector along strip in hit frame
2011  LocalVector stripDir(sin(selfAngle), cos(selfAngle), 0);
2012 
2013  LocalVector localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir)));
2014 
2015  return std::pair<LocalPoint, LocalVector>(projectedPos, localStripDir);
2016 }
2017 
2018 // Return a map between DTRecHit1DPair and wireId
2019 std::map<DTWireId, std::vector<DTRecHit1DPair>> GlobalRecHitsProducer::map1DRecHitsPerWire(
2020  const DTRecHitCollection* dt1DRecHitPairs) {
2021  std::map<DTWireId, std::vector<DTRecHit1DPair>> ret;
2022 
2023  for (DTRecHitCollection::const_iterator rechit = dt1DRecHitPairs->begin(); rechit != dt1DRecHitPairs->end();
2024  rechit++) {
2025  ret[(*rechit).wireId()].push_back(*rechit);
2026  }
2027 
2028  return ret;
2029 }
2030 
2031 // Compute SimHit distance from wire (cm)
2033  float xwire = layer->specificTopology().wirePosition(wireId.wire());
2034  LocalPoint entryP = hit.entryPoint();
2035  LocalPoint exitP = hit.exitPoint();
2036  float xEntry = entryP.x() - xwire;
2037  float xExit = exitP.x() - xwire;
2038 
2039  //FIXME: check...
2040  return fabs(xEntry - (entryP.z() * (xExit - xEntry)) / (exitP.z() - entryP.z()));
2041 }
2042 
2043 // Find the RecHit closest to the muon SimHit
2044 template <typename type>
2046  DTWireId wireId,
2047  const std::vector<type>& recHits,
2048  const float simHitDist) {
2049  float res = 99999;
2050  const type* theBestRecHit = nullptr;
2051  // Loop over RecHits within the cell
2052  for (typename std::vector<type>::const_iterator recHit = recHits.begin(); recHit != recHits.end(); recHit++) {
2053  float distTmp = recHitDistFromWire(*recHit, layer);
2054  if (fabs(distTmp - simHitDist) < res) {
2055  res = fabs(distTmp - simHitDist);
2056  theBestRecHit = &(*recHit);
2057  }
2058  } // End of loop over RecHits within the cell
2059 
2060  return theBestRecHit;
2061 }
2062 
2063 // Compute the distance from wire (cm) of a hits in a DTRecHit1DPair
2065  // Compute the rechit distance from wire
2066  return fabs(hitPair.localPosition(DTEnums::Left).x() - hitPair.localPosition(DTEnums::Right).x()) / 2.;
2067 }
2068 
2069 // Compute the distance from wire (cm) of a hits in a DTRecHit1D
2071  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
2072 }
2073 
2074 template <typename type>
2076  const std::map<DTWireId, std::vector<PSimHit>>& _simHitsPerWire,
2077  const std::map<DTWireId, std::vector<type>>& _recHitsPerWire,
2078  int step) {
2079  std::map<DTWireId, std::vector<PSimHit>> simHitsPerWire = _simHitsPerWire;
2080  std::map<DTWireId, std::vector<type>> recHitsPerWire = _recHitsPerWire;
2081  int nDt = 0;
2082  // Loop over cells with a muon SimHit
2083  for (std::map<DTWireId, std::vector<PSimHit>>::const_iterator wireAndSHits = simHitsPerWire.begin();
2084  wireAndSHits != simHitsPerWire.end();
2085  wireAndSHits++) {
2086  DTWireId wireId = (*wireAndSHits).first;
2087  std::vector<PSimHit> simHitsInCell = (*wireAndSHits).second;
2088 
2089  // Get the layer
2090  const DTLayer* layer = dtGeom->layer(wireId);
2091 
2092  // Look for a mu hit in the cell
2093  const PSimHit* muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
2094  if (muSimHit == nullptr) {
2095  continue; // Skip this cell
2096  }
2097 
2098  // Find the distance of the simhit from the wire
2099  float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
2100  // Skip simhits out of the cell
2101  if (simHitWireDist > 2.1) {
2102  continue; // Skip this cell
2103  }
2104  //GlobalPoint simHitGlobalPos = layer->toGlobal(muSimHit->localPosition());
2105 
2106  // Look for RecHits in the same cell
2107  if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
2108  continue; // No RecHit found in this cell
2109  } else {
2110  // vector<type> recHits = (*wireAndRecHits).second;
2111  std::vector<type> recHits = recHitsPerWire[wireId];
2112 
2113  // Find the best RecHit
2114  const type* theBestRecHit = findBestRecHit(layer, wireId, recHits, simHitWireDist);
2115 
2116  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
2117 
2118  ++nDt;
2119 
2120  DTRHD.push_back(recHitWireDist);
2121  DTSHD.push_back(simHitWireDist);
2122 
2123  } // find rechits
2124  } // loop over simhits
2125 
2126  return nDt;
2127 }
2128 
2130  const CSCRecHit2D& recHit,
2131  const CSCLayer* layer,
2132  int chamberType) {
2133  GlobalPoint simHitPos = layer->toGlobal(simHit.localPosition());
2134  GlobalPoint recHitPos = layer->toGlobal(recHit.localPosition());
2135 
2136  CSCRHPHI.push_back(recHitPos.phi());
2137  CSCRHPERP.push_back(recHitPos.perp());
2138  CSCSHPHI.push_back(simHitPos.phi());
2139 }
2140 
2141 //define this as a plug-in
2142 //DEFINE_FWK_MODULE(GlobalRecHitsProducer);
void putTIBL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
GlobalRecHitsProducer(const edm::ParameterSet &)
edm::EDGetTokenT< edm::PSimHitContainer > MuDTSimSrc_Token_
edm::EDGetTokenT< edm::PCaloHitContainer > HCalSrc_Token_
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
float simHitDistFromWire(const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
unsigned int tobLayer(const DetId &id) const
std::map< DTWireId, edm::PSimHitContainer > mapSimHitsPerWire(const edm::PSimHitContainer &simhits)
unsigned int pxbLayer(const DetId &id) const
void putHFCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
std::vector< PCaloHit > PCaloHitContainer
T perp() const
Definition: PV3DBase.h:69
TrackerHitAssociator::Config trackerHitAssociatorConfig_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EEHits_Token_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
void putHECalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
virtual float stripAngle(float strip) const =0
void putFWD1nRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTOBL4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdHcalOut
edm::EDGetTokenT< EBUncalibratedRecHitCollection > ECalUncalEBSrc_Token_
int wire() const
Return the wire number.
Definition: DTWireId.h:42
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
int compute(const DTGeometry *dtGeom, const std::map< DTWireId, std::vector< PSimHit >> &simHitsPerWire, const std::map< DTWireId, std::vector< type >> &recHitsPerWire, int step)
void putHBCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
T z() const
Definition: PV3DBase.h:61
ret
prodAgent to be discontinued
std::vector< PSimHit > matched
std::string const & instance() const
Definition: InputTag.h:37
void putTECW6RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putBRL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTECW8RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void fillHCal(edm::Event &, const edm::EventSetup &)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
edm::EDGetTokenT< EEUncalibratedRecHitCollection > ECalUncalEESrc_Token_
int closest(std::vector< int > const &vec, int value)
void putEECalRecHits(const std::vector< float > &re, const std::vector< float > &she)
unsigned int tidWheel(const DetId &id) const
static const int sdSiTID
void putTECW5RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned int tecWheel(const DetId &id) const
edm::EDGetTokenT< EERecHitCollection > ECalEESrc_Token_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T eta() const
Definition: PV3DBase.h:73
void putTECW7RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
T const * product() const
Definition: Handle.h:70
void putCSCRecHits(const std::vector< float > &rhphi, const std::vector< float > &rhperp, const std::vector< float > &shphi)
void putTECW2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
std::vector< T >::const_iterator const_iterator
void putTIDW1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
unsigned long long EventNumber_t
void putRPCRecHits(const std::vector< float > &rhx, const std::vector< float > &shx)
void putTECW1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
LocalPoint localPosition() const override
void storeMuon(PGlobalRecHit &)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< CrossingFrame< PCaloHit > > EBHits_Token_
Definition: Electron.h:6
void produce(edm::Event &, const edm::EventSetup &) override
void storeECal(PGlobalRecHit &)
std::map< int, edm::PSimHitContainer > theMap
void putBRL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
const_iterator end(bool update=false) const
virtual float strip(const LocalPoint &) const =0
T getUntrackedParameter(std::string const &, T const &) const
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
edm::EDGetTokenT< CrossingFrame< PSimHit > > MuCSCHits_Token_
char const * label
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
int iEvent
Definition: GenABIO.cc:224
void putTOBL1RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIDW2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putFWD2nRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdSiTIB
static const int sdPxlBrl
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > SiStripSrc_Token_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > ESHits_Token_
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
void putHOCalRecHits(const std::vector< float > &rec, const std::vector< float > &r, const std::vector< float > &she)
void putTECW3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTOBL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
T sqrt(T t)
Definition: SSEVec.h:19
void putTIBL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
unsigned int pxfDisk(const DetId &id) const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
void plotResolution(const PSimHit &simHit, const CSCRecHit2D &recHit, const CSCLayer *layer, int chamberType)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int sdSiTOB
const_iterator begin() const
const PSimHit * findMuSimHit(const edm::PSimHitContainer &hits)
Select the SimHit from a muon in a vector of SimHits.
void putEBCalRecHits(const std::vector< float > &re, const std::vector< float > &she)
void putBRL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::EDGetTokenT< CSCRecHit2DCollection > MuCSCSrc_Token_
edm::EDGetTokenT< ESRecHitCollection > ECalESSrc_Token_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::EDGetTokenT< DTRecHitCollection > MuDTSrc_Token_
void storeTrk(PGlobalRecHit &)
edm::EDGetTokenT< RPCRecHitCollection > MuRPCSrc_Token_
const int verbosity
const_iterator end() const
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
void putTIBL4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putESCalRecHits(const std::vector< float > &re, const std::vector< float > &she)
Log< level::Info, false > LogInfo
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetId.h:17
unsigned int pxfSide(const DetId &id) const
void putFWD1pRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void fillMuon(edm::Event &, const edm::EventSetup &)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
DetId geographicalId() const
void putDTRecHits(const std::vector< float > &rhd, const std::vector< float > &shd)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdHcalFwd
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
static const int sdHcalBrl
bool isValid() const
Definition: HandleBase.h:70
void storeHCal(PGlobalRecHit &)
void putTOBL2RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdSiTEC
iterator end()
Definition: DetSetNew.h:53
const_iterator find(id_type i, bool update=false) const
edm::EDGetTokenT< SiPixelRecHitCollection > SiPxlSrc_Token_
LocalPoint localPosition() const override
GlobalPoint getPosition(const DetId &id) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
std::vector< PSimHit > PSimHitContainer
unsigned int RunNumber_t
unsigned int tibLayer(const DetId &id) const
step
Definition: StallMonitor.cc:83
static const int sdPxlFwd
Log< level::Warning, false > LogWarning
void fillTrk(edm::Event &, const edm::EventSetup &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
edm::EDGetTokenT< edm::PSimHitContainer > MuRPCSimSrc_Token_
void putTECW4RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
static const int sdHcalEC
edm::EDGetTokenT< EBRecHitCollection > ECalEBSrc_Token_
void fillECal(edm::Event &, const edm::EventSetup &)
void putFWD2pRecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
def move(src, dest)
Definition: eostools.py:511
void putTIDW3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
void putTIBL3RecHits(const std::vector< float > &rx, const std::vector< float > &ry, const std::vector< float > &sx, const std::vector< float > &sy)
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:89
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
iterator begin()
Definition: DetSetNew.h:51