CMS 3D CMS Logo

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

#include <MuonDetLayerMeasurements.h>

Public Types

typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
 

Public Member Functions

MeasurementContainer fastMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &theStateOnDet, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est)
 faster version in case the TrajectoryState on the surface of the GeomDet is already available More...
 
MeasurementContainer fastMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &theStateOnDet, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
 faster version in case the TrajectoryState on the surface of the GeomDet is already available More...
 
std::vector< TrajectoryMeasurementGroupgroupedMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est)
 
std::vector< TrajectoryMeasurementGroupgroupedMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
 
MeasurementContainer measurements (const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
 
MeasurementContainer measurements (const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est)
 returns TMeasurements in a DetLayer compatible with the TSOS. More...
 
MeasurementContainer measurements (const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
 returns TMeasurements in a DetLayer compatible with the TSOS. More...
 
 MuonDetLayerMeasurements (edm::InputTag dtlabel, edm::InputTag csclabel, edm::InputTag rpclabel, edm::InputTag gemlabel, edm::InputTag me0label, edm::ConsumesCollector &iC, bool enableDT=true, bool enableCSC=true, bool enableRPC=true, bool enableGEM=true, bool enableME0=true)
 
MuonRecHitContainer recHits (const DetLayer *layer)
 returns the rechits which are on the layer More...
 
MuonRecHitContainer recHits (const DetLayer *layer, const edm::Event &iEvent)
 returns the rechits which are on the layer More...
 
void setEvent (const edm::Event &)
 set event More...
 
virtual ~MuonDetLayerMeasurements ()
 

Private Member Functions

void checkCSCRecHits ()
 
void checkDTRecHits ()
 
void checkEvent () const
 check that the event is set, and throw otherwise More...
 
void checkGEMRecHits ()
 
void checkME0RecHits ()
 
void checkRPCRecHits ()
 
MuonRecHitContainer recHits (const GeomDet *, const edm::Event &iEvent)
 obtain TrackingRecHits from a DetLayer More...
 

Private Attributes

edm::EDGetTokenT< CSCSegmentCollectioncscToken_
 
edm::EDGetTokenT< DTRecSegment4DCollectiondtToken_
 
bool enableCSCMeasurement
 
bool enableDTMeasurement
 
bool enableGEMMeasurement
 
bool enableME0Measurement
 
bool enableRPCMeasurement
 
edm::EDGetTokenT< GEMRecHitCollectiongemToken_
 
edm::EDGetTokenT< ME0SegmentCollectionme0Token_
 
edm::EDGetTokenT< RPCRecHitCollectionrpcToken_
 
edm::Event::CacheIdentifier_t theCSCEventCacheID
 
edm::Handle< CSCSegmentCollectiontheCSCRecHits
 
edm::Event::CacheIdentifier_t theDTEventCacheID
 
edm::Handle< DTRecSegment4DCollectiontheDTRecHits
 
const edm::EventtheEvent
 
edm::Event::CacheIdentifier_t theGEMEventCacheID
 
edm::Handle< GEMRecHitCollectiontheGEMRecHits
 
edm::Event::CacheIdentifier_t theME0EventCacheID
 
edm::Handle< ME0SegmentCollectiontheME0RecHits
 
edm::Event::CacheIdentifier_t theRPCEventCacheID
 
edm::Handle< RPCRecHitCollectiontheRPCRecHits
 

Detailed Description

The class to access recHits and TrajectoryMeasurements from DetLayer.

Author
C. Liu, R. Bellan, N. Amapane \modified by C. Calabria to include GEMs \modified by D. Nash to include ME0s

\modified by C. Calabria & A. Sharma to include GEMs

The class to access recHits and TrajectoryMeasurements from DetLayer.

Author
C. Liu, R. Bellan, N. Amapane \modified by C. Calabria to include GEMs \modified by D. Nash to include ME0s

\modified by C. Calabria & A.Sharma to include GEMs

Definition at line 41 of file MuonDetLayerMeasurements.h.

Member Typedef Documentation

◆ MuonRecHitContainer

Definition at line 43 of file MuonDetLayerMeasurements.h.

Constructor & Destructor Documentation

◆ MuonDetLayerMeasurements()

MuonDetLayerMeasurements::MuonDetLayerMeasurements ( edm::InputTag  dtlabel,
edm::InputTag  csclabel,
edm::InputTag  rpclabel,
edm::InputTag  gemlabel,
edm::InputTag  me0label,
edm::ConsumesCollector iC,
bool  enableDT = true,
bool  enableCSC = true,
bool  enableRPC = true,
bool  enableGEM = true,
bool  enableME0 = true 
)

Definition at line 25 of file MuonDetLayerMeasurements.cc.

36  : enableDTMeasurement(enableDT),
37  enableCSCMeasurement(enableCSC),
38  enableRPCMeasurement(enableRPC),
39  enableGEMMeasurement(enableGEM),
40  enableME0Measurement(enableME0),
41  theDTRecHits(),
42  theCSCRecHits(),
43  theRPCRecHits(),
44  theGEMRecHits(),
50  theEvent(nullptr) {
52  cscToken_ = iC.consumes<CSCSegmentCollection>(csclabel);
53  rpcToken_ = iC.consumes<RPCRecHitCollection>(rpclabel);
54  gemToken_ = iC.consumes<GEMRecHitCollection>(gemlabel);
55  me0Token_ = iC.consumes<ME0SegmentCollection>(me0label);
56 
57  static std::atomic<int> procInstance{0};
58  std::ostringstream sDT;
59  sDT << "MuonDetLayerMeasurements::checkDTRecHits::" << procInstance;
60  // theDTCheckName = sDT.str();
61  std::ostringstream sRPC;
62  sRPC << "MuonDetLayerMeasurements::checkRPCRecHits::" << procInstance;
63  //theRPCCheckName = sRPC.str();
64  std::ostringstream sCSC;
65  sCSC << "MuonDetLayerMeasurements::checkCSCRecHits::" << procInstance;
66  //theCSCCheckName = sCSC.str();
67  std::ostringstream sGEM;
68  sGEM << "MuonDetLayerMeasurements::checkGEMRecHits::" << procInstance;
69  //theGEMCheckName = sGEM.str();
70  std::ostringstream sME0;
71  sME0 << "MuonDetLayerMeasurements::checkME0RecHits::" << procInstance;
72  //theME0CheckName = sME0.str();
73  procInstance++;
74 }

References edm::ConsumesCollector::consumes(), cscToken_, dtToken_, gemToken_, me0Token_, and rpcToken_.

◆ ~MuonDetLayerMeasurements()

MuonDetLayerMeasurements::~MuonDetLayerMeasurements ( )
virtual

Definition at line 76 of file MuonDetLayerMeasurements.cc.

76 {}

Member Function Documentation

◆ checkCSCRecHits()

void MuonDetLayerMeasurements::checkCSCRecHits ( )
private

Definition at line 207 of file MuonDetLayerMeasurements.cc.

207  {
208  checkEvent();
209  auto cacheID = theEvent->cacheIdentifier();
210  if (cacheID == theCSCEventCacheID)
211  return;
212 
213  {
215  theCSCEventCacheID = cacheID;
216  }
217  if (!theCSCRecHits.isValid()) {
218  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get CSC RecHits";
219  }
220 }

References edm::Event::cacheIdentifier(), checkEvent(), cscToken_, Exception, edm::Event::getByToken(), edm::HandleBase::isValid(), theCSCEventCacheID, theCSCRecHits, and theEvent.

Referenced by recHits().

◆ checkDTRecHits()

void MuonDetLayerMeasurements::checkDTRecHits ( )
private

Definition at line 195 of file MuonDetLayerMeasurements.cc.

195  {
196  checkEvent();
197  auto const cacheID = theEvent->cacheIdentifier();
198  if (cacheID == theDTEventCacheID)
199  return;
200 
202  if (!theDTRecHits.isValid()) {
203  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get DT RecHits";
204  }
205 }

References edm::Event::cacheIdentifier(), checkEvent(), dtToken_, Exception, edm::Event::getByToken(), edm::HandleBase::isValid(), theDTEventCacheID, theDTRecHits, and theEvent.

Referenced by recHits().

◆ checkEvent()

void MuonDetLayerMeasurements::checkEvent ( ) const
private

check that the event is set, and throw otherwise

Definition at line 412 of file MuonDetLayerMeasurements.cc.

412  {
413  if (!theEvent)
414  throw cms::Exception("MuonDetLayerMeasurements") << "The event has not been set";
415 }

References Exception, and theEvent.

Referenced by checkCSCRecHits(), checkDTRecHits(), checkGEMRecHits(), checkME0RecHits(), checkRPCRecHits(), fastMeasurements(), groupedMeasurements(), measurements(), and recHits().

◆ checkGEMRecHits()

void MuonDetLayerMeasurements::checkGEMRecHits ( )
private

Definition at line 237 of file MuonDetLayerMeasurements.cc.

237  {
238  checkEvent();
239  auto cacheID = theEvent->cacheIdentifier();
240  if (cacheID == theGEMEventCacheID)
241  return;
242 
243  {
245  theGEMEventCacheID = cacheID;
246  }
247  if (!theGEMRecHits.isValid()) {
248  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get GEM RecHits";
249  }
250 }

References edm::Event::cacheIdentifier(), checkEvent(), Exception, gemToken_, edm::Event::getByToken(), edm::HandleBase::isValid(), theEvent, theGEMEventCacheID, and theGEMRecHits.

Referenced by recHits().

◆ checkME0RecHits()

void MuonDetLayerMeasurements::checkME0RecHits ( )
private

Definition at line 252 of file MuonDetLayerMeasurements.cc.

252  {
253  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Checking ME0 RecHits";
254  checkEvent();
255  auto cacheID = theEvent->cacheIdentifier();
256  if (cacheID == theME0EventCacheID)
257  return;
258 
259  {
261  theME0EventCacheID = cacheID;
262  }
263  if (!theME0RecHits.isValid()) {
264  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get ME0 RecHits";
265  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Cannot get ME0 RecHits";
266  }
267 }

References edm::Event::cacheIdentifier(), checkEvent(), Exception, edm::Event::getByToken(), edm::HandleBase::isValid(), LogDebug, me0Token_, theEvent, theME0EventCacheID, and theME0RecHits.

Referenced by recHits().

◆ checkRPCRecHits()

void MuonDetLayerMeasurements::checkRPCRecHits ( )
private

Definition at line 222 of file MuonDetLayerMeasurements.cc.

222  {
223  checkEvent();
224  auto cacheID = theEvent->cacheIdentifier();
225  if (cacheID == theRPCEventCacheID)
226  return;
227 
228  {
230  theRPCEventCacheID = cacheID;
231  }
232  if (!theRPCRecHits.isValid()) {
233  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get RPC RecHits";
234  }
235 }

References edm::Event::cacheIdentifier(), checkEvent(), Exception, edm::Event::getByToken(), edm::HandleBase::isValid(), rpcToken_, theEvent, theRPCEventCacheID, and theRPCRecHits.

Referenced by recHits().

◆ fastMeasurements() [1/2]

MeasurementContainer MuonDetLayerMeasurements::fastMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface theStateOnDet,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
)

faster version in case the TrajectoryState on the surface of the GeomDet is already available

fastMeasurements method if already got the Event

Definition at line 359 of file MuonDetLayerMeasurements.cc.

363  {
364  checkEvent();
365  return fastMeasurements(layer, theStateOnDet, startingState, prop, est, *theEvent);
366 }

References checkEvent(), fastMeasurements(), phase1PixelTopology::layer, and theEvent.

◆ fastMeasurements() [2/2]

MeasurementContainer MuonDetLayerMeasurements::fastMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface theStateOnDet,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est,
const edm::Event iEvent 
)

