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
2 changes: 1 addition & 1 deletion PWGLF/DataModel/LFHypernucleiTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@
DECLARE_SOA_COLUMN(NTPCclusPi, nTPCclusPi, uint8_t); // Number of TPC clusters of the Pi daughter
DECLARE_SOA_COLUMN(NTPCpidClusHe, nTPCpidClusHe, uint8_t); // Number of TPC clusters with PID information of the He daughter
DECLARE_SOA_COLUMN(NTPCpidClusPi, nTPCpidClusPi, uint8_t); // Number of TPC clusters with PID information of the Pi daughter
DECLARE_SOA_COLUMN(TPCsignalHe, tpcSignalHe, uint16_t); // TPC signal of the He daughter

Check failure on line 61 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCsignalPi, tpcSignalPi, uint16_t); // TPC signal of the Pi daughter

Check failure on line 62 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCChi2He, tpcChi2He, float); // TPC chi2 of the He daughter

Check failure on line 63 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(ITSChi2He, itsChi2He, float); // ITS chi2 of the He daughter

Check failure on line 64 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(ITSChi2Pi, itsChi2Pi, float); // ITS chi2 of the Pi daughter

Check failure on line 65 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TrackedClSize, trackedClSize, int); // int: zero for non-tracked candidates
DECLARE_SOA_COLUMN(Flags, flags, uint8_t); // Flags for PID in tracking (bits [0, 3] for negative daughter, [4,7] for positive daughter)
DECLARE_SOA_COLUMN(TPCmomHe, tpcMomHe, float); // TPC momentum of the He daughter

Check failure on line 68 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TPCmomPi, tpcMomPi, float); // TPC momentum of the Pi daughter

Check failure on line 69 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(TOFMass, tofMass, float); // TOF mass of the candidate

Check failure on line 70 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(ITSclusterSizesHe, itsClusterSizesHe, uint32_t); // ITS cluster size of the He daughter

Check failure on line 71 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(ITSclusterSizesPi, itsClusterSizesPi, uint32_t); // ITS cluster size of the Pi daughter

Check failure on line 72 in PWGLF/DataModel/LFHypernucleiTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(ITSclusterSizesHyp, itsClusterSizesHyp, uint32_t); // ITS cluster size of the Pi daughter
DECLARE_SOA_COLUMN(DcaHe, dcaHe, float); // DCA between He daughter and V0
DECLARE_SOA_COLUMN(DcaPi, dcaPi, float); // DCA between pi daughter and V0
Expand Down Expand Up @@ -150,7 +150,7 @@
hyperrec::IsSignal,
hyperrec::IsRecoMCCollision,
hyperrec::IsSurvEvSel,
hyperrec::IsTwoBodyDecay);
hyperrec::IsTwoBodyDecay, aod::mcparticle::StatusCode);

