35 bool enableDT,
bool enableCSC,
bool enableRPC,
bool enableGEM,
bool enableME0):
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),
59 static std::atomic<int> procInstance{0};
60 std::ostringstream sDT;
61 sDT<<
"MuonDetLayerMeasurements::checkDTRecHits::" << procInstance;
63 std::ostringstream sRPC;
64 sRPC<<
"MuonDetLayerMeasurements::checkRPCRecHits::" << procInstance;
66 std::ostringstream sCSC;
67 sCSC<<
"MuonDetLayerMeasurements::checkCSCRecHits::" << procInstance;
69 std::ostringstream sGEM;
70 sGEM<<
"MuonDetLayerMeasurements::checkGEMRecHits::" << procInstance;
72 std::ostringstream sME0;
73 sME0<<
"MuonDetLayerMeasurements::checkME0RecHits::" << procInstance;
94 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(DT): "<<chamberId<<std::endl;
101 rechit!=range.second;++rechit)
113 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(CSC): "<<chamberId<<std::endl;
120 rechit!=range.second; ++rechit)
132 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(RPC): "<<chamberId<<std::endl;
139 rechit!=range.second; ++rechit)
151 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(GEM): "<<chamberId<<std::endl;
156 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Number of GEM rechits available = " <<
theGEMRecHits->size()
157 <<
", from chamber: "<< chamberId<<std::endl;
161 rechit!=range.second; ++rechit)
163 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Number of GEM rechits = " << result.size()<<std::endl;
168 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(ME0): identified"<<std::endl;
180 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Number of ME0 rechits available = " <<
theME0RecHits->size()
181 <<
", from chamber: "<< chamberId<<std::endl;
185 rechit!=range.second; ++rechit){
186 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"On ME0 iteration " <<std::endl;
189 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Number of ME0 rechits = " << result.size()<<std::endl;
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. ";
198 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(ME0): enabled"<<std::endl;
202 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"(GEM): enabled"<<std::endl;
219 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get DT RecHits";
236 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get CSC RecHits";
253 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get RPC RecHits";
269 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get GEM RecHits";
275 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Checking ME0 RecHits";
286 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"Cannot get ME0 RecHits";
287 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"Cannot get ME0 RecHits";
312 std::vector<DetWithState> dss = layer->
compatibleDets(startingState, prop, est);
313 LogDebug(
"RecoMuon")<<
"compatibleDets: "<<dss.size()<<std::endl;
315 for(std::vector<DetWithState>::const_iterator detWithStateItr = dss.begin();
316 detWithStateItr != dss.end(); ++detWithStateItr){
320 detWithStateItr->second, est, iEvent);
321 result.insert(result.end(), detMeasurements.begin(), detMeasurements.end());
343 LogDebug(
"Muon|RecoMuon|MuonDetLayerMeasurements") <<
"ME0 Chamber ID in measurements: "<<chamberId<<std::endl;
352 for(MuonRecHitContainer::const_iterator rechit = muonRecHits.begin();
353 rechit != muonRecHits.end(); ++rechit) {
356 LogDebug(
"RecoMuon")<<
"Dimension: "<<(*rechit)->dimension()
357 <<
" Chi2: "<<estimate.second<<std::endl;
358 if (estimate.first) {
360 estimate.second,layer));
380 for (MuonRecHitContainer::const_iterator irh = rhs.begin(); irh!=rhs.end(); irh++) {
385 estimate.second,layer));
389 if (!result.empty()) {
408 std::vector<TrajectoryMeasurementGroup>
418 std::vector<TrajectoryMeasurementGroup>
425 std::vector<TrajectoryMeasurementGroup>
result;
434 for (std::vector<DetGroup>::const_iterator grp=groups.begin(); grp!=groups.end(); ++grp) {
436 std::vector<TrajectoryMeasurement> groupMeasurements;
437 for (DetGroup::const_iterator detAndStateItr=grp->begin();
438 detAndStateItr !=grp->end(); ++detAndStateItr) {
440 std::vector<TrajectoryMeasurement> detMeasurements
441 =
measurements(layer, detAndStateItr->det(), detAndStateItr->trajectoryState(), est,
iEvent);
442 groupMeasurements.insert(groupMeasurements.end(), detMeasurements.begin(), detMeasurements.end());
445 if (!groupMeasurements.empty())
446 std::sort( groupMeasurements.begin(), groupMeasurements.end(),
TrajMeasLessEstim());
462 throw cms::Exception(
"MuonDetLayerMeasurements") <<
"The event has not been set";
471 for (std::vector<const GeomDet*>::const_iterator igd = gds.begin();
472 igd != gds.end(); igd++) {
474 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
virtual const std::vector< const GeomDet * > & basicComponents() const =0
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_
uint32_t rawId() const
get the raw id
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
bool enableGEMMeasurement
DetId geographicalId() const
The label of this GeomDet.
bool enableCSCMeasurement
edm::Handle< RPCRecHitCollection > theRPCRecHits
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
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
std::pair< bool, double > HitReturnType
virtual ~MuonDetLayerMeasurements()
std::vector< TrajectoryMeasurement > MeasurementContainer
bool enableME0Measurement
edm::Handle< ME0SegmentCollection > theME0RecHits
edm::Event::CacheIdentifier_t theCSCEventCacheID
edm::EDGetTokenT< GEMRecHitCollection > gemToken_
void setEvent(const edm::Event &)
set event
edm::EDGetTokenT< RPCRecHitCollection > rpcToken_
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
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)
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
void checkEvent() const
check that the event is set, and throw otherwise
const edm::Event * theEvent
Detector det() const
get the detector field from this detid
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 ...