@@ -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
5559void 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
130137void 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)
177186void 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
182192void ITSDecodingErrorTask::endOfCycle ()
@@ -216,10 +226,17 @@ void ITSDecodingErrorTask::endOfActivity(const Activity& /*activity*/)
216226void 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