All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FileCatalogMetadataSBN.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Name: FileCatalogMetadataSBN.h.
4 //
5 // Purpose: Art service adds microboone-specific per-job sam metadata.
6 //
7 // FCL parameters:
8 //
9 // FCLName - FCL file name.
10 // ProjectName - Project name.
11 // ProjectStage - Project stage.
12 // ProjectVersion - Project version.
13 // ProjectSoftware - Project software information.
14 // ProductionName - Production campaign name.
15 // ProductionType - Production campaign type.
16 // Merge - Merge flag.
17 // 1 - Set merge.merge = 1 and merge.merged = 0
18 // 0 - Set merge.merge = 0 and merge.merged = 0
19 // -1 - Do not generate merge parameters.
20 // Parameters - Arbitrary (key, value) parameters.
21 // Specify in fcl file as sequence-of-sequence:
22 // [[key1, value1], [key2, value2],...]
23 // POTModuleLabel - POTSummary module label (default "generator").
24 //
25 // Above values will be added in internal metadata of artroot
26 // output files whenever this service is included in job
27 // configuration (service does not need to be called). The
28 // public interface of this service consists of accessors that
29 // allow other code to discover above metadata parameters.
30 //
31 // Created: 28-Oct-2014, H. Greenlee
32 //
33 ////////////////////////////////////////////////////////////////////////
34 
35 #ifndef FILECATALOGMETADATASBN_H
36 #define FILECATALOGMETADATASBN_H
37 
38 #include "fhiclcpp/ParameterSet.h"
39 #include "art/Framework/Services/Registry/ActivityRegistry.h"
40 #include "art/Framework/Services/Registry/ServiceDeclarationMacros.h"
41 
42 namespace util {
43 
45  {
46  public:
47 
48  // Constructor, destructor.
49 
50  FileCatalogMetadataSBN(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg);
51  ~FileCatalogMetadataSBN() = default;
52 
53  // Accessors.
54 
55  const std::string& GetFCLName() const {return fFCLName;}
56  const std::string& GetProjectName() const {return fProjectName;}
57  const std::string& GetProjectStage() const {return fProjectStage;}
58  const std::string& GetProjectVersion() const {return fProjectVersion;}
59  const std::string& GetProjectSoftware() const {return fProjectSoftware;}
60  const std::string& GetProductionName() const {return fProductionName;}
61  const std::string& GetProductionType() const {return fProductionType;}
62  int GetMerge() const {return fMerge;}
63  const std::vector<std::pair<std::string, std::string>>& GetParameters() const {return fParameters;}
64 
65  private:
66 
67  // Callbacks.
68 
69  void postBeginJob();
70  void postEndSubRun(art::SubRun const& subrun);
71  void preCloseOutputFile(const std::string& label);
72 
73  // Data members.
74 
75  std::string fExperiment;
76  std::string fFCLName;
77  std::string fProjectName;
78  std::string fProjectStage;
79  std::string fProjectVersion;
80  std::string fProjectSoftware;
81  std::string fProductionName; //Production parameter, do not use if not running a production
82  std::string fProductionType; //Production parameter, do not use if not running a production
83  int fMerge;
84  std::vector<std::pair<std::string, std::string>> fParameters;
85  std::string fPOTModuleLabel;
86  double fTotPOT;
87  };
88 
89 } // namespace util
90 
91 DECLARE_ART_SERVICE(util::FileCatalogMetadataSBN, LEGACY)
92 
93 #endif
const std::string & GetProjectStage() const
std::vector< std::pair< std::string, std::string > > fParameters
const std::string & GetProjectVersion() const
const std::string & GetProjectSoftware() const
FileCatalogMetadataSBN(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
void preCloseOutputFile(const std::string &label)
const std::vector< std::pair< std::string, std::string > > & GetParameters() const
const std::string & GetFCLName() const
void postEndSubRun(art::SubRun const &subrun)
const std::string & GetProjectName() const
const std::string & GetProductionType() const
const std::string & GetProductionName() const