37 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Constructor"<<endl;
41 seg_Token_ = consumes<DTRecSegment4DCollection>(
48 if (detailedAnalysis){
71 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << 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";
98 hName =
"DCC_PhibResidual";
104 hName =
"DCC_PhitkvsPhitrig";
106 chambMap[hName] = ibooker.
book2D(hName+chTag,
"Local position: segment vs trigger",100,-500.,500.,100,-500.,500.);
107 hName =
"DCC_PhibtkvsPhibtrig";
109 chambMap[hName] =ibooker.
book2D(hName+chTag,
"Local direction : segment vs trigger",200,-40.,40.,200,-40.,40.);
110 hName =
"DCC_PhibResidualvsTkPos";
112 chambMap[hName] =ibooker.
book2D(hName+chTag,
"Local direction residual vs Segment Position",100,-500.,500.,200,-10.,10.);
113 hName =
"DCC_PhiResidualvsTkPos";
115 chambMap[hName] =ibooker.
book2D(hName+chTag,
"Local Position residual vs Segment Position",100,-500.,500.,200,-10.,10.);
125 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: bookHistograms" << endl;
127 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->chambers().begin();
128 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->chambers().end();
130 for (; chambIt!=chambEnd; ++chambIt)
139 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Begin of LS transition" << endl;
143 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Cleaning histos" << endl;
144 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambIt =
chHistos.begin();
145 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambEnd =
chHistos.end();
147 for(; chambIt!=chambEnd; ++chambIt) {
148 map<string, MonitorElement*> ::const_iterator histoIt = chambIt->second.begin();
149 map<string, MonitorElement*> ::const_iterator histoEnd = chambIt->second.end();
150 for(; histoIt!=histoEnd; ++ histoIt) {
151 histoIt->second->Reset();
167 vector<L1MuDTChambPhDigi>
const* trigs = trigHandle->getContainer();
172 DTRecSegment4DCollection::id_iterator chamberId;
175 vector<const DTRecSegment4D*> best4DSegments;
177 for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId){
187 for (; trackIt!=trackEnd; ++trackIt){
189 if(trackIt->hasPhi()) {
190 dof = trackIt->phiSegment()->degreesOfFreedom();
192 tmpBest = &(*trackIt);
199 if (tmpBest) best4DSegments.push_back(tmpBest);
203 vector<const DTRecSegment4D*>::const_iterator bestTrackIt = best4DSegments.begin();
204 vector<const DTRecSegment4D*>::const_iterator bestTrackEnd = best4DSegments.end();
206 for (; bestTrackIt!=bestTrackEnd; ++bestTrackIt) {
208 if((*bestTrackIt)->hasPhi()) {
211 int nHitsPhi = (*bestTrackIt)->phiSegment()->degreesOfFreedom()+2;
213 int wheel = chId.
wheel();
216 float trackPosPhi, trackPosEta, trackDirPhi, trackDirEta;
219 map<string, MonitorElement*> &chMap =
chHistos[chId.
rawId()];
229 double deltaPos = trigPos-trackPosPhi;
231 double deltaDir = trigDir-trackDirPhi;
233 chMap.find(
"DCC_PhiResidual")->second->Fill(deltaPos);
234 chMap.find(
"DCC_PhibResidual")->second->Fill(deltaDir);
237 chMap.find(
"DCC_PhitkvsPhitrig")->second->Fill(trigPos,trackPosPhi);
238 chMap.find(
"DCC_PhibtkvsPhibtrig")->second->Fill(trigDir,trackDirPhi);
239 chMap.find(
"DCC_PhibResidualvsTkPos")->second->Fill(trackPosPhi,trigDir-trackDirPhi);
240 chMap.find(
"DCC_PhiResidualvsTkPos")->second->Fill(trackPosPhi,trigPos-trackPosPhi);
254 for (
int st=0;st<=4;++st)
255 for (
int wh=0;wh<=5;++wh)
256 for (
int sec=0;sec<=12;++sec)
259 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
260 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
261 for(; trigIt!=trigEnd; ++trigIt) {
263 int wh = trigIt->whNum();
264 int sec = trigIt->scNum() + 1;
265 int st = trigIt->stNum();
266 int qual = trigIt->code();
270 trigBest[wh+3][st][sec] = &(*trigIt);
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
Book histos.
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const_iterator, const_iterator > range
iterator range
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 dqmBeginRun(const edm::Run &, const edm::EventSetup &)
BeginRun.
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
MonitorElement * book1D(Args &&...args)
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos
DTTrigGeomUtils * trigGeomUtils
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bookHistograms
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
int trigQualBest[6][5][13]
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
To reset the MEs.
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.
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 searchDccBest(std::vector< L1MuDTChambPhDigi > const *trigs)
Find best (highest qual) DCC trigger segments.