faster version in case the TrajectoryState on the surface of the GeomDet is already available

Definition at line 336 of file MuonDetLayerMeasurements.cc.

341  {
344  for (MuonRecHitContainer::const_iterator irh = rhs.begin(); irh != rhs.end(); irh++) {
345  MeasurementEstimator::HitReturnType estimate = est.estimate(theStateOnDet, (**irh));
346  if (estimate.first) {
347  result.push_back(TrajectoryMeasurement(theStateOnDet, (*irh), estimate.second, layer));
348  }
349  }
350 
351  if (!result.empty()) {
352  sort(result.begin(), result.end(), TrajMeasLessEstim());
353  }
354 
355  return result;
356 }

References MeasurementEstimator::estimate(), iEvent, phase1PixelTopology::layer, recHits(), mps_fire::result, and jetUpdater_cfi::sort.

Referenced by fastMeasurements().

◆ groupedMeasurements() [1/2]

std::vector< TrajectoryMeasurementGroup > MuonDetLayerMeasurements::groupedMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
)

Definition at line 368 of file MuonDetLayerMeasurements.cc.

372  {
373  checkEvent();
374  return groupedMeasurements(layer, startingState, prop, est, *theEvent);
375 }

References checkEvent(), groupedMeasurements(), phase1PixelTopology::layer, and theEvent.

