43 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: Constructor" << endl;
64 LogError(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
65 <<
"[DTTriggerEfficiencyTask]: Error, no trigger source (Twinmux) has been selected!!" << endl;
69 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
70 <<
"[DTTriggerEfficiencyTask]: analyzed " <<
nevents <<
" events" << endl;
82 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: bookHistograms" << endl;
85 for (
int wh = -2; wh <= 2; ++wh) {
86 vector<string>::const_iterator tagIt =
processTags.begin();
87 vector<string>::const_iterator tagEnd =
processTags.end();
88 for (; tagIt != tagEnd; ++tagIt) {
92 for (
int sect = 1; sect <= 12; ++sect) {
110 map<DTChamberId, const L1MuDTChambPhDigi*> phBestTM;
114 vector<L1MuDTChambPhDigi>
const* phTrigs = l1DTTPGPh->
getContainer();
116 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
117 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
118 for (; iph != iphe; ++iph) {
119 int phwheel = iph->whNum();
120 int phsec = iph->scNum() + 1;
121 int phst = iph->stNum();
122 int phcode = iph->code();
126 if (phcode < 7 && (phBestTM.find(chId) == phBestTM.end() || phcode > phBestTM[chId]->code()))
127 phBestTM[chId] = &(*iph);
131 vector<const DTRecSegment4D*> best4DSegments;
135 reco::MuonCollection::const_iterator
mu;
137 for (mu = muons->begin(); mu != muons->end(); ++
mu) {
139 if (!((*mu).isStandAloneMuon())) {
144 const vector<reco::MuonChamberMatch> matchedChambers = (*mu).matches();
145 vector<reco::MuonChamberMatch>::const_iterator
chamber;
147 for (chamber = matchedChambers.begin(); chamber != matchedChambers.end(); ++
chamber) {
154 const vector<reco::MuonSegmentMatch> matchedSegments = (*chamber).segmentMatches;
155 vector<reco::MuonSegmentMatch>::const_iterator segment;
157 for (segment = matchedSegments.begin(); segment != matchedSegments.end(); ++segment) {
179 if ((*dtSegment).hasPhi()) {
180 best4DSegments.push_back(&(*dtSegment));
188 vector<const DTRecSegment4D*>::const_iterator btrack;
189 for (btrack = best4DSegments.begin(); btrack != best4DSegments.end(); ++btrack) {
190 int wheel = (*btrack)->chamberId().wheel();
191 int station = (*btrack)->chamberId().station();
195 int nHitsPhi = (*btrack)->phiSegment()->degreesOfFreedom() + 2;
197 uint32_t indexCh = dtChId.
rawId();
198 map<string, MonitorElement*>& innerChME =
chamberHistos[indexCh];
202 vector<string>::const_iterator tagIt =
processTags.begin();
203 vector<string>::const_iterator tagEnd =
processTags.end();
204 for (; tagIt != tagEnd; ++tagIt) {
205 int qual = phBestTM.find(dtChId) != phBestTM.end() ? phBestTM[dtChId]->code() : -1;
206 innerWhME.find((*tagIt) +
"_TrigEffDenum")->second->Fill(scsector, station);
207 if (qual >= 0 && qual < 7) {
208 innerWhME.find((*tagIt) +
"_TrigEffNum")->second->Fill(scsector, station);
210 innerWhME.find((*tagIt) +
"_TrigEffCorrNum")->second->Fill(scsector, station);
214 innerChME.find((*tagIt) +
"_TrackPosvsAngle")->second->Fill(xdir, x);
215 if (qual >= 0 && qual < 7) {
216 innerChME.find((*tagIt) +
"_TrackPosvsAngleAnyQual")->second->Fill(xdir, x);
218 innerChME.find((*tagIt) +
"_TrackPosvsAngleCorr")->second->Fill(xdir, x);
231 std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
232 std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr = gmt_records.begin();
233 std::vector<L1MuGMTReadoutRecord>::const_iterator egmtrr = gmt_records.end();
234 for (; igmtrr != egmtrr; igmtrr++) {
235 std::vector<L1MuGMTExtendedCand> candsGMT = igmtrr->getGMTCands();
236 std::vector<L1MuGMTExtendedCand>::const_iterator candGMTIt = candsGMT.begin();
237 std::vector<L1MuGMTExtendedCand>::const_iterator candGMTEnd = candsGMT.end();
239 for (; candGMTIt != candGMTEnd; ++candGMTIt) {
240 if (!candGMTIt->empty()) {
241 int quality = candGMTIt->quality();
242 if (candGMTIt->bx() == 0 && (quality == 5 || quality == 7)) {
256 int wh = dtCh.
wheel();
267 string bookingFolder =
268 hwFolder +
"Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() +
"/" +
folder;
269 string histoTag =
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
273 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
274 <<
"[DTTriggerEfficiencyTask]: booking histos in " << bookingFolder << endl;
281 string histoLabel =
"Position vs Angle (phi)";
284 ibooker.
book2D(histoName, histoLabel, 12, -30., 30., nbins, min, max);
286 histoName = histoType +
"_TrackPosvsAngleAnyQual" +
histoTag;
287 histoLabel =
"Position vs Angle (phi) for any qual triggers";
290 ibooker.
book2D(histoName, histoLabel, 12, -30., 30., nbins, min, max);
292 histoName = histoType +
"_TrackPosvsAngleCorr" +
histoTag;
293 histoLabel =
"Position vs Angle (phi) for correlated triggers";
296 ibooker.
book2D(histoName, histoLabel, 12, -30., 30., nbins, min, max);
303 if (hTag.find(
"Summary") != string::npos) {
311 string hTagName =
"_W" + wh.str();
313 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
314 <<
"[DTTriggerEfficiencyTask]: booking histos in " << basedir << endl;
316 string hName = hTag +
"_TrigEffDenum" + hTagName;
328 hName = hTag +
"_TrigEffNum" + hTagName;
329 me = ibooker.
book2D(hName.c_str(), hName.c_str(), 12, 1, 13, 4, 1, 5);
339 hName = hTag +
"_TrigEffCorrNum" + hTagName;
340 me = ibooker.
book2D(hName.c_str(), hName.c_str(), 12, 1, 13, 4, 1, 5);
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmt_Token_
std::string SegmArbitration
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setCurrentFolder(std::string const &fullpath)
edm::EDGetTokenT< reco::MuonCollection > muons_Token_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::string topFolder()
return the top folder
constexpr uint32_t rawId() const
get the raw id
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string histoTag, std::string folder="")
Book wheel granularity histograms.
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_Token_
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
void bookChamberHistos(DQMStore::IBooker &ibooker, const DTChamberId &dtCh, std::string histoTag, std::string folder="")
Book chamber granularity histograms.
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
BeginRun.
DTTrigGeomUtils * trigGeomUtils
static const unsigned int BestInChamberByDR
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
static const unsigned int BelongsToTrackByCleaning
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
bool hasRPCTriggers(const edm::Event &e)
checks for RPC Triggers
edm::ESHandle< DTGeometry > muonGeom
int nevents
To reset the MEs.
Phi_Container const * getContainer() const
std::vector< std::string > processTags
static const unsigned int BelongsToTrackByDR
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
DTTriggerEfficiencyTask(const edm::ParameterSet &ps)
Constructor.
edm::InputTag inputTagSEG
int station() const
Return the station number.
int wheel() const
Return the wheel number.
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.
~DTTriggerEfficiencyTask() override
Destructor.
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)