36 trigGeomUtils(nullptr) {
37 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Constructor" << endl;
66 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask")
67 <<
"[DTLocalTriggerLutTask]: analyzed " <<
nEvents <<
" events" << endl;
91 std::map<std::string, MonitorElement*>& chambMap =
chHistos[chId.
rawId()];
93 string hName =
"TM_PhiResidualIn";
95 chambMap[hName] = ibooker.
book1D(hName + chTag,
96 "Trigger local position In - Segment local position (correlated triggers)",
101 hName =
"TM_PhiResidualOut";
103 chambMap[hName] = ibooker.
book1D(hName + chTag,
104 "Trigger local position Out - Segment local position (correlated triggers)",
109 hName =
"TM_PhibResidualIn";
111 chambMap[hName] = ibooker.
book1D(hName + chTag,
112 "Trigger local direction In - Segment local direction (correlated triggers)",
117 hName =
"TM_PhibResidualOut";
119 chambMap[hName] = ibooker.
book1D(hName + chTag,
120 "Trigger local direction Out - Segment local direction (correlated triggers)",
126 hName =
"TM_PhitkvsPhitrig";
129 ibooker.
book2D(hName + chTag,
"Local position: segment vs trigger", 100, -500., 500., 100, -500., 500.);
130 hName =
"TM_PhibtkvsPhibtrig";
133 ibooker.
book2D(hName + chTag,
"Local direction : segment vs trigger", 200, -40., 40., 200, -40., 40.);
134 hName =
"TM_PhibResidualvsTkPos";
137 ibooker.
book2D(hName + chTag,
"Local direction residual vs Segment Position", 100, -500., 500., 200, -10., 10.);
138 hName =
"TM_PhiResidualvsTkPos";
141 ibooker.
book2D(hName + chTag,
"Local Position residual vs Segment Position", 100, -500., 500., 200, -10., 10.);
148 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: bookHistograms" << endl;
150 std::vector<const DTChamber*>::const_iterator chambIt =
muonGeom->
chambers().begin();
151 std::vector<const DTChamber*>::const_iterator chambEnd =
muonGeom->
chambers().end();
153 for (; chambIt != chambEnd; ++chambIt)
159 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Begin of LS transition" << endl;
162 LogTrace(
"DTDQM|DTMonitorModule|DTLocalTriggerLutTask") <<
"[DTLocalTriggerLutTask]: Cleaning histos" << endl;
163 map<uint32_t, map<string, MonitorElement*> >::const_iterator chambIt =
chHistos.begin();
164 map<uint32_t, map<string, MonitorElement*> >::const_iterator chambEnd =
chHistos.end();
166 for (; chambIt != chambEnd; ++chambIt) {
167 map<string, MonitorElement*>::const_iterator histoIt = chambIt->second.begin();
168 map<string, MonitorElement*>::const_iterator histoEnd = chambIt->second.end();
169 for (; histoIt != histoEnd; ++histoIt) {
170 histoIt->second->Reset();
184 vector<L1MuDTChambPhDigi>
const* trigsIn = trigHandleIn->
getContainer();
186 vector<L1MuDTChambPhDigi>
const* trigsOut = trigHandleOut->
getContainer();
194 vector<const DTRecSegment4D*> best4DSegments;
205 for (; trackIt != trackEnd; ++trackIt) {
206 if (trackIt->hasPhi()) {
207 dof = trackIt->phiSegment()->degreesOfFreedom();
209 tmpBest = &(*trackIt);
216 best4DSegments.push_back(tmpBest);
219 vector<const DTRecSegment4D*>::const_iterator bestTrackIt = best4DSegments.begin();
220 vector<const DTRecSegment4D*>::const_iterator bestTrackEnd = best4DSegments.end();
222 for (; bestTrackIt != bestTrackEnd; ++bestTrackIt) {
223 if ((*bestTrackIt)->hasPhi()) {
225 int nHitsPhi = (*bestTrackIt)->phiSegment()->degreesOfFreedom() + 2;
230 float trackPosPhi, trackPosEta, trackDirPhi, trackDirEta;
233 map<string, MonitorElement*>& chMap =
chHistos[chId.
rawId()];
241 double deltaPos = trigPos - trackPosPhi;
243 double deltaDir = trigDir - trackDirPhi;
245 chMap.find(
"TM_PhiResidualIn")->second->Fill(deltaPos);
246 chMap.find(
"TM_PhibResidualIn")->second->Fill(deltaDir);
249 chMap.find(
"TM_PhitkvsPhitrig")->second->Fill(trigPos, trackPosPhi);
250 chMap.find(
"TM_PhibtkvsPhibtrig")->second->Fill(trigDir, trackDirPhi);
251 chMap.find(
"TM_PhibResidualvsTkPos")->second->Fill(trackPosPhi, trigDir - trackDirPhi);
252 chMap.find(
"TM_PhiResidualvsTkPos")->second->Fill(trackPosPhi, trigPos - trackPosPhi);
263 double deltaPos = trigPos - trackPosPhi;
265 double deltaDir = trigDir - trackDirPhi;
267 chMap.find(
"TM_PhiResidualOut")->second->Fill(deltaPos);
268 chMap.find(
"TM_PhibResidualOut")->second->Fill(deltaDir);
280 for (
int st = 0; st <= 4; ++st)
281 for (
int wh = 0; wh <= 5; ++wh)
285 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
286 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
287 for (; trigIt != trigEnd; ++trigIt) {
288 int wh = trigIt->whNum();
289 int sec = trigIt->scNum() + 1;
290 int st = trigIt->stNum();
291 int qual = trigIt->code();
306 for (
int st = 0; st <= 4; ++st)
307 for (
int wh = 0; wh <= 5; ++wh)
311 vector<L1MuDTChambPhDigi>::const_iterator trigIt = trigs->begin();
312 vector<L1MuDTChambPhDigi>::const_iterator trigEnd = trigs->end();
313 for (; trigIt != trigEnd; ++trigIt) {
314 int wh = trigIt->whNum();
315 int sec = trigIt->scNum() + 1;
316 int st = trigIt->stNum();
317 int qual = trigIt->code();
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
Book histos.
int station() const
Return the station number.
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
To reset the MEs.
std::pair< const_iterator, const_iterator > range
iterator range
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
~DTLocalTriggerLutTask() override
Destructor.
void searchTMBestOut(std::vector< L1MuDTChambPhDigi > const *trigs)
virtual void setCurrentFolder(std::string const &fullpath)
std::string & topFolder()
Get the top folder.
const DTGeometry * muonGeom
float trigDir(const L1MuDTChambPhDigi *trig)
Return local direction (trigger RF) for a given trigger primitive.
DTLocalTriggerLutTask(const edm::ParameterSet &ps)
Constructor.
const int wheelArrayShift
edm::ParameterSet parameters
edm::EDGetTokenT< DTRecSegment4DCollection > seg_Token_
T getUntrackedParameter(std::string const &, T const &) const
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
constexpr uint32_t rawId() const
get the raw id
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
int wheel() const
Return the wheel number.
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
float trigPos(const L1MuDTChambPhDigi *trig)
Return local position (trigger RF) for a given trigger primitive.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void computeSCCoordinates(const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
Compute track coordinates with SC sector numbering.