◆ groupedMeasurements() [2/2]

std::vector< TrajectoryMeasurementGroup > MuonDetLayerMeasurements::groupedMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est,
const edm::Event iEvent 
)

Definition at line 377 of file MuonDetLayerMeasurements.cc.

382  {
383  std::vector<TrajectoryMeasurementGroup> result;
384  // if we want to use the concept of InvalidRecHits,
385  // we can reuse LayerMeasurements from TrackingTools/MeasurementDet
386  std::vector<DetGroup> groups(layer->groupedCompatibleDets(startingState, prop, est));
387 
388  // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or
389  // RecoMuon/DetLayers/MuRingForwardDoubleLayer
390  // and removed the reverse operation in StandAloneMuonFilter::findBestMeasurements
391 
392  for (std::vector<DetGroup>::const_iterator grp = groups.begin(); grp != groups.end(); ++grp) {
393  std::vector<TrajectoryMeasurement> groupMeasurements;
394  for (DetGroup::const_iterator detAndStateItr = grp->begin(); detAndStateItr != grp->end(); ++detAndStateItr) {
395  std::vector<TrajectoryMeasurement> detMeasurements =
396  measurements(layer, detAndStateItr->det(), detAndStateItr->trajectoryState(), est, iEvent);
397  groupMeasurements.insert(groupMeasurements.end(), detMeasurements.begin(), detMeasurements.end());
398  }
399 
400  if (!groupMeasurements.empty())
401  std::sort(groupMeasurements.begin(), groupMeasurements.end(), TrajMeasLessEstim());
402 
403  result.push_back(TrajectoryMeasurementGroup(groupMeasurements, *grp));
404  }
405 
406  return result;
407 }

