20 #include "art_root_io/RootDB/SQLite3Wrapper.h" 24 #include "ifdh_art/IFDHService/IFDH_service.h" 32 : fInheritNumberTimeSamples(pset.
get<
bool>(
"InheritNumberTimeSamples",
false))
53 fProp = std::make_unique<spdp::DetectorPropertiesProtoDUNEsp>(pset,
58 std::set<std::string>({
"InheritNumberTimeSamples" })
62 fProp->CheckIfConfigured();
72 fProp->ValidateAndConfigure(p, {
"InheritNumberTimeSamples" });
82 std::cout<<
"New run, Num is: "<<run.
run()<<
" Updating DetectorProperties."<<
std::endl;
109 auto start = filename.rfind(
"/");
110 if (start == std::string::npos)
119 int end = filename.length();
120 std::string filename_s=(filename.substr(start, end-start));
123 fProp->UpdateHV(filename_s);
125 fProp->UpdateReadoutWindowSize(clockData, filename_s);
155 if(filename.size() != 0) {
156 TFile*
file = TFile::Open(filename.c_str(),
"READ");
157 if(file != 0 && !file->IsZombie() && file->IsOpen()) {
159 art::SQLite3Wrapper sqliteDB(file,
"RootFileDB");
161 unsigned int iNumberTimeSamples = 0;
162 unsigned int nNumberTimeSamples = 0;
164 sqlite3_prepare_v2(sqliteDB,
"SELECT PSetBlob from ParameterSets;", -1, &stmt, NULL);
165 while (sqlite3_step(stmt) == SQLITE_ROW) {
172 unsigned int newNumberTimeSamples =
ps.get<
unsigned int>(
"NumberTimeSamples");
176 if(newNumberTimeSamples !=
fPS.
get<
unsigned int>(
"NumberTimeSamples")) {
177 if(nNumberTimeSamples == 0)
178 iNumberTimeSamples = newNumberTimeSamples;
179 else if(newNumberTimeSamples != iNumberTimeSamples) {
181 <<
"Historical values of NumberTimeSamples do not agree: " 182 << iNumberTimeSamples <<
" " << newNumberTimeSamples <<
"\n" ;
184 ++nNumberTimeSamples;
192 nNumberTimeSamples != 0 &&
193 iNumberTimeSamples !=
fProp->NumberTimeSamples()) {
194 mf::LogInfo(
"DetectorPropertiesServiceProtoDUNEsp")
195 <<
"Overriding configuration parameter NumberTimeSamples using historical value.\n" 196 <<
" Configured value: " <<
fProp->NumberTimeSamples() <<
"\n" 197 <<
" Historical (used) value: " << iNumberTimeSamples <<
"\n";
198 fProp->SetNumberTimeSamples(iNumberTimeSamples);
221 (ps.
get<
std::string>(
"service_type",
"") ==
"DetectorPropertiesService")
222 && (ps.
get<
std::string>(
"service_provider",
"") ==
"DetectorPropertiesServiceProtoDUNEsp")
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
ProviderPackFromServices< Services... > extractProviders()
Returns a provider pack with providers from specified services.
Encapsulate the construction of a single cyostat.
static ParameterSet make(intermediate_table const &tbl)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void preBeginRun(const art::Run &run)
void postOpenFile(const std::string &filename)
struct sqlite3_stmt sqlite3_stmt
art framework interface to geometry description
bool fInheritNumberTimeSamples
Flag saying whether to inherit NumberTimeSamples.
void reconfigure(fhicl::ParameterSet const &pset)
fhicl::ParameterSet fPS
Original parameter set.
DetectorPropertiesServiceProtoDUNEsp(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
T get(std::string const &key) const
DetectorPropertiesData DataForJob() const
General LArSoft Utilities.
The geometry of one entire detector, as served by art.
static constexpr double ps
GlobalSignal< detail::SignalResponseType::FIFO, void(Run const &)> sPreBeginRun
Encapsulate the construction of a single detector plane.
GlobalSignal< detail::SignalResponseType::LIFO, void(std::string const &)> sPostOpenFile
std::optional< T > get_if_present(std::string const &key) const
bool isDetectorPropertiesServiceProtoDUNEsp(const fhicl::ParameterSet &ps) const
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
Encapsulate the construction of a single detector plane.
std::unique_ptr< spdp::DetectorPropertiesProtoDUNEsp > fProp
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)