Skip to content

Commit

Permalink
Change all workflows from require-ctp-lumi to lumi-type option
Browse files Browse the repository at this point in the history
PR12205 took care only of TPC worflows, the option should be the same for all workflows
using TPC corrections.
  • Loading branch information
shahor02 committed Nov 13, 2023
1 parent 044a4ec commit d2ec829
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace align

/// create a processor spec
framework::DataProcessorSpec getBarrelAlignmentSpec(o2::dataformats::GlobalTrackID::mask_t srcMP, o2::dataformats::GlobalTrackID::mask_t src,
o2::detectors::DetID::mask_t dets, o2::detectors::DetID::mask_t skipDetClusters, bool enableCosmic, int postproc, bool useMC);
o2::detectors::DetID::mask_t dets, o2::detectors::DetID::mask_t skipDetClusters, bool enableCosmic, int postproc, bool useMC, int lumiType);

} // namespace align
} // namespace o2
Expand Down
4 changes: 2 additions & 2 deletions Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void BarrelAlignmentSpec::endOfStream(EndOfStreamContext& ec)
mDBGOut.reset();
}

DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_t src, DetID::mask_t dets, DetID::mask_t skipDetClusters, bool enableCosmic, int postprocess, bool useMC)
DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_t src, DetID::mask_t dets, DetID::mask_t skipDetClusters, bool enableCosmic, int postprocess, bool useMC, int lumiType)
{
std::vector<OutputSpec> outputs;
auto dataRequest = std::make_shared<DataRequest>();
Expand All @@ -383,7 +383,7 @@ DataProcessorSpec getBarrelAlignmentSpec(GTrackID::mask_t srcMP, GTrackID::mask_
}
if (src[DetID::TPC] && !skipDetClusters[DetID::TPC]) {
o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, src[GTrackID::CTP]);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, lumiType);
loadTPCCalib = true;
}
}
Expand Down
8 changes: 4 additions & 4 deletions Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
{"enable-tpc-tracks", VariantType::Bool, false, {"allow reading TPC tracks"}},
{"enable-tpc-clusters", VariantType::Bool, false, {"allow reading TPC clusters (will trigger TPC tracks reading)"}},
{"enable-cosmic", VariantType::Bool, false, {"enable cosmic tracks)"}},
{"require-ctp-lumi", o2::framework::VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}},
{"lumi-type", o2::framework::VariantType::Int, 0, {"1 = require CTP lumi for TPC correction scaling, 2 = require TPC scalers for TPC correction scaling"}},
{"postprocessing", VariantType::Int, 0, {"postprocessing bits: 1 - extract alignment objects, 2 - check constraints, 4 - print mpParams/Constraints, 8 - relabel pede results"}},
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
o2::raw::HBFUtilsInitializer::addConfigOption(options);
Expand Down Expand Up @@ -91,7 +91,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
bool loadTPCTracks = configcontext.options().get<bool>("enable-tpc-tracks");
bool enableCosmic = configcontext.options().get<bool>("enable-cosmic");
bool useMC = configcontext.options().get<bool>("enable-mc");
auto requireCTPLumi = configcontext.options().get<bool>("require-ctp-lumi");
auto lumiType = configcontext.options().get<int>("lumi-type");

DetID::mask_t dets = allowedDets & DetID::getMask(configcontext.options().get<std::string>("detectors"));
DetID::mask_t skipDetClusters; // optionally skip automatically loaded clusters
Expand Down Expand Up @@ -140,14 +140,14 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
}
LOG(info) << "adding TOF request";
}
if (requireCTPLumi) {
if (lumiType == 1) {
src = src | GID::getSourcesMask("CTP");
}
// write the configuration used for the workflow
o2::conf::ConfigurableParam::writeINI("o2_barrel_alignment_configuration.ini");
}

