Skip to content

Commit 32438b0

Browse files
matthias-kleinerdavidrohr
authored andcommitted
TPC timeseries: Add TPC only option
1 parent 6102a52 commit 32438b0

3 files changed

Lines changed: 20 additions & 15 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace tpc
2222
static constexpr header::DataDescription getDataDescriptionTimeSeries() { return header::DataDescription{"TIMESERIES"}; }
2323
static constexpr header::DataDescription getDataDescriptionTPCTimeSeriesTFId() { return header::DataDescription{"ITPCTSTFID"}; }
2424

25-
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter);
25+
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, bool tpcOnly);
2626

2727
} // end namespace tpc
2828
} // end namespace o2

Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class TPCTimeSeries : public Task
5454
{
5555
public:
5656
/// \constructor
57-
TPCTimeSeries(std::shared_ptr<o2::base::GRPGeomRequest> req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter){};
57+
TPCTimeSeries(std::shared_ptr<o2::base::GRPGeomRequest> req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, const bool tpcOnly) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter), mTPCOnly(tpcOnly){};
5858

5959
void init(framework::InitContext& ic) final
6060
{
@@ -150,13 +150,13 @@ class TPCTimeSeries : public Task
150150

151151
// getting tracks
152152
auto tracksTPC = pc.inputs().get<gsl::span<TrackTPC>>("tracksTPC");
153-
auto tracksITSTPC = pc.inputs().get<gsl::span<o2::dataformats::TrackTPCITS>>("tracksITSTPC");
154-
auto tracksITS = pc.inputs().get<gsl::span<o2::its::TrackITS>>("tracksITS");
153+
auto tracksITSTPC = mTPCOnly ? gsl::span<o2::dataformats::TrackTPCITS>() : pc.inputs().get<gsl::span<o2::dataformats::TrackTPCITS>>("tracksITSTPC");
154+
auto tracksITS = mTPCOnly ? gsl::span<o2::its::TrackITS>() : pc.inputs().get<gsl::span<o2::its::TrackITS>>("tracksITS");
155155

156156
// getting the vertices
157-
const auto vertices = pc.inputs().get<gsl::span<o2::dataformats::PrimaryVertex>>("pvtx");
158-
const auto primMatchedTracks = pc.inputs().get<gsl::span<o2::dataformats::VtxTrackIndex>>("pvtx_trmtc");
159-
const auto primMatchedTracksRef = pc.inputs().get<gsl::span<o2::dataformats::VtxTrackRef>>("pvtx_tref");
157+
const auto vertices = mTPCOnly ? gsl::span<o2::dataformats::PrimaryVertex>() : pc.inputs().get<gsl::span<o2::dataformats::PrimaryVertex>>("pvtx");
158+
const auto primMatchedTracks = mTPCOnly ? gsl::span<o2::dataformats::VtxTrackIndex>() : pc.inputs().get<gsl::span<o2::dataformats::VtxTrackIndex>>("pvtx_trmtc");
159+
const auto primMatchedTracksRef = mTPCOnly ? gsl::span<o2::dataformats::VtxTrackRef>() : pc.inputs().get<gsl::span<o2::dataformats::VtxTrackRef>>("pvtx_tref");
160160

161161
LOGP(info, "Processing {} vertices, {} primary matched vertices, {} TPC tracks, {} ITS tracks, {} ITS-TPC tracks", vertices.size(), primMatchedTracks.size(), tracksTPC.size(), tracksITS.size(), tracksITSTPC.size());
162162

@@ -810,6 +810,7 @@ class TPCTimeSeries : public Task
810810
const bool mDisableWriter{false}; ///< flag if no ROOT output will be written
811811
o2::base::Propagator::MatCorrType mMatType; ///< material for propagation
812812
const bool mUnbinnedWriter{false}; /// write out additional unbinned data
813+
const bool mTPCOnly{false}; ///< produce only TPC variables
813814
int mPhiBins = SECTORSPERSIDE; ///< number of phi bins
814815
int mTglBins{3}; ///< number of tgl bins
815816
int mQPtBins{20}; ///< number of qPt bins
@@ -1392,20 +1393,22 @@ class TPCTimeSeries : public Task
13921393
}
13931394
};
13941395

