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
16 changes: 8 additions & 8 deletions PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@
// mmark this run as configured
mRunNumber = bc.runNumber();

if(v0BuilderOpts.generatePhotonCandidates.value && v0BuilderOpts.moveTPCOnlyTracks.value){
if (v0BuilderOpts.generatePhotonCandidates.value && v0BuilderOpts.moveTPCOnlyTracks.value) {
// initialize only if needed, avoid unnecessary CCDB calls
mVDriftMgr.init(&ccdb->instance());
mVDriftMgr.update(timestamp);
Expand Down Expand Up @@ -773,8 +773,8 @@

bool trackIsInteresting = false;
if (
(originParticle.pdgCode() == 310 && v0BuilderOpts.mc_addGeneratedK0Short.value > 0) ||

Check warning on line 776 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == 3122 && v0BuilderOpts.mc_addGeneratedLambda.value > 0) ||

Check warning on line 777 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid using hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
(originParticle.pdgCode() == -3122 && v0BuilderOpts.mc_addGeneratedAntiLambda.value > 0) ||
(originParticle.pdgCode() == 22 && v0BuilderOpts.mc_addGeneratedGamma.value > 0)) {
trackIsInteresting = true;
Expand Down Expand Up @@ -1150,27 +1150,27 @@
auto negTrackPar = getTrackParCov(negTrack);

// handle TPC-only tracks properly (photon conversions)
if(v0BuilderOpts.moveTPCOnlyTracks){
if (v0BuilderOpts.moveTPCOnlyTracks) {
bool isPosTPCOnly = (posTrack.hasTPC() && !posTrack.hasITS() && !posTrack.hasTRD() && !posTrack.hasTOF());
if(isPosTPCOnly){
// Nota bene: positive is TPC-only -> this entire V0 merits treatment as photon candidate
if (isPosTPCOnly) {
// Nota bene: positive is TPC-only -> this entire V0 merits treatment as photon candidate
posTrackPar.setPID(o2::track::PID::Electron);
negTrackPar.setPID(o2::track::PID::Electron);

auto const& collision = collisions.rawIteratorAt(v0.collisionId);
if(!mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, posTrack, posTrackPar)){
if (!mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, posTrack, posTrackPar)) {
return;
}
}

bool isNegTPCOnly = (negTrack.hasTPC() && !negTrack.hasITS() && !negTrack.hasTRD() && !negTrack.hasTOF());
if(isNegTPCOnly){
// Nota bene: negative is TPC-only -> this entire V0 merits treatment as photon candidate
if (isNegTPCOnly) {
// Nota bene: negative is TPC-only -> this entire V0 merits treatment as photon candidate
posTrackPar.setPID(o2::track::PID::Electron);
negTrackPar.setPID(o2::track::PID::Electron);

auto const& collision = collisions.rawIteratorAt(v0.collisionId);
if(!mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, negTrack, negTrackPar)){
if (!mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, negTrack, negTrackPar)) {
return;
}
}
Expand Down Expand Up @@ -1206,7 +1206,7 @@
straHelper.v0.daughterDCA,
straHelper.v0.positiveDCAxy,
straHelper.v0.negativeDCAxy,
TMath::Cos(straHelper.v0.pointingAngle),

Check warning on line 1209 in PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
straHelper.v0.dcaXY,
v0.v0Type);
products.v0dataLink(products.v0cores.lastIndex(), -1);
Expand Down
44 changes: 21 additions & 23 deletions PWGLF/Utils/strangenessBuilderHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ class strangenessBuilderHelper
float pvX, float pvY, float pvZ,
TTrack const& positiveTrack,
TTrack const& negativeTrack,
TTrackParametrization& positiveTrackParam,
TTrackParametrization& negativeTrackParam,
TTrackParametrization& positiveTrackParam,
TTrackParametrization& negativeTrackParam,
bool useCollinearFit = false,
bool calculateCovariance = false)
{
Expand All @@ -195,7 +195,7 @@ class strangenessBuilderHelper
// do DCA to PV on copies instead of originals
auto positiveTrackParamCopy = positiveTrackParam;
auto negativeTrackParamCopy = negativeTrackParam;

o2::base::Propagator::Instance()->propagateToDCABxByBz({pvX, pvY, pvZ}, positiveTrackParamCopy, 2.f, fitter.getMatCorrType(), &dcaInfo);
v0.positiveDCAxy = dcaInfo[0];

Expand Down Expand Up @@ -235,7 +235,7 @@ class strangenessBuilderHelper
// avoids misuse if mixed with KF particle use
v0.momentum[i] = v0.positiveMomentum[i] + v0.negativeMomentum[i];
}

// get decay vertex coordinates
const auto& vtx = fitter.getPCACandidate();
for (int i = 0; i < 3; i++) {
Expand Down Expand Up @@ -315,17 +315,16 @@ class strangenessBuilderHelper
}

template <typename TCollision, typename TTrack, typename TTrackParametrization>
bool buildV0CandidateWithKF(TCollision const& collision,
bool buildV0CandidateWithKF(TCollision const& collision,
TTrack const& positiveTrack,
TTrack const& negativeTrack,
TTrackParametrization& positiveTrackParam,
TTrackParametrization& negativeTrackParam,
int kfConstructMethod = 2, // the typical used
TTrackParametrization& positiveTrackParam,
TTrackParametrization& negativeTrackParam,
int kfConstructMethod = 2, // the typical used
float kfConstrainedMassValue = 0.0f, // negative: no constraint
bool kfConstrainToPrimaryVertex = true
)
bool kfConstrainToPrimaryVertex = true)
{
int collisionIndex = collision.globalIndex();
int collisionIndex = collision.globalIndex();
float pvX = collision.posX();
float pvY = collision.posY();
float pvZ = collision.posZ();
Expand All @@ -352,7 +351,7 @@ class strangenessBuilderHelper
// do DCA to PV on copies instead of originals
auto positiveTrackParamCopy = positiveTrackParam;
auto negativeTrackParamCopy = negativeTrackParam;

o2::base::Propagator::Instance()->propagateToDCABxByBz({pvX, pvY, pvZ}, positiveTrackParamCopy, 2.f, fitter.getMatCorrType(), &dcaInfo);
v0.positiveDCAxy = dcaInfo[0];

Expand Down Expand Up @@ -387,7 +386,7 @@ class strangenessBuilderHelper
return false;
}

if (kfConstrainedMassValue>-1e-4) {
if (kfConstrainedMassValue > -1e-4) {
// photon constraint: this one's got no mass
KFV0.SetNonlinearMassConstraint(kfConstrainedMassValue);
}
Expand All @@ -406,10 +405,9 @@ class strangenessBuilderHelper
v0.negativeMomentum = {kfpNeg_DecayVtx.GetPx(), kfpNeg_DecayVtx.GetPy(), kfpNeg_DecayVtx.GetPz()};

v0.daughterDCA = std::hypot(
kfpPos_DecayVtx.GetX()-kfpNeg_DecayVtx.GetX(),
kfpPos_DecayVtx.GetY()-kfpNeg_DecayVtx.GetY(),
kfpPos_DecayVtx.GetZ()-kfpNeg_DecayVtx.GetZ()
);
kfpPos_DecayVtx.GetX() - kfpNeg_DecayVtx.GetX(),
kfpPos_DecayVtx.GetY() - kfpNeg_DecayVtx.GetY(),
kfpPos_DecayVtx.GetZ() - kfpNeg_DecayVtx.GetZ());

if (v0.daughterDCA > v0selections.dcav0dau) {
return false;
Expand All @@ -434,14 +432,14 @@ class strangenessBuilderHelper
v0.pointingAngle = TMath::ACos(cosPA);

v0.dcaXY = CalculateDCAStraightToPV(
v0.position[0], v0.position[1], v0.position[2],
v0.momentum[0], v0.momentum[1], v0.momentum[2],
pvX, pvY, pvZ);
v0.position[0], v0.position[1], v0.position[2],
v0.momentum[0], v0.momentum[1], v0.momentum[2],
pvX, pvY, pvZ);

// apply topological constraint to PV if requested
// might adjust px py pz
// apply topological constraint to PV if requested
// might adjust px py pz
KFParticle KFV0_PV = KFV0;
if(kfConstrainToPrimaryVertex){
if (kfConstrainToPrimaryVertex) {
KFV0_PV.SetProductionVertex(KFPV);
}
v0.momentum = {KFV0_PV.GetPx(), KFV0_PV.GetPy(), KFV0_PV.GetPz()};
Expand Down
Loading