53 LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"DTChamberEfficiency: constructor called";
60 theTracksToken_ = consumes<reco::TrackCollection>(theTracksLabel_);
62 theMaxChi2 =
static_cast<unsigned int>(pSet.
getParameter<
double>(
"theMaxChi2"));
64 theMinNrec =
static_cast<int>(pSet.
getParameter<
double>(
"theMinNrec"));
74 thedt4DSegments, thecscSegments, labelRPCRecHits,
InputTag(),
InputTag(), iC,
true,
false,
false,
false);
76 theNavigationType = pSet.
getParameter<
string>(
"NavigationType");
82 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"DTChamberEfficiency: destructor called";
86 delete theMeasurementExtractor;
93 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"DTChamberEfficiency: booking histos";
98 for (
int wheel = -2; wheel <= 2; wheel++) {
99 vector<MonitorElement*>
histos;
101 stringstream wheel_str;
104 histos.push_back(ibooker.
book2D(
105 "hCountSectVsChamb_All_W" + wheel_str.str(),
"Countings for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
107 histos.push_back(ibooker.
book2D(
108 "hCountSectVsChamb_Qual_W" + wheel_str.str(),
"Countings for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
110 histos.push_back(ibooker.
book2D(
111 "hExtrapSectVsChamb_W" + wheel_str.str(),
"Extrapolations for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
113 histosPerW.push_back(histos);
120 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
121 <<
"--- [DTChamberEfficiency] Event analysed #Run: " <<
event.id().run() <<
" #Event: " <<
event.id().event()
124 theService->update(eventSetup);
125 theMeasurementExtractor->setEvent(event);
129 event.getByToken(theTracksToken_, tracks);
137 for (reco::TrackCollection::const_iterator
track = tracks->begin();
track != tracks->end(); ++
track) {
139 const int recHitsize = (int)trans_track.
recHitsSize();
140 if (recHitsize < theMinNrec)
145 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"--- New track" << endl;
146 set<DTChamberId> chAlrUsed;
148 DetId rHitid = (*rHit)->geographicalId();
152 if (chAlrUsed.find(wId) != chAlrUsed.end())
154 chAlrUsed.insert(wId);
155 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
" " << wId << endl;
161 const DetLayer* initialLayer = theService->detLayerGeometry()->idToLayer(
id);
167 vector<const DetLayer*> layer_list =
168 compatibleLayers(*theService->muonNavigationSchool(), initialLayer, *init_fs_free,
alongMomentum);
169 vector<const DetLayer*> layer_list_2 =
170 compatibleLayers(*theService->muonNavigationSchool(), initialLayer, *init_fs_free,
oppositeToMomentum);
172 layer_list.insert(layer_list.end(), layer_list_2.begin(), layer_list_2.end());
174 set<DTChamberId> alreadyCheckedCh;
177 for (
int i = 0;
i < (int)layer_list.size();
i++) {
184 vector<DetWithState> dss = layer_list.at(
i)->compatibleDets(tsos, *
propagator(), *theEstimator);
191 const DetId idDetLay = detWithState.first->geographicalId();
194 if (!chamberSelection(idDetLay, trans_track))
200 if (alreadyCheckedCh.find(DTid) != alreadyCheckedCh.end())
202 alreadyCheckedCh.insert(DTid);
206 layer_list.at(
i), detWithState.first, detWithState.second, *theEstimator,
event);
207 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
208 <<
" chamber: " << DTid <<
" has: " << detMeasurements_initial.size() <<
" comp. meas." << endl;
215 vector<MonitorElement*>
histos = histosPerW[DTid.
wheel() + 2];
217 if (!detMeasurements_initial.empty())
219 if (!detMeasurements.empty())
225 LogInfo(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
226 <<
"[DTChamberEfficiency] Collection: " << theTracksLabel_ <<
" is not valid!" << endl;
237 if (trans_track.
recHit(0)->geographicalId() == idDetLay || trans_track.
recHit(1)->geographicalId() == idDetLay)
246 for (MeasurementContainer::const_iterator mescont_Itr = seg_list.begin(); mescont_Itr != seg_list.end();
253 for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator recList_Itr = recHit_list.begin();
254 recList_Itr != recHit_list.end();
256 nhit_seg += (int)(*recList_Itr)->transientHits().size();
261 if (tmpId.
station() < 4 && nhit_seg >= 12)
262 result.push_back(*mescont_Itr);
263 if (tmpId.
station() == 4 && nhit_seg >= 8)
264 result.push_back(*mescont_Itr);
274 vector<const DetLayer*> detLayers;
276 if (theNavigationType ==
"Standard") {
282 detLayers.insert(detLayers.begin(), initialLayer);
284 }
else if (theNavigationType ==
"Direct") {
288 LogError(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"No Properly Navigation Selected!!" << endl;
294 return theService->propagator(
"SteppingHelixPropagatorAny");
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
MeasurementContainer segQualityCut(const MeasurementContainer &seg_list) const
virtual void setCurrentFolder(std::string const &fullpath)
DTChamberEfficiency(const edm::ParameterSet &pset)
constexpr uint32_t rawId() const
get the raw id
auto const & tracks
cannot be loose
size_t recHitsSize() const
number of RecHits
Log< level::Error, false > LogError
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
TrajectoryStateOnSurface innermostMeasurementState() const
~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)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
trackingRecHit_iterator recHitsEnd() const
last iterator to RecHits
std::vector< ConstRecHitPointer > ConstRecHitContainer
Log< level::Info, false > LogInfo
const Track & track() const
std::vector< TrajectoryMeasurement > MeasurementContainer
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
int station() const
Return the station number.
int wheel() const
Return the wheel number.
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
trackingRecHit_iterator recHitsBegin() const
first iterator to RecHits
constexpr Detector det() const
get the detector field from this detid
tuple Chi2MeasurementEstimator