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 45 of file MuonDetLayerMeasurements.h.

Member Typedef Documentation

Definition at line 47 of file MuonDetLayerMeasurements.h.

Constructor & Destructor Documentation

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 29 of file MuonDetLayerMeasurements.cc.

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

35  :
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)
51 {
52 
54  cscToken_ = iC.consumes<CSCSegmentCollection>(csclabel);
55  rpcToken_ = iC.consumes<RPCRecHitCollection>(rpclabel);
56  gemToken_ = iC.consumes<GEMRecHitCollection>(gemlabel);
57  me0Token_ = iC.consumes<ME0SegmentCollection>(me0label);
58 
59  static std::atomic<int> procInstance{0};
60  std::ostringstream sDT;
61  sDT<<"MuonDetLayerMeasurements::checkDTRecHits::" << procInstance;
62  // theDTCheckName = sDT.str();
63  std::ostringstream sRPC;
64  sRPC<<"MuonDetLayerMeasurements::checkRPCRecHits::" << procInstance;
65  //theRPCCheckName = sRPC.str();
66  std::ostringstream sCSC;
67  sCSC<<"MuonDetLayerMeasurements::checkCSCRecHits::" << procInstance;
68  //theCSCCheckName = sCSC.str();
69  std::ostringstream sGEM;
70  sGEM<<"MuonDetLayerMeasurements::checkGEMRecHits::" << procInstance;
71  //theGEMCheckName = sGEM.str();
72  std::ostringstream sME0;
73  sME0<<"MuonDetLayerMeasurements::checkME0RecHits::" << procInstance;
74  //theME0CheckName = sME0.str();
75  procInstance++;
76 }
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 ( )
virtual

Definition at line 78 of file MuonDetLayerMeasurements.cc.

78 {}

Member Function Documentation

void MuonDetLayerMeasurements::checkCSCRecHits ( )
private

Definition at line 224 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

