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, const edm::Event &iEvent)
 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)
 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, const edm::Event &iEvent)
 
std::vector< TrajectoryMeasurementGroupgroupedMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est)
 
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, const edm::Event &iEvent)
 returns TMeasurements in a DetLayer compatible with the TSOS. More...
 
MeasurementContainer measurements (const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est)
 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, const edm::Event &iEvent)
 returns the rechits which are on the layer More...
 
MuonRecHitContainer recHits (const DetLayer *layer)
 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 by C. Calabria to include GEMs by D. Nash to include ME0s

by C. Calabria & A. Sharma to include GEMs

The class to access recHits and TrajectoryMeasurements from DetLayer.

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

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.

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

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 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::Event::CacheIdentifier_t theME0EventCacheID
edm::Handle< DTRecSegment4DCollection > theDTRecHits
edm::Event::CacheIdentifier_t theGEMEventCacheID
edm::Event::CacheIdentifier_t theDTEventCacheID
edm::EDGetTokenT< ME0SegmentCollection > me0Token_
edm::EDGetTokenT< DTRecSegment4DCollection > dtToken_
edm::Handle< CSCSegmentCollection > theCSCRecHits
edm::EDGetTokenT< CSCSegmentCollection > cscToken_
edm::Event::CacheIdentifier_t theRPCEventCacheID
edm::Handle< RPCRecHitCollection > theRPCRecHits
edm::Event::CacheIdentifier_t theCSCEventCacheID
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
edm::EDGetTokenT< RPCRecHitCollection > rpcToken_
edm::Handle< GEMRecHitCollection > theGEMRecHits

◆ ~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.

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

Referenced by recHits().

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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
edm::Handle< CSCSegmentCollection > theCSCRecHits
edm::EDGetTokenT< CSCSegmentCollection > cscToken_
void checkEvent() const
check that the event is set, and throw otherwise
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
edm::Event::CacheIdentifier_t theCSCEventCacheID
bool isValid() const
Definition: HandleBase.h:70

◆ checkDTRecHits()

void MuonDetLayerMeasurements::checkDTRecHits ( )
private

Definition at line 195 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

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 }
edm::Handle< DTRecSegment4DCollection > theDTRecHits
edm::Event::CacheIdentifier_t theDTEventCacheID
edm::EDGetTokenT< DTRecSegment4DCollection > dtToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
void checkEvent() const
check that the event is set, and throw otherwise
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
bool isValid() const
Definition: HandleBase.h:70

◆ checkEvent()

void MuonDetLayerMeasurements::checkEvent ( ) const
private

check that the event is set, and throw otherwise

Definition at line 412 of file MuonDetLayerMeasurements.cc.

References Exception, and theEvent.

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

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

◆ checkGEMRecHits()

void MuonDetLayerMeasurements::checkGEMRecHits ( )
private

Definition at line 237 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

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 }
edm::Event::CacheIdentifier_t theGEMEventCacheID
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
void checkEvent() const
check that the event is set, and throw otherwise
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
edm::Handle< GEMRecHitCollection > theGEMRecHits

◆ checkME0RecHits()

void MuonDetLayerMeasurements::checkME0RecHits ( )
private

Definition at line 252 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

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 }
edm::Event::CacheIdentifier_t theME0EventCacheID
edm::EDGetTokenT< ME0SegmentCollection > me0Token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
void checkEvent() const
check that the event is set, and throw otherwise
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
edm::Handle< ME0SegmentCollection > theME0RecHits
bool isValid() const
Definition: HandleBase.h:70
#define LogDebug(id)

◆ checkRPCRecHits()

void MuonDetLayerMeasurements::checkRPCRecHits ( )
private

Definition at line 222 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
edm::Event::CacheIdentifier_t theRPCEventCacheID
void checkEvent() const
check that the event is set, and throw otherwise
edm::Handle< RPCRecHitCollection > theRPCRecHits
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< RPCRecHitCollection > rpcToken_

◆ fastMeasurements() [1/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.

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

Referenced by fastMeasurements().

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 }
int iEvent
Definition: GenABIO.cc:224
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
std::vector< TrajectoryMeasurement > MeasurementContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
std::pair< bool, double > HitReturnType

◆ fastMeasurements() [2/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.

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

363  {
364  checkEvent();
365  return fastMeasurements(layer, theStateOnDet, startingState, prop, est, *theEvent);
366 }
void checkEvent() const
check that the event is set, and throw otherwise
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 ...

◆ groupedMeasurements() [1/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.

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

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

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 }
int iEvent
Definition: GenABIO.cc:224
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)

◆ groupedMeasurements() [2/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.

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

372  {
373  checkEvent();
374  return groupedMeasurements(layer, startingState, prop, est, *theEvent);
375 }
std::vector< TrajectoryMeasurementGroup > groupedMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
void checkEvent() const
check that the event is set, and throw otherwise

◆ 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.

References enableME0Measurement, MeasurementEstimator::estimate(), GeomDet::geographicalId(), iEvent, nano_mu_digi_cff::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().

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 }
int iEvent
Definition: GenABIO.cc:224
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
static constexpr int ME0
Definition: MuonSubdetId.h:15
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::vector< TrajectoryMeasurement > MeasurementContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
std::pair< bool, double > HitReturnType
#define LogDebug(id)

◆ measurements() [2/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.

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

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 }
int iEvent
Definition: GenABIO.cc:224
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
std::vector< TrajectoryMeasurement > MeasurementContainer
#define LogDebug(id)

◆ measurements() [3/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.

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

273  {
274  checkEvent();
275  return measurements(layer, startingState, prop, est, *theEvent);
276 }
void checkEvent() const
check that the event is set, and throw otherwise
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)

◆ recHits() [1/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.

References iEvent, and nano_mu_digi_cff::layer.

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

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 }
int iEvent
Definition: GenABIO.cc:224
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer

◆ recHits() [2/3]

MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const DetLayer layer)

returns the rechits which are on the layer

Definition at line 429 of file MuonDetLayerMeasurements.cc.

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

429  {
430  checkEvent();
431  return recHits(layer, *theEvent);
432 }
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
void checkEvent() const
check that the event is set, and throw otherwise

◆ 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.

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.

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 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
static constexpr int GEM
Definition: MuonSubdetId.h:14
edm::Handle< DTRecSegment4DCollection > theDTRecHits
edm::Handle< CSCSegmentCollection > theCSCRecHits
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
int iEvent
Definition: GenABIO.cc:224
static constexpr int ME0
Definition: MuonSubdetId.h:15
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
edm::Handle< RPCRecHitCollection > theRPCRecHits
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static constexpr int RPC
Definition: MuonSubdetId.h:13
edm::Handle< ME0SegmentCollection > theME0RecHits
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
edm::Handle< GEMRecHitCollection > theGEMRecHits
#define LogDebug(id)

◆ setEvent()

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

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().