Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
Utilities
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
"
15
#include "
art/Framework/Services/Registry/ActivityRegistry.h
"
16
#include "
art/Framework/Services/Registry/ServiceHandle.h
"
17
#include "
art/Framework/Services/Registry/ServiceMacros.h
"
18
#include "
art/Framework/Principal/RunPrincipal.h
"
19
#include "
art/Framework/Principal/SubRunPrincipal.h
"
20
#include "
art/Framework/Principal/Event.h
"
21
#include "
art/Utilities/OutputFileInfo.h
"
22
#include "
art/Persistency/Provenance/ScheduleContext.h
"
23
#include <iostream>
24
#include <fstream>
25
26
using namespace
std
;
27
28
namespace
util
{
29
30
class
TFileMetadataDUNE
31
{
32
public
:
33
TFileMetadataDUNE
(
fhicl::ParameterSet
const
& pset,
art::ActivityRegistry
&
reg
);
34
~
TFileMetadataDUNE
();
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;
42
std::string
fdata_tier
;
43
time_t
fend_time
;
44
unsigned
int
fevent_count=0;
45
unsigned
int
fnew_event_count = 0;
46
std::string
ffile_format
;
47
std::string
ffile_type
;
48
art::EventNumber_t
ffirst_event=0;
49
std::string
fgroup
;
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;
54
std::string
fMCGenerators
;
55
std::string
fMCOscillationP
;
56
std::string
fMCTriggerListVersion
;
57
std::string
fMCBeamEnergy
;
58
std::string
fMCBeamFluxID
;
59
std::string
fMCName
;
60
std::string
fMCDetectorType
;
61
std::string
fMCNeutrinoFlavors
;
62
std::string
fMCMassHierarchy
;
63
std::string
fMCMiscellaneous
;
64
std::string
fMCGeometryVersion
;
65
std::string
fMCOverlay
;
66
std::string
fDataRunMode
;
67
std::string
fDataDetectorType
;
68
std::string
fDataName
;
69
std::string
fStageName
;
70
std::string
fFileName
;
71
};
72
73
metadata
md
;
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.
92
bool
fGenerateTFileMetadata
;
93
std::string
frunType
;
94
std::string
fJSONFileName
;
95
96
};
// class TFileMetadataDUNE
97
98
}
//namespace utils
99
100
DECLARE_ART_SERVICE
(
util::TFileMetadataDUNE
, LEGACY)
101
102
#endif
OutputFileInfo.h
art::SubRun
Definition:
SubRun.h:21
util::TFileMetadataDUNE::metadata::fDataRunMode
std::string fDataRunMode
Definition:
TFileMetadataDUNE.h:66
util
Namespace for general, non-LArSoft-specific utilities.
Definition:
SignalShapingService.h:21
util::TFileMetadataDUNE::mdmap
std::map< std::string, std::string > mdmap
Definition:
TFileMetadataDUNE.h:75
art::OutputFileInfo
Definition:
OutputFileInfo.h:10
util::TFileMetadataDUNE::metadata::fend_time
time_t fend_time
Definition:
TFileMetadataDUNE.h:43
util::TFileMetadataDUNE::frunType
std::string frunType
Definition:
TFileMetadataDUNE.h:93
string
std::string string
Definition:
nybbler.cc:12
util::TFileMetadataDUNE::metadata::fMCGenerators
std::string fMCGenerators
Definition:
TFileMetadataDUNE.h:54
util::TFileMetadataDUNE::metadata
Definition:
TFileMetadataDUNE.h:38
util::TFileMetadataDUNE::metadata::fMCBeamEnergy
std::string fMCBeamEnergy
Definition:
TFileMetadataDUNE.h:57
RunPrincipal.h
util::TFileMetadataDUNE::metadata::fDataName
std::string fDataName
Definition:
TFileMetadataDUNE.h:68
std
STL namespace.
util::TFileMetadataDUNE::fSubRunNumbers
std::set< art::SubRunID > fSubRunNumbers
Definition:
TFileMetadataDUNE.h:74
util::TFileMetadataDUNE::md
metadata md
Definition:
TFileMetadataDUNE.h:73
util::TFileMetadataDUNE::metadata::fMCDetectorType
std::string fMCDetectorType
Definition:
TFileMetadataDUNE.h:60
util::TFileMetadataDUNE::metadata::fMCMassHierarchy
std::string fMCMassHierarchy
Definition:
TFileMetadataDUNE.h:62
util::TFileMetadataDUNE::metadata::fMCGeometryVersion
std::string fMCGeometryVersion
Definition:
TFileMetadataDUNE.h:64
util::TFileMetadataDUNE::metadata::fapplication
std::tuple< std::string, std::string, std::string > fapplication
Definition:
TFileMetadataDUNE.h:39
util::TFileMetadataDUNE::metadata::fMCMiscellaneous
std::string fMCMiscellaneous
Definition:
TFileMetadataDUNE.h:63
ParameterSet.h
ServiceHandle.h
util::TFileMetadataDUNE::metadata::fruns
std::vector< std::tuple< art::RunNumber_t, art::SubRunNumber_t, std::string > > fruns
Definition:
TFileMetadataDUNE.h:52
util::TFileMetadataDUNE::metadata::fStageName
std::string fStageName
Definition:
TFileMetadataDUNE.h:69
util::TFileMetadataDUNE::metadata::fMCOverlay
std::string fMCOverlay
Definition:
TFileMetadataDUNE.h:65
ScheduleContext.h
fn
QAsciiDict< Entry > fn
Definition:
tclscanner.cpp:1149
util::TFileMetadataDUNE::metadata::fMCNeutrinoFlavors
std::string fMCNeutrinoFlavors
Definition:
TFileMetadataDUNE.h:61
RunHistoryService::reconfigure
virtual void reconfigure(fhicl::ParameterSet const &pset)
DECLARE_ART_SERVICE
#define DECLARE_ART_SERVICE(svc, scope)
Definition:
ServiceDeclarationMacros.h:77
util::TFileMetadataDUNE
Definition:
TFileMetadataDUNE.h:30
test.p
p
Definition:
test.py:223
util::TFileMetadataDUNE::metadata::fFileName
std::string fFileName
Definition:
TFileMetadataDUNE.h:70
util::TFileMetadataDUNE::metadata::fMCOscillationP
std::string fMCOscillationP
Definition:
TFileMetadataDUNE.h:55
ServiceMacros.h
util::TFileMetadataDUNE::metadata::fMCName
std::string fMCName
Definition:
TFileMetadataDUNE.h:59
SubRunPrincipal.h
art::ScheduleContext
Definition:
ScheduleContext.h:7
art::Event
Definition:
Event.h:22
util::TFileMetadataDUNE::metadata::fdata_tier
std::string fdata_tier
Definition:
TFileMetadataDUNE.h:42
util::TFileMetadataDUNE::metadata::fDataDetectorType
std::string fDataDetectorType
Definition:
TFileMetadataDUNE.h:67
util::TFileMetadataDUNE::metadata::ffile_type
std::string ffile_type
Definition:
TFileMetadataDUNE.h:47
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
ActivityRegistry.h
util::TFileMetadataDUNE::metadata::fParents
std::set< std::string > fParents
Definition:
TFileMetadataDUNE.h:51
art::EventNumber_t
IDNumber_t< Level::Event > EventNumber_t
Definition:
IDNumber.h:118
util::TFileMetadataDUNE::metadata::fMCBeamFluxID
std::string fMCBeamFluxID
Definition:
TFileMetadataDUNE.h:58
Event.h
util::TFileMetadataDUNE::metadata::fgroup
std::string fgroup
Definition:
TFileMetadataDUNE.h:49
cet::registry_via_id
Definition:
registry_via_id.h:19
util::TFileMetadataDUNE::fJSONFileName
std::string fJSONFileName
Definition:
TFileMetadataDUNE.h:94
util::TFileMetadataDUNE::metadata::ffile_format
std::string ffile_format
Definition:
TFileMetadataDUNE.h:46
util::TFileMetadataDUNE::fGenerateTFileMetadata
bool fGenerateTFileMetadata
Definition:
TFileMetadataDUNE.h:92
util::TFileMetadataDUNE::metadata::fMCTriggerListVersion
std::string fMCTriggerListVersion
Definition:
TFileMetadataDUNE.h:56
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11