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;
139 if (!((*mu).isStandAloneMuon())) {
144 const vector<reco::MuonChamberMatch> matchedChambers = (*mu).matches();
145 vector<reco::MuonChamberMatch>::const_iterator
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();
256 int wh = dtCh.
wheel();
267 string bookingFolder =
273 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
274 <<
"[DTTriggerEfficiencyTask]: booking histos in " << bookingFolder << endl;
281 string histoLabel =
"Position vs Angle (phi)";
287 histoLabel =
"Position vs Angle (phi) for any qual triggers";
293 histoLabel =
"Position vs Angle (phi) for correlated triggers";
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;
320 me->setBinLabel(1,
"MB1", 2);
321 me->setBinLabel(2,
"MB2", 2);
322 me->setBinLabel(3,
"MB3", 2);
323 me->setBinLabel(4,
"MB4", 2);
324 me->setAxisTitle(
"Sector", 1);
328 hName = hTag +
"_TrigEffNum" + hTagName;
329 me = ibooker.
book2D(hName.c_str(), hName.c_str(), 12, 1, 13, 4, 1, 5);
331 me->setBinLabel(1,
"MB1", 2);
332 me->setBinLabel(2,
"MB2", 2);
333 me->setBinLabel(3,
"MB3", 2);
334 me->setBinLabel(4,
"MB4", 2);
335 me->setAxisTitle(
"Sector", 1);
339 hName = hTag +
"_TrigEffCorrNum" + hTagName;
340 me = ibooker.
book2D(hName.c_str(), hName.c_str(), 12, 1, 13, 4, 1, 5);
342 me->setBinLabel(1,
"MB1", 2);
343 me->setBinLabel(2,
"MB2", 2);
344 me->setBinLabel(3,
"MB3", 2);
345 me->setBinLabel(4,
"MB4", 2);
346 me->setAxisTitle(
"Sector", 1);
int station() const
Return the station number.
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmt_Token_
virtual void setCurrentFolder(std::string const &fullpath)
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
std::string SegmArbitration
edm::EDGetTokenT< reco::MuonCollection > muons_Token_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::string topFolder()
return the top folder
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
Log< level::Error, false > LogError
T getUntrackedParameter(std::string const &, T const &) const
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
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
Phi_Container const * getContainer() const
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
int nevents
To reset the MEs.
constexpr uint32_t rawId() const
get the raw id
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
std::vector< std::string > processTags
static const unsigned int BelongsToTrackByDR
int wheel() const
Return the wheel number.
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
DTTriggerEfficiencyTask(const edm::ParameterSet &ps)
Constructor.
const DTGeometry * muonGeom
edm::InputTag inputTagSEG
edm::ParameterSet parameters
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.