References iEvent, phase1PixelTopology::layer, measurements(), mps_fire::result, and jetUpdater_cfi::sort.

Referenced by CosmicMuonTrajectoryBuilder::findBestMeasurements(), StandAloneMuonFilter::findBestMeasurements(), and groupedMeasurements().

◆ measurements() [1/3]

MeasurementContainer MuonDetLayerMeasurements::measurements ( const DetLayer layer,
const GeomDet det,
const TrajectoryStateOnSurface stateOnDet,
const MeasurementEstimator est,
const edm::Event iEvent 
)

Definition at line 301 of file MuonDetLayerMeasurements.cc.

305  {
307 
308  DetId geoId = det->geographicalId();
309  //no chamber here that is actually an me0....
310  if (geoId.subdetId() == MuonSubdetId::ME0) {
311  if (enableME0Measurement) {
312  ME0DetId chamberId(geoId.rawId());
313  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements")
314  << "ME0 Chamber ID in measurements: " << chamberId << std::endl;
315  }
316  }
317 
318  // Get the Segments which relies on the GeomDet given by compatibleDets
319  MuonRecHitContainer muonRecHits = recHits(det, iEvent);
320 
321  // Create the Trajectory Measurement
322  for (MuonRecHitContainer::const_iterator rechit = muonRecHits.begin(); rechit != muonRecHits.end(); ++rechit) {
323  MeasurementEstimator::HitReturnType estimate = est.estimate(stateOnDet, **rechit);
324  LogDebug("RecoMuon") << "Dimension: " << (*rechit)->dimension() << " Chi2: " << estimate.second << std::endl;
325  if (estimate.first) {
326  result.push_back(TrajectoryMeasurement(stateOnDet, *rechit, estimate.second, layer));
327  }
328  }
329 
330  if (!result.empty())
331  sort(result.begin(), result.end(), TrajMeasLessEstim());
332 
333  return result;
334 }

References enableME0Measurement, MeasurementEstimator::estimate(), GeomDet::geographicalId(), iEvent, phase1PixelTopology::layer, LogDebug, MuonSubdetId::ME0, DetId::rawId(), recHits(), mps_fire::result, jetUpdater_cfi::sort, and DetId::subdetId().

Referenced by CosmicMuonTrajectoryBuilder::findBestMeasurements(), StandAloneMuonFilter::findBestMeasurements(), groupedMeasurements(), and measurements().

◆ measurements() [2/3]

MeasurementContainer MuonDetLayerMeasurements::measurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
)

returns TMeasurements in a DetLayer compatible with the TSOS.

measurements method if already got the Event

Definition at line 270 of file MuonDetLayerMeasurements.cc.

273  {
274  checkEvent();
275  return measurements(layer, startingState, prop, est, *theEvent);
276 }

References checkEvent(), phase1PixelTopology::layer, measurements(), and theEvent.

◆ measurements() [3/3]

MeasurementContainer MuonDetLayerMeasurements::measurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est,
const edm::Event iEvent 
)

returns TMeasurements in a DetLayer compatible with the TSOS.

Definition at line 278 of file MuonDetLayerMeasurements.cc.

