CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
DTHitAssociator Class Reference

#include <DTHitAssociator.h>

Public Types

typedef std::map< DTWireId, std::vector< DTDigi > > DigiMap
 
typedef std::map< DTWireId, std::vector< DTDigiSimLink > > LinksMap
 
typedef std::pair< PSimHit, bool > PSimHit_withFlag
 
typedef std::map< DTWireId, std::vector< DTRecHit1DPair > > RecHitMap
 
typedef std::pair< uint32_t, EncodedEventIdSimHitIdpr
 
typedef std::map< DTWireId, std::vector< PSimHit_withFlag > > SimHitMap
 

Public Member Functions

std::vector< SimHitIdprassociateDTHitId (const DTRecHit1D *dtrechit) const
 
std::vector< PSimHitassociateHit (const TrackingRecHit &hit) const
 
std::vector< SimHitIdprassociateHitId (const TrackingRecHit &hit) const
 
 DTHitAssociator (const edm::Event &, const edm::EventSetup &, const edm::ParameterSet &, bool printRtS)
 
 DTHitAssociator (const edm::ParameterSet &, edm::ConsumesCollector &&iC)
 
void initEvent (const edm::Event &, const edm::EventSetup &)
 
virtual ~DTHitAssociator ()
 

Public Attributes

DigiMap mapOfDigi
 
LinksMap mapOfLinks
 
RecHitMap mapOfRecHit
 
SimHitMap mapOfSimHit
 

Private Member Functions

bool SimHitOK (const edm::ESHandle< DTGeometry > &, const PSimHit &)
 

Private Attributes

bool associatorByWire
 
bool crossingframe
 
edm::InputTag DTdigisimlinkTag
 
edm::InputTag DTdigiTag
 
edm::InputTag DTrechitTag
 
edm::InputTag DTsimhitsTag
 
edm::InputTag DTsimhitsXFTag
 
bool dumpDT
 
bool links_exist
 
bool printRtS
 

Detailed Description

Definition at line 22 of file DTHitAssociator.h.

Member Typedef Documentation

◆ DigiMap

typedef std::map<DTWireId, std::vector<DTDigi> > DTHitAssociator::DigiMap

Definition at line 28 of file DTHitAssociator.h.

◆ LinksMap

typedef std::map<DTWireId, std::vector<DTDigiSimLink> > DTHitAssociator::LinksMap

Definition at line 29 of file DTHitAssociator.h.

◆ PSimHit_withFlag

typedef std::pair<PSimHit, bool> DTHitAssociator::PSimHit_withFlag

Definition at line 25 of file DTHitAssociator.h.

◆ RecHitMap

typedef std::map<DTWireId, std::vector<DTRecHit1DPair> > DTHitAssociator::RecHitMap

Definition at line 27 of file DTHitAssociator.h.

◆ SimHitIdpr

typedef std::pair<uint32_t, EncodedEventId> DTHitAssociator::SimHitIdpr

Definition at line 24 of file DTHitAssociator.h.

◆ SimHitMap

typedef std::map<DTWireId, std::vector<PSimHit_withFlag> > DTHitAssociator::SimHitMap

Definition at line 26 of file DTHitAssociator.h.

Constructor & Destructor Documentation

◆ DTHitAssociator() [1/2]

DTHitAssociator::DTHitAssociator ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const edm::ParameterSet conf,
bool  printRtS 
)

Definition at line 48 of file DTHitAssociator.cc.

52  : // input collection labels
53  DTsimhitsTag(conf.getParameter<edm::InputTag>("DTsimhitsTag")),
54  DTsimhitsXFTag(conf.getParameter<edm::InputTag>("DTsimhitsXFTag")),
55  DTdigiTag(conf.getParameter<edm::InputTag>("DTdigiTag")),
56  DTdigisimlinkTag(conf.getParameter<edm::InputTag>("DTdigisimlinkTag")),
57  DTrechitTag(conf.getParameter<edm::InputTag>("DTrechitTag")),
58 
59  // nice printout of DT hits
60  dumpDT(conf.getParameter<bool>("dumpDT")),
61  // CrossingFrame used or not ?
62  crossingframe(conf.getParameter<bool>("crossingframe")),
63  // Event contain the DTDigiSimLink collection ?
64  links_exist(conf.getParameter<bool>("links_exist")),
65  // associatorByWire links to a RecHit all the "valid" SimHits on the same
66  // DT wire
67  associatorByWire(conf.getParameter<bool>("associatorByWire")),
68 
69  printRtS(true)
70 
71 {
72  initEvent(iEvent, iSetup);
73 }

