Skip to content

Commit 6fa29aa

Browse files
committed
Make tpc-time-series to accept track sources
1 parent ecec4fc commit 6fa29aa

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

Detectors/TPC/workflow/include/TPCWorkflow/TPCTimeSeriesSpec.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "Framework/DataProcessorSpec.h"
1616
#include "DetectorsBase/Propagator.h"
17+
#include "ReconstructionDataFormats/GlobalTrackID.h"
1718

1819
namespace o2
1920
{
@@ -22,7 +23,7 @@ namespace tpc
2223
static constexpr header::DataDescription getDataDescriptionTimeSeries() { return header::DataDescription{"TIMESERIES"}; }
2324
static constexpr header::DataDescription getDataDescriptionTPCTimeSeriesTFId() { return header::DataDescription{"ITPCTSTFID"}; }
2425

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

2728
} // end namespace tpc
2829
} // end namespace o2

Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,14 +1751,15 @@ class TPCTimeSeries : public Task
17511751
}
17521752
};
17531753

1754-
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, bool tpcOnly)
1754+
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, GTrackID::mask_t src)
17551755
{
1756-
using GID = o2::dataformats::GlobalTrackID;
17571756
auto dataRequest = std::make_shared<DataRequest>();
17581757
bool useMC = false;
1759-
GID::mask_t srcTracks = tpcOnly ? GID::getSourcesMask("TPC") : GID::getSourcesMask("TPC,ITS,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF");
1758+
GTrackID::mask_t srcTracks = GTrackID::getSourcesMask("TPC,ITS,ITS-TPC,ITS-TPC-TRD,ITS-TPC-TOF,ITS-TPC-TRD-TOF") & src;
1759+
srcTracks.set(GTrackID::TPC); // TPC must be always there
17601760
dataRequest->requestTracks(srcTracks, useMC);
1761-
dataRequest->requestClusters(GID::getSourcesMask("TPC"), useMC);
1761+
dataRequest->requestClusters(GTrackID::getSourcesMask("TPC"), useMC);
1762+
bool tpcOnly = srcTracks == GTrackID::getSourcesMask("TPC");
17621763
if (!tpcOnly) {
17631764
dataRequest->requestPrimaryVertices(useMC);
17641765
}

Detectors/TPC/workflow/src/tpc-time-series.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2828
ConfigParamSpec{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
2929
{"disable-root-output", VariantType::Bool, false, {"disable root-files output writers"}},
3030
{"enable-unbinned-root-output", VariantType::Bool, false, {"writing out unbinned track data"}},
31-
{"tpc-only", VariantType::Bool, false, {"use only tpc tracks as input"}},
31+
{"track-sources", VariantType::String, std::string{o2::dataformats::GlobalTrackID::ALL}, {"comma-separated list of sources to use"}},
3232
{"material-type", VariantType::Int, 2, {"Type for the material budget during track propagation: 0=None, 1=Geo, 2=LUT"}}};
33-
3433
std::swap(workflowOptions, options);
3534
}
3635

@@ -42,9 +41,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
4241
o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));
4342
const bool disableWriter = config.options().get<bool>("disable-root-output");
4443
const bool enableUnbinnedWriter = config.options().get<bool>("enable-unbinned-root-output");
45-
const bool tpcOnly = config.options().get<bool>("tpc-only");
44+
auto src = o2::dataformats::GlobalTrackID::getSourcesMask(config.options().get<std::string>("track-sources"));
4645
auto materialType = static_cast<o2::base::Propagator::MatCorrType>(config.options().get<int>("material-type"));
47-
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, tpcOnly));
46+
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, src));
4847
if (!disableWriter) {
4948
workflow.emplace_back(o2::tpc::getTPCTimeSeriesWriterSpec());
5049
}

prodtests/full-system-test/calib-workflow.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fi
5656
if [[ $CALIB_ASYNC_EXTRACTTIMESERIES == 1 ]] ; then
5757
CONFIG_TPCTIMESERIES=
5858
: ${CALIB_ASYNC_SAMPLINGFACTORTIMESERIES:=0.001}
59-
if [[ ! -z "$CALIB_ASYNC_ENABLEUNBINNEDTIMESERIES" ]]; then
59+
if [[ ! -z ${CALIB_ASYNC_ENABLEUNBINNEDTIMESERIES:-} ]]; then
6060
CONFIG_TPCTIMESERIES+=" --enable-unbinned-root-output --sample-unbinned-tsallis --threads ${TPCTIMESERIES_THREADS:-1}"
6161
fi
6262
if [[ $ON_SKIMMED_DATA == 1 ]] || [[ ! -z "$CALIB_ASYNC_SAMPLINGFACTORTIMESERIES" ]]; then
@@ -68,6 +68,8 @@ if [[ $CALIB_ASYNC_EXTRACTTIMESERIES == 1 ]] ; then
6868
fi
6969
CONFIG_TPCTIMESERIES+=" --sampling-factor ${SAMPLINGFACTORTIMESERIES}"
7070
fi
71+
: ${TPCTIMESERIES_SOURCES:=$TRACK_SOURCES}
72+
CONFIG_TPCTIMESERIES+=" --track-sources $TPCTIMESERIES_SOURCES"
7173
add_W o2-tpc-time-series-workflow "${CONFIG_TPCTIMESERIES}"
7274
fi
7375

0 commit comments

Comments
 (0)