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
15 changes: 7 additions & 8 deletions PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct hyperRecoTask {
Configurable<float> TPCRigidityMinHe{"TPCRigidityMinHe", 0.2, "Minimum rigidity of the helium candidate"};
Configurable<float> etaMax{"eta", 1., "eta daughter"};
Configurable<float> nSigmaMaxHe{"nSigmaMaxHe", 5, "helium dEdx cut (n sigma)"};
Configurable<float> nTPCClusMinHe{"nTPCClusMinHe", 80, "helium NTPC clusters cut"};
Configurable<float> nTPCClusMin{"nTPCClusMin", 70, "helium NTPC clusters cut"};
Configurable<bool> mcSignalOnly{"mcSignalOnly", true, "If true, save only signal in MC"};

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

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

svCreator.setTimeMargin(customVertexerTimeMargin);
if (skipAmbiTracks) {
svCreator.setSkipAmbiTracks();
}

const AxisSpec rigidityAxis{rigidityBins, "#it{p}^{TPC}/#it{z}"};
const AxisSpec dedxAxis{dedxBins, "d#it{E}/d#it{x}"};
Expand Down Expand Up @@ -496,7 +500,7 @@ struct hyperRecoTask {
}
auto& heTrack = isHe ? posTrack : negTrack;
auto& piTrack = isHe ? negTrack : posTrack;
if (heTrack.tpcNClsFound() < nTPCClusMinHe) {
if (heTrack.tpcNClsFound() < nTPCClusMin || piTrack.tpcNClsFound() < nTPCClusMin) {
continue;
}

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

if (!track.hasITS())
if (!track.hasITS() || track.tpcNClsFound() < nTPCClusMin)
continue;

auto nSigmaHe = computeNSigmaHe3(track);
bool isHe = nSigmaHe > -1 * nSigmaMaxHe;
int pdgHypo = isHe ? heDauPdg : 211;

if (isHe && track.tpcNClsFound() < nTPCClusMinHe) {
continue;
}

svCreator.appendTrackCand(track, collisions, pdgHypo, ambiguousTracks, bcs);
}
auto& svPool = svCreator.getSVCandPool(collisions);
Expand Down
6 changes: 5 additions & 1 deletion PWGLF/Utils/svPoolCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class svPoolCreator

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

Expand All @@ -76,7 +77,7 @@ class svPoolCreator
if (trackCand.template collision_as<C>().has_bc()) {
globalBC = trackCand.template collision_as<C>().template bc_as<aod::BCsWithTimestamps>().globalBC();
}
} else {
} else if (!skipAmbiTracks) {
for (const auto& ambTrack : ambiTracks) {
if (ambTrack.trackId() != trackCand.globalIndex()) {
continue;
Expand All @@ -88,6 +89,8 @@ class svPoolCreator
globalBC = ambTrack.bc_as<aod::BCsWithTimestamps>().begin().globalBC();
break;
}
} else {
globalBC = -1;
}

if (globalBC == -1) {
Expand Down Expand Up @@ -219,6 +222,7 @@ class svPoolCreator
int track0Pdg;
int track1Pdg;
float timeMarginNS = 600.;
bool skipAmbiTracks = false;
std::unordered_map<int, std::pair<int, int>> tmap;

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