Skip to content

Commit

Permalink
connect TPCScalerSpec to dependent standalone workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Dec 12, 2023
1 parent dfab439 commit 13053ae
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Detectors/Align/Workflow/src/barrel-alignment-workflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "TPCReaderWorkflow/TrackReaderSpec.h"
#include "TPCReaderWorkflow/ClusterReaderSpec.h"
#include "TPCWorkflow/ClusterSharingMapSpec.h"
#include "TPCWorkflow/TPCScalerSpec.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "TOFWorkflowIO/ClusterReaderSpec.h"
#include "TOFWorkflowIO/TOFMatchedReaderSpec.h"
Expand Down Expand Up @@ -147,6 +148,10 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
o2::conf::ConfigurableParam::writeINI("o2_barrel_alignment_configuration.ini");
}

if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}

specs.emplace_back(o2::align::getBarrelAlignmentSpec(srcMP, src, dets, skipDetClusters, enableCosmic, postprocess, useMC, sclOpt));
// RS FIXME: check which clusters are really needed
if (!postprocess) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "ITSMFTWorkflow/ClusterReaderSpec.h"
#include "TPCReaderWorkflow/TrackReaderSpec.h"
#include "TPCReaderWorkflow/ClusterReaderSpec.h"
#include "TPCWorkflow/TPCScalerSpec.h"
#include "TPCWorkflow/ClusterSharingMapSpec.h"
#include "TOFWorkflowIO/ClusterReaderSpec.h"
#include "TOFWorkflowIO/TOFMatchedReaderSpec.h"
Expand Down Expand Up @@ -101,6 +102,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
}
GID::mask_t srcCl = src;
GID::mask_t dummy;
if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}
specs.emplace_back(o2::globaltracking::getCosmicsMatchingSpec(src, useMC, sclOpt));

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 @@ -17,6 +17,7 @@
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
#include "ITSWorkflow/TrackReaderSpec.h"
#include "TPCReaderWorkflow/TrackReaderSpec.h"
#include "TPCWorkflow/TPCScalerSpec.h"
#include "TOFWorkflowIO/TOFMatchedReaderSpec.h"
#include "TOFWorkflowIO/ClusterReaderSpec.h"
#include "ReconstructionDataFormats/GlobalTrackID.h"
Expand Down Expand Up @@ -96,7 +97,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
src = src | GID::getSourcesMask("CTP");
}
WorkflowSpec specs;

if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}
specs.emplace_back(o2::vertexing::getSecondaryVertexingSpec(src, enableCasc, enable3body, enableStrTr, enableCCDBParams, useMC, sclOpt));

// only TOF clusters are needed if TOF is involved, no clusters MC needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "TSystem.h"
#include "DetectorsBase/DPLWorkflowUtils.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "TPCWorkflow/TPCScalerSpec.h"

using namespace o2::framework;
using DetID = o2::detectors::DetID;
Expand Down Expand Up @@ -167,7 +168,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
specs.push_back(s);
}
}

if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}
specs.emplace_back(o2::globaltracking::getTOFMatcherSpec(src, useMC, useFIT, refitTPCTOF, strict, extratolerancetrd, writeMatchable, sclOpt, nLanes)); // doTPCrefit not yet supported (need to load TPC clusters?)

if (!disableRootOut) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// or submit itself to any jurisdiction.

#include "TPCWorkflow/ClusterSharingMapSpec.h"
#include "TPCWorkflow/TPCScalerSpec.h"
#include "GlobalTrackingWorkflow/TPCITSMatchingSpec.h"
#include "GlobalTrackingWorkflow/TrackWriterTPCITSSpec.h"
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
Expand Down Expand Up @@ -87,6 +88,9 @@ WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& configcont
}

o2::framework::WorkflowSpec specs;
if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}
specs.emplace_back(o2::globaltracking::getTPCITSMatchingSpec(srcL, useFT0, calib, !GID::includesSource(GID::TPC, src), useMC, sclOpt));

if (!configcontext.options().get<bool>("disable-root-output")) {
Expand Down
1 change: 1 addition & 0 deletions Detectors/GlobalTrackingWorkflow/study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ o2_add_library(GlobalTrackingStudy
O2::GlobalTrackingWorkflowHelpers
O2::DataFormatsGlobalTracking
O2::DetectorsVertexing
O2::TPCWorkflow
O2::SimulationDataFormat)

o2_add_executable(study-workflow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
#include "DetectorsRaw/HBFUtilsInitializer.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "TPCWorkflow/TPCScalerSpec.h"

using namespace o2::framework;
using GID = o2::dataformats::GlobalTrackID;
Expand Down Expand Up @@ -70,6 +71,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
}
o2::globaltracking::InputHelper::addInputSpecs(configcontext, specs, srcCls, srcTrc, srcTrc, useMC);
o2::globaltracking::InputHelper::addInputSpecsPVertex(configcontext, specs, useMC); // P-vertex is always needed
if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}
specs.emplace_back(o2::trackstudy::getTPCTrackStudySpec(srcTrc, srcCls, useMC, sclOpt));