282  {
284 
285  std::vector<DetWithState> dss = layer->compatibleDets(startingState, prop, est);
286  LogDebug("RecoMuon") << "compatibleDets: " << dss.size() << std::endl;
287 
288  for (std::vector<DetWithState>::const_iterator detWithStateItr = dss.begin(); detWithStateItr != dss.end();
289  ++detWithStateItr) {
290  MeasurementContainer detMeasurements =
291  measurements(layer, detWithStateItr->first, detWithStateItr->second, est, iEvent);
292  result.insert(result.end(), detMeasurements.begin(), detMeasurements.end());
293  }
294 
295  if (!result.empty())
296  sort(result.begin(), result.end(), TrajMeasLessEstim());
297 
298  return result;
299 }

References iEvent, phase1PixelTopology::layer, LogDebug, measurements(), mps_fire::result, and jetUpdater_cfi::sort.

◆ recHits() [1/3]

MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const DetLayer layer)

returns the rechits which are on the layer

Definition at line 429 of file MuonDetLayerMeasurements.cc.

429  {
430  checkEvent();
431  return recHits(layer, *theEvent);
432 }

References checkEvent(), phase1PixelTopology::layer, recHits(), and theEvent.

◆ recHits() [2/3]

MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const DetLayer layer,
const edm::Event iEvent 
)

returns the rechits which are on the layer

Definition at line 417 of file MuonDetLayerMeasurements.cc.

417  {
419 
420  std::vector<const GeomDet*> gds = layer->basicComponents();
421 
422  for (std::vector<const GeomDet*>::const_iterator igd = gds.begin(); igd != gds.end(); igd++) {
423  MuonRecHitContainer detHits = recHits(*igd, iEvent);
424  rhs.insert(rhs.end(), detHits.begin(), detHits.end());
425  }
426  return rhs;
427 }

References iEvent, and phase1PixelTopology::layer.

Referenced by MuonSeedBuilder::build(), fastMeasurements(), measurements(), MuonSeedOrcaPatternRecognition::produce(), recHits(), CosmicMuonTrajectoryBuilder::trajectories(), and CosmicMuonTrajectoryBuilder::unusedHits().

◆ recHits() [3/3]

MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const GeomDet geomDet,
const edm::Event iEvent 
)
private

obtain TrackingRecHits from a DetLayer

Definition at line 78 of file MuonDetLayerMeasurements.cc.

78  {
79  DetId geoId = geomDet->geographicalId();
80  theEvent = &iEvent;
82 
83  if (geoId.subdetId() == MuonSubdetId::DT) {
84  if (enableDTMeasurement) {
86 
87  // Create the ChamberId
88  DTChamberId chamberId(geoId.rawId());
89  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(DT): " << chamberId << std::endl;
90 
91  // Get the DT-Segment which relies on this chamber
93 
94  // Create the MuonTransientTrackingRechit
95  for (DTRecSegment4DCollection::const_iterator rechit = range.first; rechit != range.second; ++rechit)
96  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet, &*rechit));
97  }
98  }
99 
100  else if (geoId.subdetId() == MuonSubdetId::CSC) {
101  if (enableCSCMeasurement) {
102  checkCSCRecHits();
103 
104  // Create the chamber Id
105  CSCDetId chamberId(geoId.rawId());
106  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(CSC): " << chamberId << std::endl;
107 
108  // Get the CSC-Segment which relies on this chamber
110 
111  // Create the MuonTransientTrackingRecHit
112  for (CSCSegmentCollection::const_iterator rechit = range.first; rechit != range.second; ++rechit)
113  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet, &*rechit));
114  }
115  }
116 
117  else if (geoId.subdetId() == MuonSubdetId::RPC) {
118  if (enableRPCMeasurement) {
119  checkRPCRecHits();
120 
121  // Create the chamber Id
122  RPCDetId chamberId(geoId.rawId());
123  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(RPC): " << chamberId << std::endl;
124 
125  // Get the RPC-Segment which relies on this chamber
127 
128  // Create the MuonTransientTrackingRecHit
129  for (RPCRecHitCollection::const_iterator rechit = range.first; rechit != range.second; ++rechit)
130  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet, &*rechit));
131  }
132  } else if (geoId.subdetId() == MuonSubdetId::GEM) {
133  if (enableGEMMeasurement) {
134  checkGEMRecHits();
135 
136  // Create the chamber Id
137  GEMDetId chamberId(geoId.rawId());
138 
139  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(GEM): " << chamberId << std::endl;
140 
141  // Get the GEM-Segment which relies on this chamber
143 
144  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements")
145  << "Number of GEM rechits available = " << theGEMRecHits->size() << ", from chamber: " << chamberId
146  << std::endl;
147 
148  // Create the MuonTransientTrackingRecHit
149  for (GEMRecHitCollection::const_iterator rechit = range.first; rechit != range.second; ++rechit)
150  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet, &*rechit));
151  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Number of GEM rechits = " << result.size() << std::endl;
152  }
153  }
154 
155  else if (geoId.subdetId() == MuonSubdetId::ME0) {
156  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(ME0): identified" << std::endl;
157  if (enableME0Measurement) {
158  checkME0RecHits();
159 
160  // Create the chamber Id
161  ME0DetId chamberId(geoId.rawId());
162 
163  // Get the ME0-Segment which relies on this chamber
164  // Getting rechits right now, not segments - maybe it should be segments?
166 
167  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements")
168  << "Number of ME0 rechits available = " << theME0RecHits->size() << ", from chamber: " << chamberId
169  << std::endl;
170 
171  // Create the MuonTransientTrackingRecHit
172  for (ME0SegmentCollection::const_iterator rechit = range.first; rechit != range.second; ++rechit) {
173  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "On ME0 iteration " << std::endl;
174  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet, &*rechit));
175  }
176  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Number of ME0 rechits = " << result.size() << std::endl;
177  }
178  } else {
179  // wrong type
180  throw cms::Exception("MuonDetLayerMeasurements") << "The DetLayer with det " << geoId.det() << " subdet "
181  << geoId.subdetId() << " is not a valid Muon DetLayer. ";
182  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "The DetLayer with det " << geoId.det() << " subdet "
183  << geoId.subdetId() << " is not a valid Muon DetLayer. ";
184  }
185  if (enableME0Measurement) {
186  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(ME0): enabled" << std::endl;
187  }
188 
189  if (enableGEMMeasurement) {
190  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(GEM): enabled" << std::endl;
191  }
192  return result;
193 }

