22 #include "NovaDAQConventions/DAQConventions.h" 109 if(fclName !=
"")
fParents.push_back(fclName);
114 mf::LogInfo(
"Metadata") <<
"Parent File name is: " << fclName;
116 oldMetadata = ifdhp->getMetadata(fclName);
118 catch(WebAPIException) {
141 std::istringstream metadataStream;
142 metadataStream.str(inMetadata);
143 while(metadataStream.good()){
145 std::getline(metadataStream, line);
146 size_t pos = line.find(
":");
147 if(pos != std::string::npos){
148 key = line.substr(0, pos);
149 value = line.substr(pos+1);
150 size_t dot_pos = key.find(
".");
152 if (dot_pos != std::string::npos) manager.
AddMetadata(key, value);
161 int run_num = r.
run();
162 fRuns.insert( run_num );
169 int run_num = sr.
run();
170 int sub_num = sr.
subRun();
201 bool checkHorn =
false;
209 hornCurr = manager.
GetMetadata().at(
"nova.hornpolarity");
210 checkHorn = hornCurr.empty();
220 if(spilldata->
isRHC){
223 else if(spilldata->
is0HC){
242 if (fileWPath ==
"")
return;
244 size_t pos = fileWPath.rfind(
"/");
245 if (pos != std::string::npos) fileName = fileWPath.substr(pos+1);
246 else fileName = fileWPath;
254 oldMetadata = ifdhp->getMetadata(fileName);
256 catch(WebAPIException){
272 std::ostringstream value_stream;
280 manager.
AddMetadata(
"Nova.DetectorID", detector );
284 char* novarelease =
std::getenv(
"NOVASOFT_VERSION");
285 if( novarelease !=
nullptr)
305 const std::map<const char*, const char*> envMap =
306 {{
"NPASS",
"Nova.SubVersion"},
307 {
"NOVAGRIDUTILS_VERSION",
"Production.novagridutils_version"},
308 {
"PROCESS",
"Production.process"},
309 {
"GRID_USER",
"Production.grid_user"},
310 {
"NOVAPRODUCTION_VERSION",
"Production.novaproduction_version"},
311 {
"SAM_PROJECT_NAME",
"Production.sam_project_name"},
312 {
"HOSTNAME",
"Production.hostname"},
313 {
"CLUSTER",
"Production.cluster"},
317 for(
auto it: envMap){
325 if(
fisRHC) polarity =
"rhc";
326 else if(
fis0HC) polarity =
"0hc";
332 value_stream.str(
"");
334 manager.
AddMetadata(
"event_count", value_stream.str() );
337 value_stream.str(
"");
341 if(
it !=
fSubRuns.begin()) value_stream <<
",\n";
342 value_stream <<
"[ " <<
it->first <<
" , " 343 <<
it->second <<
" , " 352 if (
it !=
fRuns.begin() ) value_stream <<
",\n";
353 value_stream <<
"[ " << *
it <<
" , " 354 <<
"\"" <<
fRunType <<
"\"" <<
" ]";
361 value_stream.str(
"");
364 if(
it !=
fParents.begin() ) value_stream <<
",\n";
365 value_stream <<
"{ \"file_name\": \"" 369 manager.
AddMetadata(
"parents", value_stream.str() );
393 size_t found = key.find(
"jobfcl");
394 if(found != std::string::npos)
continue;
bool isRHC
is the beam in antineutrino mode, aka RHC
SubRunNumber_t subRun() const
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::string const & fileName() const
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
DEFINE_ART_MODULE(TestTMapFile)
Far Detector at Ash River, MN.
const XML_Char int const XML_Char * value
Prototype Near Detector on the surface at FNAL.
std::string getenv(std::string const &name)
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Near Detector in the NuMI cavern.
bool get_if_present(std::string const &key, T &value) const
EDAnalyzer(Table< Config > const &config)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Encapsulate the geometry of one entire detector (near, far, ndos)