References iEvent, and initEvent().

◆ DTHitAssociator() [2/2]

DTHitAssociator::DTHitAssociator ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)

Definition at line 17 of file DTHitAssociator.cc.

18  : DTsimhitsTag(conf.getParameter<edm::InputTag>("DTsimhitsTag")),
19  DTsimhitsXFTag(conf.getParameter<edm::InputTag>("DTsimhitsXFTag")),
20  DTdigiTag(conf.getParameter<edm::InputTag>("DTdigiTag")),
21  DTdigisimlinkTag(conf.getParameter<edm::InputTag>("DTdigisimlinkTag")),
22  DTrechitTag(conf.getParameter<edm::InputTag>("DTrechitTag")),
23 
24  // nice printout of DT hits
25  dumpDT(conf.getParameter<bool>("dumpDT")),
26  // CrossingFrame used or not ?
27  crossingframe(conf.getParameter<bool>("crossingframe")),
28  // Event contain the DTDigiSimLink collection ?
29  links_exist(conf.getParameter<bool>("links_exist")),
30  // associatorByWire links to a RecHit all the "valid" SimHits on the same
31  // DT wire
32  associatorByWire(conf.getParameter<bool>("associatorByWire")),
33 
34  printRtS(true) {
35  if (crossingframe) {
37  } else if (!DTsimhitsTag.label().empty()) {
39  }
42 
43  if (dumpDT && printRtS) {
45  }
46 }

References crossingframe, DTdigisimlinkTag, DTdigiTag, DTrechitTag, DTsimhitsTag, DTsimhitsXFTag, dumpDT, edm::InputTag::label(), and printRtS.

◆ ~DTHitAssociator()

virtual DTHitAssociator::~DTHitAssociator ( )
inlinevirtual

Definition at line 36 of file DTHitAssociator.h.

36 {}

Member Function Documentation

◆ associateDTHitId()

std::vector< DTHitAssociator::SimHitIdpr > DTHitAssociator::associateDTHitId ( const DTRecHit1D dtrechit) const

Definition at line 289 of file DTHitAssociator.cc.

289  {
290  std::vector<SimHitIdpr> matched;
291 
292  DTWireId wireid = dtrechit->wireId();
293 
294  if (associatorByWire) {
295  // matching based on DTWireId : take only "valid" SimHits on that wire
296 
297  auto found = mapOfSimHit.find(wireid);
298  if (found != mapOfSimHit.end()) {
299  for (vector<PSimHit_withFlag>::const_iterator hitIT = found->second.begin(); hitIT != found->second.end();
300  ++hitIT) {
301  bool valid_hit = hitIT->second;
302  PSimHit this_hit = hitIT->first;
303 
304  if (valid_hit) {
305  SimHitIdpr currentId(this_hit.trackId(), this_hit.eventId());
306  matched.push_back(currentId);
307  }
308  }
309  }
310  }
311 
312  else {
313  // matching based on DTDigiSimLink
314 
315  float theTime = dtrechit->digiTime();
316  int theNumber(-1);
317 
318  auto found = mapOfLinks.find(wireid);
319 
320  if (found != mapOfLinks.end()) {
321  // DTDigiSimLink::time() is set equal to DTDigi::time() only for the
322  // DTDigiSimLink corresponding to the digitizied PSimHit other
323  // DTDigiSimLinks associated to the same DTDigi are identified by having
324  // the same DTDigiSimLink::number()
325 
326  // first find the associated digi Number
327  for (vector<DTDigiSimLink>::const_iterator linkIT = found->second.begin(); linkIT != found->second.end();
328  ++linkIT) {
329  float digitime = linkIT->time();
330  if (fabs(digitime - theTime) < 0.1) {
331  theNumber = linkIT->number();
332  }
333  }
334 
335  // then get all the DTDigiSimLinks with that digi Number (corresponding to
336  // valid SimHits
337  // within a time window of the order of the time resolution, specified in
338  // the DTDigitizer)
339  for (vector<DTDigiSimLink>::const_iterator linkIT = found->second.begin(); linkIT != found->second.end();
340  ++linkIT) {
341  int digiNr = linkIT->number();
342  if (digiNr == theNumber) {
343  SimHitIdpr currentId(linkIT->SimTrackId(), linkIT->eventId());
344  matched.push_back(currentId);
345  }
346  }
347 
348  } else {
349  LogTrace("DTHitAssociator") << "*** ERROR in DTHitAssociator::associateDTHitId - DTRecHit1D: " << *dtrechit
350  << " has no associated DTDigiSimLink !" << endl;
351  return matched;
352  }
353  }
354 
355  return matched;
356 }

References associatorByWire, PSimHit::eventId(), newFWLiteAna::found, LogTrace, mapOfLinks, mapOfSimHit, muonTagProbeFilters_cff::matched, and PSimHit::trackId().

Referenced by associateHit(), associateHitId(), and MuonAssociatorByHitsHelper::getMatchedIds().

◆ associateHit()

std::vector< PSimHit > DTHitAssociator::associateHit ( const TrackingRecHit hit) const

Definition at line 358 of file DTHitAssociator.cc.

358  {
359  std::vector<PSimHit> simhits;
360  std::vector<SimHitIdpr> simtrackids;
361 
362  const TrackingRecHit *hitp = &hit;
363  const DTRecHit1D *dtrechit = dynamic_cast<const DTRecHit1D *>(hitp);
364 
365  if (dtrechit) {
366  DTWireId wireid = dtrechit->wireId();
367 
368  if (associatorByWire) {
369  // matching based on DTWireId : take only "valid" SimHits on that wire
370 
371  auto found = mapOfSimHit.find(wireid);
372  if (found != mapOfSimHit.end()) {
373  for (vector<PSimHit_withFlag>::const_iterator hitIT = found->second.begin(); hitIT != found->second.end();
374  ++hitIT) {
375  bool valid_hit = hitIT->second;
376  if (valid_hit)
377  simhits.push_back(hitIT->first);
378  }
379  }
380  } else {
381  // matching based on DTDigiSimLink
382 
383  simtrackids = associateDTHitId(dtrechit);
384 
385  for (vector<SimHitIdpr>::const_iterator idIT = simtrackids.begin(); idIT != simtrackids.end(); ++idIT) {
386  uint32_t trId = idIT->first;
387  EncodedEventId evId = idIT->second;
388 
389  auto found = mapOfSimHit.find(wireid);
390  if (found != mapOfSimHit.end()) {
391  for (vector<PSimHit_withFlag>::const_iterator hitIT = found->second.begin(); hitIT != found->second.end();
392  ++hitIT) {
393  if (hitIT->first.trackId() == trId && hitIT->first.eventId() == evId)
394  simhits.push_back(hitIT->first);
395  }
396  }
397  }
398  }
399 
400  } else {
401  LogTrace("DTHitAssociator") << "*** WARNING in DTHitAssociator::associateHit, null dynamic_cast !";
402  }
403  return simhits;
404 }

References associateDTHitId(), associatorByWire, newFWLiteAna::found, LogTrace, mapOfSimHit, and HLTBitAnalyser_cfi::simhits.

Referenced by MuonAssociatorByHitsHelper::getMatchedIds().

◆ associateHitId()

std::vector< DTHitAssociator::SimHitIdpr > DTHitAssociator::associateHitId ( const TrackingRecHit hit) const

Definition at line 275 of file DTHitAssociator.cc.

275  {
276  std::vector<SimHitIdpr> simtrackids;
277  const TrackingRecHit *hitp = &hit;
278  const DTRecHit1D *dtrechit = dynamic_cast<const DTRecHit1D *>(hitp);
279 
280  if (dtrechit) {
281  simtrackids = associateDTHitId(dtrechit);
282  } else {
283  LogTrace("DTHitAssociator") << "*** WARNING in DTHitAssociator::associateHitId, null dynamic_cast "
284  "!";
285  }
286  return simtrackids;
287 }

