37 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Constructor"<<endl;
41 seg_Token_ = consumes<DTRecSegment4DCollection>(
48 if (detailedAnalysis){
69 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << endl;
77 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: BeginJob" << endl;
85 stringstream wheel; wheel << chId.
wheel();
86 stringstream sector; sector << chId.
sector();
90 "/Station" + station.str() +
"/Segment");
92 string chTag =
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
93 std::map<std::string, MonitorElement*> &chambMap =
chHistos[chId.
rawId()];
95 string hName =
"DCC_PhiResidual";
97 hName =
"DCC_PhibResidual";
102 hName =
"DCC_PhitkvsPhitrig";
103 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local position: segment vs trigger",100,-500.,500.,100,-500.,500.);
104 hName =
"DCC_PhibtkvsPhibtrig";
105 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local direction : segment vs trigger",200,-40.,40.,200,-40.,40.);
106 hName =
"DCC_PhibResidualvsTkPos";
107 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local direction residual vs Segment Position",100,-500.,500.,200,-10.,10.);
108 hName =
"DCC_PhiResidualvsTkPos";
109 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local Position residual vs Segment Position",100,-500.,500.,200,-10.,10.);
119 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: BeginRun" << endl;
124 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->chambers().begin();
125 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->chambers().end();
127 for (; chambIt!=chambEnd; ++chambIt)
136 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Begin of LS transition" << endl;
140 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Cleaning histos" << endl;
141 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambIt =
chHistos.begin();
142 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambEnd =
chHistos.end();
144 for(; chambIt!=chambEnd; ++chambIt) {
145 map<string, MonitorElement*> ::const_iterator histoIt = chambIt->second.begin();
146 map<string, MonitorElement*> ::const_iterator histoEnd = chambIt->second.end();
147 for(; histoIt!=histoEnd; ++ histoIt) {
148 histoIt->second->Reset();
159 LogVerbatim(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << endl;
171 vector<L1MuDTChambPhDigi>
const* trigs = trigHandle->getContainer();
176 DTRecSegment4DCollection::id_iterator chamberId;
179 vector<const DTRecSegment4D*> best4DSegments;
181 for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId){
191 for (; trackIt!=trackEnd; ++trackIt){
193 if(trackIt->hasPhi()) {
194 dof = trackIt->phiSegment()->degreesOfFreedom();
196 tmpBest = &(*trackIt);
203 if (tmpBest) best4DSegments.push_back(tmpBest);
207 vector<const DTRecSegment4D*>::const_iterator bestTrackIt = best4DSegments.begin();
208 vector<const DTRecSegment4D*>::const_iterator bestTrackEnd = best4DSegments.end();
210 for (; bestTrackIt!=bestTrackEnd; ++bestTrackIt) {
212 if((*bestTrackIt)->hasPhi()) {
215 int nHitsPhi = (*bestTrackIt)->phiSegment()->degreesOfFreedom()+2;
217 int wheel = chId.
wheel();
220 float trackPosPhi, trackPosEta, trackDirPhi, trackDirEta;
223 map<string, MonitorElement*> &chMap =
chHistos[chId.
rawId()];
233 double deltaPos = trigPos-trackPosPhi;
235 double deltaDir = trigDir-trackDirPhi;
237 chMap.find(
"DCC_PhiResidual")->second->Fill(deltaPos);
238 chMap.find(
"DCC_PhibResidual")->second->Fill(deltaDir);
241 chMap.find(
"DCC_PhitkvsPhitrig")->second->Fill(trigPos,trackPosPhi);
242 chMap.find(
"DCC_PhibtkvsPhibtrig")->second->Fill(trigDir,trackDirPhi);
243 chMap.find(
"DCC_PhibResidualvsTkPos")->second->Fill(trackPosPhi,trigDir-trackDirPhi);
244 chMap.find(
"DCC_PhiResidualvsTkPos")->second->Fill(trackPosPhi,trigPos-trackPosPhi);
258 for (
int st=0;st<=4;++st)
259 for (
int wh=0;wh<=5;++wh)
260 for (
int sec=0;sec<=12;++sec)
263 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
264 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
265 for(; trigIt!=trigEnd; ++trigIt) {
267 int wh = trigIt->whNum();
268 int sec = trigIt->scNum() + 1;
269 int st = trigIt->stNum();
270 int qual = trigIt->code();
274 trigBest[wh+3][st][sec] = &(*trigIt);
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const_iterator, const_iterator > range
iterator range
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
std::string & topFolder()
Get the top folder.
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
DTLocalTriggerLutTask(const edm::ParameterSet &ps)
Constructor.
edm::ParameterSet parameters
edm::ESHandle< DTGeometry > muonGeom
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
uint32_t rawId() const
get the raw id
virtual ~DTLocalTriggerLutTask()
Destructor.
edm::EDGetTokenT< L1MuDTChambPhContainer > dcc_Token_
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos
DTTrigGeomUtils * trigGeomUtils
int trigQualBest[6][5][13]
void beginRun(const edm::Run &, const edm::EventSetup &)
BeginRun.
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
To reset the MEs.
void bookHistos(DTChamberId chId)
Book histos.
const L1MuDTChambPhDigi * trigBest[6][5][13]
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
int station() const
Return the station number.
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 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)
void searchDccBest(std::vector< L1MuDTChambPhDigi > const *trigs)
Find best (highest qual) DCC trigger segments.