DECLARE_SOA_TABLE(DataHypCandsWColl, "AOD", "HYPCANDSWCOLL",
o2::soa::Index<>,
Expand Down
46 changes: 24 additions & 22 deletions PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using std::array;
using CollBracket = o2::math_utils::Bracket<int>;
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TOFSignal, aod::TOFEvTime>;
using CollisionsFull = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0As, aod::CentFT0Cs, aod::CentFT0Ms>;
Expand Down Expand Up @@ -166,7 +165,7 @@ struct hyperRecoTask {

// Define o2 fitter, 2-prong, active memory (no need to redefine per event)
o2::vertexing::DCAFitterN<2> fitter;
svPoolCreator svCreator{heDauPdg, 211};
svPoolCreator svCreator{heDauPdg, PDG_t::kPiPlus};

// daughter masses
float he3Mass = o2::constants::physics::MassHelium3;
Expand Down Expand Up @@ -552,7 +551,7 @@ struct hyperRecoTask {
if (mBBparamsHe[5] < 0) {
LOG(fatal) << "Bethe-Bloch parameters for He3 not set, please check your CCDB and configuration";
}
for (auto& v0 : V0s) {
for (const auto& v0 : V0s) {
// if(v0.isStandardV0())
// continue;
auto posTrack = tracks.rawIteratorAt(v0.posTrackId());
Expand Down Expand Up @@ -593,7 +592,7 @@ struct hyperRecoTask {
svCreator.clearPools();
svCreator.fillBC2Coll(collisions, bcs);

for (auto& track : tracks) {
for (const auto& track : tracks) {

if (std::abs(track.eta()) > etaMax)
continue;
Expand All @@ -603,7 +602,7 @@ struct hyperRecoTask {

auto nSigmaHe = computeNSigmaHe3(track);
bool isHe = nSigmaHe > -1 * nSigmaMaxHe;
int pdgHypo = isHe ? heDauPdg : 211;
int pdgHypo = isHe ? heDauPdg : PDG_t::kPiPlus;
// LOG(info) << "ncls found: " << track.tpcNClsFound();
if (isHe && track.tpcNClsFound() < nTPCClusMinHe)
continue;
Expand All @@ -615,7 +614,7 @@ struct hyperRecoTask {
auto& svPool = svCreator.getSVCandPool(collisions);
LOG(debug) << "SV pool size: " << svPool.size();

for (auto& svCand : svPool) {
for (const auto& svCand : svPool) {
auto heTrack = tracks.rawIteratorAt(svCand.tr0Idx);
auto piTrack = tracks.rawIteratorAt(svCand.tr1Idx);
auto collIdxs = svCand.collBracket;
Expand All @@ -634,19 +633,19 @@ struct hyperRecoTask {
auto mcTrackHe = mcLabHe.mcParticle_as<aod::McParticles>();
auto mcTrackPi = mcLabPi.mcParticle_as<aod::McParticles>();
if (mcTrackHe.has_mothers() && mcTrackPi.has_mothers()) {
for (auto& heMother : mcTrackHe.mothers_as<aod::McParticles>()) {
for (auto& piMother : mcTrackPi.mothers_as<aod::McParticles>()) {
for (const auto& heMother : mcTrackHe.mothers_as<aod::McParticles>()) {
for (const auto& piMother : mcTrackPi.mothers_as<aod::McParticles>()) {
if (heMother.globalIndex() != piMother.globalIndex())
continue;
if (std::abs(mcTrackHe.pdgCode()) != heDauPdg || std::abs(mcTrackPi.pdgCode()) != 211)
if (std::abs(mcTrackHe.pdgCode()) != heDauPdg || std::abs(mcTrackPi.pdgCode()) != PDG_t::kPiPlus)
continue;
if (std::abs(heMother.pdgCode()) != hyperPdg)
continue;

auto primVtx = array{heMother.vx(), heMother.vy(), heMother.vz()};
auto secVtx = array{mcTrackHe.vx(), mcTrackHe.vy(), mcTrackHe.vz()};
hypCand.gMom = array{heMother.px(), heMother.py(), heMother.pz()};
hypCand.gMomHe3 = array{mcTrackHe.px(), mcTrackHe.py(), mcTrackHe.pz()};
auto primVtx = std::array<float, 3>{heMother.vx(), heMother.vy(), heMother.vz()};
auto secVtx = std::array<float, 3>{mcTrackHe.vx(), mcTrackHe.vy(), mcTrackHe.vz()};
hypCand.gMom = std::array<float, 3>{heMother.px(), heMother.py(), heMother.pz()};
hypCand.gMomHe3 = std::array<float, 3>{mcTrackHe.px(), mcTrackHe.py(), mcTrackHe.pz()};
for (int i = 0; i < 3; i++) {
hypCand.gDecVtx[i] = secVtx[i] - primVtx[i];
}
Expand Down Expand Up @@ -683,7 +682,7 @@ struct hyperRecoTask {
selectGoodCollisions(collisions);
useCustomVertexer ? fillCustomV0s(collisions, tracks, ambiTracks, bcs) : fillV0s(collisions, tracks, V0s);

for (auto& hypCand : hyperCandidates) {
for (const auto& hypCand : hyperCandidates) {
auto collision = collisions.rawIteratorAt(hypCand.collisionID);
float trackedHypClSize = !trackedClSize.empty() ? trackedClSize[hypCand.v0ID] : 0;
outputDataTable(collision.centFT0A(), collision.centFT0C(), collision.centFT0M(),
Expand Down Expand Up @@ -712,7 +711,7 @@ struct hyperRecoTask {
selectGoodCollisions(collisions);
useCustomVertexer ? fillCustomV0s(collisions, tracks, ambiTracks, bcs) : fillV0s(collisions, tracks, V0s);

for (auto& hypCand : hyperCandidates) {
for (const auto& hypCand : hyperCandidates) {
auto collision = collisions.rawIteratorAt(hypCand.collisionID);
if (isEventUsedForEPCalibration && !collision.triggereventep()) {
return;
Expand Down Expand Up @@ -746,7 +745,7 @@ struct hyperRecoTask {
selectGoodCollisions(collisions);
useCustomVertexer ? fillCustomV0s(collisions, tracks, ambiTracks, bcs) : fillV0s(collisions, tracks, V0s);

for (auto& hypCand : hyperCandidates) {
for (const auto& hypCand : hyperCandidates) {
auto collision = collisions.rawIteratorAt(hypCand.collisionID);
float trackedHypClSize = !trackedClSize.empty() ? trackedClSize[hypCand.v0ID] : 0;
outputDataTableWithCollID(hypCand.collisionID, collision.centFT0A(), collision.centFT0C(), collision.centFT0M(),
Expand Down Expand Up @@ -779,7 +778,7 @@ struct hyperRecoTask {
selectGoodCollisionsMC(collisions);
useCustomVertexer ? fillCustomV0s(collisions, tracks, ambiTracks, bcs) : fillV0s(collisions, tracks, V0s);
fillMCinfo(trackLabelsMC, particlesMC);
for (auto& hypCand : hyperCandidates) {
for (const auto& hypCand : hyperCandidates) {
auto collision = collisions.rawIteratorAt(hypCand.collisionID);
if (!hypCand.isSignal && mcSignalOnly)
continue;
Expand All @@ -798,11 +797,11 @@ struct hyperRecoTask {
hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize,
chargeFactor * hypCand.genPt(), hypCand.genPhi(), hypCand.genEta(), hypCand.genPtHe3(),
hypCand.gDecVtx[0], hypCand.gDecVtx[1], hypCand.gDecVtx[2],
hypCand.isReco, hypCand.isFakeHeOnITSLayer, hypCand.isSignal, hypCand.isRecoMCCollision, hypCand.isSurvEvSelection, 1);
hypCand.isReco, hypCand.isFakeHeOnITSLayer, hypCand.isSignal, hypCand.isRecoMCCollision, hypCand.isSurvEvSelection, 1, 0);
}

// now we fill only the signal candidates that were not reconstructed
for (auto& mcPart : particlesMC) {
for (const auto& mcPart : particlesMC) {

if (std::abs(mcPart.pdgCode()) != hyperPdg)
continue;
Expand All @@ -811,12 +810,15 @@ struct hyperRecoTask {
std::array<float, 3> momMother = {mcPart.px(), mcPart.py(), mcPart.pz()};
std::array<float, 3> momHe3;
bool isHeFound = false;
for (auto& mcDaught : mcPart.daughters_as<aod::McParticles>()) {
int mcProcess = {0};
for (const auto& mcDaught : mcPart.daughters_as<aod::McParticles>()) {
if (std::abs(mcDaught.pdgCode()) == heDauPdg) {
secVtx = {mcDaught.vx(), mcDaught.vy(), mcDaught.vz()};
momHe3 = {mcDaught.px(), mcDaught.py(), mcDaught.pz()};
isHeFound = true;
break;
}
if (mcDaught.pdgCode() != PDG_t::kElectron) { // we do not care about delta electrons
mcProcess = mcDaught.getProcess();
}
}
if (mcPart.pdgCode() > 0) {
Expand Down Expand Up @@ -870,7 +872,7 @@ struct hyperRecoTask {
-1, -1, -1, false,
chargeFactor * hypCand.genPt(), hypCand.genPhi(), hypCand.genEta(), hypCand.genPtHe3(),
hypCand.gDecVtx[0], hypCand.gDecVtx[1], hypCand.gDecVtx[2],
hypCand.isReco, -1, hypCand.isSignal, hypCand.isRecoMCCollision, hypCand.isSurvEvSelection, isHeFound);
hypCand.isReco, -1, hypCand.isSignal, hypCand.isRecoMCCollision, hypCand.isSurvEvSelection, isHeFound, mcProcess);
}
}
PROCESS_SWITCH(hyperRecoTask, processMC, "MC analysis", false);
Expand Down
Loading