Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
meta::Metadata Class Reference
Inheritance diagram for meta::Metadata:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 Metadata (const fhicl::ParameterSet &p)
 
virtual ~Metadata ()
 
void beginRun (art::Run const &r)
 
void beginSubRun (art::SubRun const &sr)
 
void endRun (art::Run const &r)
 
void analyze (const art::Event &e)
 
void reconfigure (const fhicl::ParameterSet &p)
 
void respondToOpenInputFile (art::FileBlock const &fb)
 
void respondToCloseOutputFiles (art::FileBlock const &fb)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

void GetInputMetadata (std::string inMetadata)
 
void FillMetadata ()
 

Private Attributes

int fNEvts
 
std::string fRunType
 
bool fUseSubruns
 
bool fUseFhclParent
 
bool fisRealData
 
bool fHaveHornInfo
 
bool fisRHC
 
bool fis0HC
 
std::set< intfRuns
 
std::set< std::pair< int, int > > fSubRuns
 
std::vector< std::stringfParents
 

Detailed Description

Definition at line 43 of file Metadata_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

meta::Metadata::Metadata ( const fhicl::ParameterSet p)
explicit

Definition at line 79 of file Metadata_module.cc.

References meta::MetadataManager::AddMetadata(), meta::MetadataManager::DoParsing(), fParents, fUseFhclParent, fhicl::ParameterSet::get_if_present(), GetInputMetadata(), meta::MetadataManager::getInstance(), meta::MetadataManager::GetMetadata(), and string.

79  :
80  EDAnalyzer (p),
81  fNEvts (0),
82 
83  fRunType (p.get< std::string >("runType", "physics")),
84  fUseSubruns (p.get< bool >("useSubruns", false) ),
85  fUseFhclParent(p.get< bool >("useFhclParent") ),
86 
87  fisRealData (false),
88  fHaveHornInfo (false),
89  fisRHC (false),
90  fis0HC (false)
91 
92  {
93  MetadataManager& manager = MetadataManager::getInstance();
94 
95  fhicl::ParameterSet inPSet;
96  bool foundPSet = p.get_if_present<fhicl::ParameterSet>("params", inPSet);
97  if(foundPSet) manager.DoParsing(inPSet);
98 
99  //add a default value for Nova.Subversion
100  //Order of precedence
101  //1) NPASS environment variable
102  //2) fhicl file
103  //3) input file
104  //4) default value
105  manager.AddMetadata( "Nova.SubVersion", "1" );
106 
107  //push fcl (for simulation jobs into the parents vector
108  std::string fclName = manager.GetMetadata()["simulated.jobfcl"];
109  if(fclName != "") fParents.push_back(fclName);
110 
111  if(fUseFhclParent) {
113  std::string oldMetadata;
114  mf::LogInfo("Metadata") << "Parent File name is: " << fclName;
115  try {
116  oldMetadata = ifdhp->getMetadata(fclName);
117  }
118  catch(WebAPIException) {
119  mf::LogError("Metadata") << "Web API Exception: ";
120  oldMetadata = "";
121  }
122  mf::LogInfo("Metadata") << oldMetadata;
123  GetInputMetadata(oldMetadata);
124  }
125  }
static MetadataManager & getInstance()
void GetInputMetadata(std::string inMetadata)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< std::string > fParents
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fRunType
bool get_if_present(std::string const &key, T &value) const
Definition: ParameterSet.h:208
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
enum BeamMode string
meta::Metadata::~Metadata ( )
virtual

Definition at line 128 of file Metadata_module.cc.

129  {
130  }

Member Function Documentation

void meta::Metadata::analyze ( const art::Event e)

Definition at line 176 of file Metadata_module.cc.

References fHaveHornInfo, fis0HC, fisRealData, fisRHC, fNEvts, art::DataViewImpl::getByLabel(), meta::MetadataManager::getInstance(), meta::MetadataManager::GetMetadata(), sumdata::SpillData::is0HC, art::Event::isRealData(), sumdata::SpillData::isRHC, art::Handle< T >::isValid(), and string.