References associateDTHitId(), and LogTrace.

◆ initEvent()

void DTHitAssociator::initEvent ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)

Definition at line 75 of file DTHitAssociator.cc.

75  {
76  LogTrace("DTHitAssociator") << "DTHitAssociator constructor: dumpDT = " << dumpDT
77  << ", crossingframe = " << crossingframe << ", links_exist = " << links_exist
78  << ", associatorByWire = " << associatorByWire;
79 
80  if (!links_exist && !associatorByWire) {
81  LogTrace("DTHitAssociator") << "*** WARNING in DTHitAssociator::DTHitAssociator: associatorByWire "
82  "reset to TRUE !"
83  << " \t (missing DTDigiSimLinkCollection ?)";
84  associatorByWire = true;
85  }
86 
87  // need DT Geometry to discard hits for which the drift time parametrisation
88  // is not applicable
90  iSetup.get<MuonGeometryRecord>().get(muonGeom);
91 
92  // Get the DT SimHits from the event and map PSimHit by DTWireId
93  mapOfSimHit.clear();
94  bool takeHit(true);
95 
96  if (crossingframe) {
98  LogTrace("DTHitAssociator") << "getting CrossingFrame<PSimHit> collection - " << DTsimhitsXFTag;
99  iEvent.getByLabel(DTsimhitsXFTag, xFrame);
100  unique_ptr<MixCollection<PSimHit>> DTsimhits(new MixCollection<PSimHit>(xFrame.product()));
101  LogTrace("DTHitAssociator") << "... size = " << DTsimhits->size();
103  for (isimhit = DTsimhits->begin(); isimhit != DTsimhits->end(); isimhit++) {
104  DTWireId wireid((*isimhit).detUnitId());
105  takeHit = SimHitOK(muonGeom, *isimhit);
106  mapOfSimHit[wireid].push_back(make_pair(*isimhit, takeHit));
107  }
108  } else if (!DTsimhitsTag.label().empty()) {
110  LogTrace("DTHitAssociator") << "getting PSimHit collection - " << DTsimhitsTag;
111  iEvent.getByLabel(DTsimhitsTag, DTsimhits);
112  LogTrace("DTHitAssociator") << "... size = " << DTsimhits->size();
113  edm::PSimHitContainer::const_iterator isimhit;
114  for (isimhit = DTsimhits->begin(); isimhit != DTsimhits->end(); isimhit++) {
115  DTWireId wireid((*isimhit).detUnitId());
116  takeHit = SimHitOK(muonGeom, *isimhit);
117  mapOfSimHit[wireid].push_back(make_pair(*isimhit, takeHit));
118  }
119  }
120 
121  // Get the DT Digi collection from the event
122  mapOfDigi.clear();
124  LogTrace("DTHitAssociator") << "getting DTDigi collection - " << DTdigiTag;
125  iEvent.getByLabel(DTdigiTag, digis);
126 
127  if (digis.isValid()) {
128  // Map DTDigi by DTWireId
129  for (DTDigiCollection::DigiRangeIterator detUnit = digis->begin(); detUnit != digis->end(); ++detUnit) {
130  const DTLayerId &layerid = (*detUnit).first;
131  const DTDigiCollection::Range &range = (*detUnit).second;
132 
134  for (digi = range.first; digi != range.second; ++digi) {
135  DTWireId wireid(layerid, (*digi).wire());
136  mapOfDigi[wireid].push_back(*digi);
137  }
138  }
139  } else {
140  LogTrace("DTHitAssociator") << "... NO DTDigi collection found !";
141  }
142 
143  mapOfLinks.clear();
144  if (links_exist) {
145  // Get the DT DigiSimLink collection from the event and map DTDigiSimLink by
146  // DTWireId
148  LogTrace("DTHitAssociator") << "getting DTDigiSimLink collection - " << DTdigisimlinkTag;
149  iEvent.getByLabel(DTdigisimlinkTag, digisimlinks);
150 
151  for (DTDigiSimLinkCollection::DigiRangeIterator detUnit = digisimlinks->begin(); detUnit != digisimlinks->end();
152  ++detUnit) {
153  const DTLayerId &layerid = (*detUnit).first;
154  const DTDigiSimLinkCollection::Range &range = (*detUnit).second;
155 
157  for (link = range.first; link != range.second; ++link) {
158  DTWireId wireid(layerid, (*link).wire());
159  mapOfLinks[wireid].push_back(*link);
160  }
161  }
162  }
163 
164  if (dumpDT && printRtS) {
165  // Get the DT rechits from the event
167  LogTrace("DTHitAssociator") << "getting DTRecHit1DPair collection - " << DTrechitTag;
168  iEvent.getByLabel(DTrechitTag, DTrechits);
169  LogTrace("DTHitAssociator") << "... size = " << DTrechits->size();
170 
171  // map DTRecHit1DPair by DTWireId
172  mapOfRecHit.clear();
174  for (rechit = DTrechits->begin(); rechit != DTrechits->end(); ++rechit) {
175  DTWireId wireid = (*rechit).wireId();
176  mapOfRecHit[wireid].push_back(*rechit);
177  }
178 
179  if (mapOfSimHit.end() != mapOfSimHit.begin()) {
180  LogTrace("DTHitAssociator") << "\n *** Dump DT PSimHit's ***";
181 
182  int jwire = 0;
183  int ihit = 0;
184 
185  for (SimHitMap::const_iterator mapIT = mapOfSimHit.begin(); mapIT != mapOfSimHit.end(); ++mapIT, jwire++) {
186  DTWireId wireid = (*mapIT).first;
187  for (vector<PSimHit_withFlag>::const_iterator hitIT = mapOfSimHit[wireid].begin();
188  hitIT != mapOfSimHit[wireid].end();
189  hitIT++, ihit++) {
190  PSimHit hit = hitIT->first;
191  LogTrace("DTHitAssociator") << "PSimHit " << ihit << ", wire " << wireid //<<", detID = "<<hit.detUnitId()
192  << ", SimTrack Id:" << hit.trackId() << "/Evt:(" << hit.eventId().event() << ","
193  << hit.eventId().bunchCrossing() << ") "
194  << ", pdg = " << hit.particleType() << ", procs = " << hit.processType();
195  }
196  }
197  } else {
198  LogTrace("DTHitAssociator") << "\n *** There are NO DT PSimHit's ***";
199  }
200 
201  if (mapOfDigi.end() != mapOfDigi.begin()) {
202  int jwire = 0;
203  int ihit = 0;
204 
205  for (DigiMap::const_iterator mapIT = mapOfDigi.begin(); mapIT != mapOfDigi.end(); ++mapIT, jwire++) {
206  LogTrace("DTHitAssociator") << "\n *** Dump DT digis ***";
207 
208  DTWireId wireid = (*mapIT).first;
209  for (vector<DTDigi>::const_iterator hitIT = mapOfDigi[wireid].begin(); hitIT != mapOfDigi[wireid].end();
210  hitIT++, ihit++) {
211  LogTrace("DTHitAssociator") << "DTDigi " << ihit << ", wire " << wireid << ", number = " << hitIT->number()
212  << ", TDC counts = " << hitIT->countsTDC();
213  }
214  }
215  } else {
216  LogTrace("DTHitAssociator") << "\n *** There are NO DTDigi's ***";
217  }
218 
219  if (mapOfRecHit.end() != mapOfRecHit.begin())
220  LogTrace("DTHitAssociator") << "\n *** Analyze DTRecHitCollection by DTWireId ***";
221 
222  int iwire = 0;
223  for (RecHitMap::const_iterator mapIT = mapOfRecHit.begin(); mapIT != mapOfRecHit.end(); ++mapIT, iwire++) {
224  DTWireId wireid = (*mapIT).first;
225  LogTrace("DTHitAssociator") << "\n======================================="
226  "============================";
227  LogTrace("DTHitAssociator") << "wire index = " << iwire << " *** DTWireId = "
228  << " (" << wireid << ")";
229 
230  if (mapOfSimHit.find(wireid) != mapOfSimHit.end()) {
231  LogTrace("DTHitAssociator") << "\n" << mapOfSimHit[wireid].size() << " SimHits (PSimHit):";
232 
233  for (vector<PSimHit_withFlag>::const_iterator hitIT = mapOfSimHit[wireid].begin();
234  hitIT != mapOfSimHit[wireid].end();
235  ++hitIT) {
236  stringstream tId;
237  tId << (hitIT->first).trackId();
238  string simhitlog = "\t SimTrack Id = " + tId.str();
239  if (hitIT->second)
240  simhitlog = simhitlog + "\t -VALID HIT-";
241  else
242  simhitlog = simhitlog + "\t -not valid hit-";
243  LogTrace("DTHitAssociator") << simhitlog;
244  }
245  }
246 
247  if (mapOfLinks.find(wireid) != mapOfLinks.end()) {
248  LogTrace("DTHitAssociator") << "\n" << mapOfLinks[wireid].size() << " Links (DTDigiSimLink):";
249 
250  for (vector<DTDigiSimLink>::const_iterator hitIT = mapOfLinks[wireid].begin();
251  hitIT != mapOfLinks[wireid].end();
252  ++hitIT) {
253  LogTrace("DTHitAssociator") << "\t digi number = " << hitIT->number() << ", time = " << hitIT->time()
254  << ", SimTrackId = " << hitIT->SimTrackId();
255  }
256  }
257 
258  if (mapOfDigi.find(wireid) != mapOfDigi.end()) {
259  LogTrace("DTHitAssociator") << "\n" << mapOfDigi[wireid].size() << " Digis (DTDigi):";
260  for (vector<DTDigi>::const_iterator hitIT = mapOfDigi[wireid].begin(); hitIT != mapOfDigi[wireid].end();
261  ++hitIT) {
262  LogTrace("DTHitAssociator") << "\t digi number = " << hitIT->number() << ", time = " << hitIT->time();
263  }
264  }
265 
266  LogTrace("DTHitAssociator") << "\n" << (*mapIT).second.size() << " RecHits (DTRecHit1DPair):";
267  for (vector<DTRecHit1DPair>::const_iterator vIT = (*mapIT).second.begin(); vIT != (*mapIT).second.end(); ++vIT) {
268  LogTrace("DTHitAssociator") << "\t digi time = " << vIT->digiTime();
269  }
270  }
271  }
272 }