// configure dpl timer to inject correct firstTForbit: start from the 1st orbit of TF containing 1st sampled orbit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ struct CorrectionMapsLoaderGloOpts {
int lumiType = 0; ///< 0: no scaling, 1: CTP, 2: IDC
int lumiMode = 0; ///< 0: classical scaling, 1: Using of the derivative map, 2: Using of the derivative map for MC
bool enableVShapeCorrection = false;

bool needTPCScalersWorkflow() const
{
return lumiType == 2 || enableVShapeCorrection;
}
};

class CorrectionMapsLoader : public o2::gpu::CorrectionMapsHelper
Expand Down
7 changes: 7 additions & 0 deletions Detectors/TPC/workflow/src/RecoWorkflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "TPCWorkflow/TPCTriggerWriterSpec.h"
#include "TPCReaderWorkflow/PublisherSpec.h"
#include "TPCWorkflow/ClustererSpec.h"
#include "TPCWorkflow/TPCScalerSpec.h"
#include "TPCWorkflow/ClusterDecoderRawSpec.h"
#include "GPUWorkflow/GPUWorkflowSpec.h"
#include "TPCWorkflow/EntropyEncoderSpec.h"
Expand Down Expand Up @@ -196,6 +197,9 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
laneConfiguration,
&hook},
propagateMC));
if (sclOpts.needTPCScalersWorkflow()) { // for standalone tpc-reco workflow
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpts.lumiType == 2, sclOpts.enableVShapeCorrection));
}
} else if (inputType == InputType::ClustersHardware) {
specs.emplace_back(o2::tpc::getPublisherSpec(PublisherConf{
"tpc-clusterhardware-reader",
Expand All @@ -214,6 +218,9 @@ framework::WorkflowSpec getWorkflow(CompletionPolicyData* policyData, std::vecto
if (!getenv("DPL_DISABLE_TPC_TRIGGER_READER") || atoi(getenv("DPL_DISABLE_TPC_TRIGGER_READER")) != 1) {
specs.emplace_back(o2::tpc::getTPCTriggerReaderSpec());
}
if (sclOpts.needTPCScalersWorkflow()) { // for standalone tpc-reco workflow
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpts.lumiType == 2, sclOpts.enableVShapeCorrection));
}
} else if (inputType == InputType::CompClusters) {
// TODO: need to check if we want to store the MC labels alongside with compressed clusters
// for the moment reading of labels is disabled (last parameter is false)
Expand Down
7 changes: 6 additions & 1 deletion Detectors/TPC/workflow/src/tpc-calib-gainmap-tracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "TPCWorkflow/TPCCalibPadGainTracksSpec.h"
#include "TPCReaderWorkflow/TPCSectorCompletionPolicy.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "TPCWorkflow/TPCScalerSpec.h"

using namespace o2::framework;

Expand Down Expand Up @@ -63,6 +64,10 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
const std::string polynomialsFile = config.options().get<std::string>("polynomialsFile");
const auto disablePolynomialsCCDB = config.options().get<bool>("disablePolynomialsCCDB");
const auto sclOpt = o2::tpc::CorrectionMapsLoader::parseGlobalOptions(config.options());
WorkflowSpec workflow{getTPCCalibPadGainTracksSpec(publishAfterTFs, debug, useLastExtractedMapAsReference, polynomialsFile, disablePolynomialsCCDB, sclOpt)};
WorkflowSpec workflow;
if (sclOpt.needTPCScalersWorkflow()) {
workflow.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}
workflow.emplace_back(o2::tpc::getTPCCalibPadGainTracksSpec(publishAfterTFs, debug, useLastExtractedMapAsReference, polynomialsFile, disablePolynomialsCCDB, sclOpt));
return workflow;
}
4 changes: 4 additions & 0 deletions Detectors/TRD/workflow/src/trd-tracking-workflow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "TRDWorkflow/TRDPulseHeightSpec.h"
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "TPCWorkflow/TPCScalerSpec.h"

using namespace o2::framework;
using GTrackID = o2::dataformats::GlobalTrackID;
Expand Down Expand Up @@ -112,6 +113,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)

// processing devices
o2::framework::WorkflowSpec specs;
if (sclOpt.needTPCScalersWorkflow() && !configcontext.options().get<bool>("disable-root-input")) {
specs.emplace_back(o2::tpc::getTPCScalerSpec(sclOpt.lumiType == 2, sclOpt.enableVShapeCorrection));
}
specs.emplace_back(o2::trd::getTRDGlobalTrackingSpec(useMC, srcTRD, trigRecFilterActive, strict, pid, policy, sclOpt));
if (vdexb || gain) {
specs.emplace_back(o2::trd::getTRDTrackBasedCalibSpec(srcTRD, vdexb, gain));
Expand Down

0 comments on commit 13053ae

Please sign in to comment.