177  {
178  //art::Timestamp evtTime = e.time();
179  //if (fNEvts == 0)
180  //{
181  // fStartTime = evtTime;
182  // fEndTime = evtTime;
183  //}
184  //else
185  //{
186  // if (evtTime < fStartTime) fStartTime = evtTime;
187  // if (evtTime > fEndTime) fEndTime = evtTime;
188  //}
189 
190  fisRealData = e.isRealData();
191  // Check for horn polarity:
192  // * for data, always. (this ensures that IFDB's values are always used
193  // even if erroneous metadata made it into a previous tier, which happens every once in a while.)
194  // * for MC, only if the horn current metadata isn't already set.
195  // (it should be for beam MC, where it's set at simulation stage,
196  // but occasionally the horn current metadata is used for other purposes
197  // in non-beam MC -- e.g., indicating which training of CVN was used
198  // on cosmic MC.)
199  if (fNEvts == 0)
200  {
201  bool checkHorn = false;
202  if (fisRealData)
203  checkHorn = true;
204  else
205  {
206  MetadataManager& manager = MetadataManager::getInstance();
207  std::string hornCurr;
208  if (manager.GetMetadata().find("nova.hornpolarity") != manager.GetMetadata().end())
209  hornCurr = manager.GetMetadata().at("nova.hornpolarity");
210  checkHorn = hornCurr.empty();
211  }
212 
213  if (checkHorn)
214  {
216  e.getByLabel("ifdbspillinfo", spilldata);
217 
218  if (spilldata.isValid()) {
219  fHaveHornInfo = true;
220  if(spilldata->isRHC){
221  fisRHC = true;
222  }
223  else if(spilldata->is0HC){
224  fis0HC = true;
225  }
226  }
227  }
228  }
229 
230  ++fNEvts;
231  return;
232  }
bool isRHC
is the beam in antineutrino mode, aka RHC
Definition: SpillData.h:28
static MetadataManager & getInstance()
bool is0HC
horn off
Definition: SpillData.h:29
bool isRealData() const
Definition: Event.h:83
bool isValid() const
Definition: Handle.h:189
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
enum BeamMode string
void meta::Metadata::beginRun ( art::Run const &  r)
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 159 of file Metadata_module.cc.

References fRuns, and art::Run::run().

160  {
161  int run_num = r.run();
162  fRuns.insert( run_num );
163  return;
164  }
TRandom3 r(0)
std::set< int > fRuns
void meta::Metadata::beginSubRun ( art::SubRun const &  sr)
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 167 of file Metadata_module.cc.

References fSubRuns, make_pair(), art::SubRun::run(), and art::SubRun::subRun().

168  {
169  int run_num = sr.run();
170  int sub_num = sr.subRun();
171  fSubRuns.insert( std::make_pair( run_num, sub_num ) );
172  return;
173  }
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
caf::StandardRecord * sr
std::set< std::pair< int, int > > fSubRuns
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
void meta::Metadata::endRun ( art::Run const &  r)
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 373 of file Metadata_module.cc.

References FillMetadata().

374  {
375  FillMetadata();
376  }
void meta::Metadata::FillMetadata ( )
private

Definition at line 265 of file Metadata_module.cc.

References meta::MetadataManager::AddMetadata(), meta::MetadataManager::AddMetadataHighPrio(), runNovaSAM::detector, geo::GeometryBase::DetId(), fHaveHornInfo, fis0HC, fisRHC, fNEvts, fParents, fRuns, fRunType, fSubRuns, fUseSubruns, cet::getenv(), meta::MetadataManager::getInstance(), it, novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, novadaq::cnv::kNEARDET, novadaq::cnv::kTESTBEAM, string, and febshutoff_auto::val.

Referenced by endRun(), and respondToCloseOutputFiles().