References checkCSCRecHits(), checkDTRecHits(), checkGEMRecHits(), checkME0RecHits(), checkRPCRecHits(), MuonSubdetId::CSC, DetId::det(), MuonSubdetId::DT, enableCSCMeasurement, enableDTMeasurement, enableGEMMeasurement, enableME0Measurement, enableRPCMeasurement, Exception, MuonSubdetId::GEM, GeomDet::geographicalId(), iEvent, LogDebug, MuonSubdetId::ME0, FastTimerService_cff::range, DetId::rawId(), mps_fire::result, MuonSubdetId::RPC, MuonTransientTrackingRecHit::specificBuild(), DetId::subdetId(), theCSCRecHits, theDTRecHits, theEvent, theGEMRecHits, theME0RecHits, and theRPCRecHits.

◆ setEvent()

void MuonDetLayerMeasurements::setEvent ( const edm::Event event)

set event

Definition at line 410 of file MuonDetLayerMeasurements.cc.

410 { theEvent = &event; }

References edmPickEvents::event, and theEvent.

Referenced by CosmicMuonTrajectoryBuilder::setEvent(), and StandAloneMuonFilter::setEvent().

Member Data Documentation

◆ cscToken_

edm::EDGetTokenT<CSCSegmentCollection> MuonDetLayerMeasurements::cscToken_
private

Definition at line 122 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits(), and MuonDetLayerMeasurements().

◆ dtToken_

edm::EDGetTokenT<DTRecSegment4DCollection> MuonDetLayerMeasurements::dtToken_
private

Definition at line 121 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits(), and MuonDetLayerMeasurements().

◆ enableCSCMeasurement

bool MuonDetLayerMeasurements::enableCSCMeasurement
private

Definition at line 128 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

◆ enableDTMeasurement

bool MuonDetLayerMeasurements::enableDTMeasurement
private

Definition at line 127 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

◆ enableGEMMeasurement

bool MuonDetLayerMeasurements::enableGEMMeasurement
private

Definition at line 130 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

◆ enableME0Measurement

bool MuonDetLayerMeasurements::enableME0Measurement
private

Definition at line 131 of file MuonDetLayerMeasurements.h.

Referenced by measurements(), and recHits().

◆ enableRPCMeasurement

bool MuonDetLayerMeasurements::enableRPCMeasurement
private

Definition at line 129 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

◆ gemToken_

edm::EDGetTokenT<GEMRecHitCollection> MuonDetLayerMeasurements::gemToken_
private

Definition at line 124 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits(), and MuonDetLayerMeasurements().

◆ me0Token_

edm::EDGetTokenT<ME0SegmentCollection> MuonDetLayerMeasurements::me0Token_
private

Definition at line 125 of file MuonDetLayerMeasurements.h.

