Skip to content

Commit e13369e

Browse files
Add metadata configuration options for TOFResponse
1 parent 41bf946 commit e13369e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,17 @@ struct strangenesstofpid {
185185
Configurable<bool> autoSetProcessFunctions{"autoSetProcessFunctions", true, "Flag to autodetect the process functions to use"};
186186
} ccdbConfigurations;
187187

188+
// Metadata options
189+
struct : ConfigurableGroup {
190+
std::string prefix = "metadata";
191+
// necessary for TOFResponse when running over derived data (where no metadata can be found)
192+
Configurable<bool> overrideMetadata{"overrideMetadata", false, "Override metadataInfo with custom information. Enable when running over derived data"};
193+
Configurable<std::string> Run{"Run", "3", "Is it Run 3 ? If yes: 3 ; otherwise: 2"};
194+
Configurable<std::string> DataType{"DataType", "Data", "Is it Data? If yes: Data ; otherwise: MC"};
195+
Configurable<std::string> AnchorPassName{"AnchorPassName", "apass1", "Anchor pass name (only if needed for DataType = MC)"};
196+
Configurable<std::string> RecoPassName{"RecoPassName", "apass1", "Reco pass name (only if needed for DataType = Data)"};
197+
} metadataConfigurations;
198+
188199
// manual
189200
Configurable<int> useCustomRunNumber{"useCustomRunNumber", false, "Use custom timestamp"};
190201
Configurable<int> manualRunNumber{"manualRunNumber", 544122, "manual run number if no collisions saved"};
@@ -470,6 +481,13 @@ struct strangenesstofpid {
470481

471482
LOGF(info, "intializing TOFResponse");
472483
std::string taskName = initContext.services().get<o2::framework::DeviceSpec const>().name;
484+
if (doprocessDerivedData || metadataConfigurations.overrideMetadata) {
485+
LOG(info) << "Overriding metadata info. Run = " << metadataConfigurations.Run.value << " ; DataType = " << metadataConfigurations.DataType.value << " ; AnchorPassName (only if DataType = MC) = " << metadataConfigurations.AnchorPassName.value << " ; RecoPassName (only if DataType = Data) = " << metadataConfigurations.RecoPassName.value;
486+
mTOFResponse->metadataInfo.set("Run", metadataConfigurations.Run.value);
487+
mTOFResponse->metadataInfo.set("DataType", metadataConfigurations.DataType.value);
488+
mTOFResponse->metadataInfo.set("AnchorPassName", metadataConfigurations.AnchorPassName.value);
489+
mTOFResponse->metadataInfo.set("RecoPassName", metadataConfigurations.RecoPassName.value);
490+
}
473491
mTOFResponse->initSetup(ccdb, initContext, taskName);
474492

475493
// per event

0 commit comments

Comments
 (0)