specs.emplace_back(o2::align::getBarrelAlignmentSpec(srcMP, src, dets, skipDetClusters, enableCosmic, postprocess, useMC));
specs.emplace_back(o2::align::getBarrelAlignmentSpec(srcMP, src, dets, skipDetClusters, enableCosmic, postprocess, useMC, lumiType));
// RS FIXME: check which clusters are really needed
if (!postprocess) {
GID::mask_t dummy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace globaltracking
{

/// create a processor spec
framework::DataProcessorSpec getCosmicsMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC);
framework::DataProcessorSpec getCosmicsMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC, int lumiType);

} // namespace globaltracking
} // namespace o2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace vertexing
{

/// create a processor spec
o2::framework::DataProcessorSpec getSecondaryVertexingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool enableCasc, bool enable3body, bool enableStrangenesTracking, bool useMC);
o2::framework::DataProcessorSpec getSecondaryVertexingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool enableCasc, bool enable3body, bool enableStrangenesTracking, bool useMC, int lumiType);

} // namespace vertexing
} // namespace o2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace globaltracking
{

/// create a processor spec
framework::DataProcessorSpec getTOFMatcherSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC, bool useFIT, bool tpcRefit, bool strict, float extratolerancetrd = 0., bool pushMatchable = 0);
framework::DataProcessorSpec getTOFMatcherSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC, bool useFIT, bool tpcRefit, bool strict, float extratolerancetrd, bool pushMatchable, int lumiType);

} // namespace globaltracking
} // namespace o2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace o2
namespace globaltracking
{
/// create a processor spec
framework::DataProcessorSpec getTPCITSMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useMC);
framework::DataProcessorSpec getTPCITSMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useMC, int lumiType);

} // namespace globaltracking
} // namespace o2
Expand Down
4 changes: 2 additions & 2 deletions Detectors/GlobalTrackingWorkflow/src/CosmicsMatchingSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void CosmicsMatchingSpec::endOfStream(EndOfStreamContext& ec)
mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
}

DataProcessorSpec getCosmicsMatchingSpec(GTrackID::mask_t src, bool useMC)
DataProcessorSpec getCosmicsMatchingSpec(GTrackID::mask_t src, bool useMC, int lumiType)
{
std::vector<OutputSpec> outputs;
Options opts{
Expand All @@ -198,7 +198,7 @@ DataProcessorSpec getCosmicsMatchingSpec(GTrackID::mask_t src, bool useMC)
dataRequest->inputs,
true);
o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, src[GTrackID::CTP]);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, lumiType);

return DataProcessorSpec{
"cosmics-matcher",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void SecondaryVertexingSpec::updateTimeDependentParams(ProcessingContext& pc)
pc.inputs().get<o2::dataformats::MeanVertexObject*>("meanvtx");
}

DataProcessorSpec getSecondaryVertexingSpec(GTrackID::mask_t src, bool enableCasc, bool enable3body, bool enableStrangenesTracking, bool useMC)
DataProcessorSpec getSecondaryVertexingSpec(GTrackID::mask_t src, bool enableCasc, bool enable3body, bool enableStrangenesTracking, bool useMC, int lumiType)
{
std::vector<OutputSpec> outputs;
Options opts{
Expand All @@ -218,7 +218,7 @@ DataProcessorSpec getSecondaryVertexingSpec(GTrackID::mask_t src, bool enableCas
dataRequest->inputs,
true);
o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, src[GTrackID::CTP]);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, lumiType);

outputs.emplace_back("GLO", "V0S_IDX", 0, Lifetime::Timeframe); // found V0s indices
outputs.emplace_back("GLO", "V0S", 0, Lifetime::Timeframe); // found V0s
Expand Down
4 changes: 2 additions & 2 deletions Detectors/GlobalTrackingWorkflow/src/TOFMatcherSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void TOFMatcherSpec::endOfStream(EndOfStreamContext& ec)
mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
}

DataProcessorSpec getTOFMatcherSpec(GID::mask_t src, bool useMC, bool useFIT, bool tpcRefit, bool strict, float extratolerancetrd, bool pushMatchable)
DataProcessorSpec getTOFMatcherSpec(GID::mask_t src, bool useMC, bool useFIT, bool tpcRefit, bool strict, float extratolerancetrd, bool pushMatchable, int lumiType)
{
uint32_t ss = o2::globaltracking::getSubSpec(strict ? o2::globaltracking::MatchingType::Strict : o2::globaltracking::MatchingType::Standard);
Options opts;
Expand All @@ -260,7 +260,7 @@ DataProcessorSpec getTOFMatcherSpec(GID::mask_t src, bool useMC, bool useFIT, bo
dataRequest->inputs,
true);
o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, src[GID::CTP]);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, lumiType);
std::vector<OutputSpec> outputs;
if (GID::includesSource(GID::TPC, src)) {
outputs.emplace_back(o2::header::gDataOriginTOF, "MTC_TPC", ss, Lifetime::Timeframe);
Expand Down
4 changes: 2 additions & 2 deletions Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void TPCITSMatchingDPL::updateTimeDependentParams(ProcessingContext& pc)
}
}

