All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
icarusutil::FileCatalogMetadataICARUS Class Reference

#include <FileCatalogMetadataICARUS.h>

Public Member Functions

 FileCatalogMetadataICARUS (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~FileCatalogMetadataICARUS ()=default
 
const std::string & GetFCLName () const
 
const std::string & GetProjectName () const
 
const std::string & GetProjectStage () const
 
const std::string & GetProjectVersion () const
 
const std::string & GetProjectSoftware () const
 
const std::string & GetProductionName () const
 
const std::string & GetProductionType () const
 
int Merge () const
 
const std::vector< std::string > & Parameters () const
 

Private Member Functions

void postBeginJob ()
 

Private Attributes

std::string fFCLName
 
std::string fProjectName
 
std::string fProjectStage
 
std::string fProjectVersion
 
std::string fProjectSoftware
 
std::string fProductionName
 
std::string fProductionType
 
int fMerge
 
std::vector< std::string > fParameters
 

Detailed Description

Definition at line 36 of file FileCatalogMetadataICARUS.h.

Constructor & Destructor Documentation

icarusutil::FileCatalogMetadataICARUS::FileCatalogMetadataICARUS ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry &  reg 
)

Definition at line 20 of file FileCatalogMetadataICARUS_service.cc.

21 {
22  // Get parameters.
23  std::cout << "FileCatalogMetadataICARUS::parameterset begin" << std::endl;
24  fFCLName = pset.get<std::string>("FCLName");
25  fProjectName = pset.get<std::string>("ProjectName");
26  fProjectStage = pset.get<std::string>("ProjectStage");
27  fProjectVersion = pset.get<std::string>("ProjectVersion");
28  fProjectSoftware = pset.get<std::string>("ProjectSoftware","");
29  fProductionName = pset.get<std::string>("ProductionName",""); //Leave as default value if not running a production
30  fProductionType = pset.get<std::string>("ProductionType",""); //Leave as default value if not running a production
31 
32  fMerge = pset.get<int>("Merge", 0);
33  fParameters = pset.get<std::vector<std::string> >("Parameters", std::vector<std::string>());
34  // It doesn't make sense for parameter vector to have an odd number of elements.
35  if(fParameters.size() % 2 != 0) {
36  throw cet::exception("FileCatalogMetadataICARUS")
37  << "Parameter vector has odd number of elements.\n";
38  }
39 
40 
41  // Register for callbacks.
42 
43  reg.sPostBeginJob.watch(this, &FileCatalogMetadataICARUS::postBeginJob);
44  std::cout << "FileCatalogMetadataICARUS::parameterset ends" << std::endl;
45 
46 }
BEGIN_PROLOG could also be cout
icarusutil::FileCatalogMetadataICARUS::~FileCatalogMetadataICARUS ( )
default

Member Function Documentation

const std::string& icarusutil::FileCatalogMetadataICARUS::GetFCLName ( ) const
inline

Definition at line 47 of file FileCatalogMetadataICARUS.h.

const std::string& icarusutil::FileCatalogMetadataICARUS::GetProductionName ( ) const
inline

Definition at line 52 of file FileCatalogMetadataICARUS.h.

const std::string& icarusutil::FileCatalogMetadataICARUS::GetProductionType ( ) const
inline

Definition at line 53 of file FileCatalogMetadataICARUS.h.

const std::string& icarusutil::FileCatalogMetadataICARUS::GetProjectName ( ) const
inline

Definition at line 48 of file FileCatalogMetadataICARUS.h.

const std::string& icarusutil::FileCatalogMetadataICARUS::GetProjectSoftware ( ) const
inline

Definition at line 51 of file FileCatalogMetadataICARUS.h.

const std::string& icarusutil::FileCatalogMetadataICARUS::GetProjectStage ( ) const
inline

Definition at line 49 of file FileCatalogMetadataICARUS.h.

const std::string& icarusutil::FileCatalogMetadataICARUS::GetProjectVersion ( ) const
inline

Definition at line 50 of file FileCatalogMetadataICARUS.h.

int icarusutil::FileCatalogMetadataICARUS::Merge ( ) const
inline
const std::vector<std::string>& icarusutil::FileCatalogMetadataICARUS::Parameters ( ) const
inline

Definition at line 55 of file FileCatalogMetadataICARUS.h.

55 {return fParameters;}
void icarusutil::FileCatalogMetadataICARUS::postBeginJob ( )
private

Definition at line 51 of file FileCatalogMetadataICARUS_service.cc.

52 {
53  // Get art metadata service.
54 
55  std::cout << "FileCatalogMetadataICARUS::postBeginJob() begin" << std::endl;
56  art::ServiceHandle<art::FileCatalogMetadata> mds;
57 
58  // Add metadata.
59  mds->addMetadata("fcl.name", fFCLName);
60  mds->addMetadata("icarus_project.name", fProjectName);
61  mds->addMetadata("icarus_project.stage", fProjectStage);
62  mds->addMetadata("icarus_project.version", fProjectVersion);
63  mds->addMetadata("icarus_project.software", fProjectSoftware);
64  mds->addMetadata("production.name", fProductionName);
65  mds->addMetadata("production.type", fProductionType);
66  std::ostringstream ostr;
67  ostr << fMerge;
68  mds->addMetadata("merge.merge", ostr.str());
69  mds->addMetadata("merge.merged", "0");
70  for(unsigned int i=0; i<fParameters.size(); i += 2)
71  mds->addMetadata(fParameters[i], fParameters[i+1]);
72  std::cout << "FileCatalogMetadataICARUS::postBeginJob() end" << std::endl;
73 }
BEGIN_PROLOG could also be cout

Member Data Documentation

std::string icarusutil::FileCatalogMetadataICARUS::fFCLName
private

Definition at line 66 of file FileCatalogMetadataICARUS.h.

int icarusutil::FileCatalogMetadataICARUS::fMerge
private

Definition at line 73 of file FileCatalogMetadataICARUS.h.

std::vector<std::string> icarusutil::FileCatalogMetadataICARUS::fParameters
private

Definition at line 74 of file FileCatalogMetadataICARUS.h.

std::string icarusutil::FileCatalogMetadataICARUS::fProductionName
private

Definition at line 71 of file FileCatalogMetadataICARUS.h.

std::string icarusutil::FileCatalogMetadataICARUS::fProductionType
private

Definition at line 72 of file FileCatalogMetadataICARUS.h.

std::string icarusutil::FileCatalogMetadataICARUS::fProjectName
private

Definition at line 67 of file FileCatalogMetadataICARUS.h.

std::string icarusutil::FileCatalogMetadataICARUS::fProjectSoftware
private

Definition at line 70 of file FileCatalogMetadataICARUS.h.

std::string icarusutil::FileCatalogMetadataICARUS::fProjectStage
private

Definition at line 68 of file FileCatalogMetadataICARUS.h.

std::string icarusutil::FileCatalogMetadataICARUS::fProjectVersion
private

Definition at line 69 of file FileCatalogMetadataICARUS.h.


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