@@ -51,14 +51,12 @@ void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/)
5151 mHistoBCMinBias2 = std::make_unique<TH1D>(" bcMinBias2" , " BC position MB2" , norbits, 0 , norbits);
5252 mHistoInputRatios = std::make_unique<TH1DRatio>(" inputRatio" , " Input Ratio to MTVX; Input; Ratio;" , ninps, 0 , ninps, true );
5353 mHistoClassRatios = std::make_unique<TH1DRatio>(" classRatio" , " Class Ratio to MB; Class; Ratio" , nclasses, 0 , nclasses, true );
54- mHistoDecodeError = std::make_unique<TH1D>(" decodeError" , " Errors from decoder" , nclasses, 0 , nclasses);
5554 getObjectsManager ()->startPublishing (mHistoInputs .get ());
5655 getObjectsManager ()->startPublishing (mHistoClasses .get ());
5756 getObjectsManager ()->startPublishing (mHistoClassRatios .get ());
5857 getObjectsManager ()->startPublishing (mHistoInputRatios .get ());
5958 getObjectsManager ()->startPublishing (mHistoBCMinBias1 .get ());
6059 getObjectsManager ()->startPublishing (mHistoBCMinBias2 .get ());
61- getObjectsManager ()->startPublishing (mHistoDecodeError .get ());
6260
6361 mDecoder .setDoLumi (1 );
6462 mDecoder .setDoDigits (1 );
@@ -78,7 +76,6 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
7876 mHistoInputRatios ->Reset ();
7977 mHistoBCMinBias1 ->Reset ();
8078 mHistoBCMinBias2 ->Reset ();
81- mHistoDecodeError ->Reset ();
8279
8380 mRunNumber = activity.mId ;
8481 mTimestamp = activity.mValidity .getMin ();
@@ -213,9 +210,15 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
213210 if (performConsistencyCheck == " true" ) {
214211 mDecoder .setCheckConsistency (1 );
215212 mDecoder .setDecodeInps (1 );
213+ mPerformConsistencyCheck = true ;
216214 } else {
217215 mDecoder .setCheckConsistency (0 );
218216 }
217+
218+ if (mPerformConsistencyCheck ) {
219+ mHistoDecodeError = std::make_unique<TH1D>(" decodeError" , " Errors from decoder" , nclasses, 0 , nclasses);
220+ getObjectsManager ()->startPublishing (mHistoDecodeError .get ());
221+ }
219222}
220223
221224void CTPRawDataReaderTask::startOfCycle ()
@@ -228,7 +231,7 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
228231 static constexpr double sOrbitLengthInMS = o2::constants::lhc::LHCOrbitMUS / 1000 ;
229232 auto nOrbitsPerTF = 32 .;
230233 // get the input
231- std::vector<o2::framework::InputSpec> filter;
234+ std::vector<o2::framework::InputSpec> filter{ o2::framework::InputSpec{ " filter " , o2::framework::ConcreteDataTypeMatcher{ " CTP " , " RAWDATA " }, o2::framework::Lifetime::Timeframe } } ;
232235 std::vector<o2::ctp::LumiInfo> lumiPointsHBF1;
233236 std::vector<o2::ctp::CTPDigit> outputDigits;
234237
@@ -269,9 +272,11 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
269272 o2::framework::InputRecord& inputs = ctx.inputs ();
270273 int ret = mDecoder .decodeRaw (inputs, filter, outputDigits, lumiPointsHBF1);
271274 mClassErrorsA = mDecoder .getClassErrorsA ();
272- for (size_t i = 0 ; i < o2::ctp::CTP_NCLASSES; i++) {
273- if (mClassErrorsA [i] > 0 ) {
274- mHistoDecodeError ->Fill (i, mClassErrorsA [i]);
275+ if (mPerformConsistencyCheck ) {
276+ for (size_t i = 0 ; i < o2::ctp::CTP_NCLASSES; i++) {
277+ if (mClassErrorsA [i] > 0 ) {
278+ mHistoDecodeError ->Fill (i, mClassErrorsA [i]);
279+ }
275280 }
276281 }
277282
@@ -340,7 +345,8 @@ void CTPRawDataReaderTask::reset()
340345 mHistoClassRatios ->Reset ();
341346 mHistoBCMinBias1 ->Reset ();
342347 mHistoBCMinBias2 ->Reset ();
343- mHistoDecodeError ->Reset ();
348+ if (mPerformConsistencyCheck )
349+ mHistoDecodeError ->Reset ();
344350}
345351
346352} // namespace o2::quality_control_modules::ctp
0 commit comments