@@ -88,6 +88,12 @@ bpo::options_description SubTimeFrameFileSink::getProgramOptions()
8888 OptionKeyStfSinkStfPercent,
8989 bpo::value<double >()->default_value (100.0 ),
9090 " Specifies probabilistic acceptance percentage for saving of each (Sub)TimeFrames, between 0.0 and 100. Default: 100.0" )(
91+ OptionKeyStfSinkMinTFIDForceToStore,
92+ bpo::value<std::uint64_t >()->default_value (std::int64_t (0 )),
93+ " Specifies min TF ID forced to store regardless of requested mean fraction" )(
94+ OptionKeyStfSinkMaxTFIDForceToStore,
95+ bpo::value<std::uint64_t >()->default_value (std::int64_t (0 )),
96+ " Specifies max TF ID forced to store regardless of requested mean fraction" )(
9197 OptionKeyStfSinkFileSize,
9298 bpo::value<std::uint64_t >()->default_value (std::uint64_t (4 ) << 10 ), /* 4GiB */
9399 " Specifies target size for (Sub)TimeFrame files in MiB." )(
@@ -127,6 +133,8 @@ bool SubTimeFrameFileSink::loadVerifyConfig(const fair::mq::ProgOptions& pFMQPro
127133 mStfsPerFile = pFMQProgOpt.GetValue <std::uint64_t >(OptionKeyStfSinkStfsPerFile);
128134 mFileSize = std::max (std::uint64_t (1 ), pFMQProgOpt.GetValue <std::uint64_t >(OptionKeyStfSinkFileSize));
129135 mPercentageToSave = std::clamp (pFMQProgOpt.GetValue <double >(OptionKeyStfSinkStfPercent), 0.0 , 100.0 );
136+ mMinTFIDForceToStore = pFMQProgOpt.GetValue <std::uint64_t >(OptionKeyStfSinkMinTFIDForceToStore);
137+ mMaxTFIDForceToStore = pFMQProgOpt.GetValue <std::uint64_t >(OptionKeyStfSinkMaxTFIDForceToStore);
130138 mFileSize <<= 20 ; /* in MiB */
131139 mSidecar = pFMQProgOpt.GetValue <bool >(OptionKeyStfSinkSidecar);
132140 mEosMetaDir = pFMQProgOpt.GetValue <std::string>(OptionKeyStfSinkEpn2EosMetaDir);
@@ -197,6 +205,8 @@ bool SubTimeFrameFileSink::loadVerifyConfig(const fair::mq::ProgOptions& pFMQPro
197205 IDDLOG (" (Sub)TimeFrame Sink :: root dir = {}" , mRootDir );
198206 IDDLOG (" (Sub)TimeFrame Sink :: file pattern = {}" , mFileNamePattern );
199207 IDDLOG (" (Sub)TimeFrame Sink :: stfs per file = {}" , (mStfsPerFile > 0 ? std::to_string (mStfsPerFile ) : " unlimited" ));
208+ IDDLOG (" (Sub)TimeFrame Sink :: force min TFID = {}" , (mMinTFIDForceToStore > 0 && mMinTFIDForceToStore <= mMaxTFIDForceToStore ? std::to_string (mMinTFIDForceToStore ) : " none" ));
209+ IDDLOG (" (Sub)TimeFrame Sink :: force max TFID = {}" , (mMinTFIDForceToStore > 0 && mMinTFIDForceToStore <= mMaxTFIDForceToStore ? std::to_string (mMaxTFIDForceToStore ) : " none" ));
200210 IDDLOG (" (Sub)TimeFrame Sink :: stfs percentage = {:.4}" , (mPercentageToSave ));
201211 IDDLOG (" (Sub)TimeFrame Sink :: max file size = {}" , mFileSize );
202212 IDDLOG (" (Sub)TimeFrame Sink :: sidecar files = {}" , (mSidecar ? " yes" : " no" ));
@@ -323,7 +333,7 @@ void SubTimeFrameFileSink::DataHandlerThread(const unsigned pIdx)
323333 }
324334
325335 // apply rejection rules
326- bool lStfAccepted = (lUniformDist (lGen) <= mPercentageToSave ) ? true : false ;
336+ bool lStfAccepted = (lUniformDist (lGen) <= mPercentageToSave ) || (lStf-> id () <= mMaxTFIDForceToStore && lStf-> id () >= mMinTFIDForceToStore ) ? true : false ;
327337
328338 if (mEnabled && mReady && lStfAccepted) {
329339 do {
0 commit comments