References associatorByWire, MuonDigiCollection< IndexType, DigiType >::begin(), crossingframe, DTdigisimlinkTag, DTdigiTag, DTrechitTag, DTsimhitsTag, DTsimhitsXFTag, dumpDT, MuonDigiCollection< IndexType, DigiType >::end(), edm::EventSetup::get(), get, iEvent, edm::HandleBase::isValid(), edm::InputTag::label(), MainPageGenerator::link, links_exist, LogTrace, mapOfDigi, mapOfLinks, mapOfRecHit, mapOfSimHit, printRtS, edm::Handle< T >::product(), FastTimerService_cff::range, and SimHitOK().

Referenced by DTHitAssociator().

◆ SimHitOK()

bool DTHitAssociator::SimHitOK ( const edm::ESHandle< DTGeometry > &  muongeom,
const PSimHit simhit 
)
private

Definition at line 406 of file DTHitAssociator.cc.

406  {
407  bool result = true;
408 
409  DTWireId wireid(simhit.detUnitId());
410  const DTLayer *dtlayer = muongeom->layer(wireid.layerId());
411  LocalPoint entryP = simhit.entryPoint();
412  LocalPoint exitP = simhit.exitPoint();
413  const DTTopology &topo = dtlayer->specificTopology();
414  float xwire = topo.wirePosition(wireid.wire());
415  float xEntry = entryP.x() - xwire;
416  float xExit = exitP.x() - xwire;
417  DTTopology::Side entrySide = topo.onWhichBorder(xEntry, entryP.y(), entryP.z());
418  DTTopology::Side exitSide = topo.onWhichBorder(xExit, exitP.y(), exitP.z());
419 
420  bool noParametrisation =
421  ((entrySide == DTTopology::none || exitSide == DTTopology::none) || (entrySide == exitSide) ||
422  ((entrySide == DTTopology::xMin && exitSide == DTTopology::xMax) ||
423  (entrySide == DTTopology::xMax && exitSide == DTTopology::xMin)));
424 
425  // discard hits where parametrization can not be used
426  if (noParametrisation) {
427  result = false;
428  return result;
429  }
430 
431  float x;
432  LocalPoint hitPos = simhit.localPosition();
433 
434  if (fabs(hitPos.z()) < 0.002) {
435  // hit center within 20 um from z=0, no need to extrapolate.
436  x = hitPos.x() - xwire;
437  } else {
438  x = xEntry - (entryP.z() * (xExit - xEntry)) / (exitP.z() - entryP.z());
439  }
440 
441  // discard hits where x is out of range of the parametrization (|x|>2.1 cm)
442  x *= 10.; // cm -> mm
443  if (fabs(x) > 21.)
444  result = false;
445 
446  return result;
447 }

