17 #include "art_root_io/RootDB/SQLite3Wrapper.h" 29 lar::providerFrom<geo::Geometry>(),
30 lar::providerFrom<detinfo::LArPropertiesService>(),
31 std::set<std::string>({
"InheritNumberTimeSamples"})}
72 if (filename.empty()) {
return; }
74 std::unique_ptr<TFile>
file{TFile::Open(filename.c_str(),
"READ")};
75 if (!
file) {
return; }
77 if (
file->IsZombie() || !
file->IsOpen()) {
return; }
81 art::SQLite3Wrapper sqliteDB(
file.get(),
"RootFileDB");
85 unsigned int iNumberTimeSamples = 0;
86 unsigned int nNumberTimeSamples = 0;
88 sqlite3_stmt* stmt =
nullptr;
89 sqlite3_prepare_v2(sqliteDB,
"SELECT PSetBlob from ParameterSets;", -1, &stmt,
nullptr);
90 while (sqlite3_step(stmt) == SQLITE_ROW) {
99 auto const newNumberTimeSamples = ps.
get<
unsigned int>(
"NumberTimeSamples");
103 if (newNumberTimeSamples !=
fPS.
get<
unsigned int>(
"NumberTimeSamples")) {
104 if (nNumberTimeSamples == 0)
105 iNumberTimeSamples = newNumberTimeSamples;
106 else if (newNumberTimeSamples != iNumberTimeSamples) {
108 <<
"Historical values of NumberTimeSamples do not agree: " << iNumberTimeSamples
109 <<
" " << newNumberTimeSamples <<
"\n";
111 ++nNumberTimeSamples;
121 <<
"Overriding configuration parameter NumberTimeSamples using " 122 "historical value.\n" 124 <<
" Historical (used) value: " << iNumberTimeSamples <<
"\n";
139 return (ps.
get<std::string>(
"service_type",
"") ==
"DetectorPropertiesService") &&
140 (ps.
get<std::string>(
"service_provider",
"") ==
"DetectorPropertiesServiceStandard");
Utilities to manage ProviderPack objects with art.
unsigned int NumberTimeSamples() const override
static ParameterSet make(intermediate_table const &tbl)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void SetNumberTimeSamples(unsigned int nsamp)
DetectorPropertiesServiceStandard(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
T get(std::string const &key) const
DetectorPropertiesStandard fProp
fhicl::ParameterSet fPS
Original parameter set.
General LArSoft Utilities.
bool isDetectorPropertiesServiceStandard(const fhicl::ParameterSet &ps) const
bool fInheritNumberTimeSamples
Flag saying whether to inherit NumberTimeSamples.
void postOpenFile(const std::string &filename)
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception