53 LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"DTChamberEfficiency: constructor called";
60 theTracksToken_ = consumes<reco::TrackCollection>(theTracksLabel_);
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";
99 vector<MonitorElement*>
histos;
101 stringstream wheel_str;
105 "hCountSectVsChamb_All_W" + wheel_str.str(),
"Countings for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
108 "hCountSectVsChamb_Qual_W" + wheel_str.str(),
"Countings for wheel " + wheel_str.str(), 14, 1., 15., 4, 1., 5.));
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()
125 theMeasurementExtractor->setEvent(
event);
129 event.getByToken(theTracksToken_,
tracks);
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
int station() const
Return the station number.
const Track & track() const
T getParameter(std::string const &) const
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
virtual void setCurrentFolder(std::string const &fullpath)
trackingRecHit_iterator recHitsEnd() const
last iterator to RecHits
DTChamberEfficiency(const edm::ParameterSet &pset)
bool chamberSelection(const DetId &idDetLay, reco::TransientTrack &trans_track) const
MeasurementContainer segQualityCut(const MeasurementContainer &seg_list) const
trackingRecHit_iterator recHitsBegin() const
first iterator to RecHits
Log< level::Error, false > LogError
const SurfaceType & surface() const
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
constexpr Detector det() const
get the detector field from this detid
~DTChamberEfficiency() override
T getUntrackedParameter(std::string const &, T const &) const
edm::ESHandle< Propagator > propagator() const
std::vector< const DetLayer * > compatibleLayers(const DetLayer &detLayer, Args &&... args) const
Returns all layers compatible.
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
TrackingRecHitRef recHit(size_t i) const
get n-th recHit
size_t recHitsSize() const
number of RecHits
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
TrajectoryStateOnSurface innermostMeasurementState() const
std::vector< const DetLayer * > compatibleLayers(const NavigationSchool &navigationSchool, const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< ConstRecHitPointer > ConstRecHitContainer
Log< level::Info, false > LogInfo
constexpr uint32_t rawId() const
get the raw id
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())
int wheel() const
Return the wheel number.
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
FreeTrajectoryState const * freeState(bool withErrors=true) const