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();
291 measurements(layer, detWithStateItr->first, detWithStateItr->second, est, iEvent);
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) {
351 if (!result.empty()) {
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());
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::Event::CacheIdentifier_t theME0EventCacheID
std::pair< const_iterator, const_iterator > range
iterator range
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
edm::Handle< DTRecSegment4DCollection > theDTRecHits
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::Event::CacheIdentifier_t theGEMEventCacheID
edm::Event::CacheIdentifier_t theDTEventCacheID
constexpr uint32_t rawId() const
get the raw id
edm::EDGetTokenT< ME0SegmentCollection > me0Token_
edm::EDGetTokenT< DTRecSegment4DCollection > dtToken_
edm::Handle< CSCSegmentCollection > theCSCRecHits
std::vector< TrajectoryMeasurementGroup > groupedMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
edm::EDGetTokenT< CSCSegmentCollection > cscToken_
constexpr std::array< uint8_t, layerIndexSize > layer
const uint16_t range(const Frame &aFrame)
C::const_iterator const_iterator
constant access iterator type
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
edm::Event::CacheIdentifier_t theRPCEventCacheID
CacheIdentifier_t cacheIdentifier() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool enableGEMMeasurement
DetId geographicalId() const
The label of this GeomDet.
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
bool enableCSCMeasurement
edm::Handle< RPCRecHitCollection > theRPCRecHits
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
virtual ~MuonDetLayerMeasurements()
std::vector< TrajectoryMeasurement > MeasurementContainer
bool enableME0Measurement
edm::Handle< ME0SegmentCollection > theME0RecHits
edm::Event::CacheIdentifier_t theCSCEventCacheID
virtual const std::vector< const GeomDet * > & basicComponents() const =0
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
void setEvent(const edm::Event &)
set event
edm::EDGetTokenT< RPCRecHitCollection > rpcToken_
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)
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
std::pair< bool, double > HitReturnType
void checkEvent() const
check that the event is set, and throw otherwise
const edm::Event * theEvent
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
std::vector< MuonRecHitPointer > MuonRecHitContainer
bool enableRPCMeasurement
edm::Handle< GEMRecHitCollection > theGEMRecHits
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 ...
constexpr Detector det() const
get the detector field from this detid