@@ -40,7 +40,8 @@ void RawDecoderSpec::init(framework::InitContext& ctx)
4040 int inp2 = mDecoder .setLumiInp (2 , lumiinp2);
4141 mOutputLumiInfo .inp1 = inp1;
4242 mOutputLumiInfo .inp2 = inp2;
43- LOG (info) << " CTP reco init done. Inputs decoding here:" << decodeinps << " DoLumi:" << mDoLumi << " DoDigits:" << mDoDigits << " NTF:" << mNTFToIntegrate << " Lumi inputs:" << lumiinp1 << " :" << inp1 << " " << lumiinp2 << " :" << inp2 << " Max errors:" << maxerrors;
43+ mMaxOutputSize = ctx.options ().get <int >(" max-output-size" );
44+ LOG (info) << " CTP reco init done. Inputs decoding here:" << decodeinps << " DoLumi:" << mDoLumi << " DoDigits:" << mDoDigits << " NTF:" << mNTFToIntegrate << " Lumi inputs:" << lumiinp1 << " :" << inp1 << " " << lumiinp2 << " :" << inp2 << " Max errors:" << maxerrors << " Max output size:" << mMaxOutputSize ;
4445 // mOutputLumiInfo.printInputs();
4546}
4647void RawDecoderSpec::endOfStream (framework::EndOfStreamContext& ec)
@@ -117,6 +118,10 @@ void RawDecoderSpec::run(framework::ProcessingContext& ctx)
117118 }
118119 if (mDoDigits ) {
119120 LOG (info) << " [CTPRawToDigitConverter - run] Writing " << mOutputDigits .size () << " digits. IR rejected:" << mDecoder .getIRRejected () << " TCR rejected:" << mDecoder .getTCRRejected ();
121+ if ((mMaxOutputSize > 0 ) && (mOutputDigits .size () > mMaxOutputSize )) {
122+ LOG (error) << " CTP raw output size: " << mOutputDigits .size ();
123+ mOutputDigits .clear ();
124+ }
120125 ctx.outputs ().snapshot (o2::framework::Output{" CTP" , " DIGITS" , 0 }, mOutputDigits );
121126 }
122127 if (mDoLumi ) {
@@ -189,5 +194,6 @@ o2::framework::DataProcessorSpec o2::ctp::reco_workflow::getRawDecoderSpec(bool
189194 {" lumi-inp1" , o2::framework::VariantType::String, " TVX" , {" The first input used for online lumi. Name in capital." }},
190195 {" lumi-inp2" , o2::framework::VariantType::String, " VBA" , {" The second input used for online lumi. Name in capital." }},
191196 {" use-verbose-mode" , o2::framework::VariantType::Bool, false , {" Verbose logging" }},
197+ {" max-output-size" , o2::framework::VariantType::Int, 0 , {" Do not send output if bigger than max size, 0 - do not check" }},
192198 {" ctpinputs-decoding" , o2::framework::VariantType::Bool, false , {" Inputs alignment: true - raw decoder - has to be compatible with CTF decoder: allowed options: 10,01,00" }}}};
193199}
0 commit comments