1717#include " TRDWorkflow/GainCalibSpec.h"
1818#include " TRDWorkflow/NoiseCalibSpec.h"
1919#include " TRDWorkflow/T0FitSpec.h"
20+ #include " TRDWorkflow/PIDCalibSpec.h"
2021#include " CommonUtils/ConfigurableParam.h"
22+ #include " ReconstructionDataFormats/GlobalTrackID.h"
23+ #include " DetectorsCommonDataFormats/DetID.h"
24+ #include " GlobalTrackingWorkflowHelpers/InputHelper.h"
25+ #include " DetectorsRaw/HBFUtilsInitializer.h"
2126
2227using namespace o2 ::framework;
28+ using GID = o2::dataformats::GlobalTrackID;
29+ using DetID = o2::detectors::DetID;
2330
2431// we need to add workflow options before including Framework/runDataProcessing
2532void customize (std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
@@ -31,9 +38,12 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3138 {" noise" , o2::framework::VariantType::Bool, false , {" enable noise and pad status calibration" }},
3239 {" gain" , o2::framework::VariantType::Bool, false , {" enable gain calibration" }},
3340 {" t0" , o2::framework::VariantType::Bool, false , {" enable t0 fit" }},
41+ {" pid" , o2::framework::VariantType::Bool, false , {" enable pid calibration" }},
42+ {" track-sources" , VariantType::String, std::string{GID::ALL}, {" comma-separated list of track sources to use" }},
43+ {" with-sv" , o2::framework::VariantType::Bool, false , {" request secondary-vertices" }},
3444 {" calib-dds-collection-index" , VariantType::Int, -1 , {" allow only single collection to produce calibration objects (use -1 for no limit)" }},
3545 {" configKeyValues" , VariantType::String, " " , {" Semicolon separated key=value strings" }}};
36-
46+ o2::raw::HBFUtilsInitializer::addConfigOption (options);
3747 std::swap (workflowOptions, options);
3848}
3949
@@ -87,5 +97,17 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
8797 specs.emplace_back (getTRDT0FitSpec ());
8898 }
8999
100+ if (configcontext.options ().get <bool >(" pid" )) {
101+ const auto allowedTrkSources = GID::getSourcesMask (" ITS,TPC,TRD,TOF,ITS-TPC-TRD,TPC-TRD,TPC-TRD-TOF,ITS-TPC-TRD-TOF" );
102+ auto srcTrc = allowedTrkSources & GID::getSourcesMask (configcontext.options ().get <std::string>(" track-sources" ));
103+ o2::globaltracking::InputHelper::addInputSpecs (configcontext, specs, {}, srcTrc, srcTrc, false );
104+ auto withSV = configcontext.options ().get <bool >(" with-sv" );
105+ if (withSV) {
106+ o2::globaltracking::InputHelper::addInputSpecsSVertex (configcontext, specs);
107+ }
108+ specs.emplace_back (getTRDPIDCalibSpec (srcTrc, withSV));
109+ o2::raw::HBFUtilsInitializer hbfIni (configcontext, specs);
110+ }
111+
90112 return specs;
91113}
0 commit comments