CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< TrajectoryMeasurementGroup
groupedMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
 
std::vector
< TrajectoryMeasurementGroup
groupedMeasurements (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::ConsumesCollector &iC, bool enableDT=true, bool enableCSC=true, bool enableRPC=true, bool enableGEM=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 checkRPCRecHits ()
 
MuonRecHitContainer recHits (const GeomDet *, const edm::Event &iEvent)
 obtain TrackingRecHits from a DetLayer More...
 

Private Attributes

edm::EDGetTokenT
< CSCSegmentCollection
cscToken_
 
edm::EDGetTokenT
< DTRecSegment4DCollection
dtToken_
 
bool enableCSCMeasurement
 
bool enableDTMeasurement
 
bool enableGEMMeasurement
 
bool enableRPCMeasurement
 
edm::EDGetTokenT
< GEMRecHitCollection
gemToken_
 
edm::EDGetTokenT
< RPCRecHitCollection
rpcToken_
 
edm::Event::CacheIdentifier_t theCSCEventCacheID
 
edm::Handle< CSCSegmentCollectiontheCSCRecHits
 
edm::Event::CacheIdentifier_t theDTEventCacheID
 
edm::Handle
< DTRecSegment4DCollection
theDTRecHits
 
const edm::EventtheEvent
 
edm::Event::CacheIdentifier_t theGEMEventCacheID
 
edm::Handle< GEMRecHitCollectiontheGEMRecHits
 
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 & A. Sharma to include GEMs

The class to access recHits and TrajectoryMeasurements from DetLayer.

Author
C. Liu, R. Bellan, N. Amapane

by C. Calabria & A.Sharma to include GEMs

Definition at line 41 of file MuonDetLayerMeasurements.h.

Member Typedef Documentation

Definition at line 43 of file MuonDetLayerMeasurements.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file MuonDetLayerMeasurements.cc.

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

32  :
33  enableDTMeasurement(enableDT),
34  enableCSCMeasurement(enableCSC),
35  enableRPCMeasurement(enableRPC),
36  enableGEMMeasurement(enableGEM),
37 
38  theDTRecHits(),
39  theCSCRecHits(),
40  theRPCRecHits(),
41  theGEMRecHits(),
46  theEvent(0)
47 {
48 
50  cscToken_ = iC.consumes<CSCSegmentCollection>(csclabel);
51  rpcToken_ = iC.consumes<RPCRecHitCollection>(rpclabel);
52  gemToken_ = iC.consumes<GEMRecHitCollection>(gemlabel);
53 
54  static int procInstance(0);
55  std::ostringstream sDT;
56  sDT<<"MuonDetLayerMeasurements::checkDTRecHits::" << procInstance;
57  // theDTCheckName = sDT.str();
58  std::ostringstream sRPC;
59  sRPC<<"MuonDetLayerMeasurements::checkRPCRecHits::" << procInstance;
60  //theRPCCheckName = sRPC.str();
61  std::ostringstream sCSC;
62  sCSC<<"MuonDetLayerMeasurements::checkCSCRecHits::" << procInstance;
63  //theCSCCheckName = sCSC.str();
64  std::ostringstream sGEM;
65  sGEM<<"MuonDetLayerMeasurements::checkGEMRecHits::" << procInstance;
66  //theGEMCheckName = sGEM.str();
67  procInstance++;
68 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::Handle< DTRecSegment4DCollection > theDTRecHits
edm::Event::CacheIdentifier_t theGEMEventCacheID
edm::Event::CacheIdentifier_t theDTEventCacheID
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 70 of file MuonDetLayerMeasurements.cc.

70 {}

Member Function Documentation

void MuonDetLayerMeasurements::checkCSCRecHits ( )
private

Definition at line 180 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

181 {
182  checkEvent();
183  auto cacheID = theEvent->cacheIdentifier();
184  if (cacheID == theCSCEventCacheID) return;
185 
186  {
188  theCSCEventCacheID = cacheID;
189  }
190  if(!theCSCRecHits.isValid())
191  {
192  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get CSC RecHits";
193  }
194 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::Handle< CSCSegmentCollection > theCSCRecHits
edm::EDGetTokenT< CSCSegmentCollection > cscToken_
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:32
bool isValid() const
Definition: HandleBase.h:75
edm::Event::CacheIdentifier_t theCSCEventCacheID
void checkEvent() const
check that the event is set, and throw otherwise
void MuonDetLayerMeasurements::checkDTRecHits ( )
private

Definition at line 164 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

165 {
166  checkEvent();
167  auto const cacheID = theEvent->cacheIdentifier();
168  if (cacheID == theDTEventCacheID) return;
169 
170  {
172  }
173  if(!theDTRecHits.isValid())
174  {
175  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get DT RecHits";
176  }
177 }
edm::Handle< DTRecSegment4DCollection > theDTRecHits
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::Event::CacheIdentifier_t theDTEventCacheID
edm::EDGetTokenT< DTRecSegment4DCollection > dtToken_
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:32
bool isValid() const
Definition: HandleBase.h:75
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 387 of file MuonDetLayerMeasurements.cc.

References Exception, and theEvent.

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

387  {
388  if(!theEvent)
389  throw cms::Exception("MuonDetLayerMeasurements") << "The event has not been set";
390 }
void MuonDetLayerMeasurements::checkGEMRecHits ( )
private

Definition at line 213 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

214 {
215  checkEvent();
216  auto cacheID = theEvent->cacheIdentifier();
217  if (cacheID == theGEMEventCacheID) return;
218 
219  {
221  theGEMEventCacheID = cacheID;
222  }
223  if(!theGEMRecHits.isValid())
224  {
225  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get GEM RecHits";
226  }
227 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::Event::CacheIdentifier_t theGEMEventCacheID
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:32
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
void checkEvent() const
check that the event is set, and throw otherwise
edm::Handle< GEMRecHitCollection > theGEMRecHits
void MuonDetLayerMeasurements::checkRPCRecHits ( )
private

Definition at line 197 of file MuonDetLayerMeasurements.cc.

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

Referenced by recHits().

198 {
199  checkEvent();
200  auto cacheID = theEvent->cacheIdentifier();
201  if (cacheID == theRPCEventCacheID) return;
202 
203  {
205  theRPCEventCacheID = cacheID;
206  }
207  if(!theRPCRecHits.isValid())
208  {
209  throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get RPC RecHits";
210  }
211 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::Event::CacheIdentifier_t theRPCEventCacheID
CacheIdentifier_t cacheIdentifier() const
Definition: Event.cc:32
edm::Handle< RPCRecHitCollection > theRPCRecHits
bool isValid() const
Definition: HandleBase.h:75
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 299 of file MuonDetLayerMeasurements.cc.

References MeasurementEstimator::estimate(), recHits(), query::result, and python.multivaluedict::sort().

Referenced by fastMeasurements().

304  {
306  MuonRecHitContainer rhs = recHits(layer, iEvent);
307  for (MuonRecHitContainer::const_iterator irh = rhs.begin(); irh!=rhs.end(); irh++) {
308  MeasurementEstimator::HitReturnType estimate = est.estimate(theStateOnDet, (**irh));
309  if (estimate.first)
310  {
311  result.push_back(TrajectoryMeasurement(theStateOnDet,(*irh),
312  estimate.second,layer));
313  }
314  }
315 
316  if (!result.empty()) {
317  sort( result.begin(), result.end(), TrajMeasLessEstim());
318  }
319 
320  return result;
321 }
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
tuple result
Definition: query.py:137
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
std::pair< bool, double > HitReturnType
std::vector< TrajectoryMeasurement > MeasurementContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
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 325 of file MuonDetLayerMeasurements.cc.

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

329  {
330  checkEvent();
331  return fastMeasurements(layer, theStateOnDet, startingState, prop, est, *theEvent);
332 }
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 346 of file MuonDetLayerMeasurements.cc.

References GeometricSearchDet::groupedCompatibleDets(), iEvent, measurements(), query::result, and python.multivaluedict::sort().

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

350  {
351 
352  std::vector<TrajectoryMeasurementGroup> result;
353  // if we want to use the concept of InvalidRecHits,
354  // we can reuse LayerMeasurements from TrackingTools/MeasurementDet
355  std::vector<DetGroup> groups(layer->groupedCompatibleDets(startingState, prop, est));
356 
357  // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or
358  // RecoMuon/DetLayers/MuRingForwardDoubleLayer
359  // and removed the reverse operation in StandAloneMuonFilter::findBestMeasurements
360 
361  for (std::vector<DetGroup>::const_iterator grp=groups.begin(); grp!=groups.end(); ++grp) {
362 
363  std::vector<TrajectoryMeasurement> groupMeasurements;
364  for (DetGroup::const_iterator detAndStateItr=grp->begin();
365  detAndStateItr !=grp->end(); ++detAndStateItr) {
366 
367  std::vector<TrajectoryMeasurement> detMeasurements
368  = measurements(layer, detAndStateItr->det(), detAndStateItr->trajectoryState(), est, iEvent);
369  groupMeasurements.insert(groupMeasurements.end(), detMeasurements.begin(), detMeasurements.end());
370  }
371 
372  if (!groupMeasurements.empty())
373  std::sort( groupMeasurements.begin(), groupMeasurements.end(), TrajMeasLessEstim());
374 
375  result.push_back(TrajectoryMeasurementGroup(groupMeasurements, *grp));
376  }
377 
378  return result;
379 }
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
int iEvent
Definition: GenABIO.cc:230
tuple result
Definition: query.py:137
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 336 of file MuonDetLayerMeasurements.cc.

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

339  {
340  checkEvent();
341  return groupedMeasurements(layer, startingState, prop, est, *theEvent);
342 }
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 268 of file MuonDetLayerMeasurements.cc.

References MeasurementEstimator::estimate(), LogTrace, recHits(), query::result, and python.multivaluedict::sort().

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

272  {
274 
275  // Get the Segments which relies on the GeomDet given by compatibleDets
276  MuonRecHitContainer muonRecHits = recHits(det, iEvent);
277 
278  // Create the Trajectory Measurement
279  for(MuonRecHitContainer::const_iterator rechit = muonRecHits.begin();
280  rechit != muonRecHits.end(); ++rechit) {
281 
282  MeasurementEstimator::HitReturnType estimate = est.estimate(stateOnDet,**rechit);
283  LogTrace("RecoMuon")<<"Dimension: "<<(*rechit)->dimension()
284  <<" Chi2: "<<estimate.second<<std::endl;
285  if (estimate.first) {
286  result.push_back(TrajectoryMeasurement(stateOnDet, *rechit,
287  estimate.second,layer));
288  }
289  }
290 
291  if (!result.empty()) sort( result.begin(), result.end(), TrajMeasLessEstim());
292 
293  return result;
294 }
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
tuple result
Definition: query.py:137
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
#define LogTrace(id)
std::pair< bool, double > HitReturnType
std::vector< TrajectoryMeasurement > MeasurementContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
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 241 of file MuonDetLayerMeasurements.cc.

References GeometricSearchDet::compatibleDets(), LogTrace, measurements(), query::result, and python.multivaluedict::sort().

245  {
246 
248 
249  std::vector<DetWithState> dss = layer->compatibleDets(startingState, prop, est);
250  LogTrace("RecoMuon")<<"compatibleDets: "<<dss.size()<<std::endl;
251 
252  for(std::vector<DetWithState>::const_iterator detWithStateItr = dss.begin();
253  detWithStateItr != dss.end(); ++detWithStateItr){
254 
255  MeasurementContainer detMeasurements
256  = measurements(layer, detWithStateItr->first,
257  detWithStateItr->second, est, iEvent);
258  result.insert(result.end(), detMeasurements.begin(), detMeasurements.end());
259  }
260 
261  if (!result.empty()) sort( result.begin(), result.end(), TrajMeasLessEstim());
262 
263  return result;
264 }
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
#define LogTrace(id)
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 231 of file MuonDetLayerMeasurements.cc.

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

234  {
235  checkEvent();
236  return measurements(layer, startingState, prop, est, *theEvent);
237 }
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 392 of file MuonDetLayerMeasurements.cc.

References GeometricSearchDet::basicComponents().

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

393  {
395 
396  std::vector <const GeomDet*> gds = layer->basicComponents();
397 
398  for (std::vector<const GeomDet*>::const_iterator igd = gds.begin();
399  igd != gds.end(); igd++) {
400  MuonRecHitContainer detHits = recHits(*igd, iEvent);
401  rhs.insert(rhs.end(), detHits.begin(), detHits.end());
402  }
403  return rhs;
404 }
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
virtual const std::vector< const GeomDet * > & basicComponents() const =0
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
MuonRecHitContainer MuonDetLayerMeasurements::recHits ( const DetLayer layer)

returns the rechits which are on the layer

Definition at line 406 of file MuonDetLayerMeasurements.cc.

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

407 {
408  checkEvent();
409  return recHits(layer, *theEvent);
410 }
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 72 of file MuonDetLayerMeasurements.cc.

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

74 {
75  DetId geoId = geomDet->geographicalId();
76  theEvent = &iEvent;
78 
79  if (geoId.subdetId() == MuonSubdetId::DT) {
81  {
83 
84  // Create the ChamberId
85  DTChamberId chamberId(geoId.rawId());
86  // LogTrace("Muon|RecoMuon|MuonDetLayerMeasurements") << "(DT): "<<chamberId<<std::endl;
87 
88  // Get the DT-Segment which relies on this chamber
89  DTRecSegment4DCollection::range range = theDTRecHits->get(chamberId);
90 
91  // Create the MuonTransientTrackingRechit
92  for (DTRecSegment4DCollection::const_iterator rechit = range.first;
93  rechit!=range.second;++rechit)
94  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
95  }
96  }
97 
98  else if (geoId.subdetId() == MuonSubdetId::CSC) {
100  {
101  checkCSCRecHits();
102 
103  // Create the chamber Id
104  CSCDetId chamberId(geoId.rawId());
105  // LogTrace("Muon|RecoMuon|MuonDetLayerMeasurements") << "(CSC): "<<chamberId<<std::endl;
106 
107  // Get the CSC-Segment which relies on this chamber
108  CSCSegmentCollection::range range = theCSCRecHits->get(chamberId);
109 
110  // Create the MuonTransientTrackingRecHit
111  for (CSCSegmentCollection::const_iterator rechit = range.first;
112  rechit!=range.second; ++rechit)
113  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
114  }
115  }
116 
117  else if (geoId.subdetId() == MuonSubdetId::RPC) {
119  {
120  checkRPCRecHits();
121 
122  // Create the chamber Id
123  RPCDetId chamberId(geoId.rawId());
124  // LogTrace("Muon|RecoMuon|MuonDetLayerMeasurements") << "(RPC): "<<chamberId<<std::endl;
125 
126  // Get the RPC-Segment which relies on this chamber
127  RPCRecHitCollection::range range = theRPCRecHits->get(chamberId);
128 
129  // Create the MuonTransientTrackingRecHit
130  for (RPCRecHitCollection::const_iterator rechit = range.first;
131  rechit!=range.second; ++rechit)
132  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
133  }
134  }
135 
136  else if (geoId.subdetId() == MuonSubdetId::GEM) {
138  {
139  checkGEMRecHits();
140 
141  // Create the chamber Id
142  GEMDetId chamberId(geoId.rawId());
143 
144  // LogTrace("Muon|RecoMuon|MuonDetLayerMeasurements") << "(GEM): "<<chamberId<<std::endl;
145 
146  // Get the GEM-Segment which relies on this chamber
147  GEMRecHitCollection::range range = theGEMRecHits->get(chamberId);
148 
149  // Create the MuonTransientTrackingRecHit
150  for (GEMRecHitCollection::const_iterator rechit = range.first;
151  rechit!=range.second; ++rechit)
152  result.push_back(MuonTransientTrackingRecHit::specificBuild(geomDet,&*rechit));
153  }
154  }
155 
156  else {
157  // wrong type
158  throw cms::Exception("MuonDetLayerMeasurements") << "The DetLayer with det " << geoId.det() << " subdet " << geoId.subdetId() << " is not a valid Muon DetLayer. ";
159  }
160  return result;
161 }
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
edm::Handle< CSCSegmentCollection > theCSCRecHits
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int iEvent
Definition: GenABIO.cc:230
static const int CSC
Definition: MuonSubdetId.h:13
tuple result
Definition: query.py:137
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
edm::Handle< RPCRecHitCollection > theRPCRecHits
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
static const int RPC
Definition: MuonSubdetId.h:14
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
static const int DT
Definition: MuonSubdetId.h:12
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
edm::Handle< GEMRecHitCollection > theGEMRecHits
void MuonDetLayerMeasurements::setEvent ( const edm::Event event)

set event

Definition at line 382 of file MuonDetLayerMeasurements.cc.

References event(), and theEvent.

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

382  {
383  theEvent = &event;
384 }
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 131 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits(), and MuonDetLayerMeasurements().

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

Definition at line 130 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits(), and MuonDetLayerMeasurements().

bool MuonDetLayerMeasurements::enableCSCMeasurement
private

Definition at line 137 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

bool MuonDetLayerMeasurements::enableDTMeasurement
private

Definition at line 136 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

bool MuonDetLayerMeasurements::enableGEMMeasurement
private

Definition at line 139 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

bool MuonDetLayerMeasurements::enableRPCMeasurement
private

Definition at line 138 of file MuonDetLayerMeasurements.h.

Referenced by recHits().

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

Definition at line 133 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits(), and MuonDetLayerMeasurements().

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

Definition at line 132 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits(), and MuonDetLayerMeasurements().

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

Definition at line 154 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits().

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

Definition at line 143 of file MuonDetLayerMeasurements.h.

Referenced by checkCSCRecHits(), and recHits().

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

Definition at line 153 of file MuonDetLayerMeasurements.h.

Referenced by checkDTRecHits().

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

Definition at line 142 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 156 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits().

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

Definition at line 145 of file MuonDetLayerMeasurements.h.

Referenced by checkGEMRecHits(), and recHits().

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

Definition at line 155 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits().

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

Definition at line 144 of file MuonDetLayerMeasurements.h.

Referenced by checkRPCRecHits(), and recHits().