Skip to content

Commit aac62bf

Browse files
authored
Added correct reset of GBTLink Decoding Plot (#2361)
1 parent 7b7ed0e commit aac62bf

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

Modules/ITS/include/ITS/ITSDecodingErrorTask.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ class ITSDecodingErrorTask final : public TaskInterface
6969
TH1D* hAlwaysBusy;
7070
TH1D* mChipErrorPlots;
7171
TH1D* mLinkErrorPlots;
72+
bool isDoLinkErrorReset = true;
73+
std::map<int, std::vector<int>> DecErr_lastCycle;
7274
TH2D* mChipErrorVsChipid[7]; // chip ErrorVsChipid
7375
TH2D* mLinkErrorVsFeeid; // link ErrorVsFeeid
7476
TH2D* mChipErrorVsFeeid; // chip ErrorVsFeeid

Modules/ITS/itsDecoding.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
},
3636
"location": "local",
3737
"taskParameters": {
38+
"isDoLinkErrorReset": 0,
3839
"mBusyViolationLimit": "0.75"
3940
}
4041
}

Modules/ITS/src/ITSDecodingErrorTask.cxx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ void ITSDecodingErrorTask::initialize(o2::framework::InitContext& /*ctx*/)
5050
getParameters();
5151
createDecodingPlots();
5252
setPlotsFormat();
53+
54+
for (int iFEE = 0; iFEE < NFees; iFEE++) {
55+
DecErr_lastCycle[iFEE] = std::vector<int>(o2::itsmft::GBTLinkDecodingStat::NErrorsDefined, 0);
56+
}
5357
}
5458

5559
void ITSDecodingErrorTask::createDecodingPlots()
@@ -125,11 +129,13 @@ void ITSDecodingErrorTask::startOfActivity(const Activity& activity)
125129
ILOG(Debug, Devel) << "startOfActivity : " << activity.mId << ENDM;
126130
}
127131

128-
void ITSDecodingErrorTask::startOfCycle() { ILOG(Debug, Devel) << "startOfCycle" << ENDM; }
132+
void ITSDecodingErrorTask::startOfCycle()
133+
{
134+
ILOG(Debug, Devel) << "startOfCycle" << ENDM;
135+
}
129136

130137
void ITSDecodingErrorTask::monitorData(o2::framework::ProcessingContext& ctx)
131138
{
132-
133139
auto linkErrors = ctx.inputs().get<gsl::span<o2::itsmft::GBTLinkDecodingStat>>("linkerrors");
134140
auto decErrors = ctx.inputs().get<gsl::span<o2::itsmft::ChipError>>("decerrors");
135141

@@ -143,7 +149,10 @@ void ITSDecodingErrorTask::monitorData(o2::framework::ProcessingContext& ctx)
143149
if (le.errorCounts[ierror] <= 0) {
144150
continue;
145151
}
146-
mLinkErrorVsFeeid->SetBinContent(ifee + 1, ierror + 1, le.errorCounts[ierror]);
152+
if (isDoLinkErrorReset)
153+
mLinkErrorVsFeeid->SetBinContent(ifee + 1, ierror + 1, le.errorCounts[ierror] - DecErr_lastCycle[ifee][ierror]);
154+
else
155+
mLinkErrorVsFeeid->SetBinContent(ifee + 1, ierror + 1, le.errorCounts[ierror]);
147156
}
148157
}
149158

@@ -177,6 +186,7 @@ void ITSDecodingErrorTask::monitorData(o2::framework::ProcessingContext& ctx)
177186
void ITSDecodingErrorTask::getParameters()
178187
{
179188
mBusyViolationLimit = o2::quality_control_modules::common::getFromConfig<float>(mCustomParameters, "mBusyViolationLimit", mBusyViolationLimit);
189+
isDoLinkErrorReset = (bool)o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "isDoLinkErrorReset", isDoLinkErrorReset);
180190
}
181191

182192
void ITSDecodingErrorTask::endOfCycle()
@@ -216,10 +226,17 @@ void ITSDecodingErrorTask::endOfActivity(const Activity& /*activity*/)
216226
void ITSDecodingErrorTask::resetGeneralPlots()
217227
{
218228
mTFCount++;
229+
mChipErrorPlots->Reset();
230+
231+
if (isDoLinkErrorReset) {
232+
for (int iFEE = 1; iFEE <= mLinkErrorVsFeeid->GetNbinsY(); iFEE++) {
233+
for (int iError = 1; iError <= mLinkErrorVsFeeid->GetNbinsX(); iError++) {
234+
DecErr_lastCycle[iFEE - 1][iError - 1] += mLinkErrorVsFeeid->GetBinContent(iFEE, iError);
235+
}
236+
}
237+
}
219238
mLinkErrorVsFeeid->Reset();
220-
mChipErrorVsFeeid->Reset();
221239
mLinkErrorPlots->Reset();
222-
mChipErrorPlots->Reset();
223240
for (int ilayer = 0; ilayer < 7; ilayer++) {
224241
mChipErrorVsChipid[ilayer]->Reset();
225242
}

0 commit comments

Comments
 (0)