57 LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"DTChamberEfficiency: constructor called";
64 theTracksToken_ = consumes<reco::TrackCollection>(theTracksLabel_);
78 thedt4DSegments, thecscSegments, labelRPCRecHits,
InputTag(),
InputTag(), iC,
true,
false,
false,
false);
80 theNavigationType = pSet.
getParameter<
string>(
"NavigationType");
86 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"DTChamberEfficiency: destructor called";
90 delete theMeasurementExtractor;
107 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"DTChamberEfficiency: booking histos";
113 vector<MonitorElement*>
histos;
115 stringstream wheel_str;
118 histos.push_back(ibooker.
book2D(
119 "hCountSectVsChamb_All_W" + wheel_str.str(),
"Countings for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
121 histos.push_back(ibooker.
book2D(
122 "hCountSectVsChamb_Qual_W" + wheel_str.str(),
"Countings for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
124 histos.push_back(ibooker.
book2D(
125 "hExtrapSectVsChamb_W" + wheel_str.str(),
"Extrapolations for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
127 histosPerW.push_back(histos);
134 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
135 <<
"--- [DTChamberEfficiency] Event analysed #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event()
138 theService->update(eventSetup);
139 theMeasurementExtractor->setEvent(event);
143 event.getByToken(theTracksToken_, tracks);
148 for (reco::TrackCollection::const_iterator
track = tracks->begin();
track != tracks->end(); ++
track) {
156 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"--- New track" << endl;
157 set<DTChamberId> chAlrUsed;
159 DetId rHitid = (*rHit)->geographicalId();
163 if (chAlrUsed.find(wId) != chAlrUsed.end())
165 chAlrUsed.insert(wId);
166 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
" " << wId << endl;
171 DetId id = trans_track.track().innerDetId();
172 const DetLayer* initialLayer = theService->detLayerGeometry()->idToLayer(
id);
178 vector<const DetLayer*> layer_list =
179 compatibleLayers(*theService->muonNavigationSchool(), initialLayer, *init_fs_free,
alongMomentum);
180 vector<const DetLayer*> layer_list_2 =
181 compatibleLayers(*theService->muonNavigationSchool(), initialLayer, *init_fs_free,
oppositeToMomentum);
183 layer_list.insert(layer_list.end(), layer_list_2.begin(), layer_list_2.end());
185 set<DTChamberId> alreadyCheckedCh;
188 for (
int i = 0;
i < (
int)layer_list.size();
i++) {
195 vector<DetWithState> dss = layer_list.at(
i)->compatibleDets(tsos, *
propagator(), *theEstimator);
202 const DetId idDetLay = detWithState.first->geographicalId();
205 if (!chamberSelection(idDetLay, trans_track))
211 if (alreadyCheckedCh.find(DTid) != alreadyCheckedCh.end())
213 alreadyCheckedCh.insert(DTid);
217 layer_list.at(
i), detWithState.first, detWithState.second, *theEstimator,
event);
218 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
219 <<
" chamber: " << DTid <<
" has: " << detMeasurements_initial.size() <<
" comp. meas." << endl;
226 vector<MonitorElement*>
histos = histosPerW[DTid.
wheel() + 2];
228 if (!detMeasurements_initial.empty())
230 if (!detMeasurements.empty())
236 LogInfo(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
237 <<
"[DTChamberEfficiency] Collection: " << theTracksLabel_ <<
" is not valid!" << endl;
248 if (trans_track.
recHit(0)->geographicalId() == idDetLay || trans_track.
recHit(1)->geographicalId() == idDetLay)
257 for (MeasurementContainer::const_iterator mescont_Itr = seg_list.begin(); mescont_Itr != seg_list.end();
264 for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator recList_Itr = recHit_list.begin();
265 recList_Itr != recHit_list.end();
267 nhit_seg += (
int)(*recList_Itr)->transientHits().size();
272 if (tmpId.
station() < 4 && nhit_seg >= 12)
273 result.push_back(*mescont_Itr);
274 if (tmpId.
station() == 4 && nhit_seg >= 8)
275 result.push_back(*mescont_Itr);
285 vector<const DetLayer*> detLayers;
287 if (theNavigationType ==
"Standard") {
293 detLayers.insert(detLayers.begin(), initialLayer);
295 }
else if (theNavigationType ==
"Direct") {
299 LogError(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"No Properly Navigation Selected!!" << endl;
305 return theService->propagator(
"SteppingHelixPropagatorAny");
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MeasurementContainer segQualityCut(const MeasurementContainer &seg_list) const
DTChamberEfficiency(const edm::ParameterSet &pset)
void setCurrentFolder(std::string const &fullpath)
constexpr uint32_t rawId() const
get the raw id
size_t recHitsSize() const
number of RecHits
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
~DTChamberEfficiency() override
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
const SurfaceType & surface() const
bool chamberSelection(const DetId &idDetLay, reco::TransientTrack &trans_track) const
edm::ESHandle< Propagator > propagator() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::vector< const DetLayer * > compatibleLayers(const DetLayer &detLayer, Args &&...args) const
Returns all layers compatible.
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
TrackingRecHitRef recHit(size_t i) const
get n-th recHit
std::vector< const DetLayer * > compatibleLayers(const NavigationSchool &navigationSchool, const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< TrajectoryMeasurement > MeasurementContainer
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
int station() const
Return the station number.
int wheel() const
Return the wheel number.
constexpr Detector det() const
get the detector field from this detid