DataProcessorSpec getTPCITSMatchingSpec(GTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useMC)
DataProcessorSpec getTPCITSMatchingSpec(GTrackID::mask_t src, bool useFT0, bool calib, bool skipTPCOnly, bool useMC, int lumiType)
{
std::vector<OutputSpec> outputs;
auto dataRequest = std::make_shared<DataRequest>();
Expand Down Expand Up @@ -239,7 +239,7 @@ DataProcessorSpec getTPCITSMatchingSpec(GTrackID::mask_t src, bool useFT0, bool
{"debug-tree-flags", VariantType::Int, 0, {"DebugFlagTypes bit-pattern for debug tree"}}};

o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, src[GTrackID::CTP]);
o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, lumiType);

return DataProcessorSpec{
"itstpc-track-matcher",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
{"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
{"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
{"track-sources", VariantType::String, std::string{GID::ALL}, {"comma-separated list of sources to use"}},
{"require-ctp-lumi", o2::framework::VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}},
{"lumi-type", o2::framework::VariantType::Int, 0, {"1 = require CTP lumi for TPC correction scaling, 2 = require TPC scalers for TPC correction scaling"}},
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
o2::raw::HBFUtilsInitializer::addConfigOption(options);
std::swap(workflowOptions, options);
Expand Down Expand Up @@ -84,7 +84,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)

auto useMC = !configcontext.options().get<bool>("disable-mc");
auto disableRootOut = configcontext.options().get<bool>("disable-root-output");
auto requireCTPLumi = configcontext.options().get<bool>("require-ctp-lumi");
auto lumiType = configcontext.options().get<int>("lumi-type");

GID::mask_t src = alowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("track-sources"));
if (GID::includesDet(DetID::TPC, src)) {
Expand All @@ -96,12 +96,12 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
if (GID::includesDet(DetID::TOF, src)) {
src |= GID::getSourceMask(GID::TOF);
}
if (requireCTPLumi) {
if (lumiType == 1) {
src = src | GID::getSourcesMask("CTP");
}
GID::mask_t srcCl = src;
GID::mask_t dummy;
specs.emplace_back(o2::globaltracking::getCosmicsMatchingSpec(src, useMC));
specs.emplace_back(o2::globaltracking::getCosmicsMatchingSpec(src, useMC, lumiType));

o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, src, src, src, useMC, dummy); // clusters MC is not needed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
{"disable-strangeness-tracker", o2::framework::VariantType::Bool, false, {"do not run strangeness tracker"}},

{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}},
{"require-ctp-lumi", o2::framework::VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}},
{"lumi-type", o2::framework::VariantType::Int, 0, {"1 = require CTP lumi for TPC correction scaling, 2 = require TPC scalers for TPC correction scaling"}},
{"combine-source-devices", o2::framework::VariantType::Bool, false, {"merge DPL source devices"}}};
o2::raw::HBFUtilsInitializer::addConfigOption(options);
std::swap(workflowOptions, options);
Expand All @@ -81,19 +81,19 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
auto enableCasc = !configcontext.options().get<bool>("disable-cascade-finder");
auto enable3body = !configcontext.options().get<bool>("disable-3body-finder");
auto enagleStrTr = !configcontext.options().get<bool>("disable-strangeness-tracker");
auto requireCTPLumi = configcontext.options().get<bool>("require-ctp-lumi");
auto lumiType = configcontext.options().get<int>("lumi-type");

