48 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: Constructor" << endl;
58 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: analyzed " <<
nevents <<
" events" << endl;
65 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: BeginJob" << endl;
75 for (
int wh=-2;wh<=2;++wh){
81 for (
int stat=1;stat<=4;++stat){
82 for (
int sect=1;sect<=12;++sect){
96 for (
int stat=1;stat<=4;++stat){
97 for (
int sect=1;sect<=12;++sect){
112 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: BeginRun" << endl;
121 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: Begin of LS transition"<<endl;
128 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: analyzed " <<
nevents <<
" events" << endl;
145 for (
int i=0;
i<5;++
i){
146 for (
int j=0;
j<6;++
j){
147 for (
int k=0;
k<13;++
k){
157 vector<L1MuDTChambPhDigi>* phTrigs = l1DTTPGPh->getContainer();
159 vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin();
160 vector<L1MuDTChambPhDigi>::const_iterator iphe = phTrigs->end();
161 for(; iph !=iphe ; ++iph) {
163 int phwheel = iph->whNum();
164 int phsec = iph->scNum() + 1;
165 int phst = iph->stNum();
166 int phcode = iph->code();
168 if(phcode>
phCodeBestDCC[phwheel+3][phst][phsec] && phcode<7) {
170 phBestDCC[phwheel+3][phst][phsec] = &(*iph);
179 for (detUnitIt=trigsDDU->begin();detUnitIt!=trigsDDU->end();++detUnitIt){
185 int sec =
id.sector();
186 int st =
id.station();
190 int quality = trigIt->quality();
192 if(quality>-1 && quality<7 &&
201 vector<const DTRecSegment4D*> best4DSegments;
208 for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId){
215 for ( track = range.first; track != range.second; ++track){
216 if( (*track).hasPhi() ) {
217 hit = (*track).phiSegment()->degreesOfFreedom()+2;
232 best4DSegments.push_back(tmpBest);
237 vector<const DTRecSegment4D*>::const_iterator btrack;
238 for ( btrack = best4DSegments.begin(); btrack != best4DSegments.end(); ++btrack ){
240 int wheel = (*btrack)->chamberId().wheel();
241 int station = (*btrack)->chamberId().station();
245 int nHitsPhi = (*btrack)->phiSegment()->degreesOfFreedom()+2;
247 uint32_t indexCh = dtChId.
rawId();
248 map<string, MonitorElement*> &innerChME =
chamberHistos[indexCh];
249 map<string, MonitorElement*> &innerWhME =
wheelHistos[wheel];
251 if (fabs(xdir)<30. && nHitsPhi>=7){
255 innerWhME.find(
"DCC_TrigEffDenum")->second->Fill(scsector,station);
256 if ( qual>=0 && qual<7 ) {
257 innerWhME.find(
"DCC_TrigEffNum")->second->Fill(scsector,station);
259 innerWhME.find(
"DCC_TrigEffCorrNum")->second->Fill(scsector,station);
266 innerChME.find(
"DCC_TrackPosvsAngle")->second->Fill(xdir,x);
267 if ( qual>=0 && qual<7 ) {
268 innerChME.find(
"DCC_TrackPosvsAngleAnyQual")->second->Fill(xdir,x);
270 innerChME.find(
"DCC_TrackPosvsAngleCorr")->second->Fill(xdir,x);
281 innerWhME.find(
"DDU_TrigEffDenum")->second->Fill(scsector,station);
282 bool qualOK = qual>=0 && qual<7;
285 innerWhME.find(
"DDU_TrigEffNum")->second->Fill(scsector,station);
287 innerWhME.find(
"DDU_TrigEffCorrNum")->second->Fill(scsector,station);
294 innerChME.find(
"DDU_TrackPosvsAngle")->second->Fill(xdir,x);
296 innerChME.find(
"DDU_TrackPosvsAngleAnyQual")->second->Fill(xdir,x);
298 innerChME.find(
"DDU_TrackPosvsAngleCorr")->second->Fill(xdir,x);
317 std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
318 std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr;
320 for(igmtrr=gmt_records.begin(); igmtrr!=gmt_records.end(); igmtrr++) {
321 if( (*igmtrr).getBxInEvent()==0 ) {
322 std::vector<L1MuRegionalCand>::const_iterator iter1;
323 std::vector<L1MuRegionalCand> rmc = (*igmtrr).getBrlRPCCands();
324 for(iter1=rmc.begin(); iter1!=rmc.end(); iter1++) {
325 if ( !(*iter1).empty() ) {
338 int wh = dtCh.
wheel();
341 stringstream wheel; wheel << wh;
342 stringstream
station; station << st;
343 stringstream sector; sector << sc;
345 string histoType = histoTag.substr(4,histoTag.find(
"_",4)-4);
346 string hwFolder =
topFolder(histoTag.substr(0,3)==
"DCC");
347 string bookingFolder = hwFolder +
"Wheel" + wheel.str() +
"/Sector" + sector.str() +
"/Station" + station.str() +
"/" + folder;
348 string histoName = histoTag +
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
352 LogTrace (
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: booking " << bookingFolder <<
"/" << histoName << endl;
354 if( histoType.find(
"TrackPosvsAngle") == 0 ){
358 string histoLabel =
"Position vs Angle (phi)";
359 if (histoType.find(
"Corr") != string::npos) histoLabel +=
" for correlated triggers";
360 else if (histoType.find(
"AnyQual") != string::npos) histoLabel +=
" for any qual triggers";
369 stringstream wh; wh << wheel;
371 bool isDCC = hTag.substr(0,3)==
"DCC" ;
372 if (hTag.find(
"Summary") != string::npos ) {
375 basedir =
topFolder(isDCC) +
"Wheel" + wh.str() +
"/" ;
379 basedir += folder +
"/" ;
383 string hname = hTag+
"_W" + wh.str();
385 LogTrace(
"DTDQM|DTMonitorModule|DTTriggerEfficiencyTask") <<
"[DTTriggerEfficiencyTask]: booking "<< basedir << hname;
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const_iterator, const_iterator > range
iterator range
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)
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
const DTLocalTrigger * phBestDDU[6][5][13]
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
C::const_iterator const_iterator
constant access iterator type
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
std::string topFolder(bool source)
return the top folder 0=DDU 1=DCC
void beginRun(const edm::Run &run, const edm::EventSetup &context)
BeginRun.
const T & max(const T &a, const T &b)
DTTrigGeomUtils * trigGeomUtils
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
const L1MuDTChambPhDigi * phBestDCC[6][5][13]
bool hasRPCTriggers(const edm::Event &e)
checks for RPC Triggers
edm::ESHandle< DTGeometry > muonGeom
virtual ~DTTriggerEfficiencyTask()
Destructor.
std::vector< DigiType >::const_iterator const_iterator
int phCodeBestDDU[6][5][13]
void bookWheelHistos(int wheel, std::string histoTag, std::string folder="")
Book wheel granularity histograms.
std::pair< const_iterator, const_iterator > Range
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
DTTriggerEfficiencyTask(const edm::ParameterSet &ps)
Constructor.
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)
int phCodeBestDCC[6][5][13]
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.
void setCurrentFolder(const std::string &fullpath)