Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
Utilities
FileCatalogMetadataDUNE_service.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
// Name: FileCatalogMetadataDUNE_service.cc.
3
//
4
// Purpose: Art service adds DUNE-specific per-job sam metadata.
5
//
6
// This service does not have user-callable methods. Simply
7
// add to an art configuration in services.user block of job
8
// file.
9
//
10
// Created: 3-Dec-2014, T. Yang
11
// Copied FileCatalogMetadataMicroBooNE_service.cc by H. Greenlee
12
//
13
////////////////////////////////////////////////////////////////////////
14
15
#include "
dunecore/Utilities/FileCatalogMetadataDUNE.h
"
16
#include "
art/Framework/Services/Registry/ServiceDefinitionMacros.h
"
17
18
//--------------------------------------------------------------------
19
// Constructor.
20
21
util::FileCatalogMetadataDUNE::
22
FileCatalogMetadataDUNE
(
fhicl::ParameterSet
const
& pset,
art::ActivityRegistry
&
reg
)
23
{
24
// Get parameters.
25
26
fMCGenerators
= pset.
get
<
std::string
>(
"MCGenerators"
,
""
);
27
fMCOscillationP
= pset.
get
<
std::string
>(
"MCOscillationP"
,
""
);
28
fMCTriggerListVersion
= pset.
get
<
std::string
>(
"MCTriggerListVersion"
,
""
);
29
fMCBeamEnergy
= pset.
get
<
std::string
>(
"MCBeamEnergy"
,
""
);
30
fMCBeamFluxID
= pset.
get
<
std::string
>(
"MCBeamFluxID"
,
""
);
31
fMCName
= pset.
get
<
std::string
>(
"MCName"
,
""
);
32
fMCDetectorType
= pset.
get
<
std::string
>(
"MCDetectorType"
,
""
);
33
fMCNeutrinoFlavors
= pset.
get
<
std::string
>(
"MCNeutrinoFlavors"
,
""
);
34
fMCMassHierarchy
= pset.
get
<
std::string
>(
"MCMassHierarchy"
,
""
);
35
fMCMiscellaneous
= pset.
get
<
std::string
>(
"MCMiscellaneous"
,
""
);
36
fMCGeometryVersion
= pset.
get
<
std::string
>(
"MCGeometryVersion"
,
""
);
37
fMCOverlay
= pset.
get
<
std::string
>(
"MCOverlay"
,
""
);
38
fDataRunMode
= pset.
get
<
std::string
>(
"DataRunMode"
,
""
);
39
fDataDetectorType
= pset.
get
<
std::string
>(
"DataDetectorType"
,
""
);
40
fDataName
= pset.
get
<
std::string
>(
"DataName"
,
""
);
41
fStageName
= pset.
get
<
std::string
>(
"StageName"
,
""
);
42
// Register for callbacks.
43
44
reg.
sPostBeginJob
.watch(
this
, &
FileCatalogMetadataDUNE::postBeginJob
);
45
}
46
47
//--------------------------------------------------------------------
48
// PostBeginJob callback.
49
// Insert per-job metadata via FileCatalogMetadata service.
50
void
util::FileCatalogMetadataDUNE::postBeginJob
()
51
{
52
// Get art metadata service.
53
54
art::ServiceHandle<art::FileCatalogMetadata>
mds;
55
56
// Add metadata.
57
58
if
(
fMCGenerators
!=
""
) mds->
addMetadata
(
"lbneMCGenerators"
,
fMCGenerators
);
59
if
(
fMCOscillationP
!=
""
) mds->
addMetadata
(
"lbneMCOscillationP"
,
fMCOscillationP
);
60
if
(
fMCTriggerListVersion
!=
""
) mds->
addMetadata
(
"lbneMCTriggerListVersion"
,
fMCTriggerListVersion
);
61
if
(
fMCBeamEnergy
!=
""
) mds->
addMetadata
(
"lbneMCBeamEnergy"
,
fMCBeamEnergy
);
62
if
(
fMCBeamFluxID
!=
""
) mds->
addMetadata
(
"lbneMCBeamFluxID"
,
fMCBeamFluxID
);
63
if
(
fMCName
!=
""
) mds->
addMetadata
(
"lbneMCName"
,
fMCName
);
64
if
(
fMCDetectorType
!=
""
) mds->
addMetadata
(
"lbneMCDetectorType"
,
fMCDetectorType
);
65
if
(
fMCNeutrinoFlavors
!=
""
) mds->
addMetadata
(
"lbneMCNeutrinoFlavors"
,
fMCNeutrinoFlavors
);
66
if
(
fMCMassHierarchy
!=
""
) mds->
addMetadata
(
"lbneMCMassHierarchy"
,
fMCMassHierarchy
);
67
if
(
fMCMiscellaneous
!=
""
) mds->
addMetadata
(
"lbneMCMiscellaneous"
,
fMCMiscellaneous
);
68
if
(
fMCGeometryVersion
!=
""
) mds->
addMetadata
(
"lbneMCGeometryVersion"
,
fMCGeometryVersion
);
69
if
(
fMCOverlay
!=
""
) mds->
addMetadata
(
"lbneMCOverlay"
,
fMCOverlay
);
70
if
(
fDataRunMode
!=
""
) mds->
addMetadata
(
"lbneDataRunMode"
,
fDataRunMode
);
71
if
(
fDataDetectorType
!=
""
) mds->
addMetadata
(
"lbneDataDetectorType"
,
fDataDetectorType
);
72
if
(
fDataName
!=
""
) mds->
addMetadata
(
"lbneDataName"
,
fDataName
);
73
if
(
fStageName
!=
""
) mds->
addMetadata
(
"StageName"
,
fStageName
);
74
}
75
76
DEFINE_ART_SERVICE
(
util::FileCatalogMetadataDUNE
)
art::ServiceHandle
Definition:
ServiceHandle.h:37
FileCatalogMetadataDUNE.h
art::ActivityRegistry::sPostBeginJob
GlobalSignal< detail::SignalResponseType::FIFO, void()> sPostBeginJob
Definition:
ActivityRegistry.h:63
util::FileCatalogMetadataDUNE::fDataName
std::string fDataName
Definition:
FileCatalogMetadataDUNE.h:80
util::FileCatalogMetadataDUNE::fMCBeamEnergy
std::string fMCBeamEnergy
Definition:
FileCatalogMetadataDUNE.h:69
string
std::string string
Definition:
nybbler.cc:12
util::FileCatalogMetadataDUNE::fMCTriggerListVersion
std::string fMCTriggerListVersion
Definition:
FileCatalogMetadataDUNE.h:68
util::FileCatalogMetadataDUNE::fMCGeometryVersion
std::string fMCGeometryVersion
Definition:
FileCatalogMetadataDUNE.h:76
util::FileCatalogMetadataDUNE::postBeginJob
void postBeginJob()
Definition:
FileCatalogMetadataDUNE_service.cc:50
util::FileCatalogMetadataDUNE::fStageName
std::string fStageName
Definition:
FileCatalogMetadataDUNE.h:81
util::FileCatalogMetadataDUNE::fDataDetectorType
std::string fDataDetectorType
Definition:
FileCatalogMetadataDUNE.h:79
util::FileCatalogMetadataDUNE
Definition:
FileCatalogMetadataDUNE.h:30
util::FileCatalogMetadataDUNE::fMCGenerators
std::string fMCGenerators
Definition:
FileCatalogMetadataDUNE.h:66
util::FileCatalogMetadataDUNE::fMCDetectorType
std::string fMCDetectorType
Definition:
FileCatalogMetadataDUNE.h:72
util::FileCatalogMetadataDUNE::fMCOscillationP
std::string fMCOscillationP
Definition:
FileCatalogMetadataDUNE.h:67
util::FileCatalogMetadataDUNE::fDataRunMode
std::string fDataRunMode
Definition:
FileCatalogMetadataDUNE.h:78
fhicl::ParameterSet::get
T get(std::string const &key) const
Definition:
ParameterSet.h:271
util::FileCatalogMetadataDUNE::FileCatalogMetadataDUNE
FileCatalogMetadataDUNE(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
Definition:
FileCatalogMetadataDUNE_service.cc:22
util::FileCatalogMetadataDUNE::fMCName
std::string fMCName
Definition:
FileCatalogMetadataDUNE.h:71
DEFINE_ART_SERVICE
#define DEFINE_ART_SERVICE(svc)
Definition:
ServiceDefinitionMacros.h:36
util::FileCatalogMetadataDUNE::fMCMassHierarchy
std::string fMCMassHierarchy
Definition:
FileCatalogMetadataDUNE.h:74
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
art::FileCatalogMetadata::addMetadata
void addMetadata(std::string const &key, std::string const &value)
Definition:
FileCatalogMetadata.cc:78
ServiceDefinitionMacros.h
cet::registry_via_id
Definition:
registry_via_id.h:19
util::FileCatalogMetadataDUNE::fMCMiscellaneous
std::string fMCMiscellaneous
Definition:
FileCatalogMetadataDUNE.h:75
util::FileCatalogMetadataDUNE::fMCBeamFluxID
std::string fMCBeamFluxID
Definition:
FileCatalogMetadataDUNE.h:70
util::FileCatalogMetadataDUNE::fMCNeutrinoFlavors
std::string fMCNeutrinoFlavors
Definition:
FileCatalogMetadataDUNE.h:73
fhicl::ParameterSet
Definition:
ParameterSet.h:36
util::FileCatalogMetadataDUNE::fMCOverlay
std::string fMCOverlay
Definition:
FileCatalogMetadataDUNE.h:77
Generated by
1.8.11