40 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Constructor"<<endl;
49 if (detailedAnalysis){
70 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << endl;
78 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: BeginJob" << endl;
86 stringstream wheel; wheel << chId.
wheel();
87 stringstream sector; sector << chId.
sector();
91 "/Station" + station.str() +
"/Segment");
93 string chTag =
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
94 std::map<std::string, MonitorElement*> &chambMap =
chHistos[chId.
rawId()];
96 string hName =
"DCC_PhiResidual";
98 hName =
"DCC_PhibResidual";
103 hName =
"DCC_PhitkvsPhitrig";
104 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local position: segment vs trigger",100,-500.,500.,100,-500.,500.);
105 hName =
"DCC_PhibtkvsPhibtrig";
106 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local direction : segment vs trigger",200,-40.,40.,200,-40.,40.);
107 hName =
"DCC_PhibResidualvsTkPos";
108 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local direction residual vs Segment Position",100,-500.,500.,200,-10.,10.);
109 hName =
"DCC_PhiResidualvsTkPos";
110 chambMap[hName] =
dbe->
book2D(hName+chTag,
"Local Position residual vs Segment Position",100,-500.,500.,200,-10.,10.);
120 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: BeginRun" << endl;
125 std::vector<DTChamber*>::const_iterator chambIt =
muonGeom->chambers().begin();
126 std::vector<DTChamber*>::const_iterator chambEnd =
muonGeom->chambers().end();
128 for (; chambIt!=chambEnd; ++chambIt)
137 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Begin of LS transition" << endl;
141 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Cleaning histos" << endl;
142 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambIt =
chHistos.begin();
143 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambEnd =
chHistos.end();
145 for(; chambIt!=chambEnd; ++chambIt) {
146 map<string, MonitorElement*> ::const_iterator histoIt = chambIt->second.begin();
147 map<string, MonitorElement*> ::const_iterator histoEnd = chambIt->second.end();
148 for(; histoIt!=histoEnd; ++ histoIt) {
149 histoIt->second->Reset();
160 LogVerbatim(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << endl;
172 vector<L1MuDTChambPhDigi>* trigs = trigHandle->getContainer();
180 vector<const DTRecSegment4D*> best4DSegments;
182 for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId){
192 for (; trackIt!=trackEnd; ++trackIt){
194 if(trackIt->hasPhi()) {
197 tmpBest = &(*trackIt);
204 if (tmpBest) best4DSegments.push_back(tmpBest);
208 vector<const DTRecSegment4D*>::const_iterator bestTrackIt = best4DSegments.begin();
209 vector<const DTRecSegment4D*>::const_iterator bestTrackEnd = best4DSegments.end();
211 for (; bestTrackIt!=bestTrackEnd; ++bestTrackIt) {
213 if((*bestTrackIt)->hasPhi()) {
216 int nHitsPhi = (*bestTrackIt)->phiSegment()->degreesOfFreedom()+2;
218 int wheel = chId.
wheel();
221 float trackPosPhi, trackPosEta, trackDirPhi, trackDirEta;
224 map<string, MonitorElement*> &chMap =
chHistos[chId.
rawId()];
234 double deltaPos = trigPos-trackPosPhi;
236 double deltaDir = trigDir-trackDirPhi;
238 chMap.find(
"DCC_PhiResidual")->second->Fill(deltaPos);
239 chMap.find(
"DCC_PhibResidual")->second->Fill(deltaDir);
242 chMap.find(
"DCC_PhitkvsPhitrig")->second->Fill(trigPos,trackPosPhi);
243 chMap.find(
"DCC_PhibtkvsPhibtrig")->second->Fill(trigDir,trackDirPhi);
244 chMap.find(
"DCC_PhibResidualvsTkPos")->second->Fill(trackPosPhi,trigDir-trackDirPhi);
245 chMap.find(
"DCC_PhiResidualvsTkPos")->second->Fill(trackPosPhi,trigPos-trackPosPhi);
262 for (
int st=0;st<=4;++st)
263 for (
int wh=0;wh<=5;++wh)
264 for (
int sec=0;sec<=12;++sec)
267 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
268 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
269 for(; trigIt!=trigEnd; ++trigIt) {
271 int wh = trigIt->whNum();
272 int sec = trigIt->scNum() + 1;
273 int st = trigIt->stNum();
274 int qual = trigIt->code();
278 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.
virtual int degreesOfFreedom() const
return the DOF of the segment
void rmdir(const std::string &fullpath)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
std::string & topFolder()
Get the top folder.
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
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
uint32_t rawId() const
get the raw id
C::const_iterator const_iterator
constant access iterator type
virtual ~DTLocalTriggerLutTask()
Destructor.
const T & max(const T &a, const T &b)
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
void searchDccBest(std::vector< L1MuDTChambPhDigi > *trigs)
Find best (highest qual) DCC trigger segments.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos
DTTrigGeomUtils * trigGeomUtils
edm::InputTag dccInputTag
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)
edm::InputTag segInputTag