References PSimHit::detUnitId(), PSimHit::entryPoint(), PSimHit::exitPoint(), DTGeometry::layer(), PSimHit::localPosition(), DTTopology::none, DTTopology::onWhichBorder(), mps_fire::result, DTTopology::wirePosition(), x, PV3DBase< T, PVType, FrameType >::x(), DTTopology::xMax, DTTopology::xMin, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by initEvent().

Member Data Documentation

◆ associatorByWire

bool DTHitAssociator::associatorByWire
private

Definition at line 58 of file DTHitAssociator.h.

Referenced by associateDTHitId(), associateHit(), and initEvent().

◆ crossingframe

bool DTHitAssociator::crossingframe
private

Definition at line 56 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

◆ DTdigisimlinkTag

edm::InputTag DTHitAssociator::DTdigisimlinkTag
private

Definition at line 52 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

◆ DTdigiTag

edm::InputTag DTHitAssociator::DTdigiTag
private

Definition at line 51 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

◆ DTrechitTag

edm::InputTag DTHitAssociator::DTrechitTag
private

Definition at line 53 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

◆ DTsimhitsTag

edm::InputTag DTHitAssociator::DTsimhitsTag
private

Definition at line 49 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

◆ DTsimhitsXFTag

edm::InputTag DTHitAssociator::DTsimhitsXFTag
private