225 {
226  checkEvent();
227  auto cacheID = theEvent->cacheIdentifier();
228  if (cacheID == theCSCEventCacheID) return;
229 
230  {
232  theCSCEventCacheID = cacheID;
233  }
234  if(!theCSCRecHits.isValid())
235  {
236  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get CSC RecHits";
237  }
238 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::Handle< CSCSegmentCollection > theCSCRecHits
edm::EDGetTokenT< CSCSegmentCollection > cscToken_
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
bool isValid() const
Definition: HandleBase.h:74
edm::Event::CacheIdentifier_t theCSCEventCacheID
void checkEvent() const
check that the event is set, and throw otherwise
void MuonDetLayerMeasurements::checkDTRecHits ( )
private

Definition at line 208 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

209 {
210  checkEvent();
211  auto const cacheID = theEvent->cacheIdentifier();
212  if (cacheID == theDTEventCacheID) return;
213 
214  {
216  }
217  if(!theDTRecHits.isValid())
218  {
219  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get DT RecHits";
220  }
221 }
edm::Handle< DTRecSegment4DCollection > theDTRecHits
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::Event::CacheIdentifier_t theDTEventCacheID
edm::EDGetTokenT< DTRecSegment4DCollection > dtToken_
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
bool isValid() const
Definition: HandleBase.h:74
void checkEvent() const
check that the event is set, and throw otherwise
void MuonDetLayerMeasurements::checkEvent ( ) const
private

check that the event is set, and throw otherwise

Definition at line 460 of file MuonDetLayerMeasurements.cc.

References Exception, and theEvent.

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

460  {
461  if(!theEvent)
462  throw cms::Exception("MuonDetLayerMeasurements") << "The event has not been set";
463 }
void MuonDetLayerMeasurements::checkGEMRecHits ( )
private

Definition at line 257 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

258 {
259  checkEvent();
260  auto cacheID = theEvent->cacheIdentifier();
261  if (cacheID == theGEMEventCacheID) return;
262 
263  {
265  theGEMEventCacheID = cacheID;
266  }
267  if(!theGEMRecHits.isValid())
268  {
269  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get GEM RecHits";
270  }
271 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::Event::CacheIdentifier_t theGEMEventCacheID
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
void checkEvent() const
check that the event is set, and throw otherwise
edm::Handle< GEMRecHitCollection > theGEMRecHits
void MuonDetLayerMeasurements::checkME0RecHits ( )
private

Definition at line 273 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().

274 {
275  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Checking ME0 RecHits";
276  checkEvent();
277  auto cacheID = theEvent->cacheIdentifier();
278  if (cacheID == theME0EventCacheID) return;
279 
280  {
282  theME0EventCacheID = cacheID;
283  }
284  if(!theME0RecHits.isValid())
285  {
286  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get ME0 RecHits";
287  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Cannot get ME0 RecHits";
288  }
289 }
#define LogDebug(id)
edm::Event::CacheIdentifier_t theME0EventCacheID
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< ME0SegmentCollection > me0Token_
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
bool isValid() const
Definition: HandleBase.h:74
edm::Handle< ME0SegmentCollection > theME0RecHits
void checkEvent() const
check that the event is set, and throw otherwise
void MuonDetLayerMeasurements::checkRPCRecHits ( )
private

Definition at line 241 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

242 {
243  checkEvent();
244  auto cacheID = theEvent->cacheIdentifier();
245  if (cacheID == theRPCEventCacheID) return;
246 
247  {
249  theRPCEventCacheID = cacheID;
250  }
251  if(!theRPCRecHits.isValid())
252  {
253  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get RPC RecHits";
254  }
255 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::Event::CacheIdentifier_t theRPCEventCacheID
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:37
edm::Handle< RPCRecHitCollection > theRPCRecHits
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< RPCRecHitCollection > rpcToken_
void checkEvent() const
check that the event is set, and throw otherwise
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 372 of file MuonDetLayerMeasurements.cc.

References MeasurementEstimator::estimate(), recHits(), and mps_fire::result.

Referenced by fastMeasurements().

377  {
379  MuonRecHitContainer rhs = recHits(layer, iEvent);
380  for (MuonRecHitContainer::const_iterator irh = rhs.begin(); irh!=rhs.end(); irh++) {
381  MeasurementEstimator::HitReturnType estimate = est.estimate(theStateOnDet, (**irh));
382  if (estimate.first)
383  {
384  result.push_back(TrajectoryMeasurement(theStateOnDet,(*irh),
385  estimate.second,layer));
386  }
387  }
388 
389  if (!result.empty()) {
390  sort( result.begin(), result.end(), TrajMeasLessEstim());
391  }
392 
393  return result;
394 }
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
std::pair< bool, double > HitReturnType
std::vector< TrajectoryMeasurement > MeasurementContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
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 398 of file MuonDetLayerMeasurements.cc.

References checkEvent(), fastMeasurements(), and theEvent.

402  {
403  checkEvent();
404  return fastMeasurements(layer, theStateOnDet, startingState, prop, est, *theEvent);
405 }
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 ...
std::vector< TrajectoryMeasurementGroup > MuonDetLayerMeasurements::groupedMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est,
const edm::Event iEvent 
)

Definition at line 419 of file MuonDetLayerMeasurements.cc.

References GeometricSearchDet::groupedCompatibleDets(), iEvent, measurements(), and mps_fire::result.

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

423  {
424 
425  std::vector<TrajectoryMeasurementGroup> result;
426  // if we want to use the concept of InvalidRecHits,
427  // we can reuse LayerMeasurements from TrackingTools/MeasurementDet
428  std::vector<DetGroup> groups(layer->groupedCompatibleDets(startingState, prop, est));
429 
430  // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or
431  // RecoMuon/DetLayers/MuRingForwardDoubleLayer
432  // and removed the reverse operation in StandAloneMuonFilter::findBestMeasurements
433 
434  for (std::vector<DetGroup>::const_iterator grp=groups.begin(); grp!=groups.end(); ++grp) {
435 
436  std::vector<TrajectoryMeasurement> groupMeasurements;
437  for (DetGroup::const_iterator detAndStateItr=grp->begin();
438  detAndStateItr !=grp->end(); ++detAndStateItr) {
439 
440  std::vector<TrajectoryMeasurement> detMeasurements
441  = measurements(layer, detAndStateItr->det(), detAndStateItr->trajectoryState(), est, iEvent);
442  groupMeasurements.insert(groupMeasurements.end(), detMeasurements.begin(), detMeasurements.end());
443  }
444 
445  if (!groupMeasurements.empty())
446  std::sort( groupMeasurements.begin(), groupMeasurements.end(), TrajMeasLessEstim());
447 
448  result.push_back(TrajectoryMeasurementGroup(groupMeasurements, *grp));
449  }
450 
451  return result;
452 }
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
int iEvent
Definition: GenABIO.cc:230
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
std::vector< TrajectoryMeasurementGroup > MuonDetLayerMeasurements::groupedMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
)

Definition at line 409 of file MuonDetLayerMeasurements.cc.

References checkEvent(), groupedMeasurements(), and theEvent.

412  {
413  checkEvent();
414  return groupedMeasurements(layer, startingState, prop, est, *theEvent);
415 }
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
MeasurementContainer MuonDetLayerMeasurements::measurements ( const DetLayer layer,
const GeomDet det,
const TrajectoryStateOnSurface stateOnDet,
const MeasurementEstimator est,
const edm::Event iEvent 
)

Definition at line 331 of file MuonDetLayerMeasurements.cc.

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

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

335  {
337 
338  DetId geoId = det->geographicalId();
339  //no chamber here that is actually an me0....
340  if (geoId.subdetId() == MuonSubdetId::ME0) {
342  ME0DetId chamberId(geoId.rawId());
343  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "ME0 Chamber ID in measurements: "<<chamberId<<std::endl;
344  }
345  }
346 
347 
348  // Get the Segments which relies on the GeomDet given by compatibleDets
349  MuonRecHitContainer muonRecHits = recHits(det, iEvent);
350 
351  // Create the Trajectory Measurement
352  for(MuonRecHitContainer::const_iterator rechit = muonRecHits.begin();
353  rechit != muonRecHits.end(); ++rechit) {
354 
355  MeasurementEstimator::HitReturnType estimate = est.estimate(stateOnDet,**rechit);
356  LogDebug("RecoMuon")<<"Dimension: "<<(*rechit)->dimension()
357  <<" Chi2: "<<estimate.second<<std::endl;
358  if (estimate.first) {
359  result.push_back(TrajectoryMeasurement(stateOnDet, *rechit,
360  estimate.second,layer));
361  }
362  }
363 
364  if (!result.empty()) sort( result.begin(), result.end(), TrajMeasLessEstim());
365 
366  return result;
367 }
#define LogDebug(id)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
static const int ME0
Definition: MuonSubdetId.h:16
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
std::pair< bool, double > HitReturnType
Definition: DetId.h:18
std::vector< TrajectoryMeasurement > MeasurementContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
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 303 of file MuonDetLayerMeasurements.cc.

References GeometricSearchDet::compatibleDets(), LogDebug, measurements(), and mps_fire::result.

307  {
308 
310 
311 
312  std::vector<DetWithState> dss = layer->compatibleDets(startingState, prop, est);
313  LogDebug("RecoMuon")<<"compatibleDets: "<<dss.size()<<std::endl;
314 
315  for(std::vector<DetWithState>::const_iterator detWithStateItr = dss.begin();
316  detWithStateItr != dss.end(); ++detWithStateItr){
317 
318  MeasurementContainer detMeasurements
319  = measurements(layer, detWithStateItr->first,
320  detWithStateItr->second, est, iEvent);
321  result.insert(result.end(), detMeasurements.begin(), detMeasurements.end());
322  }
323 
324  if (!result.empty()) sort( result.begin(), result.end(), TrajMeasLessEstim());
325 
326  return result;
327 }
#define LogDebug(id)
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
std::vector< TrajectoryMeasurement > MeasurementContainer
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 293 of file MuonDetLayerMeasurements.cc.

References checkEvent(), measurements(), and theEvent.

296  {
297  checkEvent();
298  return measurements(layer, startingState, prop, est, *theEvent);
299 }
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
void checkEvent() const
check that the event is set, and throw otherwise
MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const DetLayer layer,
const edm::Event iEvent 
)

returns the rechits which are on the layer

Definition at line 465 of file MuonDetLayerMeasurements.cc.

References GeometricSearchDet::basicComponents().

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

