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
9 changes: 8 additions & 1 deletion PWGLF/DataModel/LFhe3HadronTables.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/DataModel/LFhe3HadronTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -12,7 +12,7 @@
///
/// \file LFhe3HadronTables.h
/// \brief Slim tables for he3Hadron
///

Check failure on line 15 in PWGLF/DataModel/LFhe3HadronTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

#include "Framework/AnalysisDataModel.h"
#include "Framework/ASoAHelpers.h"
Expand All @@ -32,10 +32,10 @@
DECLARE_SOA_COLUMN(EtaHad, etaHad, float);
DECLARE_SOA_COLUMN(PhiHad, phiHad, float);

DECLARE_SOA_COLUMN(DCAxyHe3, dcaxyHe3, float);

Check failure on line 35 in PWGLF/DataModel/LFhe3HadronTables.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(DCAzHe3, dcazHe3, float);

Check failure on line 36 in PWGLF/DataModel/LFhe3HadronTables.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(DCAxyHad, dcaxyHad, float);

Check failure on line 37 in PWGLF/DataModel/LFhe3HadronTables.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(DCAzHad, dcazHad, float);

Check failure on line 38 in PWGLF/DataModel/LFhe3HadronTables.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(SignalTPCHe3, signalTPCHe3, float);
DECLARE_SOA_COLUMN(InnerParamTPCHe3, innerParamTPCHe3, float);
Expand All @@ -43,13 +43,13 @@
DECLARE_SOA_COLUMN(InnerParamTPCHad, innerParamTPCHad, float);
DECLARE_SOA_COLUMN(NClsTPCHe3, nClsTPCHe3, uint8_t);
DECLARE_SOA_COLUMN(NSigmaTPCHe3, nSigmaTPCHe3, float);
DECLARE_SOA_COLUMN(NSigmaTPCHad, nSigmaTOFHad, float);

Check failure on line 46 in PWGLF/DataModel/LFhe3HadronTables.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(Chi2TPCHe3, chi2TPCHe3, float);
DECLARE_SOA_COLUMN(Chi2TPCHad, chi2TPCHad, float);
DECLARE_SOA_COLUMN(MassTOFHe3, massTOFHe3, float);
DECLARE_SOA_COLUMN(MassTOFHad, massTOFHad, float);
DECLARE_SOA_COLUMN(PIDtrkHe3, pidTrkHe3, uint32_t);

Check failure on line 51 in PWGLF/DataModel/LFhe3HadronTables.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(PIDtrkHad, pidTrkHad, uint32_t);

Check failure on line 52 in PWGLF/DataModel/LFhe3HadronTables.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(ItsClusterSizeHe3, itsClusterSizeHe3, uint32_t);
DECLARE_SOA_COLUMN(ItsClusterSizeHad, itsClusterSizeHad, uint32_t);
Expand All @@ -72,9 +72,13 @@
DECLARE_SOA_COLUMN(CollisionId, collisionId, int64_t);
DECLARE_SOA_COLUMN(ZVertex, zVertex, float);
DECLARE_SOA_COLUMN(Multiplicity, multiplicity, uint16_t);
DECLARE_SOA_COLUMN(CentralityFT0C, centFT0C, float);

Check failure on line 75 in PWGLF/DataModel/LFhe3HadronTables.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(MultiplicityFT0C, multiplicityFT0C, float);

DECLARE_SOA_COLUMN(IsMotherLi4, isMotherLi4, bool);
DECLARE_SOA_COLUMN(IsHe3Primary, isHe3Primary, bool);
DECLARE_SOA_COLUMN(IsHadPrimary, isHadPrimary, bool);

} // namespace he3HadronTablesNS

