@@ -512,6 +512,19 @@ void AODProducerWorkflowDPL::fillTrackTablesPerCollision(int collisionID,
512512 }
513513 }
514514
515+ // include specific selection of tpc standalone tracks if thinning is active
516+ if (mThinTracks && extraInfoHolder.isTPConly && !writeQAData) { // if trackQA is written then no check has to be done
517+ auto trk = data.getTPCTrack (trackIndex);
518+ if (trk.getNClusters () >= mTrackQCNCls && trk.getPt () >= mTrackQCPt ) {
519+ o2::dataformats::DCA dcaInfo{999 .f , 999 .f , 999 .f , 999 .f , 999 .f };
520+ o2::dataformats::VertexBase v = mVtx .getMeanVertex (collisionID < 0 ? 0 .f : data.getPrimaryVertex (collisionID).getZ ());
521+ if (o2::base::Propagator::Instance ()->propagateToDCABxByBz (v, trk, 2 ., mMatCorr , &dcaInfo) && std::abs (dcaInfo.getY ()) < mTrackQCDCAxy ) {
522+ writeQAData = true ; // just setting this to not thin the track
523+ }
524+ }
525+ }
526+
527+ // Skip thinning if not enabled or track is not tpc standalone or assoc. to a V0 or qa'ed
515528 if (mThinTracks && src == GIndex::Source::TPC && mGIDUsedBySVtx .find (trackIndex) == mGIDUsedBySVtx .end () && mGIDUsedByStr .find (trackIndex) == mGIDUsedByStr .end () && !writeQAData) {
516529 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
517530 continue ;
@@ -1683,6 +1696,9 @@ void AODProducerWorkflowDPL::init(InitContext& ic)
16831696 }
16841697 mTrackQCFraction = ic.options ().get <float >(" trackqc-fraction" );
16851698 mTrackQCNTrCut = ic.options ().get <int64_t >(" trackqc-NTrCut" );
1699+ mTrackQCDCAxy = ic.options ().get <float >(" trackqc-tpc-dca" );
1700+ mTrackQCPt = ic.options ().get <float >(" trackqc-tpc-pt" );
1701+ mTrackQCNCls = ic.options ().get <int >(" trackqc-tpc-cls" );
16861702 if (auto seed = ic.options ().get <int >(" seed" ); seed == 0 ) {
16871703 LOGP (info, " Using random device for seeding" );
16881704 std::random_device rd;
@@ -3237,6 +3253,9 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo
32373253 ConfigParamSpec{" thin-tracks" , VariantType::Bool, false , {" Produce thinned track tables" }},
32383254 ConfigParamSpec{" trackqc-fraction" , VariantType::Float, float (0.1 ), {" Fraction of tracks to QC" }},
32393255 ConfigParamSpec{" trackqc-NTrCut" , VariantType::Int64, 4L , {" Minimal length of the track - in amount of tracklets" }},
3256+ ConfigParamSpec{" trackqc-tpc-dca" , VariantType::Float, 3 .f , {" Keep TPC standalone track with this DCAxy to the PV" }},
3257+ ConfigParamSpec{" trackqc-tpc-cls" , VariantType::Int, 80 , {" Keep TPC standalone track with this #clusters" }},
3258+ ConfigParamSpec{" trackqc-tpc-pt" , VariantType::Float, 0 .2f , {" Keep TPC standalone track with this pt" }},
32403259 ConfigParamSpec{" with-streamers" , VariantType::String, " " , {" Bit-mask to steer writing of intermediate streamer files" }},
32413260 ConfigParamSpec{" seed" , VariantType::Int, 0 , {" Set seed for random generator used for sampling (0 (default) means using a random_device)" }},
32423261 }};
0 commit comments