TFileMetadataDUNE.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Name: TFileMetadataDUNE.h
3 //
4 // A struct datatype to hold the metadata information as it is extracted
5 // from various places.
6 //
7 // Created: 1-Nov-2017, T. Junk
8 // Based on the MicroBooNE version by S. Gollapinni
9 //
10 ////////////////////////////////////////////////////////////////////////
11 #ifndef TFILEMETADATADUNE_H
12 #define TFILEMETADATADUNE_H
13 
14 #include "fhiclcpp/ParameterSet.h"
23 #include <iostream>
24 #include <fstream>
25 
26 using namespace std;
27 
28 namespace util{
29 
31  {
32  public:
35 
36  void reconfigure(fhicl::ParameterSet const& p);
37 
38  struct metadata {
39  std::tuple<std::string, std::string, std::string> fapplication;
40  //no crc information yet
41  //std::vector<std::string> fcrcs;
43  time_t fend_time;
44  unsigned int fevent_count=0;
45  unsigned int fnew_event_count = 0;
48  art::EventNumber_t ffirst_event=0;
50  art::EventNumber_t flast_event=0;
51  std::set<std::string> fParents;
52  std::vector<std::tuple<art::RunNumber_t,art::SubRunNumber_t,std::string>> fruns;
53  time_t fstart_time=0;
71  };
72 
74  std::set<art::SubRunID> fSubRunNumbers;
75  std::map<std::string,std::string> mdmap;
76 
77  private:
78 
79  // Callbacks.
80  void postBeginJob();
81  void postOpenFile(std::string const& fn);
82  void postEvent(art::Event const& ev, art::ScheduleContext);
83  void postCloseOutput(art::OutputFileInfo const&);
84  void postBeginSubRun(art::SubRun const& subrun);
85  void postEndJob();
86 
87  // Private member functions.
88 
89  // Data members.
90 
91  // Fcl parameters.
95 
96  }; // class TFileMetadataDUNE
97 
98 } //namespace utils
99 
101 
102 #endif
Namespace for general, non-LArSoft-specific utilities.
std::map< std::string, std::string > mdmap
std::string string
Definition: nybbler.cc:12
STL namespace.
std::set< art::SubRunID > fSubRunNumbers
std::tuple< std::string, std::string, std::string > fapplication
std::vector< std::tuple< art::RunNumber_t, art::SubRunNumber_t, std::string > > fruns
QAsciiDict< Entry > fn
virtual void reconfigure(fhicl::ParameterSet const &pset)
#define DECLARE_ART_SERVICE(svc, scope)
p
Definition: test.py:223
std::set< std::string > fParents
IDNumber_t< Level::Event > EventNumber_t
Definition: IDNumber.h:118