50 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: Constructor" << endl;
60 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: analyzed " <<
nevents <<
" events" << endl;
67 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: BeginJob" << endl;
94 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: BeginRun" << endl;
98 for (
int wh=-2;wh<=2;++wh){
99 vector<string>::const_iterator tagIt =
processTags.begin();
100 vector<string>::const_iterator tagEnd =
processTags.end();
101 for (; tagIt!=tagEnd; ++tagIt) {
104 for (
int stat=1;stat<=4;++stat){
105 for (
int sect=1;sect<=12;++sect){
120 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: Begin of LS transition"<<endl;
127 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: analyzed " <<
nevents <<
" events" << endl;
138 map<DTChamberId,const L1MuDTChambPhDigi*> phBestDCC;
139 map<DTChamberId,const DTLocalTrigger*> phBestDDU;
144 vector<L1MuDTChambPhDigi>* phTrigs = l1DTTPGPh->getContainer();
146 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
147 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
148 for(; iph !=iphe ; ++iph) {
150 int phwheel = iph->whNum();
151 int phsec = iph->scNum() + 1;
152 int phst = iph->stNum();
153 int phcode = iph->code();
157 if( phcode < 7 && (phBestDCC.find(chId) == phBestDCC.end() ||
158 phcode>phBestDCC[chId]->code()) ) phBestDCC[chId] = &(*iph);
166 for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
173 for (; trigIt!= trigEnd;++trigIt){
174 int quality = trigIt->quality();
175 if(quality>-1 && quality<7 &&
176 (phBestDDU.find(
id) == phBestDDU.end() ||
177 quality>phBestDDU[
id]->quality()) ) phBestDDU[
id] = &(*trigIt);
183 vector<const DTRecSegment4D*> best4DSegments;
187 reco::MuonCollection::const_iterator
mu;
189 for( mu = muons->begin(); mu != muons->end(); ++
mu ) {
192 if( !((*mu).isStandAloneMuon()) ) {
continue;}
195 const vector<reco::MuonChamberMatch> matchedChambers = (*mu).matches();
196 vector<reco::MuonChamberMatch>::const_iterator chamber;
198 for( chamber = matchedChambers.begin(); chamber != matchedChambers.end(); ++chamber ) {
204 const vector<reco::MuonSegmentMatch> matchedSegments = (*chamber).segmentMatches;
205 vector<reco::MuonSegmentMatch>::const_iterator segment;
207 for( segment = matchedSegments.begin(); segment != matchedSegments.end(); ++segment ) {
225 if( (*dtSegment).hasPhi() ) {
226 best4DSegments.push_back(&(*dtSegment));
234 vector<const DTRecSegment4D*>::const_iterator btrack;
235 for ( btrack = best4DSegments.begin(); btrack != best4DSegments.end(); ++btrack ){
237 int wheel = (*btrack)->chamberId().wheel();
238 int station = (*btrack)->chamberId().station();
242 int nHitsPhi = (*btrack)->phiSegment()->degreesOfFreedom()+2;
244 uint32_t indexCh = dtChId.
rawId();
245 map<string, MonitorElement*> &innerChME =
chamberHistos[indexCh];
246 map<string, MonitorElement*> &innerWhME =
wheelHistos[wheel];
250 vector<string>::const_iterator tagIt =
processTags.begin();
251 vector<string>::const_iterator tagEnd =
processTags.end();
253 for (; tagIt!=tagEnd; ++tagIt) {
255 int qual = (*tagIt) ==
"DCC" ?
256 phBestDCC.find(dtChId) != phBestDCC.end() ? phBestDCC[dtChId]->code() : -1 :
257 phBestDDU.find(dtChId) != phBestDDU.end() ? phBestDDU[dtChId]->quality() : -1;
259 innerWhME.find((*tagIt) +
"_TrigEffDenum")->second->Fill(scsector,station);
260 if ( qual>=0 && qual<7 ) {
261 innerWhME.find((*tagIt) +
"_TrigEffNum")->second->Fill(scsector,station);
263 innerWhME.find((*tagIt) +
"_TrigEffCorrNum")->second->Fill(scsector,station);
267 innerChME.find((*tagIt) +
"_TrackPosvsAngle")->second->Fill(xdir,x);
268 if ( qual>=0 && qual<7 ) {
269 innerChME.find((*tagIt) +
"_TrackPosvsAngleAnyQual")->second->Fill(xdir,x);
271 innerChME.find((*tagIt) +
"_TrackPosvsAngleCorr")->second->Fill(xdir,x);
286 std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
287 std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr = gmt_records.begin();
288 std::vector<L1MuGMTReadoutRecord>::const_iterator egmtrr = gmt_records.end();
289 for(; igmtrr!=egmtrr; igmtrr++) {
291 std::vector<L1MuGMTExtendedCand> candsGMT = igmtrr->getGMTCands();
292 std::vector<L1MuGMTExtendedCand>::const_iterator candGMTIt = candsGMT.begin();
293 std::vector<L1MuGMTExtendedCand>::const_iterator candGMTEnd = candsGMT.end();
295 for(; candGMTIt!=candGMTEnd; ++candGMTIt){
296 if(!candGMTIt->empty()) {
297 int quality = candGMTIt->quality();
298 if(candGMTIt->bx()==0 &&
299 (quality == 5 || quality == 7)){
312 int wh = dtCh.
wheel();
315 stringstream wheel; wheel << wh;
316 stringstream
station; station << st;
317 stringstream sector; sector << sc;
320 string bookingFolder = hwFolder +
"Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() +
"/" + folder;
321 string histoTag =
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
325 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
326 <<
"[DTTriggerEfficiencyTask]: booking histos in " << bookingFolder << endl;
332 string histoName = histoType +
"_TrackPosvsAngle" + histoTag;
333 string histoLabel =
"Position vs Angle (phi)";
335 dbe->
book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
337 histoName = histoType +
"_TrackPosvsAngleAnyQual" + histoTag;
338 histoLabel =
"Position vs Angle (phi) for any qual triggers";
340 dbe->
book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
342 histoName = histoType +
"_TrackPosvsAngleCorr" + histoTag;
343 histoLabel =
"Position vs Angle (phi) for correlated triggers";
345 dbe->
book2D(histoName,histoLabel,12,-30.,30.,nbins,min,max);
351 stringstream wh; wh << wheel;
353 if (hTag.find(
"Summary") != string::npos ) {
356 basedir =
topFolder(hTag) + folder +
"/" ;
361 string hTagName =
"_W" + wh.str();
363 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask")
364 <<
"[DTTriggerEfficiencyTask]: booking histos in "<< basedir << endl;
366 string hName = hTag +
"_TrigEffDenum" + hTagName;
377 hName = hTag +
"_TrigEffNum" + hTagName;
378 me =
dbe->
book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
388 hName = hTag +
"_TrigEffCorrNum" + hTagName;
389 me =
dbe->
book2D(hName.c_str(),hName.c_str(),12,1,13,4,1,5);
T getUntrackedParameter(std::string const &, T const &) const
std::string SegmArbitration
void bookChamberHistos(const DTChamberId &dtCh, std::string histoTag, std::string folder="")
Book chamber granularity histograms.
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)
std::map< int, std::map< std::string, MonitorElement * > > wheelHistos
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
To reset the MEs.
uint32_t rawId() const
get the raw id
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
edm::InputTag inputTagMuons
void beginRun(const edm::Run &run, const edm::EventSetup &context)
BeginRun.
const T & max(const T &a, const T &b)
edm::InputTag inputTagDCC
DTTrigGeomUtils * trigGeomUtils
static const unsigned int BestInChamberByDR
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
virtual ~DTTriggerEfficiencyTask()
Destructor.
std::vector< DigiType >::const_iterator const_iterator
std::vector< std::string > processTags
static const unsigned int BelongsToTrackByDR
void bookWheelHistos(int wheel, std::string histoTag, std::string folder="")
Book wheel granularity histograms.
edm::InputTag inputTagGMT
std::pair< const_iterator, const_iterator > Range
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.
edm::ParameterSet parameters
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
int wheel() const
Return the wheel number.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::string topFolder(std::string source)
return the top folder
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.
edm::InputTag inputTagDDU
void setCurrentFolder(const std::string &fullpath)