GID::mask_t src = allowedSources & GID::getSourcesMask(configcontext.options().get<std::string>("vertexing-sources"));
GID::mask_t dummy, srcClus = GID::includesDet(DetID::TOF, src) ? GID::getSourceMask(GID::TOF) : dummy; // eventually, TPC clusters will be needed for refit
if (enagleStrTr) {
srcClus |= GID::getSourceMask(GID::ITS);
}
if (requireCTPLumi) {
if (lumiType == 1) {
src = src | GID::getSourcesMask("CTP");
}
WorkflowSpec specs;

specs.emplace_back(o2::vertexing::getSecondaryVertexingSpec(src, enableCasc, enable3body, enagleStrTr, useMC));
specs.emplace_back(o2::vertexing::getSecondaryVertexingSpec(src, enableCasc, enable3body, enagleStrTr, useMC, lumiType));

// only TOF clusters are needed if TOF is involved, no clusters MC needed
WorkflowSpec inputspecs;
Expand Down
8 changes: 4 additions & 4 deletions Detectors/GlobalTrackingWorkflow/src/tof-matcher-workflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
{"enable-dia", o2::framework::VariantType::Bool, false, {"to require diagnostic freq and then write to calib outputs (obsolete since now default)"}},
{"trd-extra-tolerance", o2::framework::VariantType::Float, 500.0f, {"Extra time tolerance for TRD tracks in ns"}},
{"write-matchable", o2::framework::VariantType::Bool, false, {"write all matchable pairs in a file (o2matchable_tof.root)"}},
{"require-ctp-lumi", o2::framework::VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}},
{"lumi-type", o2::framework::VariantType::Int, 0, {"1 = require CTP lumi for TPC correction scaling, 2 = require TPC scalers for TPC correction scaling"}},
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}},
{"combine-devices", o2::framework::VariantType::Bool, false, {"merge DPL source/writer devices"}}};
o2::raw::HBFUtilsInitializer::addConfigOption(options);
Expand Down Expand Up @@ -93,7 +93,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
auto diagnostic = configcontext.options().get<bool>("enable-dia");
auto extratolerancetrd = configcontext.options().get<float>("trd-extra-tolerance");
auto writeMatchable = configcontext.options().get<bool>("write-matchable");
auto requireCTPLumi = configcontext.options().get<bool>("require-ctp-lumi");
auto lumiType = configcontext.options().get<int>("lumi-type");
bool writematching = 0;
bool writecalib = 0;
auto outputType = configcontext.options().get<std::string>("output-type");
Expand Down Expand Up @@ -138,7 +138,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
if (useFIT) {
clustermask |= GID::getSourceMask(GID::FT0);
}
if (requireCTPLumi) {
if (lumiType == 1) {
src = src | GID::getSourcesMask("CTP");
}
if (useMC) {
Expand All @@ -159,7 +159,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
}
}

specs.emplace_back(o2::globaltracking::getTOFMatcherSpec(src, useMC, useFIT, false, strict, extratolerancetrd, writeMatchable)); // doTPCrefit not yet supported (need to load TPC clusters?)
specs.emplace_back(o2::globaltracking::getTOFMatcherSpec(src, useMC, useFIT, false, strict, extratolerancetrd, writeMatchable, lumiType)); // doTPCrefit not yet supported (need to load TPC clusters?)

if (!disableRootOut) {
std::vector<DataProcessorSpec> writers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
// option allowing to set parameters
std::vector<o2::framework::ConfigParamSpec> options{
{"use-ft0", o2::framework::VariantType::Bool, false, {"use FT0 in matching"}},
{"require-ctp-lumi", o2::framework::VariantType::Bool, false, {"require CTP lumi for TPC correction scaling"}},
{"lumi-type", o2::framework::VariantType::Int, 0, {"1 = require CTP lumi for TPC correction scaling, 2 = require TPC scalers for TPC correction scaling"}},
{"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}},
{"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
{"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
Expand Down Expand Up @@ -78,16 +78,16 @@ WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& configcont
if (useFT0) {
src |= GID::getSourceMask(GID::FT0);
}
auto requireCTPLumi = configcontext.options().get<bool>("require-ctp-lumi");
auto lumiType = configcontext.options().get<int>("lumi-type");
auto useMC = !configcontext.options().get<bool>("disable-mc");
auto calib = configcontext.options().get<bool>("produce-calibration-data");
auto srcL = src | GID::getSourcesMask("ITS,TPC"); // ITS is neadded always, TPC must be loaded even if bare TPC tracks are not used in matching
if (requireCTPLumi) {
if (lumiType == 1) {
srcL = srcL | GID::getSourcesMask("CTP");
}

o2::framework::WorkflowSpec specs;
specs.emplace_back(o2::globaltracking::getTPCITSMatchingSpec(srcL, useFT0, calib, !GID::includesSource(GID::TPC, src), useMC));
specs.emplace_back(o2::globaltracking::getTPCITSMatchingSpec(srcL, useFT0, calib, !GID::includesSource(GID::TPC, src), useMC, lumiType));

if (!configcontext.options().get<bool>("disable-root-output")) {
specs.emplace_back(o2::globaltracking::getTrackWriterTPCITSSpec(useMC));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace o2::trackstudy
{
/// create a processor spec
o2::framework::DataProcessorSpec getTPCTrackStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC);
o2::framework::DataProcessorSpec getTPCTrackStudySpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC, int lumyType);

} // namespace o2::trackstudy

Expand Down
Loading

0 comments on commit d2ec829

Please sign in to comment.