Skip to content

Commit bcefd65

Browse files
fmazzascFrancesco Mazzaschialibuild
authored
hyperRecoTask: Add few optimisations (#6585)
* Add few optimisations * Please consider the following formatting changes --------- Co-authored-by: Francesco Mazzaschi <fmazzasc@alipap1.cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent fbb8bb7 commit bcefd65

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct hyperRecoTask {
135135
Configurable<float> TPCRigidityMinHe{"TPCRigidityMinHe", 0.2, "Minimum rigidity of the helium candidate"};
136136
Configurable<float> etaMax{"eta", 1., "eta daughter"};
137137
Configurable<float> nSigmaMaxHe{"nSigmaMaxHe", 5, "helium dEdx cut (n sigma)"};
138-
Configurable<float> nTPCClusMinHe{"nTPCClusMinHe", 80, "helium NTPC clusters cut"};
138+
Configurable<float> nTPCClusMin{"nTPCClusMin", 70, "helium NTPC clusters cut"};
139139
Configurable<bool> mcSignalOnly{"mcSignalOnly", true, "If true, save only signal in MC"};
140140

141141
// Define o2 fitter, 2-prong, active memory (no need to redefine per event)
@@ -148,6 +148,7 @@ struct hyperRecoTask {
148148
float piMass = o2::constants::physics::MassPionCharged;
149149

150150
Configurable<bool> useCustomVertexer{"useCustomVertexer", false, "Use custom vertexer"};
151+
Configurable<bool> skipAmbiTracks{"skipAmbiTracks", false, "Skip ambiguous tracks"};
151152
Configurable<float> customVertexerTimeMargin{"customVertexerTimeMargin", 800, "Time margin for custom vertexer (ns)"};
152153
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], 1, 6, particleNames, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for He3"};
153154
Configurable<bool> cfgCompensatePIDinTracking{"cfgCompensatePIDinTracking", true, "If true, divide tpcInnerParam by the electric charge"};
@@ -209,6 +210,9 @@ struct hyperRecoTask {
209210
fitter.setMatCorrType(static_cast<o2::base::Propagator::MatCorrType>(mat));
210211

211212
svCreator.setTimeMargin(customVertexerTimeMargin);
213+
if (skipAmbiTracks) {
214+
svCreator.setSkipAmbiTracks();
215+
}
212216

213217
const AxisSpec rigidityAxis{rigidityBins, "#it{p}^{TPC}/#it{z}"};
214218
const AxisSpec dedxAxis{dedxBins, "d#it{E}/d#it{x}"};
@@ -496,7 +500,7 @@ struct hyperRecoTask {
496500
}
497501
auto& heTrack = isHe ? posTrack : negTrack;
498502
auto& piTrack = isHe ? negTrack : posTrack;
499-
if (heTrack.tpcNClsFound() < nTPCClusMinHe) {
503+
if (heTrack.tpcNClsFound() < nTPCClusMin || piTrack.tpcNClsFound() < nTPCClusMin) {
500504
continue;
501505
}
502506

@@ -521,17 +525,12 @@ struct hyperRecoTask {
521525
if (std::abs(track.eta()) > etaMax)
522526
continue;
523527

524-
if (!track.hasITS())
528+
if (!track.hasITS() || track.tpcNClsFound() < nTPCClusMin)
525529
continue;
526530

527531
auto nSigmaHe = computeNSigmaHe3(track);
528532
bool isHe = nSigmaHe > -1 * nSigmaMaxHe;
529533
int pdgHypo = isHe ? heDauPdg : 211;
530-
531-
if (isHe && track.tpcNClsFound() < nTPCClusMinHe) {
532-
continue;
533-
}
534-
535534
svCreator.appendTrackCand(track, collisions, pdgHypo, ambiguousTracks, bcs);
536535
}
537536
auto& svPool = svCreator.getSVCandPool(collisions);

PWGLF/Utils/svPoolCreator.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class svPoolCreator
6060

6161
void setTimeMargin(float timeMargin) { timeMarginNS = timeMargin; }
6262
void setFitter(const o2::vertexing::DCAFitterN<2>& fitter) { this->fitter = fitter; }
63+
void setSkipAmbiTracks() { skipAmbiTracks = true; }
6364
o2::vertexing::DCAFitterN<2>* getFitter() { return &fitter; }
6465
std::array<std::vector<TrackCand>, 4> getTrackCandPool() { return trackCandPool; }
6566

@@ -76,7 +77,7 @@ class svPoolCreator
7677
if (trackCand.template collision_as<C>().has_bc()) {
7778
globalBC = trackCand.template collision_as<C>().template bc_as<aod::BCsWithTimestamps>().globalBC();
7879
}
79-
} else {
80+
} else if (!skipAmbiTracks) {
8081
for (const auto& ambTrack : ambiTracks) {
8182
if (ambTrack.trackId() != trackCand.globalIndex()) {
8283
continue;
@@ -88,6 +89,8 @@ class svPoolCreator
8889
globalBC = ambTrack.bc_as<aod::BCsWithTimestamps>().begin().globalBC();
8990
break;
9091
}
92+
} else {
93+
globalBC = -1;
9194
}
9295

9396
if (globalBC == -1) {
@@ -219,6 +222,7 @@ class svPoolCreator
219222
int track0Pdg;
220223
int track1Pdg;
221224
float timeMarginNS = 600.;
225+
bool skipAmbiTracks = false;
222226
std::unordered_map<int, std::pair<int, int>> tmap;
223227

224228
std::array<std::vector<TrackCand>, 4> trackCandPool; // Sorting: dau0 pos, dau0 neg, dau1 pos, dau1 neg

0 commit comments

Comments
 (0)