266  {
267 
268  //if(fUseFhclParent) return;
269  //fhicl file is already parsed - now add in additional metadata
270  MetadataManager& manager = MetadataManager::getInstance();
271 
272  std::ostringstream value_stream;
273 
274  std::string detector("unknown");
276  if(geo->DetId() == novadaq::cnv::kFARDET) detector = "fd";
277  else if(geo->DetId() == novadaq::cnv::kNEARDET) detector = "nd";
278  else if(geo->DetId() == novadaq::cnv::kNDOS) detector = "ndos";
279  else if(geo->DetId() == novadaq::cnv::kTESTBEAM) detector = "tb";
280  manager.AddMetadata( "Nova.DetectorID", detector );
281 
282  //set release this stage of processing used (takes precedence over input files)
283  // NOVASOFT_VERSION is set for the ups build, but SRT_BASE_RELEASE is for SRT
284  char* novarelease = std::getenv("NOVASOFT_VERSION");
285  if( novarelease != nullptr)
286  manager.AddMetadata( "Nova.Release", novarelease);
287  else
288  manager.AddMetadata( "Nova.Release", std::getenv("SRT_BASE_RELEASE"));
289 
290  //value_stream.str("");
291  //value_stream << fStartTime.value();
292  //manager.AddMetadata( "start_time", value_stream.str() );
293  //value_stream.str("");
294  //value_stream << fEndTime.value();
295  //manager.AddMetadata( "end_time", value_stream.str() );
296 
297  //things in the high priority metadata have precedence over metadata from the fhicl file
298  //
299  // eg nova.subversion by default is set to 1
300  // if input files have a pass number, that supercedes the default
301  // if NPASS exists as an environment variable,
302  // that supercedes value in input files
303 
304  // Map from environment variable to metadata field name
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"},
314  };
315 
316  // Set the environment-derived parameters in the metadata
317  for(auto it: envMap){
318  const char* val = std::getenv(it.first);
319  if(val) manager.AddMetadataHighPrio(it.second, val);
320  }
321 
322  //Horn Polarity
323  if(fHaveHornInfo){
324  std::string polarity("fhc");
325  if(fisRHC) polarity = "rhc";
326  else if(fis0HC) polarity = "0hc";
327  manager.AddMetadataHighPrio( "Nova.HornPolarity", polarity ); // "high priority" so that it overrides the job FCL
328  }
329 
330 
331  //Add in event count
332  value_stream.str("");
333  value_stream << fNEvts;
334  manager.AddMetadata( "event_count", value_stream.str() );
335 
336  //Add in runs list
337  value_stream.str("");
338  if(fUseSubruns){
339  value_stream << "[";
340  for(auto it = fSubRuns.begin(); it != fSubRuns.end(); ++it){
341  if(it != fSubRuns.begin()) value_stream << ",\n";
342  value_stream << "[ " << it->first << " , "
343  << it->second << " , "
344  << "\"" << fRunType
345  << "\"" << " ]";
346  }
347  value_stream << "]";
348  }
349  else{
350  value_stream << "[";
351  for( auto it = fRuns.begin(); it != fRuns.end(); ++it){
352  if (it != fRuns.begin() ) value_stream << ",\n";
353  value_stream << "[ " << *it << " , "
354  << "\"" << fRunType << "\"" << " ]";
355  }
356  value_stream << "]";
357  }
358  manager.AddMetadata( "runs", value_stream.str() );
359 
360  //Add in parents
361  value_stream.str("");
362  value_stream << "[";
363  for(auto it = fParents.begin(); it != fParents.end(); ++it){
364  if(it != fParents.begin() ) value_stream << ",\n";
365  value_stream << "{ \"file_name\": \""
366  << *it << "\" }";
367  }
368  value_stream << "]";
369  manager.AddMetadata( "parents", value_stream.str() );
370  }
static MetadataManager & getInstance()
set< int >::iterator it
std::vector< std::string > fParents
Far Detector at Ash River, MN.
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.
Definition: GeometryBase.h:243
Near Detector in the NuMI cavern.
std::string fRunType
Helper for AttenCurve.
Definition: Path.h:10
std::set< int > fRuns
std::set< std::pair< int, int > > fSubRuns
enum BeamMode string
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
void meta::Metadata::GetInputMetadata ( std::string  inMetadata)
private

Definition at line 137 of file Metadata_module.cc.

References meta::MetadataManager::AddMetadata(), meta::MetadataManager::getInstance(), findDuplicateFiles::key, make_syst_table_plots::line, elec2geo::pos, and string.

Referenced by Metadata(), and respondToOpenInputFile().

138  {
139  MetadataManager& manager = MetadataManager::getInstance();
140 
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(".");
151  //if the key contains a dot, this is experiment specific: copy over
152  if (dot_pos != std::string::npos) manager.AddMetadata(key, value);
153  }
154  }
155  return;
156  }
static MetadataManager & getInstance()
const XML_Char int const XML_Char * value
Definition: expat.h:331
enum BeamMode string
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void meta::Metadata::reconfigure ( const fhicl::ParameterSet p)