Referenced by checkME0RecHits(), and MuonDetLayerMeasurements().

◆ rpcToken_

edm::EDGetTokenT<RPCRecHitCollection> MuonDetLayerMeasurements::rpcToken_
private

Definition at line 123 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits(), and MuonDetLayerMeasurements().

◆ theCSCEventCacheID

edm::Event::CacheIdentifier_t MuonDetLayerMeasurements::theCSCEventCacheID
private

Definition at line 148 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits().

◆ theCSCRecHits

edm::Handle<CSCSegmentCollection> MuonDetLayerMeasurements::theCSCRecHits
private

Definition at line 135 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits(), and recHits().

◆ theDTEventCacheID

edm::Event::CacheIdentifier_t MuonDetLayerMeasurements::theDTEventCacheID
private

Definition at line 147 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits().

◆ theDTRecHits

edm::Handle<DTRecSegment4DCollection> MuonDetLayerMeasurements::theDTRecHits
private

Definition at line 134 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits(), and recHits().

◆ theEvent

const edm::Event* MuonDetLayerMeasurements::theEvent
private

◆ theGEMEventCacheID

edm::Event::CacheIdentifier_t MuonDetLayerMeasurements::theGEMEventCacheID
private

Definition at line 150 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits().

◆ theGEMRecHits

edm::Handle<GEMRecHitCollection> MuonDetLayerMeasurements::theGEMRecHits
private

Definition at line 137 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits(), and recHits().

◆ theME0EventCacheID

edm::Event::CacheIdentifier_t MuonDetLayerMeasurements::theME0EventCacheID
private

Definition at line 151 of file MuonDetLayerMeasurements.h.

Referenced by checkME0RecHits().

◆ theME0RecHits

edm::Handle<ME0SegmentCollection> MuonDetLayerMeasurements::theME0RecHits
private

Definition at line 138 of file MuonDetLayerMeasurements.h.

Referenced by checkME0RecHits(), and recHits().

◆ theRPCEventCacheID

edm::Event::CacheIdentifier_t MuonDetLayerMeasurements::theRPCEventCacheID
private

Definition at line 149 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits().

◆ theRPCRecHits

edm::Handle<RPCRecHitCollection> MuonDetLayerMeasurements::theRPCRecHits
private

Definition at line 136 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits(), and recHits().

GEMRecHitCollection
MuonSubdetId::GEM
static constexpr int GEM
Definition: MuonSubdetId.h:14
MuonDetLayerMeasurements::theDTRecHits
edm::Handle< DTRecSegment4DCollection > theDTRecHits
Definition: MuonDetLayerMeasurements.h:134
MuonDetLayerMeasurements::groupedMeasurements
std::vector< TrajectoryMeasurementGroup > groupedMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
Definition: MuonDetLayerMeasurements.cc:377
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
MuonTransientTrackingRecHit::specificBuild
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
Definition: MuonTransientTrackingRecHit.h:75
MuonDetLayerMeasurements::enableDTMeasurement
bool enableDTMeasurement
Definition: MuonDetLayerMeasurements.h:127
MuonDetLayerMeasurements::checkRPCRecHits
void checkRPCRecHits()
Definition: MuonDetLayerMeasurements.cc:222
MuonDetLayerMeasurements::checkGEMRecHits
void checkGEMRecHits()
Definition: MuonDetLayerMeasurements.cc:237
MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: CosmicMuonSmoother.h:31
MuonDetLayerMeasurements::checkDTRecHits
void checkDTRecHits()
Definition: MuonDetLayerMeasurements.cc:195
MuonDetLayerMeasurements::checkCSCRecHits
void checkCSCRecHits()
Definition: MuonDetLayerMeasurements.cc:207
MuonDetLayerMeasurements::theME0EventCacheID
edm::Event::CacheIdentifier_t theME0EventCacheID
Definition: MuonDetLayerMeasurements.h:151
MuonDetLayerMeasurements::cscToken_
edm::EDGetTokenT< CSCSegmentCollection > cscToken_
Definition: MuonDetLayerMeasurements.h:122
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
RPCDetId
Definition: RPCDetId.h:16
MuonDetLayerMeasurements::enableME0Measurement
bool enableME0Measurement
Definition: MuonDetLayerMeasurements.h:131
TrajMeasLessEstim
Definition: TrajMeasLessEstim.h:10
CSCSegmentCollection
MeasurementEstimator::HitReturnType
std::pair< bool, double > HitReturnType
Definition: MeasurementEstimator.h:34
MeasurementContainer
std::vector< TrajectoryMeasurement > MeasurementContainer
Definition: RPCRecHitFilter.h:55
MeasurementEstimator::estimate
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
MuonDetLayerMeasurements::gemToken_
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
Definition: MuonDetLayerMeasurements.h:124
DetId
Definition: DetId.h:17
MuonDetLayerMeasurements::theEvent
const edm::Event * theEvent
Definition: MuonDetLayerMeasurements.h:153
MuonDetLayerMeasurements::theGEMEventCacheID
edm::Event::CacheIdentifier_t theGEMEventCacheID
Definition: MuonDetLayerMeasurements.h:150
RPCRecHitCollection
MuonDetLayerMeasurements::enableCSCMeasurement
bool enableCSCMeasurement
Definition: MuonDetLayerMeasurements.h:128
edm::Event::cacheIdentifier
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
MuonDetLayerMeasurements::enableRPCMeasurement
bool enableRPCMeasurement
Definition: MuonDetLayerMeasurements.h:129
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
DTRecSegment4DCollection
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
MuonDetLayerMeasurements::theRPCEventCacheID
edm::Event::CacheIdentifier_t theRPCEventCacheID
Definition: MuonDetLayerMeasurements.h:149
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
MuonDetLayerMeasurements::theME0RecHits
edm::Handle< ME0SegmentCollection > theME0RecHits
Definition: MuonDetLayerMeasurements.h:138
MuonDetLayerMeasurements::theCSCEventCacheID
edm::Event::CacheIdentifier_t theCSCEventCacheID
Definition: MuonDetLayerMeasurements.h:148
GEMDetId
Definition: GEMDetId.h:18
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
CSCDetId
Definition: CSCDetId.h:26
edmPickEvents.event
event
Definition: edmPickEvents.py:273
iEvent
int iEvent
Definition: GenABIO.cc:224
MuonDetLayerMeasurements::checkEvent
void checkEvent() const
check that the event is set, and throw otherwise
Definition: MuonDetLayerMeasurements.cc:412
ME0DetId
Definition: ME0DetId.h:16
MuonSubdetId::ME0
static constexpr int ME0
Definition: MuonSubdetId.h:15
MuonDetLayerMeasurements::rpcToken_
edm::EDGetTokenT< RPCRecHitCollection > rpcToken_
Definition: MuonDetLayerMeasurements.h:123
MuonDetLayerMeasurements::recHits
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
Definition: MuonDetLayerMeasurements.cc:417
MuonDetLayerMeasurements::theDTEventCacheID
edm::Event::CacheIdentifier_t theDTEventCacheID
Definition: MuonDetLayerMeasurements.h:147
MuonDetLayerMeasurements::theRPCRecHits
edm::Handle< RPCRecHitCollection > theRPCRecHits
Definition: MuonDetLayerMeasurements.h:136
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MuonSubdetId::RPC
static constexpr int RPC
Definition: MuonSubdetId.h:13
TrajectoryMeasurementGroup
Definition: TrajectoryMeasurementGroup.h:17
Exception
Definition: hltDiff.cc:245
MuonDetLayerMeasurements::dtToken_
edm::EDGetTokenT< DTRecSegment4DCollection > dtToken_
Definition: MuonDetLayerMeasurements.h:121
MuonDetLayerMeasurements::theGEMRecHits
edm::Handle< GEMRecHitCollection > theGEMRecHits
Definition: MuonDetLayerMeasurements.h:137
MuonDetLayerMeasurements::theCSCRecHits
edm::Handle< CSCSegmentCollection > theCSCRecHits
Definition: MuonDetLayerMeasurements.h:135
MuonDetLayerMeasurements::measurements
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
Definition: MuonDetLayerMeasurements.cc:301
mps_fire.result
result
Definition: mps_fire.py:311
DTChamberId
Definition: DTChamberId.h:14
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
MuonDetLayerMeasurements::fastMeasurements
MeasurementContainer fastMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &theStateOnDet, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
faster version in case the TrajectoryState on the surface of the GeomDet is already available
Definition: MuonDetLayerMeasurements.cc:336
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
ME0SegmentCollection
MuonDetLayerMeasurements::me0Token_
edm::EDGetTokenT< ME0SegmentCollection > me0Token_
Definition: MuonDetLayerMeasurements.h:125
MuonDetLayerMeasurements::enableGEMMeasurement
bool enableGEMMeasurement
Definition: MuonDetLayerMeasurements.h:130
MuonDetLayerMeasurements::checkME0RecHits
void checkME0RecHits()
Definition: MuonDetLayerMeasurements.cc:252