33 setConfig(ps,
"DTTriggerLut");
34 baseFolderTM =
"DT/03-LocalTrigger-TM/";
50 vector<string>::const_iterator iTr = trigSources.begin();
51 vector<string>::const_iterator trEnd = trigSources.end();
52 vector<string>::const_iterator iHw = hwSources.begin();
53 vector<string>::const_iterator hwEnd = hwSources.end();
56 if (
parameters.getUntrackedParameter<
bool>(
"staticBooking")) {
57 for (; iTr != trEnd; ++iTr) {
59 for (; iHw != hwEnd; ++iHw) {
62 for (
int wh = -2; wh <= 2; ++wh) {
63 if (detailedAnalysis) {
64 bookWheelHistos(ibooker, wh,
"PhiResidualPercentage");
65 bookWheelHistos(ibooker, wh,
"PhibResidualPercentage");
68 bookWheelHistos(ibooker, wh,
"PhiLutSummary",
"Summaries");
69 bookWheelHistos(ibooker, wh,
"PhibLutSummary",
"Summaries");
71 if (detailedAnalysis) {
72 bookWheelHistos(ibooker, wh,
"PhiResidualMean");
73 bookWheelHistos(ibooker, wh,
"PhiResidualRMS");
74 bookWheelHistos(ibooker, wh,
"PhibResidualMean");
75 bookWheelHistos(ibooker, wh,
"PhibResidualRMS");
76 bookWheelHistos(ibooker, wh,
"CorrelationFactorPhi");
77 bookWheelHistos(ibooker, wh,
"CorrelationFactorPhib");
78 bookWheelHistos(ibooker, wh,
"DoublePeakFlagPhib");
82 bookCmsHistos(ibooker,
"TrigLutSummary",
"",
true);
83 bookCmsHistos(ibooker,
"PhiLutSummary");
84 bookCmsHistos(ibooker,
"PhibLutSummary");
85 if (detailedAnalysis) {
86 bookCmsHistos1d(ibooker,
"PhiPercentageSummary");
87 bookCmsHistos1d(ibooker,
"PhibPercentageSummary");
98 Bookings(ibooker, igetter);
101 if (detailedAnalysis) {
102 cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Reset();
103 cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Reset();
107 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
109 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
111 vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
112 vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
113 for (; chIt != chEnd; ++chIt) {
115 int wh = chId.
wheel();
116 int sect = chId.sector();
117 int stat = chId.station();
119 std::map<std::string, MonitorElement*>& innerME = whME[wh];
122 TH1F* PhiResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhiResidual",
"Segment", chId)));
124 if (PhiResidual && PhiResidual->GetEntries() > 10) {
125 if (innerME.find(
fullName(
"PhiResidualPercentage")) == innerME.end()) {
126 bookWheelHistos(ibooker, wh,
"PhiResidualPercentage");
129 float rangeBin = validRange / (PhiResidual->GetBinWidth(1));
130 float center = (PhiResidual->GetNbinsX()) / 2.;
132 (PhiResidual->Integral(floor(center - rangeBin),
ceil(center + rangeBin))) / (PhiResidual->Integral());
133 fillWhPlot(innerME.find(
fullName(
"PhiResidualPercentage"))->second, sect,
stat, perc,
false);
134 phiSummary = performLutTest(perc, thresholdWarnPhi, thresholdErrPhi);
135 if (detailedAnalysis)
136 cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Fill(perc);
139 fillWhPlot(innerME.find(
fullName(
"PhiLutSummary"))->second, sect,
stat, phiSummary);
141 if (detailedAnalysis) {
142 if ((phiSummary == 0) || (phiSummary == 3)) {
144 if (innerME.find(
fullName(
"PhiResidualMean")) == innerME.end()) {
145 bookWheelHistos(ibooker, wh,
"PhiResidualMean");
146 bookWheelHistos(ibooker, wh,
"PhiResidualRMS");
149 float center = (PhiResidual->GetNbinsX()) / 2.;
150 float rangeBin = validRange / (PhiResidual->GetBinWidth(1));
151 PhiResidual->GetXaxis()->SetRange(floor(center - rangeBin),
ceil(center + rangeBin));
152 float max = PhiResidual->GetMaximumBin();
153 float maxBin = PhiResidual->GetXaxis()->FindBin(max);
154 float nBinMax = 0.5 / (PhiResidual->GetBinWidth(1));
155 PhiResidual->GetXaxis()->SetRange(floor(maxBin - nBinMax),
ceil(maxBin + nBinMax));
156 float Mean = PhiResidual->GetMean();
157 float rms = PhiResidual->GetRMS();
159 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second, sect,
stat,
Mean);
160 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second, sect,
stat,
rms);
163 TH2F* TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
165 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries() > 100) {
166 float corr = TrackPhitkvsPhitrig->GetCorrelationFactor();
167 if (innerME.find(
fullName(
"CorrelationFactorPhi")) == innerME.end()) {
168 bookWheelHistos(ibooker, wh,
"CorrelationFactorPhi");
170 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhi"))->second, sect,
stat,
corr,
false);
175 TH1F* PhibResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhibResidual",
"Segment", chId)));
176 int phibSummary = stat == 3 ? -1 : 1;
178 if (stat != 3 && PhibResidual &&
179 PhibResidual->GetEntries() > 10) {
181 if (innerME.find(
fullName(
"PhibResidualPercentage")) == innerME.end()) {
182 bookWheelHistos(ibooker, wh,
"PhibResidualPercentage");
185 float rangeBin = validRange / (PhibResidual->GetBinWidth(1));
186 float center = (PhibResidual->GetNbinsX()) / 2.;
188 (PhibResidual->Integral(floor(center - rangeBin),
ceil(center + rangeBin))) / (PhibResidual->Integral());
190 fillWhPlot(innerME.find(
fullName(
"PhibResidualPercentage"))->second, sect,
stat, perc,
false);
191 phibSummary = performLutTest(perc, thresholdWarnPhiB, thresholdErrPhiB);
192 if (detailedAnalysis)
193 cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Fill(perc);
196 fillWhPlot(innerME.find(
fullName(
"PhibLutSummary"))->second, sect,
stat, phibSummary);
198 if (detailedAnalysis) {
199 if ((phibSummary == 0) || (phibSummary == 3)) {
200 if (innerME.find(
fullName(
"PhibResidualMean")) == innerME.end()) {
201 bookWheelHistos(ibooker, wh,
"PhibResidualMean");
202 bookWheelHistos(ibooker, wh,
"PhibResidualRMS");
205 float center = (PhibResidual->GetNbinsX()) / 2.;
206 float rangeBin = validRange / (PhibResidual->GetBinWidth(1));
207 PhibResidual->GetXaxis()->SetRange(floor(center - rangeBin),
ceil(center + rangeBin));
208 float max = PhibResidual->GetMaximumBin();
209 float maxBin = PhibResidual->GetXaxis()->FindBin(max);
210 float nBinMax = 0.5 / (PhibResidual->GetBinWidth(1));
211 PhibResidual->GetXaxis()->SetRange(floor(maxBin - nBinMax),
ceil(maxBin + nBinMax));
212 float Mean = PhibResidual->GetMean();
213 float rms = PhibResidual->GetRMS();
215 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second, sect,
stat,
Mean);
216 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second, sect,
stat,
rms);
219 TH2F* TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
220 if (TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries() > 100) {
221 float corr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
222 if (innerME.find(
fullName(
"CorrelationFactorPhib")) == innerME.end()) {
223 bookWheelHistos(ibooker, wh,
"CorrelationFactorPhib");
226 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhib"))->second, sect,
stat,
corr,
false);
234 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
236 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
238 for (
int wh = -2; wh <= 2; ++wh) {
239 std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
241 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
242 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
244 for (
int sect = 1; sect <= 12; ++sect) {
245 int phiSectorTotal = 0;
246 int phibSectorTotal = 0;
254 if (phiWhSummary->GetBinContent(sect,
stat) == 2) {
258 if (phiWhSummary->GetBinContent(sect,
stat) == 1)
260 if (phibWhSummary->GetBinContent(sect,
stat) == 2) {
261 phibSectorTotal += 1;
264 if (phibWhSummary->GetBinContent(sect,
stat) == 1)
268 phiStatus = phiSectorTotal;
272 phibStatus = phibSectorTotal;
276 cmsME.find(
"TrigLutSummary")->second->setBinContent(sect, wh + wheelArrayShift, glbStatus);
277 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phiStatus);
278 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phibStatus);
286 bool isInWarn = perc < thresholdWarn;
287 bool isInErr = perc < thresholdErr;
289 int result = isInErr ? 2 : isInWarn ? 3 : 0;
296 if (!folder.empty()) {
297 basedir += folder +
"/";
302 LogTrace(
category()) <<
"[" << testName <<
"Test]: booking " << basedir << hName;
311 int scsect = sect == 13 ? 4 : 10;
312 if ((value > plot->
getBinContent(scsect, stat)) == lessIsBest) {
~DTTriggerLutTest() override
Destructor.
constexpr int32_t ceil(float num)
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
T getUntrackedParameter(std::string const &, T const &) const
void bookCmsHistos1d(DQMStore::IBooker &, std::string hTag, std::string folder="")
const edm::EventSetup & c
DTTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
virtual void setCurrentFolder(std::string const &fullpath)
static const char category[]
constexpr unsigned int maxBin
int performLutTest(double perc, double threshold1, double threshold2)
Perform Lut Test logical operations.
void fillWhPlot(MonitorElement *plot, int sect, int stat, float value, bool lessIsBest=true)
Fill summary plots managing double MB4 chambers.
virtual MonitorElement * get(std::string const &fullpath) const
virtual double getBinContent(int binx) const
get content of bin (1-D)
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void runClientDiagnostic(DQMStore::IBooker &, DQMStore::IGetter &) override
Run client analysis.
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
int wheel() const
Return the wheel number.
EventID const & max(EventID const &lh, EventID const &rh)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)