Definition at line 133 of file Metadata_module.cc.

134  {
135  }
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
void meta::Metadata::respondToCloseOutputFiles ( art::FileBlock const &  fb)
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 378 of file Metadata_module.cc.

References art::FileCatalogMetadata::addMetadata(), DEFINE_ART_MODULE(), FillMetadata(), modifyFHiCL::found, meta::MetadataManager::getInstance(), meta::MetadataManager::GetMetadata(), it, findDuplicateFiles::key, fetch_tb_beamline_files::md, and string.

379  {
380  //actually add the metadata to FileCatalogMetadata service here
381  //this is the only time we actually write it out
382 
383  FillMetadata();
384 
385  MetadataManager& manager = MetadataManager::getInstance();
386 
388  for(auto& it : manager.GetMetadata()){
389  std::string key = it.first;
390  std::string value = it.second;
391 
392  //remove "jobfcl" from the metadata when committing it
393  size_t found = key.find("jobfcl");
394  if(found != std::string::npos) continue;
395 
396  md->addMetadata( key, value );
397  }
398  }
static MetadataManager & getInstance()
set< int >::iterator it
const XML_Char int const XML_Char * value
Definition: expat.h:331
void addMetadata(std::string const &key, std::string const &value)
enum BeamMode string
void meta::Metadata::respondToOpenInputFile ( art::FileBlock const &  fb)
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 235 of file Metadata_module.cc.

References art::FileBlock::fileName(), plotROC::fileName, fParents, fUseFhclParent, GetInputMetadata(), elec2geo::pos, and string.

236  {
237  //If we're forcing fcl parentage (like overlays)
238  //Don't get the metadata using the input file.
239  if(fUseFhclParent) return;
240 
241  std::string fileWPath = fb.fileName();
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;
247 
248  fParents.push_back( fileName );
249 
250  //get old metadata from input file
252  std::string oldMetadata;
253  try{
254  oldMetadata = ifdhp->getMetadata(fileName);
255  }
256  catch(WebAPIException){
257  oldMetadata = "";
258  }
259  GetInputMetadata(oldMetadata);
260 
261  return;
262  }
void GetInputMetadata(std::string inMetadata)
fileName
Definition: plotROC.py:78
std::vector< std::string > fParents
enum BeamMode string
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

bool meta::Metadata::fHaveHornInfo
private

Definition at line 68 of file Metadata_module.cc.

Referenced by analyze(), and FillMetadata().

bool meta::Metadata::fis0HC
private

Definition at line 70 of file Metadata_module.cc.

Referenced by analyze(), and FillMetadata().

bool meta::Metadata::fisRealData
private

Definition at line 65 of file Metadata_module.cc.

Referenced by analyze().

bool meta::Metadata::fisRHC
private

Definition at line 69 of file Metadata_module.cc.

Referenced by analyze(), and FillMetadata().

int meta::Metadata::fNEvts
private

Definition at line 60 of file Metadata_module.cc.

Referenced by analyze(), and FillMetadata().

std::vector< std::string > meta::Metadata::fParents
private

Definition at line 74 of file Metadata_module.cc.

Referenced by FillMetadata(), Metadata(), and respondToOpenInputFile().

std::set< int > meta::Metadata::fRuns
private

Definition at line 72 of file Metadata_module.cc.

Referenced by beginRun(), and FillMetadata().

std::string meta::Metadata::fRunType
private

Definition at line 61 of file Metadata_module.cc.

Referenced by FillMetadata().

std::set< std::pair<int, int> > meta::Metadata::fSubRuns
private

Definition at line 73 of file Metadata_module.cc.

Referenced by beginSubRun(), and FillMetadata().

bool meta::Metadata::fUseFhclParent
private

Definition at line 63 of file Metadata_module.cc.

Referenced by Metadata(), and respondToOpenInputFile().

bool meta::Metadata::fUseSubruns
private

Definition at line 62 of file Metadata_module.cc.

Referenced by FillMetadata().


The documentation for this class was generated from the following file: