@@ -62,6 +62,12 @@ class CTFCoderBase
6262 // detector coder need to redefine this method if uses no default version, see comment in the cxx file
6363 virtual void assignDictVersion (CTFDictHeader& h) const ;
6464
65+ template <typename SPAN >
66+ void setSelectedIRFrames (const SPAN & sp)
67+ {
68+ mIRFrameSelector .setSelectedIRFrames (sp, mIRFrameSelMarginBwd , mIRFrameSelMarginFwd , true );
69+ }
70+
6571 template <typename CTF >
6672 std::vector<char > readDictionaryFromFile (const std::string& dictPath, bool mayFail = false );
6773
@@ -116,19 +122,22 @@ class CTFCoderBase
116122 void updateTimeDependentParams (o2::framework::ProcessingContext& pc);
117123
118124 o2::utils::IRFrameSelector& getIRFramesSelector () { return mIRFrameSelector ; }
125+ size_t getIRFrameSelMarginBwd () const { return mIRFrameSelMarginBwd ; }
126+ size_t getIRFrameSelMarginFwd () const { return mIRFrameSelMarginFwd ; }
119127
120128 protected:
121129 std::string getPrefix () const { return o2::utils::Str::concat_string (mDet .getName (), " _CTF: " ); }
122130
123131 void checkDictVersion (const CTFDictHeader& h) const ;
124-
125132 std::vector<std::shared_ptr<void >> mCoders ; // encoders/decoders
126133 DetID mDet ;
127134 CTFDictHeader mExtHeader ; // external dictionary header
128135 o2::utils::IRFrameSelector mIRFrameSelector ; // optional IR frames selector
129136 float mMemMarginFactor = 1 .0f ; // factor for memory allocation in EncodedBlocks
130137 bool mLoadDictFromCCDB {true };
131138 OpType mOpType ; // Encoder or Decoder
139+ size_t mIRFrameSelMarginBwd = 0 ; // margin in BC to add to the IRFrame lower boundary when selection is requested
140+ size_t mIRFrameSelMarginFwd = 0 ; // margin in BC to add to the IRFrame upper boundary when selection is requested
132141 int mVerbosity = 0 ;
133142};
134143
@@ -223,6 +232,12 @@ void CTFCoderBase::init(o2::framework::InitContext& ic)
223232 if (ic.options ().hasOption (" mem-factor" )) {
224233 setMemMarginFactor (ic.options ().get <float >(" mem-factor" ));
225234 }
235+ if (ic.options ().hasOption (" irframe-margin-bwd" )) {
236+ mIRFrameSelMarginBwd = ic.options ().get <uint32_t >(" irframe-margin-bwd" );
237+ }
238+ if (ic.options ().hasOption (" irframe-margin-fwd" )) {
239+ mIRFrameSelMarginFwd = ic.options ().get <uint32_t >(" irframe-margin-fwd" );
240+ }
226241 auto dict = ic.options ().get <std::string>(" ctf-dict" );
227242 if (dict.empty () || dict == " ccdb" ) { // load from CCDB
228243 mLoadDictFromCCDB = true ;
0 commit comments