466  {
468 
469  std::vector <const GeomDet*> gds = layer->basicComponents();
470 
471  for (std::vector<const GeomDet*>::const_iterator igd = gds.begin();
472  igd != gds.end(); igd++) {
473  MuonRecHitContainer detHits = recHits(*igd, iEvent);
474  rhs.insert(rhs.end(), detHits.begin(), detHits.end());
475  }
476  return rhs;
477 }
virtual const std::vector< const GeomDet * > & basicComponents() const =0
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const DetLayer layer)

returns the rechits which are on the layer

Definition at line 479 of file MuonDetLayerMeasurements.cc.

References checkEvent(), recHits(), and theEvent.

480 {
481  checkEvent();
482  return recHits(layer, *theEvent);
483 }
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
MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const GeomDet geomDet,
const edm::Event iEvent 
)
private

obtain TrackingRecHits from a DetLayer

Definition at line 80 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, DetId::rawId(), mps_fire::result, MuonSubdetId::RPC, MuonTransientTrackingRecHit::specificBuild(), DetId::subdetId(), theCSCRecHits, theDTRecHits, theEvent, theGEMRecHits, theME0RecHits, and theRPCRecHits.

82 {
83  DetId geoId = geomDet->geographicalId();
84  theEvent = &iEvent;
86 
87  if (geoId.subdetId() == MuonSubdetId::DT) {
89  {
91 
92  // Create the ChamberId
93  DTChamberId chamberId(geoId.rawId());
94  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(DT): "<<chamberId<<std::endl;
95 
96  // Get the DT-Segment which relies on this chamber
97  DTRecSegment4DCollection::range range = theDTRecHits->get(chamberId);
98 
99  // Create the MuonTransientTrackingRechit
100  for (DTRecSegment4DCollection::const_iterator rechit = range.first;
101  rechit!=range.second;++rechit)
102  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
103  }
104  }
105 
106  else if (geoId.subdetId() == MuonSubdetId::CSC) {
108  {
109  checkCSCRecHits();
110 
111  // Create the chamber Id
112  CSCDetId chamberId(geoId.rawId());
113  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(CSC): "<<chamberId<<std::endl;
114 
115  // Get the CSC-Segment which relies on this chamber
116  CSCSegmentCollection::range range = theCSCRecHits->get(chamberId);
117 
118  // Create the MuonTransientTrackingRecHit
119  for (CSCSegmentCollection::const_iterator rechit = range.first;
120  rechit!=range.second; ++rechit)
121  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
122  }
123  }
124 
125  else if (geoId.subdetId() == MuonSubdetId::RPC) {
127  {
128  checkRPCRecHits();
129 
130  // Create the chamber Id
131  RPCDetId chamberId(geoId.rawId());
132  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(RPC): "<<chamberId<<std::endl;
133 
134  // Get the RPC-Segment which relies on this chamber
135  RPCRecHitCollection::range range = theRPCRecHits->get(chamberId);
136 
137  // Create the MuonTransientTrackingRecHit
138  for (RPCRecHitCollection::const_iterator rechit = range.first;
139  rechit!=range.second; ++rechit)
140  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
141  }
142  }
143  else if (geoId.subdetId() == MuonSubdetId::GEM) {
145  {
146  checkGEMRecHits();
147 
148  // Create the chamber Id
149  GEMDetId chamberId(geoId.rawId());
150 
151  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(GEM): "<<chamberId<<std::endl;
152 
153  // Get the GEM-Segment which relies on this chamber
154  GEMRecHitCollection::range range = theGEMRecHits->get(chamberId);
155 
156  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Number of GEM rechits available = " << theGEMRecHits->size()
157  <<", from chamber: "<< chamberId<<std::endl;
158 
159  // Create the MuonTransientTrackingRecHit
160  for (GEMRecHitCollection::const_iterator rechit = range.first;
161  rechit!=range.second; ++rechit)
162  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
163  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Number of GEM rechits = " << result.size()<<std::endl;
164  }
165  }
166 
167  else if (geoId.subdetId() == MuonSubdetId::ME0) {
168  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(ME0): identified"<<std::endl;
170  {
171  checkME0RecHits();
172 
173  // Create the chamber Id
174  ME0DetId chamberId(geoId.rawId());
175 
176  // Get the ME0-Segment which relies on this chamber
177  // Getting rechits right now, not segments - maybe it should be segments?
178  ME0SegmentCollection::range range = theME0RecHits->get(chamberId);
179 
180  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Number of ME0 rechits available = " << theME0RecHits->size()
181  <<", from chamber: "<< chamberId<<std::endl;
182 
183  // Create the MuonTransientTrackingRecHit
184  for (ME0SegmentCollection::const_iterator rechit = range.first;
185  rechit!=range.second; ++rechit){
186  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "On ME0 iteration " <<std::endl;
187  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
188  }
189  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "Number of ME0 rechits = " << result.size()<<std::endl;
190  }
191  }
192  else {
193  // wrong type
194  throw cms::Exception("MuonDetLayerMeasurements") << "The DetLayer with det " << geoId.det() << " subdet " << geoId.subdetId() << " is not a valid Muon DetLayer. ";
195  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements")<< "The DetLayer with det " << geoId.det() << " subdet " << geoId.subdetId() << " is not a valid Muon DetLayer. ";
196  }
198  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(ME0): enabled"<<std::endl;
199  }
200 
202  LogDebug("Muon|RecoMuon|MuonDetLayerMeasurements") << "(GEM): enabled"<<std::endl;
203  }
204  return result;
205 }
#define LogDebug(id)
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
edm::Handle< DTRecSegment4DCollection > theDTRecHits
static const int GEM
Definition: MuonSubdetId.h:15
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
edm::Handle< CSCSegmentCollection > theCSCRecHits
static const int ME0
Definition: MuonSubdetId.h:16
int iEvent
Definition: GenABIO.cc:230
static const int CSC
Definition: MuonSubdetId.h:13
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
edm::Handle< RPCRecHitCollection > theRPCRecHits
Definition: DetId.h:18
edm::Handle< ME0SegmentCollection > theME0RecHits
static const int RPC
Definition: MuonSubdetId.h:14
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
static const int DT
Definition: MuonSubdetId.h:12
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
edm::Handle< GEMRecHitCollection > theGEMRecHits
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39
void MuonDetLayerMeasurements::setEvent ( const edm::Event event)