1395-
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter)
1396+
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, bool tpcOnly)
13961397
{
13971398
const bool enableAskMatLUT = matType == o2::base::Propagator::MatCorrType::USEMatCorrLUT;
13981399
std::vector<InputSpec> inputs;
1399-
inputs.emplace_back("tracksITSTPC", "GLO", "TPCITS", 0, Lifetime::Timeframe);
1400+
if (!tpcOnly) {
1401+
inputs.emplace_back("tracksITSTPC", "GLO", "TPCITS", 0, Lifetime::Timeframe);
1402+
inputs.emplace_back("tracksITS", header::gDataOriginITS, "TRACKS", 0, Lifetime::Timeframe);
1403+
inputs.emplace_back("pvtx", "GLO", "PVTX", 0, Lifetime::Timeframe);
1404+
inputs.emplace_back("pvtx_trmtc", "GLO", "PVTX_TRMTC", 0, Lifetime::Timeframe); // global ids of associated tracks
1405+
inputs.emplace_back("pvtx_tref", "GLO", "PVTX_TRMTCREFS", 0, Lifetime::Timeframe); // vertex - trackID refs
1406+
}
14001407
inputs.emplace_back("tracksTPC", header::gDataOriginTPC, "TRACKS", 0, Lifetime::Timeframe);
1401-
inputs.emplace_back("tracksITS", header::gDataOriginITS, "TRACKS", 0, Lifetime::Timeframe);
14021408
if (enableUnbinnedWriter) {
14031409
// request tpc clusters only in case the debug streamer is used for the cluster bit mask
14041410
inputs.emplace_back("trackTPCClRefs", header::gDataOriginTPC, "CLUSREFS", 0, Lifetime::Timeframe);
14051411
}
1406-
inputs.emplace_back("pvtx", "GLO", "PVTX", 0, Lifetime::Timeframe);
1407-
inputs.emplace_back("pvtx_trmtc", "GLO", "PVTX_TRMTC", 0, Lifetime::Timeframe); // global ids of associated tracks
1408-
inputs.emplace_back("pvtx_tref", "GLO", "PVTX_TRMTCREFS", 0, Lifetime::Timeframe); // vertex - trackID refs
14091412

14101413
auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(!disableWriter, // orbitResetTime
14111414
false, // GRPECS=true for nHBF per TF
@@ -1428,7 +1431,7 @@ o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter,
14281431
"tpc-time-series",
14291432
inputs,
14301433
outputs,
1431-
AlgorithmSpec{adaptFromTask<TPCTimeSeries>(ccdbRequest, disableWriter, matType, enableUnbinnedWriter)},
1434+
AlgorithmSpec{adaptFromTask<TPCTimeSeries>(ccdbRequest, disableWriter, matType, enableUnbinnedWriter, tpcOnly)},
14321435
Options{
14331436
{"min-momentum", VariantType::Float, 0.2f, {"Minimum momentum of the tracks"}},
14341437
{"min-cluster", VariantType::Int, 80, {"Minimum number of clusters of the tracks"}},

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ 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"}},
3132
{"material-type", VariantType::Int, 2, {"Type for the material budget during track propagation: 0=None, 1=Geo, 2=LUT"}}};
3233

3334
std::swap(workflowOptions, options);
@@ -41,8 +42,9 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
4142
o2::conf::ConfigurableParam::updateFromString(config.options().get<std::string>("configKeyValues"));
4243
const bool disableWriter = config.options().get<bool>("disable-root-output");
4344
const bool enableUnbinnedWriter = config.options().get<bool>("enable-unbinned-root-output");
45+
const bool tpcOnly = config.options().get<bool>("tpc-only");
4446
auto materialType = static_cast<o2::base::Propagator::MatCorrType>(config.options().get<int>("material-type"));
45-
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter));
47+
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, tpcOnly));
4648
if (!disableWriter) {
4749
workflow.emplace_back(o2::tpc::getTPCTimeSeriesWriterSpec());
4850
}

0 commit comments

Comments
 (0)