@@ -79,22 +79,22 @@ class RawFileWriter
7979 // / Single GBT link helper
8080 struct LinkData {
8181 static constexpr int MarginToFlush = 10 * sizeof (RDHAny); // flush superpage if free space left <= this margin
82- RDHAny rdhCopy; // RDH with the running info of the last RDH seen
83- IR updateIR; // IR at which new HBF needs to be created
84- int lastRDHoffset = -1 ; // position of last RDH in the link buffer
85- bool startOfRun = true ; // to signal if this is the 1st HBF of the run or not
86- uint8_t packetCounter = 0 ; // running counter
87- uint16_t pageCnt = 0 ; // running counter
88- LinkSubSpec_t subspec = 0 ; // subspec according to DataDistribution
89- bool discardData = false ; // discard data if true (e.g. desired max IR reached)
82+ RDHAny rdhCopy; // RDH with the running info of the last RDH seen
83+ IR updateIR; // IR at which new HBF needs to be created
84+ int lastRDHoffset = -1 ; // position of last RDH in the link buffer
85+ bool startOfRun = true ; // to signal if this is the 1st HBF of the run or not
86+ uint8_t packetCounter = 0 ; // running counter
87+ uint16_t pageCnt = 0 ; // running counter
88+ LinkSubSpec_t subspec = 0 ; // subspec according to DataDistribution
89+ bool discardData = false ; // discard data if true (e.g. desired max IR reached)
9090 //
9191 size_t nTFWritten = 0 ; // number of TFs written
9292 size_t nRDHWritten = 0 ; // number of RDHs written
9393 size_t nBytesWritten = 0 ; // number of bytes written
9494 //
95- std::string fileName{}; // file name associated with this link
96- std::vector<char > buffer; // buffer to accumulate superpage data
97- RawFileWriter* writer = nullptr ; // pointer on the parent writer
95+ std::string fileName{}; // file name associated with this link
96+ std::vector<char > buffer; // buffer to accumulate superpage data
97+ RawFileWriter* writer = nullptr ; // pointer on the parent writer
9898
9999 PayloadCache cacheBuffer; // used for caching in case of async. data input
100100 std::unique_ptr<TTree> cacheTree; // tree to store the cache
@@ -141,7 +141,6 @@ class RawFileWriter
141141 nRDHWritten++;
142142 return pushBack (reinterpret_cast <const char *>(&rdh), sizeof (RDHAny), false );
143143 }
144-
145144 };
146145 // =====================================================================================
147146 // If addData was called with given IR for at least 1 link, then it should be called for all links, even it with empty payload
@@ -402,13 +401,13 @@ class RawFileWriter
402401 int mVerbosity = 0 ;
403402 o2::header::DataOrigin mOrigin = o2::header::gDataOriginInvalid ;
404403 int mUseRDHVersion = RDHUtils::getVersion<o2::header::RAWDataHeader>(); // by default, use default version
405- int mSuperPageSize = 1024 * 1024 ; // super page size
406- bool mStartTFOnNewSPage = true ; // every TF must start on a new SPage
407- bool mDontFillEmptyHBF = false ; // skipp adding empty HBFs (uness it must have TF flag)
408- bool mAddSeparateHBFStopPage = true ; // HBF stop is added on a separate CRU page
409- bool mUseRDHStop = true ; // detector uses STOP in RDH
410- bool mCRUDetector = true ; // Detector readout via CRU ( RORC if false)
411- bool mApplyCarryOverToLastPage = false ; // call CarryOver method also for last chunk and overwrite modified trailer
404+ int mSuperPageSize = 1024 * 1024 ; // super page size
405+ bool mStartTFOnNewSPage = true ; // every TF must start on a new SPage
406+ bool mDontFillEmptyHBF = false ; // skipp adding empty HBFs (uness it must have TF flag)
407+ bool mAddSeparateHBFStopPage = true ; // HBF stop is added on a separate CRU page
408+ bool mUseRDHStop = true ; // detector uses STOP in RDH
409+ bool mCRUDetector = true ; // Detector readout via CRU ( RORC if false)
410+ bool mApplyCarryOverToLastPage = false ; // call CarryOver method also for last chunk and overwrite modified trailer
412411
413412 // >> caching --------------
414413 bool mCachingStage = false ; // signal that current data should be cached
@@ -425,7 +424,14 @@ class RawFileWriter
425424 bool mDoLazinessCheck = true ;
426425
427426 ClassDefNV (RawFileWriter, 1 );
428- }; // namespace raw
427+ };
428+
429+ /* * Ensure (i.e. create if needed) directory
430+ * @param outDirName : output path to be asserted
431+ *
432+ * Log a FATAL if the directory does not exist and can not be created
433+ */
434+ void assertOutputDirectory (std::string_view outDirName);
429435
430436} // namespace raw
431437} // namespace o2
0 commit comments