1 #ifndef art_Framework_IO_ClosingCriteria_h 2 #define art_Framework_IO_ClosingCriteria_h 13 #include <type_traits> 17 #define GRANULARITY_COMMENT \ 18 "The 'granularity' parameter specifies the level at which\n" \ 19 "a file may be closed, and thereby the granularity of the file.\n" \ 20 "The following values are possible:\n\n" \ 22 " =======================================================\n" \ 23 " \"Event\" Allow file switch at next Event\n" \ 24 " \"SubRun\" Allow file switch at next SubRun\n" \ 25 " \"Run\" Allow file switch at next Run\n" \ 26 " \"InputFile\" Allow file switch at next InputFile\n" \ 27 " \"Job\" File closes at the end of Job\n\n" \ 28 "For example, if a granularity of \"SubRun\" is specified, but the\n" \ 29 "file has reached the maximum events written to disk (as specified\n" \ 30 "by the 'maxEvents' parameter), switching to a new file will NOT\n" \ 31 "happen until a new SubRun has been reached (or there are no more\n" \ 32 "Events/SubRuns/Runs to process)." 67 std::chrono::seconds age);
116 template <Granularity::BT B>
117 std::enable_if_t<B != Granularity::InputFile>
120 ++treeEntryNumbers_[
B];
126 template <Granularity::BT B>
127 std::enable_if_t<B == Granularity::InputFile>
145 std::array<unsigned, Granularity::NBoundaries()> counts_{
148 treeEntryNumbers_{{}};
149 std::chrono::seconds age_{std::chrono::seconds::zero()};
160 template <
typename T>
162 template <
typename T>
170 Comment(
"Maximum size of file (in KiB)"),
173 Comment(
"Maximum age of output file (in seconds)"),
187 return closingCriteria_;
204 #undef GRANULARITY_COMMENT std::ostream & operator<<(std::ostream &os, EDAnalyzer::Table< T > const &t)
static constexpr std::size_t NBoundaries()
auto const & fileProperties() const
std::enable_if_t< B==Granularity::InputFile > update()
static constexpr auto unsigned_max()
static constexpr auto granularity_default()
static BT value(std::string const &spec)
auto array(Array const &a)
Returns a manipulator which will print the specified array.
void updateAge(std::chrono::seconds const age)
auto eventEntryNumber() const
auto runEntryNumber() const
static constexpr auto seconds_max()
FileProperties closingCriteria_
#define GRANULARITY_COMMENT
static constexpr auto size_max()
std::enable_if_t< B!=Granularity::InputFile > update(OutputFileStatus const status)
auto subRunEntryNumber() const
void updateSize(unsigned const size)