Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
19 changes: 19 additions & 0 deletions Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1683,6 +1696,9 @@ void AODProducerWorkflowDPL::init(InitContext& ic)
}
mTrackQCFraction = ic.options().get<float>("trackqc-fraction");
mTrackQCNTrCut = ic.options().get<int64_t>("trackqc-NTrCut");
mTrackQCDCAxy = ic.options().get<float>("trackqc-tpc-dca");
mTrackQCPt = ic.options().get<float>("trackqc-tpc-pt");
mTrackQCNCls = ic.options().get<int>("trackqc-tpc-cls");
if (auto seed = ic.options().get<int>("seed"); seed == 0) {
LOGP(info, "Using random device for seeding");
std::random_device rd;
Expand Down Expand Up @@ -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)"}},
}};
Expand Down