Skip to content

Commit 239eeaa

Browse files
f3schshahor02
authored andcommitted
AOD: save selected TPC standalone tracks from thinning
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 1a486e9 commit 239eeaa

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ class AODProducerWorkflowDPL : public Task
239239
bool mPropMuons{false};
240240
float mTrackQCFraction{0.00};
241241
int64_t mTrackQCNTrCut{4};
242+
float mTrackQCDCAxy{3.};
243+
float mTrackQCPt{0.2};
244+
int mTrackQCNCls{80};
242245
float mSqrtS{13860.};
243246
std::mt19937 mGenerator{}; ///< random generator for trackQA sampling
244247
o2::base::Propagator::MatCorrType mMatCorr{o2::base::Propagator::MatCorrType::USEMatCorrLUT};

Detectors/AOD/src/AODProducerWorkflowSpec.cxx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)