DECLARE_SOA_TABLE(he3HadronTable, "AOD", "HE3HADTABLE",
Expand Down Expand Up @@ -115,7 +119,10 @@
he3HadronTablesNS::EtaMCHad,
he3HadronTablesNS::PhiMCHad,
he3HadronTablesNS::SignedPtMC,
he3HadronTablesNS::MassMC)
he3HadronTablesNS::MassMC,
he3HadronTablesNS::IsMotherLi4,
he3HadronTablesNS::IsHe3Primary,
he3HadronTablesNS::IsHadPrimary)
DECLARE_SOA_TABLE(he3HadronMult, "AOD", "HE3HADMULT",
he3HadronTablesNS::CollisionId,
he3HadronTablesNS::ZVertex,
Expand Down
85 changes: 80 additions & 5 deletions PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3",
// constexpr float pionchargedMass = o2::constants::physics::MassPiPlus;
constexpr int Li4PDG = 1000030040;
constexpr int ProtonPDG = PDG_t::kProton;
constexpr int PionPDG = PDG_t::kPiPlus;
constexpr int He3PDG = o2::constants::physics::Pdg::kHelium3;
constexpr float CommonInite = 0.0f;
// constexpr int pichargedPDG = 211;
Expand Down Expand Up @@ -162,6 +163,10 @@ struct He3HadCandidate {
float etaHadMC = -99.f;
float phiHadMC = -99.f;

bool isHe3Primary = false;
bool isHadPrimary = false;
bool isMotherLi4 = false;

// collision information
int32_t collisionID = 0;
};
Expand Down Expand Up @@ -638,17 +643,26 @@ struct he3HadronFemto {
}

template <typename Mc>
void fillCandidateInfoMC(const Mc& mctrackHe3, const Mc& mctrackHad, const Mc& mctrackMother, He3HadCandidate& he3Hadcand)
void fillCandidateInfoMC(const Mc& mctrackHe3, const Mc& mctrackHad, He3HadCandidate& he3Hadcand)
{
LOG(info) << "--------------------------Filling candidate info MC";
he3Hadcand.momHe3MC = mctrackHe3.pt() * (mctrackHe3.pdgCode() > 0 ? 1 : -1);
he3Hadcand.etaHe3MC = mctrackHe3.eta();
he3Hadcand.phiHe3MC = mctrackHe3.phi();
he3Hadcand.momHadMC = mctrackHad.pt() * (mctrackHad.pdgCode() > 0 ? 1 : -1);
he3Hadcand.etaHadMC = mctrackHad.eta();
he3Hadcand.phiHadMC = mctrackHad.phi();
he3Hadcand.isHe3Primary = mctrackHe3.isPhysicalPrimary();
he3Hadcand.isHadPrimary = mctrackHad.isPhysicalPrimary();
}

template <typename Mc>
void fillMotherInfoMC(const Mc& mctrackHe3, const Mc& mctrackHad, const Mc& mctrackMother, He3HadCandidate& he3Hadcand)
{
he3Hadcand.l4PtMC = mctrackMother.pt() * (mctrackMother.pdgCode() > 0 ? 1 : -1);
const double eLit = mctrackHe3.e() + mctrackHad.e();
he3Hadcand.l4MassMC = std::sqrt(eLit * eLit - mctrackMother.p() * mctrackMother.p());
he3Hadcand.isMotherLi4 = std::abs(mctrackMother.pdgCode()) == Li4PDG;
}

template <typename Ttrack>
Expand Down Expand Up @@ -763,7 +777,10 @@ struct he3HadronFemto {
he3Hadcand.etaHadMC,
he3Hadcand.phiHadMC,
he3Hadcand.l4PtMC,
he3Hadcand.l4MassMC);
he3Hadcand.l4MassMC,
he3Hadcand.isMotherLi4,
he3Hadcand.isHe3Primary,
he3Hadcand.isHadPrimary);
}
if (settingFillMultiplicity) {
outputMultiplicityTable(
Expand Down Expand Up @@ -836,7 +853,8 @@ struct he3HadronFemto {
}
if (daughtHe3 && daughtHad) {
He3HadCandidate he3Hadcand;
fillCandidateInfoMC(mcHe3, mcHad, mcParticle, he3Hadcand);
fillCandidateInfoMC(mcHe3, mcHad, he3Hadcand);
fillMotherInfoMC(mcHe3, mcHad, mcParticle, he3Hadcand);
auto collision = collisions.rawIteratorAt(he3Hadcand.collisionID);
fillTable(he3Hadcand, collision, /*isMC*/ true);
}
Expand Down Expand Up @@ -945,7 +963,8 @@ struct he3HadronFemto {
if (!fillCandidateInfo(heTrack, prTrack, collBracket, collisions, he3Hadcand, tracks, /*mix*/ false)) {
continue;
}
fillCandidateInfoMC(mctrackHe3, mctrackHad, mothertrack, he3Hadcand);
fillCandidateInfoMC(mctrackHe3, mctrackHad, he3Hadcand);
fillMotherInfoMC(mctrackHe3, mctrackHad, mothertrack, he3Hadcand);
fillHistograms(he3Hadcand);
auto collision = collisions.rawIteratorAt(he3Hadcand.collisionID);
fillTable(he3Hadcand, collision, /*isMC*/ true);
Expand All @@ -959,6 +978,61 @@ struct he3HadronFemto {
}
PROCESS_SWITCH(he3HadronFemto, processMC, "Process MC", false);

void processPiHe3MC(const CollisionsFullMC& collisions, const aod::BCsWithTimestamps& bcs, const TrackCandidatesMC& tracks, const aod::McParticles& /* mcParticles */)
{
mGoodCollisions.clear();
mGoodCollisions.resize(collisions.size(), false);

LOG(info) << "processPiHe3MC begin";

for (const auto& collision : collisions) {

mTrackPairs.clear();

if (!selectCollision</*isMC*/ true>(collision, bcs)) {
continue;
}

const uint64_t collIdx = collision.globalIndex();
mGoodCollisions[collIdx] = true;
auto trackTableThisCollision = tracks.sliceBy(mPerColMC, collIdx);
trackTableThisCollision.bindExternalIndices(&tracks);

pairTracksSameEvent(trackTableThisCollision);

for (const auto& trackPair : mTrackPairs) {

auto heTrack = tracks.rawIteratorAt(trackPair.tr0Idx);
auto piTrack = tracks.rawIteratorAt(trackPair.tr1Idx);
auto collBracket = trackPair.collBracket;

if (!heTrack.has_mcParticle() || !piTrack.has_mcParticle()) {
continue;
}

auto mctrackHe3 = heTrack.mcParticle();
auto mctrackHad = piTrack.mcParticle();

if (std::abs(mctrackHe3.pdgCode()) != He3PDG || std::abs(mctrackHad.pdgCode()) != PionPDG) {
continue;
}
LOG(info) << "only pi-He3";

He3HadCandidate he3Hadcand;
if (!fillCandidateInfo(heTrack, piTrack, collBracket, collisions, he3Hadcand, tracks, /*mix*/ false)) {
continue;
}

fillCandidateInfoMC(mctrackHe3, mctrackHad, he3Hadcand);
fillHistograms(he3Hadcand);
LOG(info) << "fillHistograms done";
auto collision = collisions.rawIteratorAt(he3Hadcand.collisionID);
fillTable(he3Hadcand, collision, /*isMC*/ true);
}
}
}
PROCESS_SWITCH(he3HadronFemto, processPiHe3MC, "Process pi-He3 MC", false);

void processSameEventPools(const CollisionsFull& collisions, const TrackCandidates& tracks, const aod::AmbiguousTracks& ambiguousTracks, const aod::BCsWithTimestamps& bcs)
{
mGoodCollisions.clear();
Expand Down Expand Up @@ -1073,7 +1147,8 @@ struct he3HadronFemto {
if (!fillCandidateInfo(heTrack, prTrack, collBracket, collisions, he3Hadcand, tracks, /*mix*/ false)) {
continue;
}
fillCandidateInfoMC(mctrackHe3, mctrackHad, mothertrackHe, he3Hadcand);
fillCandidateInfoMC(mctrackHe3, mctrackHad, he3Hadcand);
fillMotherInfoMC(mctrackHe3, mctrackHad, mothertrackHe, he3Hadcand);
fillHistograms(he3Hadcand);
auto collision = collisions.rawIteratorAt(he3Hadcand.collisionID);
fillTable(he3Hadcand, collision, /*isMC*/ true);
Expand Down
Loading