|
|
Go to the documentation of this file.
36 : enableDTMeasurement(enableDT),
37 enableCSCMeasurement(enableCSC),
38 enableRPCMeasurement(enableRPC),
39 enableGEMMeasurement(enableGEM),
40 enableME0Measurement(enableME0),
46 theCSCEventCacheID(0),
47 theRPCEventCacheID(0),
48 theGEMEventCacheID(0),
49 theME0EventCacheID(0),
57 static std::atomic<int> procInstance{0};
58 std::ostringstream sDT;
59 sDT <<
"MuonDetLayerMeasurements::checkDTRecHits::" << procInstance;
61 std::ostringstream sRPC;
62 sRPC <<
"MuonDetLayerMeasurements::checkRPCRecHits::" << procInstance;
64 std::ostringstream sCSC;
65 sCSC <<
"MuonDetLayerMeasurements::checkCSCRecHits::" << procInstance;
67 std::ostringstream sGEM;
68 sGEM <<
"MuonDetLayerMeasurements::checkGEMRecHits::" << procInstance;
70 std::ostringstream sME0;
71 sME0 <<
"MuonDetLayerMeasurements::checkME0RecHits::" << procInstance;
89 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(DT): " << chamberId << std::endl;
106 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(CSC): " << chamberId << std::endl;
123 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(RPC): " << chamberId << std::endl;
139 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(GEM): " << chamberId << std::endl;
144 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements")
145 <<
"Number of GEM rechits available = " <<
theGEMRecHits->size() <<
", from chamber: " << chamberId
151 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Number of GEM rechits = " <<
result.size() << std::endl;
156 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(ME0): identified" << std::endl;
167 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements")
168 <<
"Number of ME0 rechits available = " <<
theME0RecHits->size() <<
", from chamber: " << chamberId
173 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"On ME0 iteration " << std::endl;
176 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Number of ME0 rechits = " <<
result.size() << std::endl;
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. ";
186 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(ME0): enabled" << std::endl;
190 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(GEM): enabled" << std::endl;
203 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get DT RecHits";
218 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get CSC RecHits";
233 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get RPC RecHits";
248 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get GEM RecHits";
253 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Checking ME0 RecHits";
264 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get ME0 RecHits";
265 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Cannot get ME0 RecHits";
285 std::vector<DetWithState> dss = layer->
compatibleDets(startingState, prop, est);
286 LogDebug(
"RecoMuon") <<
"compatibleDets: " << dss.size() << std::endl;
288 for (std::vector<DetWithState>::const_iterator detWithStateItr = dss.begin(); detWithStateItr != dss.end();
292 result.insert(
result.end(), detMeasurements.begin(), detMeasurements.end());
313 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements")
314 <<
"ME0 Chamber ID in measurements: " << chamberId << std::endl;
322 for (MuonRecHitContainer::const_iterator rechit = muonRecHits.begin(); rechit != muonRecHits.end(); ++rechit) {
324 LogDebug(
"RecoMuon") <<
"Dimension: " << (*rechit)->dimension() <<
" Chi2: " << estimate.second << std::endl;
325 if (estimate.first) {
344 for (MuonRecHitContainer::const_iterator irh = rhs.begin(); irh != rhs.end(); irh++) {
346 if (estimate.first) {
383 std::vector<TrajectoryMeasurementGroup>
result;
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());
400 if (!groupMeasurements.empty())
401 std::sort(groupMeasurements.begin(), groupMeasurements.end(),
TrajMeasLessEstim());
414 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"The event has not been set";
422 for (std::vector<const GeomDet*>::const_iterator igd = gds.begin(); igd != gds.end(); igd++) {
424 rhs.insert(rhs.end(), detHits.begin(), detHits.end());
edm::Handle< DTRecSegment4DCollection > theDTRecHits
std::vector< TrajectoryMeasurementGroup > groupedMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
edm::Event::CacheIdentifier_t theME0EventCacheID
edm::EDGetTokenT< CSCSegmentCollection > cscToken_
constexpr Detector det() const
get the detector field from this detid
bool enableME0Measurement
std::vector< MuonRecHitPointer > MuonRecHitContainer
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
std::pair< bool, double > HitReturnType
std::vector< TrajectoryMeasurement > MeasurementContainer
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
const edm::Event * theEvent
void setEvent(const edm::Event &)
set event
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
edm::Event::CacheIdentifier_t theGEMEventCacheID
bool enableCSCMeasurement
CacheIdentifier_t cacheIdentifier() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool enableRPCMeasurement
bool getByToken(EDGetToken token, Handle< PROD > &result) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
DetId geographicalId() const
The label of this GeomDet.
edm::Event::CacheIdentifier_t theRPCEventCacheID
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
edm::Handle< ME0SegmentCollection > theME0RecHits
edm::Event::CacheIdentifier_t theCSCEventCacheID
C::const_iterator const_iterator
constant access iterator type
void checkEvent() const
check that the event is set, and throw otherwise
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)
edm::EDGetTokenT< RPCRecHitCollection > rpcToken_
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
edm::Event::CacheIdentifier_t theDTEventCacheID
edm::Handle< RPCRecHitCollection > theRPCRecHits
std::pair< const_iterator, const_iterator > range
iterator range
constexpr uint32_t rawId() const
get the raw id
edm::EDGetTokenT< DTRecSegment4DCollection > dtToken_
edm::Handle< GEMRecHitCollection > theGEMRecHits
edm::Handle< CSCSegmentCollection > theCSCRecHits
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
virtual ~MuonDetLayerMeasurements()
virtual const std::vector< const GeomDet * > & basicComponents() const =0
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
edm::EDGetTokenT< ME0SegmentCollection > me0Token_
bool enableGEMMeasurement