LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
rootOutputConfigurationTools.cc
Go to the documentation of this file.
6 
7 using namespace art;
8 
9 namespace {
10  bool
11  maxCriterionSpecified(ClosingCriteria const& cc)
12  {
13  auto fp = std::mem_fn(&ClosingCriteria::fileProperties);
14  return fp(cc).nEvents() != Defaults::unsigned_max() ||
15  fp(cc).nSubRuns() != Defaults::unsigned_max() ||
16  fp(cc).nRuns() != Defaults::unsigned_max() ||
17  fp(cc).size() != Defaults::size_max() ||
18  fp(cc).age().count() != Defaults::seconds_max();
19  }
20 }
21 
22 bool
23 art::detail::shouldFastClone(bool const fastCloningSet,
24  bool const fastCloning,
25  bool const wantAllEvents,
26  ClosingCriteria const& cc)
27 {
28  bool result{fastCloning};
29  mf::LogInfo("FastCloning")
30  << "Initial fast cloning configuration "
31  << (fastCloningSet ? "(user-set): " : "(from default): ") << std::boolalpha
32  << fastCloning;
33 
34  if (fastCloning && !wantAllEvents) {
35  result = false;
36  mf::LogWarning("FastCloning")
37  << "Fast cloning deactivated due to presence of\n"
38  << "event selection configuration.";
39  }
40  if (fastCloning && maxCriterionSpecified(cc) &&
42  result = false;
43  mf::LogWarning("FastCloning")
44  << "Fast cloning deactivated due to request to allow\n"
45  << "output file switching at an Event, SubRun, or Run boundary.";
46  }
47  return result;
48 }
49 
50 bool
51 art::detail::shouldDropEvents(bool const dropAllEventsSet,
52  bool const dropAllEvents,
53  bool const dropAllSubRuns)
54 {
55  if (!dropAllSubRuns)
56  return dropAllEvents;
57 
58  if (dropAllEventsSet && !dropAllEvents) {
60  << "\nThe following FHiCL specification is illegal\n\n"
61  << " dropAllEvents : false \n"
62  << " dropAllSubRuns : true \n\n"
63  << "[1] Both can be 'true', "
64  << "[2] both can be 'false', or "
65  << "[3] 'dropAllEvents : true' and 'dropAllSubRuns : false' "
66  << "is allowed.\n\n";
67  }
68  return true;
69 }
auto const & fileProperties() const
bool shouldDropEvents(bool dropAllEventsSet, bool dropAllEvents, bool dropAllSubRuns)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
static constexpr auto unsigned_max()
auto granularity() const
static constexpr auto seconds_max()
FILE * fp
Definition: plot.C:36
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static constexpr auto size_max()
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
HLT enums.
bool shouldFastClone(bool fastCloningSet, bool fastCloning, bool wantAllEvents, ClosingCriteria const &fileProperties)