2727#include " DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h"
2828#include " DetectorsCommonDataFormats/DetID.h"
2929#include " SpacePoints/SpacePointsCalibParam.h"
30+ #include " SpacePoints/SpacePointsCalibConfParam.h"
3031
3132using namespace o2 ::framework;
3233using namespace o2 ::globaltracking;
@@ -40,9 +41,6 @@ namespace tpc
4041
4142void TPCInterpolationDPL::init (InitContext& ic)
4243{
43- if (mWriteUnfiltered ) {
44- mInterpolation .setWriteUnfiltered ();
45- }
4644 // -------- init geometry and field --------//
4745 mTimer .Stop ();
4846 mTimer .Reset ();
@@ -57,9 +55,7 @@ void TPCInterpolationDPL::updateTimeDependentParams(ProcessingContext& pc)
5755 if (!initOnceDone) { // this params need to be queried only once
5856 initOnceDone = true ;
5957 // other init-once stuff
60-
6158 mInterpolation .init ();
62- mResidualProcessor .init (false , o2::base::Propagator::Instance ()->getNominalBz ()); // initialize but skip the binning which is needed only later
6359 }
6460 // we may have other params which need to be queried regularly
6561 if (mTPCVDriftHelper .isUpdated ()) {
@@ -87,6 +83,7 @@ void TPCInterpolationDPL::run(ProcessingContext& pc)
8783 RecoContainer recoData;
8884 recoData.collectData (pc, *mDataRequest .get ());
8985 updateTimeDependentParams (pc);
86+ const auto & param = SpacePointsCalibConfParam::Instance ();
9087
9188 // load the input tracks
9289 std::vector<o2::globaltracking::RecoContainer::GlobalIDSet> gidTables;
@@ -95,7 +92,7 @@ void TPCInterpolationDPL::run(ProcessingContext& pc)
9592 std::vector<GTrackID> gids;
9693 bool processITSTPConly = mProcessITSTPConly ; // so that the flag can be used inside the lambda
9794 // the creator goes from most complete track (ITS-TPC-TRD-TOF) to least complete one (ITS-TPC)
98- auto creator = [&gidTables, &seeds, &trkTimes, &recoData, &processITSTPConly, &gids](auto & _tr, GTrackID _origID, float t0, float tErr) {
95+ auto creator = [&gidTables, &seeds, &trkTimes, &recoData, &processITSTPConly, &gids, ¶m ](auto & _tr, GTrackID _origID, float t0, float tErr) {
9996 if constexpr (std::is_base_of_v<o2::track::TrackParCov, std::decay_t <decltype (_tr)>>) {
10097 bool trackGood = true ;
10198 bool hasOuterPoint = false ;
@@ -111,7 +108,7 @@ void TPCInterpolationDPL::run(ProcessingContext& pc)
111108 const auto itsTrk = &recoData.getITSTrack (gidTable[GTrackID::ITS ]);
112109 const auto tpcTrk = &recoData.getTPCTrack (gidTable[GTrackID::TPC ]);
113110 // apply track quality cuts
114- if (itsTrk->getChi2 () / itsTrk->getNumberOfClusters () > param::MaxITSChi2 || tpcTrk->getChi2 () / tpcTrk->getNClusterReferences () > param::MaxTPCChi2 ) {
111+ if (itsTrk->getChi2 () / itsTrk->getNumberOfClusters () > param. maxITSChi2 || tpcTrk->getChi2 () / tpcTrk->getNClusterReferences () > param. maxTPCChi2 ) {
115112 // reduced chi2 cut is the same for all track types
116113 trackGood = false ;
117114 }
@@ -120,11 +117,11 @@ void TPCInterpolationDPL::run(ProcessingContext& pc)
120117 if (!processITSTPConly) {
121118 return true ;
122119 }
123- if (itsTrk->getNumberOfClusters () < param::MinITSNClsNoOuterPoint || tpcTrk->getNClusterReferences () < param::MinTPCNClsNoOuterPoint ) {
120+ if (itsTrk->getNumberOfClusters () < param. minITSNClsNoOuterPoint || tpcTrk->getNClusterReferences () < param. minTPCNClsNoOuterPoint ) {
124121 trackGood = false ;
125122 }
126123 } else {
127- if (itsTrk->getNumberOfClusters () < param::MinITSNCls || tpcTrk->getNClusterReferences () < param::MinTPCNCls ) {
124+ if (itsTrk->getNumberOfClusters () < param. minITSNCls || tpcTrk->getNClusterReferences () < param. minTPCNCls ) {
128125 trackGood = false ;
129126 }
130127 }
@@ -151,7 +148,7 @@ void TPCInterpolationDPL::run(ProcessingContext& pc)
151148 mTimer .Stop ();
152149 LOGF (info, " TPC interpolation timing: Cpu: %.3e Real: %.3e s" , mTimer .CpuTime (), mTimer .RealTime ());
153150
154- if (mWriteUnfiltered ) {
151+ if (param. writeUnfiltered ) {
155152 // these are the residuals and tracks before outlier rejection; they are not used in production
156153 pc.outputs ().snapshot (Output{" GLO" , " TPCINT_RES" , 0 , Lifetime::Timeframe}, mInterpolation .getClusterResidualsUnfiltered ());
157154 if (mSendTrackData ) {
@@ -172,7 +169,7 @@ void TPCInterpolationDPL::endOfStream(EndOfStreamContext& ec)
172169 mTimer .CpuTime (), mTimer .RealTime (), mTimer .Counter () - 1 );
173170}
174171
175- DataProcessorSpec getTPCInterpolationSpec (GTrackID::mask_t src, bool useMC, bool processITSTPConly, bool writeUnfiltered, bool sendTrackData)
172+ DataProcessorSpec getTPCInterpolationSpec (GTrackID::mask_t src, bool useMC, bool processITSTPConly, bool sendTrackData)
176173{
177174 auto dataRequest = std::make_shared<DataRequest>();
178175 std::vector<OutputSpec> outputs;
@@ -193,7 +190,7 @@ DataProcessorSpec getTPCInterpolationSpec(GTrackID::mask_t src, bool useMC, bool
193190 dataRequest->inputs ,
194191 true );
195192 o2::tpc::VDriftHelper::requestCCDBInputs (dataRequest->inputs );
196- if (writeUnfiltered) {
193+ if (SpacePointsCalibConfParam::Instance (). writeUnfiltered ) {
197194 outputs.emplace_back (" GLO" , " TPCINT_TRK" , 0 , Lifetime::Timeframe);
198195 outputs.emplace_back (" GLO" , " TPCINT_RES" , 0 , Lifetime::Timeframe);
199196 }
@@ -204,7 +201,7 @@ DataProcessorSpec getTPCInterpolationSpec(GTrackID::mask_t src, bool useMC, bool
204201 " tpc-track-interpolation" ,
205202 dataRequest->inputs ,
206203 outputs,
207- AlgorithmSpec{adaptFromTask<TPCInterpolationDPL>(dataRequest, ggRequest, useMC, processITSTPConly, writeUnfiltered, sendTrackData)},
204+ AlgorithmSpec{adaptFromTask<TPCInterpolationDPL>(dataRequest, ggRequest, useMC, processITSTPConly, sendTrackData)},
208205 Options{}};
209206}
210207
0 commit comments