35 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Constructor" << endl;
45 if (detailedAnalysis) {
65 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask")
66 <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << endl;
80 wheel << chId.
wheel();
89 string chTag =
"_W" + wheel.str() +
"_Sec" + sector.str() +
"_St" + station.str();
90 std::map<std::string, MonitorElement*>& chambMap =
chHistos[chId.
rawId()];
92 string hName =
"TM_PhiResidualIn";
94 chambMap[hName] = ibooker.
book1D(hName + chTag,
95 "Trigger local position In - Segment local position (correlated triggers)",
100 hName =
"TM_PhiResidualOut";
102 chambMap[hName] = ibooker.
book1D(hName + chTag,
103 "Trigger local position Out - Segment local position (correlated triggers)",
108 hName =
"TM_PhibResidualIn";
110 chambMap[hName] = ibooker.
book1D(hName + chTag,
111 "Trigger local direction In - Segment local direction (correlated triggers)",
116 hName =
"TM_PhibResidualOut";
118 chambMap[hName] = ibooker.
book1D(hName + chTag,
119 "Trigger local direction Out - Segment local direction (correlated triggers)",
125 hName =
"TM_PhitkvsPhitrig";
128 ibooker.
book2D(hName + chTag,
"Local position: segment vs trigger", 100, -500., 500., 100, -500., 500.);
129 hName =
"TM_PhibtkvsPhibtrig";
132 ibooker.
book2D(hName + chTag,
"Local direction : segment vs trigger", 200, -40., 40., 200, -40., 40.);
133 hName =
"TM_PhibResidualvsTkPos";
136 ibooker.
book2D(hName + chTag,
"Local direction residual vs Segment Position", 100, -500., 500., 200, -10., 10.);
137 hName =
"TM_PhiResidualvsTkPos";
140 ibooker.
book2D(hName + chTag,
"Local Position residual vs Segment Position", 100, -500., 500., 200, -10., 10.);
147 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: bookHistograms" << endl;
149 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
150 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
152 for (; chambIt != chambEnd; ++chambIt)
158 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Begin of LS transition" << endl;
161 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Cleaning histos" << endl;
162 map<uint32_t, map<string, MonitorElement*> >::const_iterator chambIt =
chHistos.begin();
163 map<uint32_t, map<string, MonitorElement*> >::const_iterator chambEnd =
chHistos.end();
165 for (; chambIt != chambEnd; ++chambIt) {
166 map<string, MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
167 map<string, MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
168 for (; histoIt != histoEnd; ++histoIt) {
169 histoIt->second->Reset();
183 vector<L1MuDTChambPhDigi>
const* trigsIn = trigHandleIn->
getContainer();
185 vector<L1MuDTChambPhDigi>
const* trigsOut = trigHandleOut->
getContainer();
193 vector<const DTRecSegment4D*> best4DSegments;
195 for (chamberId = segments4D->id_begin(); chamberId != segments4D->id_end(); ++chamberId) {
204 for (; trackIt != trackEnd; ++trackIt) {
205 if (trackIt->hasPhi()) {
206 dof = trackIt->phiSegment()->degreesOfFreedom();
208 tmpBest = &(*trackIt);
215 best4DSegments.push_back(tmpBest);
218 vector<const DTRecSegment4D*>::const_iterator bestTrackIt = best4DSegments.begin();
219 vector<const DTRecSegment4D*>::const_iterator bestTrackEnd = best4DSegments.end();
221 for (; bestTrackIt != bestTrackEnd; ++bestTrackIt) {
222 if ((*bestTrackIt)->hasPhi()) {
224 int nHitsPhi = (*bestTrackIt)->phiSegment()->degreesOfFreedom() + 2;
229 float trackPosPhi, trackPosEta, trackDirPhi, trackDirEta;
232 map<string, MonitorElement*>& chMap =
chHistos[chId.
rawId()];
235 trigQualBestIn[wheel + 3][station][scsector] < 7 && nHitsPhi >= 7) {
240 double deltaPos = trigPos - trackPosPhi;
242 double deltaDir = trigDir - trackDirPhi;
244 chMap.find(
"TM_PhiResidualIn")->second->Fill(deltaPos);
245 chMap.find(
"TM_PhibResidualIn")->second->Fill(deltaDir);
248 chMap.find(
"TM_PhitkvsPhitrig")->second->Fill(trigPos, trackPosPhi);
249 chMap.find(
"TM_PhibtkvsPhibtrig")->second->Fill(trigDir, trackDirPhi);
250 chMap.find(
"TM_PhibResidualvsTkPos")->second->Fill(trackPosPhi, trigDir - trackDirPhi);
251 chMap.find(
"TM_PhiResidualvsTkPos")->second->Fill(trackPosPhi, trigPos - trackPosPhi);
262 double deltaPos = trigPos - trackPosPhi;
264 double deltaDir = trigDir - trackDirPhi;
266 chMap.find(
"TM_PhiResidualOut")->second->Fill(deltaPos);
267 chMap.find(
"TM_PhibResidualOut")->second->Fill(deltaDir);
279 for (
int st = 0; st <= 4; ++st)
280 for (
int wh = 0; wh <= 5; ++wh)
284 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
285 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
286 for (; trigIt != trigEnd; ++trigIt) {
287 int wh = trigIt->whNum();
288 int sec = trigIt->scNum() + 1;
289 int st = trigIt->stNum();
290 int qual = trigIt->code();
305 for (
int st = 0; st <= 4; ++st)
306 for (
int wh = 0; wh <= 5; ++wh)
310 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
311 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
312 for (; trigIt != trigEnd; ++trigIt) {
313 int wh = trigIt->whNum();
314 int sec = trigIt->scNum() + 1;
315 int st = trigIt->stNum();
316 int qual = trigIt->code();
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
Book histos.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
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.
void setCurrentFolder(std::string const &fullpath)
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_
C::const_iterator const_iterator
constant access iterator type
edm::EDGetTokenT< L1MuDTChambPhContainer > tm_TokenOut_
DTArr3int trigQualBestOut
void trigToSeg(int st, float &x, float dir)
Compute Trigger x coordinate in chamber RF.
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
Phi_Container const * getContainer() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
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.