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 @@ -28,7 +28,7 @@ struct TrackMCStudyConfig : o2::conf::ConfigurableParamHelper<TrackMCStudyConfig
bool requireITSorTPCTrackRefs = true;
bool requireTopBottomRefs = false;
int minTPCRefsToExtractClRes = 2;
float rejectClustersResStat = 0.;
float rejectClustersResStat = 0.1;
float maxTPCRefExtrap = 2; // max dX to extrapolate the track ref when extrapolating track true posions
int decayPDG[5] = {310, 3122, 411, 421, -1}; // decays to study, must end by -1
O2ParamDef(TrackMCStudyConfig, "trmcconf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ struct MCTrackInfo {
uint8_t maxTPCRowSect = -1;
int8_t nITSCl = 0;
int8_t pattITSCl = 0;
ClassDefNV(MCTrackInfo, 4);
bool addedAtRecStage = false;
ClassDefNV(MCTrackInfo, 5);
};

struct RecTrack {
Expand All @@ -75,6 +76,7 @@ struct RecTrack {
uint8_t nClTPC = 0;
uint8_t pattITS = 0;
int8_t lowestPadRow = -1;
int8_t padFromEdge = -1;

bool isFakeGLO() const { return flags & FakeGLO; }
bool isFakeITS() const { return flags & FakeITS; }
Expand All @@ -83,7 +85,7 @@ struct RecTrack {
bool isFakeTOF() const { return flags & FakeTOF; }
bool isFakeITSTPC() const { return flags & FakeITSTPC; }

ClassDefNV(RecTrack, 1);
ClassDefNV(RecTrack, 2);
};

struct TrackPairInfo {
Expand Down
20 changes: 15 additions & 5 deletions Detectors/GlobalTrackingWorkflow/study/src/TrackMCStudy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class TrackMCStudy : public Task
std::vector<float> mTPCOcc; ///< TPC occupancy for this interaction time
std::vector<int> mITSOcc; //< N ITS clusters in the ROF containing collision
bool mCheckSV = false; //< check SV binding (apart from prongs availability)
bool mRecProcStage = false; //< flag that the MC particle was added only at the stage of reco tracks processing
int mNTPCOccBinLength = 0; ///< TPC occ. histo bin length in TBs
float mNTPCOccBinLengthInv;
int mVerbose = 0;
Expand Down Expand Up @@ -185,6 +186,7 @@ void TrackMCStudy::run(ProcessingContext& pc)

recoData.collectData(pc, *mDataRequest.get()); // select tracks of needed type, with minimal cuts, the real selected will be done in the vertexer
updateTimeDependentParams(pc); // Make sure this is called after recoData.collectData, which may load some conditions
mRecProcStage = false;
process(recoData);
}

Expand Down Expand Up @@ -278,15 +280,21 @@ void TrackMCStudy::process(const o2::globaltracking::RecoContainer& recoData)
return patt;
};

auto getLowestPadrow = [&recoData](const o2::tpc::TrackTPC& trc) {
auto getLowestPadrow = [&recoData](const o2::tpc::TrackTPC& trc, RecTrack& tref) {
if (recoData.inputsTPCclusters) {
uint8_t clSect = 0, clRow = 0;
uint32_t clIdx = 0;
const auto clRefs = recoData.getTPCTracksClusterRefs();
const auto tpcClusAcc = recoData.getTPCClusters();
trc.getClusterReference(clRefs, trc.getNClusterReferences() - 1, clSect, clRow, clIdx);
return int(clRow);
const auto& clus = tpcClusAcc.clusters[clSect][clRow][clIdx];
int padFromEdge = int(clus.getPad()), npads = o2::gpu::GPUTPCGeometry::NPads(clRow);
if (padFromEdge > npads / 2) {
padFromEdge = npads - 1 - padFromEdge;
}
tref.padFromEdge = uint8_t(padFromEdge);
tref.lowestPadRow = clRow;
}
return -1;
};

auto flagTPCClusters = [&recoData](const o2::tpc::TrackTPC& trc, o2::MCCompLabel lbTrc) {
Expand Down Expand Up @@ -352,7 +360,7 @@ void TrackMCStudy::process(const o2::globaltracking::RecoContainer& recoData)
int nev = mcReader.getNEvents(curSrcMC);
bool okAccVtx = true;
if (nev != (int)mMCVtVec.size()) {
LOGP(error, "source {} has {} events while {} MC vertices were booked", curSrcMC, nev, mMCVtVec.size());
LOGP(debug, "source {} has {} events while {} MC vertices were booked", curSrcMC, nev, mMCVtVec.size());
okAccVtx = false;
}
for (curEvMC = 0; curEvMC < nev; curEvMC++) {
Expand Down Expand Up @@ -382,6 +390,7 @@ void TrackMCStudy::process(const o2::globaltracking::RecoContainer& recoData)
}

// add reconstruction info to MC particles. If MC particle was not selected before but was reconstrected, account MC info
mRecProcStage = true; // MC particles accepted only at this stage will be flagged
for (int iv = 0; iv < nv; iv++) {
if (mVerbose > 1) {
LOGP(info, "processing PV {} of {}", iv, nv);
Expand Down Expand Up @@ -532,7 +541,7 @@ void TrackMCStudy::process(const o2::globaltracking::RecoContainer& recoData)
if (msk[DetID::TPC]) {
const auto& trtpc = recoData.getTPCTrack(gidSet[GTrackID::TPC]);
tref.nClTPC = trtpc.getNClusters();
tref.lowestPadRow = getLowestPadrow(trtpc);
getLowestPadrow(trtpc, tref);
flagTPCClusters(trtpc, entry.first);
if (trackFam.entTPC < 0) {
trackFam.entTPC = tcnt;
Expand Down Expand Up @@ -1088,6 +1097,7 @@ bool TrackMCStudy::addMCParticle(const MCTrack& mcPart, const o2::MCCompLabel& l
mcEntry.mcTrackInfo.bcInTF = mIntBC[lb.getEventID()];
mcEntry.mcTrackInfo.occTPC = mTPCOcc[lb.getEventID()];
mcEntry.mcTrackInfo.occITS = mITSOcc[lb.getEventID()];
mcEntry.mcTrackInfo.addedAtRecStage = mRecProcStage;
int moth = -1;
o2::MCCompLabel mclbPar;
if ((moth = mcPart.getMotherTrackId()) >= 0) {
Expand Down