diff --git a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h index 959aed28cab6b..1f82eaf34c473 100644 --- a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h +++ b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h @@ -239,6 +239,9 @@ class AODProducerWorkflowDPL : public Task bool mPropMuons{false}; float mTrackQCFraction{0.00}; int64_t mTrackQCNTrCut{4}; + float mTrackQCDCAxy{3.}; + float mTrackQCPt{0.2}; + int mTrackQCNCls{80}; float mSqrtS{13860.}; std::mt19937 mGenerator{}; ///< random generator for trackQA sampling o2::base::Propagator::MatCorrType mMatCorr{o2::base::Propagator::MatCorrType::USEMatCorrLUT}; diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index c12b614960554..8532107d57035 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -512,6 +512,19 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID, } } + // include specific selection of tpc standalone tracks if thinning is active + if (mThinTracks && extraInfoHolder.isTPConly && !writeQAData) { // if trackQA is written then no check has to be done + auto trk = data.getTPCTrack(trackIndex); + if (trk.getNClusters() >= mTrackQCNCls && trk.getPt() >= mTrackQCPt) { + o2::dataformats::DCA dcaInfo{999.f, 999.f, 999.f, 999.f, 999.f}; + o2::dataformats::VertexBase v = mVtx.getMeanVertex(collisionID < 0 ? 0.f : data.getPrimaryVertex(collisionID).getZ()); + if (o2::base::Propagator::Instance()->propagateToDCABxByBz(v, trk, 2., mMatCorr, &dcaInfo) && std::abs(dcaInfo.getY()) < mTrackQCDCAxy) { + writeQAData = true; // just setting this to not thin the track + } + } + } + + // Skip thinning if not enabled or track is not tpc standalone or assoc. to a V0 or qa'ed if (mThinTracks && src == GIndex::Source::TPC && mGIDUsedBySVtx.find(trackIndex) == mGIDUsedBySVtx.end() && mGIDUsedByStr.find(trackIndex) == mGIDUsedByStr.end() && !writeQAData) { mGIDToTableID.emplace(trackIndex, -1); // pretend skipped tracks are stored; this is safe since they are are not written to disk and -1 indicates to all users to not use this track continue; @@ -1683,6 +1696,9 @@ void AODProducerWorkflowDPL::init(InitContext& ic) } mTrackQCFraction = ic.options().get("trackqc-fraction"); mTrackQCNTrCut = ic.options().get("trackqc-NTrCut"); + mTrackQCDCAxy = ic.options().get("trackqc-tpc-dca"); + mTrackQCPt = ic.options().get("trackqc-tpc-pt"); + mTrackQCNCls = ic.options().get("trackqc-tpc-cls"); if (auto seed = ic.options().get("seed"); seed == 0) { LOGP(info, "Using random device for seeding"); std::random_device rd; @@ -3237,6 +3253,9 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo ConfigParamSpec{"thin-tracks", VariantType::Bool, false, {"Produce thinned track tables"}}, ConfigParamSpec{"trackqc-fraction", VariantType::Float, float(0.1), {"Fraction of tracks to QC"}}, ConfigParamSpec{"trackqc-NTrCut", VariantType::Int64, 4L, {"Minimal length of the track - in amount of tracklets"}}, + ConfigParamSpec{"trackqc-tpc-dca", VariantType::Float, 3.f, {"Keep TPC standalone track with this DCAxy to the PV"}}, + ConfigParamSpec{"trackqc-tpc-cls", VariantType::Int, 80, {"Keep TPC standalone track with this #clusters"}}, + ConfigParamSpec{"trackqc-tpc-pt", VariantType::Float, 0.2f, {"Keep TPC standalone track with this pt"}}, ConfigParamSpec{"with-streamers", VariantType::String, "", {"Bit-mask to steer writing of intermediate streamer files"}}, ConfigParamSpec{"seed", VariantType::Int, 0, {"Set seed for random generator used for sampling (0 (default) means using a random_device)"}}, }};