set event

Definition at line 455 of file MuonDetLayerMeasurements.cc.

References event(), and theEvent.

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

455  {
456  theEvent = &event;
457 }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past

Member Data Documentation

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

Definition at line 136 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits(), and MuonDetLayerMeasurements().

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

Definition at line 135 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits(), and MuonDetLayerMeasurements().

bool MuonDetLayerMeasurements::enableCSCMeasurement
private

Definition at line 143 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

bool MuonDetLayerMeasurements::enableDTMeasurement
private

Definition at line 142 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

bool MuonDetLayerMeasurements::enableGEMMeasurement
private

Definition at line 145 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

bool MuonDetLayerMeasurements::enableME0Measurement
private

Definition at line 146 of file MuonDetLayerMeasurements.h.

Referenced by measurements(), and recHits().

bool MuonDetLayerMeasurements::enableRPCMeasurement
private

Definition at line 144 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

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

Definition at line 138 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits(), and MuonDetLayerMeasurements().

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

Definition at line 139 of file MuonDetLayerMeasurements.h.

Referenced by checkME0RecHits(), and MuonDetLayerMeasurements().

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

Definition at line 137 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits(), and MuonDetLayerMeasurements().

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

Definition at line 163 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits().

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

Definition at line 150 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits(), and recHits().

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

Definition at line 162 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits().

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

Definition at line 149 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits(), and recHits().

const edm::Event* MuonDetLayerMeasurements::theEvent
private
edm::Event::CacheIdentifier_t MuonDetLayerMeasurements::theGEMEventCacheID
private

Definition at line 165 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits().

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

Definition at line 152 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits(), and recHits().

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

Definition at line 166 of file MuonDetLayerMeasurements.h.

Referenced by checkME0RecHits().

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

Definition at line 153 of file MuonDetLayerMeasurements.h.

Referenced by checkME0RecHits(), and recHits().

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

Definition at line 164 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits().

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

Definition at line 151 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits(), and recHits().