Skip to content

Commit

Permalink
Make tpc-time-series to accept track sources
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Dec 19, 2024
1 parent ecec4fc commit 6fa29aa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "Framework/DataProcessorSpec.h"
#include "DetectorsBase/Propagator.h"
#include "ReconstructionDataFormats/GlobalTrackID.h"

namespace o2
{
Expand All @@ -22,7 +23,7 @@ namespace tpc
static constexpr header::DataDescription getDataDescriptionTimeSeries() { return header::DataDescription{"TIMESERIES"}; }
static constexpr header::DataDescription getDataDescriptionTPCTimeSeriesTFId() { return header::DataDescription{"ITPCTSTFID"}; }

o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, bool tpcOnly);
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, o2::dataformats::GlobalTrackID::mask_t src);

} // end namespace tpc
} // end namespace o2
Expand Down
9 changes: 5 additions & 4 deletions Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1751,14 +1751,15 @@ class TPCTimeSeries : public Task
}
};

o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, bool tpcOnly)
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, GTrackID::mask_t src)
{
using GID = o2::dataformats::GlobalTrackID;
auto dataRequest = std::make_shared<DataRequest>();
bool useMC = false;
GID::mask_t srcTracks = tpcOnly ? GID::getSourcesMask("TPC") : GID::getSourcesMask("TPC,ITS,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
GTrackID::mask_t srcTracks = GTrackID::getSourcesMask("TPC,ITS,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF") & src;
srcTracks.set(GTrackID::TPC); // TPC must be always there
dataRequest->requestTracks(srcTracks, useMC);
dataRequest->requestClusters(GID::getSourcesMask("TPC"), useMC);
dataRequest->requestClusters(GTrackID::getSourcesMask("TPC"), useMC);
bool tpcOnly = srcTracks == GTrackID::getSourcesMask("TPC");
if (!tpcOnly) {
dataRequest->requestPrimaryVertices(useMC);
}
Expand Down
7 changes: 3 additions & 4 deletions Detectors/TPC/workflow/src/tpc-time-series.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
{"disable-root-output", VariantType::Bool, false, {"disable root-files output writers"}},
{"enable-unbinned-root-output", VariantType::Bool, false, {"writing out unbinned track data"}},
{"tpc-only", VariantType::Bool, false, {"use only tpc tracks as input"}},
{"track-sources", VariantType::String, std::string{o2::dataformats::GlobalTrackID::ALL}, {"comma-separated list of sources to use"}},
{"material-type", VariantType::Int, 2, {"Type for the material budget during track propagation: 0=None, 1=Geo, 2=LUT"}}};

std::swap(workflowOptions, options);
}

Expand All @@ -42,9 +41,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));
const bool disableWriter = config.options().get<bool>("disable-root-output");
const bool enableUnbinnedWriter = config.options().get<bool>("enable-unbinned-root-output");
const bool tpcOnly = config.options().get<bool>("tpc-only");
auto src = o2::dataformats::GlobalTrackID::getSourcesMask(config.options().get<std::string>("track-sources"));
auto materialType = static_cast<o2::base::Propagator::MatCorrType>(config.options().get<int>("material-type"));
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, tpcOnly));
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, src));
if (!disableWriter) {
workflow.emplace_back(o2::tpc::getTPCTimeSeriesWriterSpec());
}
Expand Down
4 changes: 3 additions & 1 deletion prodtests/full-system-test/calib-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fi
if [[ $CALIB_ASYNC_EXTRACTTIMESERIES == 1 ]] ; then
CONFIG_TPCTIMESERIES=
: ${CALIB_ASYNC_SAMPLINGFACTORTIMESERIES:=0.001}
if [[ ! -z "$CALIB_ASYNC_ENABLEUNBINNEDTIMESERIES" ]]; then
if [[ ! -z ${CALIB_ASYNC_ENABLEUNBINNEDTIMESERIES:-} ]]; then
CONFIG_TPCTIMESERIES+=" --enable-unbinned-root-output --sample-unbinned-tsallis --threads ${TPCTIMESERIES_THREADS:-1}"
fi
if [[ $ON_SKIMMED_DATA == 1 ]] || [[ ! -z "$CALIB_ASYNC_SAMPLINGFACTORTIMESERIES" ]]; then
Expand All @@ -68,6 +68,8 @@ if [[ $CALIB_ASYNC_EXTRACTTIMESERIES == 1 ]] ; then
fi
CONFIG_TPCTIMESERIES+=" --sampling-factor ${SAMPLINGFACTORTIMESERIES}"
fi
: ${TPCTIMESERIES_SOURCES:=$TRACK_SOURCES}
CONFIG_TPCTIMESERIES+=" --track-sources $TPCTIMESERIES_SOURCES"
add_W o2-tpc-time-series-workflow "${CONFIG_TPCTIMESERIES}"
fi

Expand Down

0 comments on commit 6fa29aa

Please sign in to comment.