Definition at line 50 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

◆ dumpDT

bool DTHitAssociator::dumpDT
private

Definition at line 55 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

◆ links_exist

bool DTHitAssociator::links_exist
private

Definition at line 57 of file DTHitAssociator.h.

Referenced by initEvent().

◆ mapOfDigi

DigiMap DTHitAssociator::mapOfDigi

Definition at line 45 of file DTHitAssociator.h.

Referenced by initEvent().

◆ mapOfLinks

LinksMap DTHitAssociator::mapOfLinks

Definition at line 46 of file DTHitAssociator.h.

Referenced by associateDTHitId(), and initEvent().

◆ mapOfRecHit

RecHitMap DTHitAssociator::mapOfRecHit

Definition at line 44 of file DTHitAssociator.h.

Referenced by initEvent().

◆ mapOfSimHit

SimHitMap DTHitAssociator::mapOfSimHit

Definition at line 43 of file DTHitAssociator.h.

Referenced by associateDTHitId(), associateHit(), and initEvent().

◆ printRtS

bool DTHitAssociator::printRtS
private

Definition at line 61 of file DTHitAssociator.h.

Referenced by DTHitAssociator(), and initEvent().

muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DTHitAssociator::DTdigisimlinkTag
edm::InputTag DTdigisimlinkTag
Definition: DTHitAssociator.h:52
DTTopology::xMax
Definition: DTTopology.h:89
edm::Handle::product
T const * product() const
Definition: Handle.h:70
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
SimHitIdpr
std::pair< uint32_t, EncodedEventId > SimHitIdpr
Definition: TrackerHitAssociator.h:54
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DTHitAssociator::crossingframe
bool crossingframe
Definition: DTHitAssociator.h:56
MuonDigiCollection
A container for a generic type of digis indexed by some index, implemented with a map<IndexType,...
Definition: MuonDigiCollection.h:87
DTRecHit1D
Definition: DTRecHit1D.h:25
DTHitAssociator::dumpDT
bool dumpDT
Definition: DTHitAssociator.h:55
DTHitAssociator::associateDTHitId
std::vector< SimHitIdpr > associateDTHitId(const DTRecHit1D *dtrechit) const
Definition: DTHitAssociator.cc:289
dtrechit
Definition: DTRecHitQuality.cc:24
DTTopology::Side
Side
Sides of the cell.
Definition: DTTopology.h:89
DDAxes::x
DTHitAssociator::mapOfLinks
LinksMap mapOfLinks
Definition: DTHitAssociator.h:46
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle
Definition: AssociativeIterator.h:50
MixCollection::MixItr
Definition: MixCollection.h:62
PSimHit::entryPoint
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
DTHitAssociator::DTrechitTag
edm::InputTag DTrechitTag
Definition: DTHitAssociator.h:53
PSimHit::eventId
EncodedEventId eventId() const
Definition: PSimHit.h:108
PSimHit::detUnitId
unsigned int detUnitId() const
Definition: PSimHit.h:97
DTTopology
Definition: DTTopology.h:28
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
EncodedEventId
Definition: EncodedEventId.h:11
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
CrossingFrame
Definition: CrossingFrame.h:38
DTTopology::wirePosition
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DTRecHitCollection
PSimHit::exitPoint
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
DTWireId
Definition: DTWireId.h:12
MixCollection
Definition: MixCollection.h:11
DTHitAssociator::printRtS
bool printRtS
Definition: DTHitAssociator.h:61
DTHitAssociator::DTdigiTag
edm::InputTag DTdigiTag
Definition: DTHitAssociator.h:51
edm::ESHandle< DTGeometry >
PSimHit::localPosition
Local3DPoint localPosition() const
Definition: PSimHit.h:52
MuonDigiCollection::end
DigiRangeIterator end() const
Definition: MuonDigiCollection.h:136
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
Point3DBase< float, LocalTag >
MuonDigiCollection::begin
DigiRangeIterator begin() const
Definition: MuonDigiCollection.h:134
DTTopology::onWhichBorder
Side onWhichBorder(float x, float y, float z) const
Definition: DTTopology.cc:78
DTLayerId
Definition: DTLayerId.h:12
DTHitAssociator::DTsimhitsTag
edm::InputTag DTsimhitsTag
Definition: DTHitAssociator.h:49
HLTBitAnalyser_cfi.simhits
simhits
SIM objects.
Definition: HLTBitAnalyser_cfi.py:21
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
DTDigiCollection
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
iEvent
int iEvent
Definition: GenABIO.cc:224
DTHitAssociator::links_exist
bool links_exist
Definition: DTHitAssociator.h:57
get
#define get
DTTopology::none
Definition: DTTopology.h:89
DTLayer
Definition: DTLayer.h:25
DTHitAssociator::mapOfRecHit
RecHitMap mapOfRecHit
Definition: DTHitAssociator.h:44
TrackingRecHit
Definition: TrackingRecHit.h:21
DTHitAssociator::associatorByWire
bool associatorByWire
Definition: DTHitAssociator.h:58
DTHitAssociator::mapOfSimHit
SimHitMap mapOfSimHit
Definition: DTHitAssociator.h:43
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
DTHitAssociator::mapOfDigi
DigiMap mapOfDigi
Definition: DTHitAssociator.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PSimHit::trackId
unsigned int trackId() const
Definition: PSimHit.h:106
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
PSimHit
Definition: PSimHit.h:15
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DigiContainerIterator
Definition: MuonDigiCollection.h:30
DTTopology::xMin
Definition: DTTopology.h:89
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
DTHitAssociator::initEvent
void initEvent(const edm::Event &, const edm::EventSetup &)
Definition: DTHitAssociator.cc:75
edm::InputTag
Definition: InputTag.h:15
DTHitAssociator::SimHitOK
bool SimHitOK(const edm::ESHandle< DTGeometry > &, const PSimHit &)
Definition: DTHitAssociator.cc:406
hit
Definition: SiStripHitEffFromCalibTree.cc:88
DTHitAssociator::DTsimhitsXFTag
edm::InputTag DTsimhitsXFTag
Definition: DTHitAssociator.h:50