37 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Constructor"<<endl;
43 seg_Token_ = consumes<DTRecSegment4DCollection>(
50 if (detailedAnalysis){
73 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << endl;
88 stringstream sector; sector << chId.
sector();
92 "/Station" + station.str() +
"/Segment");
94 string chTag =
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
95 std::map<std::string, MonitorElement*> &chambMap =
chHistos[chId.
rawId()];
97 string hName =
"TM_PhiResidualIn";
99 chambMap[hName] = ibooker.
book1D(hName+chTag,
"Trigger local position In - Segment local position (correlated triggers)",
nPhiBins,-
rangePhi,
rangePhi);
101 hName =
"TM_PhiResidualOut";
103 chambMap[hName] = ibooker.
book1D(hName+chTag,
"Trigger local position Out - Segment local position (correlated triggers)",
nPhiBins,-
rangePhi,
rangePhi);
105 hName =
"TM_PhibResidualIn";
109 hName =
"TM_PhibResidualOut";
116 hName =
"TM_PhitkvsPhitrig";
118 chambMap[hName] = ibooker.
book2D(hName+chTag,
"Local position: segment vs trigger",100,-500.,500.,100,-500.,500.);
119 hName =
"TM_PhibtkvsPhibtrig";
121 chambMap[hName] =ibooker.
book2D(hName+chTag,
"Local direction : segment vs trigger",200,-40.,40.,200,-40.,40.);
122 hName =
"TM_PhibResidualvsTkPos";
124 chambMap[hName] =ibooker.
book2D(hName+chTag,
"Local direction residual vs Segment Position",100,-500.,500.,200,-10.,10.);
125 hName =
"TM_PhiResidualvsTkPos";
127 chambMap[hName] =ibooker.
book2D(hName+chTag,
"Local Position residual vs Segment Position",100,-500.,500.,200,-10.,10.);
137 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: bookHistograms" << endl;
139 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
140 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
142 for (; chambIt!=chambEnd; ++chambIt)
151 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Begin of LS transition" << endl;
155 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Cleaning histos" << endl;
156 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambIt =
chHistos.begin();
157 map<uint32_t, map<string, MonitorElement*> > ::const_iterator chambEnd =
chHistos.end();
159 for(; chambIt!=chambEnd; ++chambIt) {
160 map<string, MonitorElement*> ::const_iterator histoIt = chambIt->second.begin();
161 map<string, MonitorElement*> ::const_iterator histoEnd = chambIt->second.end();
162 for(; histoIt!=histoEnd; ++ histoIt) {
163 histoIt->second->Reset();
182 vector<L1MuDTChambPhDigi>
const* trigsIn = trigHandleIn->
getContainer();
184 vector<L1MuDTChambPhDigi>
const* trigsOut = trigHandleOut->
getContainer();
189 DTRecSegment4DCollection::id_iterator chamberId;
192 vector<const DTRecSegment4D*> best4DSegments;
194 for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId){
204 for (; trackIt!=trackEnd; ++trackIt){
206 if(trackIt->hasPhi()) {
207 dof = trackIt->phiSegment()->degreesOfFreedom();
209 tmpBest = &(*trackIt);
216 if (tmpBest) best4DSegments.push_back(tmpBest);
220 vector<const DTRecSegment4D*>::const_iterator bestTrackIt = best4DSegments.begin();
221 vector<const DTRecSegment4D*>::const_iterator bestTrackEnd = best4DSegments.end();
223 for (; bestTrackIt!=bestTrackEnd; ++bestTrackIt) {
225 if((*bestTrackIt)->hasPhi()) {
228 int nHitsPhi = (*bestTrackIt)->phiSegment()->degreesOfFreedom()+2;
233 float trackPosPhi, trackPosEta, trackDirPhi, trackDirEta;
236 map<string, MonitorElement*> &chMap =
chHistos[chId.
rawId()];
246 double deltaPos = trigPos-trackPosPhi;
248 double deltaDir = trigDir-trackDirPhi;
250 chMap.find(
"TM_PhiResidualIn")->second->Fill(deltaPos);
251 chMap.find(
"TM_PhibResidualIn")->second->Fill(deltaDir);
254 chMap.find(
"TM_PhitkvsPhitrig")->second->Fill(trigPos,trackPosPhi);
255 chMap.find(
"TM_PhibtkvsPhibtrig")->second->Fill(trigDir,trackDirPhi);
256 chMap.find(
"TM_PhibResidualvsTkPos")->second->Fill(trackPosPhi,trigDir-trackDirPhi);
257 chMap.find(
"TM_PhiResidualvsTkPos")->second->Fill(trackPosPhi,trigPos-trackPosPhi);
270 double deltaPos = trigPos-trackPosPhi;
272 double deltaDir = trigDir-trackDirPhi;
274 chMap.find(
"TM_PhiResidualOut")->second->Fill(deltaPos);
275 chMap.find(
"TM_PhibResidualOut")->second->Fill(deltaDir);
289 for (
int st=0;st<=4;++st)
290 for (
int wh=0;wh<=5;++wh)
291 for (
int sec=0;sec<=12;++sec)
294 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
295 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
296 for(; trigIt!=trigEnd; ++trigIt) {
298 int wh = trigIt->whNum();
299 int sec = trigIt->scNum() + 1;
300 int st = trigIt->stNum();
301 int qual = trigIt->code();
320 for (
int st=0;st<=4;++st)
321 for (
int wh=0;wh<=5;++wh)
322 for (
int sec=0;sec<=12;++sec)
325 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
326 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
327 for(; trigIt!=trigEnd; ++trigIt) {
329 int wh = trigIt->whNum();
330 int sec = trigIt->scNum() + 1;
331 int st = trigIt->stNum();
332 int qual = trigIt->code();
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
Book histos.
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
To reset the MEs.
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
std::pair< const_iterator, const_iterator > range
iterator range
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
~DTLocalTriggerLutTask() override
Destructor.
void searchTMBestOut(std::vector< L1MuDTChambPhDigi > const *trigs)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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.
constexpr uint32_t rawId() const
get the raw id
const int wheelArrayShift
edm::ESHandle< DTGeometry > muonGeom
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
void setCurrentFolder(std::string const &fullpath)
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_TokenOut_
DTArr3int trigQualBestOut
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
MonitorElement * book1D(Args &&...args)
void searchTMBestIn(std::vector< L1MuDTChambPhDigi > const *trigs)
Find best (highest qual) TM trigger segments.
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_TokenIn_
std::map< uint32_t, std::map< std::string, MonitorElement * > > chHistos
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
BeginRun.
DTTrigGeomUtils * trigGeomUtils
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bookHistograms
MonitorElement * book2D(Args &&...args)
Phi_Container const * getContainer() const
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.