Skip to content

Commit ce1c4bc

Browse files
Add option to disable sector edge fluctuation debug in time series
1 parent 635c7d8 commit ce1c4bc

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

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

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

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

2828
} // end namespace tpc
2929
} // end namespace o2

Detectors/TPC/workflow/src/TPCTimeSeriesSpec.cxx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TPCTimeSeries : public Task
6464
{
6565
public:
6666
/// \constructor
67-
TPCTimeSeries(std::shared_ptr<o2::base::GRPGeomRequest> req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, const bool tpcOnly, std::shared_ptr<o2::globaltracking::DataRequest> dr) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter), mTPCOnly(tpcOnly), mDataRequest(dr) {};
67+
TPCTimeSeries(std::shared_ptr<o2::base::GRPGeomRequest> req, const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, const bool tpcOnly, std::shared_ptr<o2::globaltracking::DataRequest> dr, const bool enableSecEdgeFluc) : mCCDBRequest(req), mDisableWriter(disableWriter), mMatType(matType), mUnbinnedWriter(enableUnbinnedWriter), mTPCOnly(tpcOnly), mDataRequest(dr), mEnableSecEdgeFluc(enableSecEdgeFluc) {};
6868

6969
void init(framework::InitContext& ic) final
7070
{
@@ -141,7 +141,9 @@ class TPCTimeSeries : public Task
141141
const int nBins = getNBins();
142142

143143
mTimeMS = o2::base::GRPGeomHelper::instance().getOrbitResetTimeMS() + processing_helpers::getFirstTForbit(pc) * o2::constants::lhc::LHCOrbitMUS / 1000;
144-
mBufferDCA.mSecEdgeFlucCorr = mSecEdgeFlucInfo.getSectorsAtTime(static_cast<long>(mTimeMS));
144+
if (mEnableSecEdgeFluc) {
145+
mBufferDCA.mSecEdgeFlucCorr = mSecEdgeFlucInfo.getSectorsAtTime(static_cast<long>(mTimeMS));
146+
}
145147
mRun = processing_helpers::getRunNumber(pc);
146148
mBufferDCA.mTemperature = mPTHelper.getMeanTemperature(mTimeMS);
147149
mBufferDCA.mPressure = mPTHelper.getPressure(mTimeMS);
@@ -1049,6 +1051,7 @@ class TPCTimeSeries : public Task
10491051
const bool mUnbinnedWriter{false}; /// write out additional unbinned data
10501052
const bool mTPCOnly{false}; ///< produce only TPC variables
10511053
std::shared_ptr<o2::globaltracking::DataRequest> mDataRequest; ///< steers the input
1054+
bool mEnableSecEdgeFluc{false}; ///< enable write out of sector edge fluctuations
10521055
int mPhiBins = SECTORSPERSIDE; ///< number of phi bins
10531056
int mTglBins{3}; ///< number of tgl bins
10541057
int mQPtBins{20}; ///< number of qPt bins
@@ -1831,7 +1834,7 @@ class TPCTimeSeries : public Task
18311834
}
18321835
};
18331836

1834-
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, GTrackID::mask_t src)
1837+
o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter, const o2::base::Propagator::MatCorrType matType, const bool enableUnbinnedWriter, GTrackID::mask_t src, const bool enableSecEdgeFluc)
18351838
{
18361839
auto dataRequest = std::make_shared<DataRequest>();
18371840
bool useMC = false;
@@ -1860,7 +1863,9 @@ o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter,
18601863

18611864
o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
18621865
PressureTemperatureHelper::requestCCDBInputs(dataRequest->inputs);
1863-
dataRequest->inputs.emplace_back("tpSecFlucInfo", o2::header::gDataOriginTPC, "InfoMapSecFluc", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalSecEdgeInfo), {}, 1));
1866+
if (enableSecEdgeFluc) {
1867+
dataRequest->inputs.emplace_back("tpSecFlucInfo", o2::header::gDataOriginTPC, "InfoMapSecFluc", 0, Lifetime::Condition, ccdbParamSpec(CDBTypeMap.at(CDBType::CalSecEdgeInfo), {}, 1));
1868+
}
18641869

18651870
std::vector<OutputSpec> outputs;
18661871
outputs.emplace_back(o2::header::gDataOriginTPC, getDataDescriptionTimeSeries(), 0, Lifetime::Sporadic);
@@ -1872,7 +1877,7 @@ o2::framework::DataProcessorSpec getTPCTimeSeriesSpec(const bool disableWriter,
18721877
"tpc-time-series",
18731878
dataRequest->inputs,
18741879
outputs,
1875-
AlgorithmSpec{adaptFromTask<TPCTimeSeries>(ccdbRequest, disableWriter, matType, enableUnbinnedWriter, tpcOnly, dataRequest)},
1880+
AlgorithmSpec{adaptFromTask<TPCTimeSeries>(ccdbRequest, disableWriter, matType, enableUnbinnedWriter, tpcOnly, dataRequest, enableSecEdgeFluc)},
18761881
Options{
18771882
{"min-momentum", VariantType::Float, 0.2f, {"Minimum momentum of the tracks"}},
18781883
{"min-cluster", VariantType::Int, 80, {"Minimum number of clusters of the tracks"}},

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
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"}},
3131
{"track-sources", VariantType::String, std::string{o2::dataformats::GlobalTrackID::ALL}, {"comma-separated list of sources to use"}},
32-
{"material-type", VariantType::Int, 2, {"Type for the material budget during track propagation: 0=None, 1=Geo, 2=LUT"}}};
33-
std::swap(workflowOptions, options);
32+
{"material-type", VariantType::Int, 2, {"Type for the material budget during track propagation: 0=None, 1=Geo, 2=LUT"}},
33+
{"enable-sec-edge-fluc-correction", VariantType::Bool, false, {"Enable sector edge fluctuation correction output"}}};
34+
35+
std::swap(workflowOptions, options);
3436
}
3537

3638
#include "Framework/runDataProcessing.h"
@@ -43,7 +45,8 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config)
4345
const bool enableUnbinnedWriter = config.options().get<bool>("enable-unbinned-root-output");
4446
auto src = o2::dataformats::GlobalTrackID::getSourcesMask(config.options().get<std::string>("track-sources"));
4547
auto materialType = static_cast<o2::base::Propagator::MatCorrType>(config.options().get<int>("material-type"));
46-
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, src));
48+
const bool enableSecEdgeFluc = config.options().get<bool>("enable-sec-edge-fluc-correction");
49+
workflow.emplace_back(o2::tpc::getTPCTimeSeriesSpec(disableWriter, materialType, enableUnbinnedWriter, src, enableSecEdgeFluc));
4750
if (!disableWriter) {
4851
workflow.emplace_back(o2::tpc::getTPCTimeSeriesWriterSpec());
4952
}

0 commit comments

Comments
 (0)