Skip to content

Commit 938cb93

Browse files
committed
MCStudy: fix ITS/TPC extrapolation, optionally add TPC track.refs
1 parent 8139414 commit 938cb93

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

Detectors/GlobalTrackingWorkflow/study/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12-
#add_compile_options(-O0 -g -fPIC)
12+
add_compile_options(-O0 -g -fPIC)
1313

1414
o2_add_library(GlobalTrackingStudy
1515
TARGETVARNAME targetName

Detectors/GlobalTrackingWorkflow/study/include/GlobalTrackingStudy/TrackMCStudyConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct TrackMCStudyConfig : o2::conf::ConfigurableParamHelper<TrackMCStudyConfig
2727
float decayMotherMaxT = 1.0f; // max TOF in ns for mother particles to study
2828
bool requireITSorTPCTrackRefs = true;
2929
bool requireTopBottomRefs = false;
30+
bool storeTPCTrackRefs = false;
3031
int minTPCRefsToExtractClRes = 2;
3132
int nOccBinsDrift = 10; // number of bins for TPC max drift time, where we integrate the occupancies
3233
int nTBPerOccBin = 48; // number of TB per occ bin

Detectors/GlobalTrackingWorkflow/study/include/GlobalTrackingStudy/TrackMCStudyTypes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct MCTrackInfo {
3333
int getLowestITSLayer() const;
3434
int getHighestITSLayer() const;
3535
std::vector<float> occTPCV{};
36+
std::vector<o2::track::TrackPar> trackRefsTPC{};
3637
o2::track::TrackPar track{};
3738
o2::MCCompLabel label{};
3839
float occTPC = -1.f;
@@ -73,7 +74,7 @@ struct MCTrackInfo {
7374
float getTrackParTPCPar(int i, float b, float x = 90) const;
7475
float getTrackParTPCPhiSec(float b, float x = 90) const;
7576

76-
ClassDefNV(MCTrackInfo, 7);
77+
ClassDefNV(MCTrackInfo, 8);
7778
};
7879

7980
struct RecTrack {

Detectors/GlobalTrackingWorkflow/study/src/TrackMCStudy.cxx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ void TrackMCStudy::process(const o2::globaltracking::RecoContainer& recoData)
507507
}
508508

509509
LOGP(info, "collected {} MC tracks", mSelMCTracks.size());
510-
if (params.minTPCRefsToExtractClRes > 0) { // prepare MC trackrefs for TPC
510+
if (params.minTPCRefsToExtractClRes > 0 || params.storeTPCTrackRefs) { // prepare MC trackrefs for TPC
511511
processTPCTrackRefs();
512512
}
513513

@@ -532,6 +532,15 @@ void TrackMCStudy::process(const o2::globaltracking::RecoContainer& recoData)
532532
}
533533
return lhs.gid.getSource() > rhs.gid.getSource();
534534
});
535+
if (params.storeTPCTrackRefs) {
536+
auto rft = mSelTRefIdx.find(entry.first);
537+
if (rft != mSelTRefIdx.end()) {
538+
auto rfent = rft->second;
539+
for (int irf = rfent.first; irf < rfent.second; irf++) {
540+
trackFam.mcTrackInfo.trackRefsTPC.push_back(mSelTRefs[irf]);
541+
}
542+
}
543+
}
535544
// fill track params
536545
int tcnt = 0;
537546
for (auto& tref : tracks) {
@@ -598,8 +607,8 @@ void TrackMCStudy::process(const o2::globaltracking::RecoContainer& recoData)
598607
tcnt++;
599608
}
600609
if (trackFam.entITS > -1 && trackFam.entTPC > -1) { // ITS and TPC were found but matching failed
601-
auto vidITS = tracks[trackFam.entITS].gid;
602-
auto vidTPC = tracks[trackFam.entTPC].gid;
610+
auto vidITS = recoData.getITSContributorGID(tracks[trackFam.entITS].gid);
611+
auto vidTPC = recoData.getTPCContributorGID(tracks[trackFam.entTPC].gid);
603612
auto trcTPC = recoData.getTrackParam(vidTPC);
604613
auto trcITS = recoData.getTrackParamOut(vidITS);
605614
if (propagateToRefX(trcTPC, trcITS)) {

0 commit comments

Comments
 (0)