Skip to content
Merged
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
259 changes: 115 additions & 144 deletions PWGLF/TableProducer/Nuspex/ebyeMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
using namespace o2::framework;
using namespace o2::framework::expressions;

using TracksFull = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TOFSignal, aod::TOFEvTime>;
using TracksFullPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TOFSignal, aod::TOFEvTime, aod::pidTOFPr>;
using TracksFullIUPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TOFSignal, aod::TOFEvTime, aod::pidTOFPr>;
using BCsWithRun2Info = soa::Join<aod::BCs, aod::Run2BCInfos, aod::Timestamps>;
Expand Down Expand Up @@ -200,7 +199,7 @@
ConfigurableAxis massLambdaAxis{"massLambdaAxis", {400, o2::constants::physics::MassLambda0 - 0.03f, o2::constants::physics::MassLambda0 + 0.03f}, "binning for the lambda invariant-mass"};

// binning of PID QA histograms
ConfigurableAxis momAxis{"momAxisFine", {5.e2, 0.f, 5.f}, "momentum axis binning"};

Check failure on line 202 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"};

Configurable<float> zVtxMax{"zVtxMax", 10.0f, "maximum z position of the primary vertex"};
Expand Down Expand Up @@ -229,13 +228,13 @@
Configurable<float> lambdaPtMax{"lambdaPtMax", 4.f, "maximum (anti)lambda pT (GeV/c)"};

Configurable<float> trackNcrossedRows{"trackNcrossedRows", 70, "Minimum number of crossed TPC rows"};
Configurable<float> trackNclusItsCut{"trackNclusITScut", 2, "Minimum number of ITS clusters"};

Check failure on line 231 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> trackNclusTpcCut{"trackNclusTPCcut", 60, "Minimum number of TPC clusters"};

Check failure on line 232 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> trackChi2Cut{"trackChi2Cut", 4.f, "Maximum chi2/ncls in TPC"};

Configurable<float> v0trackNcrossedRows{"v0trackNcrossedRows", 100, "Minimum number of crossed TPC rows for V0 daughter"};
Configurable<float> v0trackNclusItsCut{"v0trackNclusITScut", 0, "Minimum number of ITS clusters for V0 daughter"};

Check failure on line 236 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> v0trackNclusTpcCut{"v0trackNclusTPCcut", 100, "Minimum number of TPC clusters for V0 daughter"};

Check failure on line 237 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> v0trackNsharedClusTpc{"v0trackNsharedClusTpc", 5, "Maximum number of shared TPC clusters for V0 daughter"};
Configurable<bool> v0requireITSrefit{"v0requireITSrefit", false, "require ITS refit for V0 daughter"};
Configurable<float> vetoMassK0Short{"vetoMassK0Short", 0.01f, "veto for V0 compatible with K0s mass"};
Expand All @@ -247,10 +246,10 @@
Configurable<float> antipNsigmaTpcCutLow{"antipNsigmaTpcCutLow", -4.f, "TPC PID cut low"};
Configurable<float> antipNsigmaTpcCutUp{"antipNsigmaTpcCutUp", 4.f, "TPC PID cut up"};

Configurable<float> v0settingDcaV0Dau{"v0setting_dcav0dau", 0.5f, "DCA V0 Daughters"};

Check failure on line 249 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> v0settingDcaV0Pv{"v0setting_dcav0pv", 1.f, "DCA V0 to Pv"};

Check failure on line 250 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> v0settingDcaDaughToPv{"v0setting_dcadaughtopv", 0.1f, "DCA Pos To PV"};

Check failure on line 251 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<double> v0settingCosPa{"v0setting_cospa", 0.99f, "V0 CosPA"};

Check failure on line 252 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> v0settingRadius{"v0setting_radius", 5.f, "v0radius"};
Configurable<float> v0settingLifetime{"v0setting_lifetime", 40.f, "v0 lifetime cut"};
Configurable<float> v0settingNSigmaTpc{"v0setting_nsigmatpc", 4.f, "nsigmatpc"};
Expand All @@ -258,6 +257,7 @@

Configurable<LabeledArray<float>> cfgTrackSels{"cfgTrackSels", {kTrackSels, 1, 12, particleName, trackSelsNames}, "Track selections"};
Configurable<LabeledArray<float>> cfgDcaSelsParam{"cfgDcaSelsParam", {kDcaSelsParam[0], 3, 3, dcaSelsNames, dcaParNames}, "DCA threshold settings"};
Configurable<bool> fillMini{"fillMini", false, "fill mini tables"};

std::array<float, kNpart> ptMin;
std::array<float, kNpart> ptTof;
Expand All @@ -267,7 +267,6 @@

HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

Preslice<TracksFull> perCollisionTracksFull = o2::aod::track::collisionId;
Preslice<TracksFullPID> perCollisionTracksFullPID = o2::aod::track::collisionId;
Preslice<TracksFullIUPID> perCollisionTracksFullIUPID = o2::aod::track::collisionId;
Preslice<aod::V0s> perCollisionV0 = o2::aod::v0::collisionId;
Expand Down Expand Up @@ -427,12 +426,40 @@
return static_cast<float>((track.tpcSignal() - expBethe) / expSigma);
}

template <class T>
float getOuterPID(T const& track)
template <const bool isMc, class T>
void fillTableMiniTrack(CandidateTrack& candidateTrack, T const& tk, float const& nSigmaITS = -999.f)
{
if (!(doprocessRun2 || doprocessMcRun2) && track.hasTOF() && track.pt() > antipPtTof)
return track.tofNSigmaPr();
return -999.f;
int selMask = -1;
if ((isMc && candidateTrack.isreco) || !isMc) {
float outerPID = tk.pt() > antipPtTof ? tk.tofNSigmaPr() : -999.f;
candidateTrack.itsnsigma = nSigmaITS;
candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID;
selMask = getTrackSelMask(candidateTrack);
if (candidateTrack.outerPID < outerPIDMin)
return;
if (isMc && candidateTrack.pdgcodemoth > 0)
selMask |= candidateTrack.pdgcodemoth;
} else if (isMc && candidateTrack.pdgcodemoth > 0) {
selMask = candidateTrack.pdgcodemoth;
}
if (isMc && selMask >= 0) {
mcMiniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.outerPID,
candidateTrack.pdgcode > 0 ? candidateTrack.genpt : -candidateTrack.genpt,
static_cast<int8_t>(candidateTrack.geneta * 100),
candidateTrack.isreco);
} else if (!isMc) {
miniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.outerPID);
}
}

template <class T>
Expand Down Expand Up @@ -523,8 +550,6 @@
{
if (doprocessRun3 || doprocessMcRun3)
return tracksAll.sliceBy(perCollisionTracksFullIUPID, collId);
else if (doprocessRun2 || doprocessMcRun2)
return tracksAll.sliceBy(perCollisionTracksFull, collId);
else
return tracksAll.sliceBy(perCollisionTracksFullPID, collId);
}
Expand All @@ -543,7 +568,7 @@
for (const auto& track : tracks) {
if (track.trackType() == o2::aod::track::TrackTypeEnum::Run2Tracklet && std::abs(track.eta()) < etaMax && !(doprocessRun3 || doprocessMcRun3)) { // tracklet
nTrackletsColl++;
} else if (std::abs(track.eta()) < etaMax && track.itsNCls() > 3 && (doprocessRun3 || doprocessMcRun3)) { // ITS only + global tracks

Check failure on line 571 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
nTrackletsColl++;
}
if (!selectTrack(track)) {
Expand Down Expand Up @@ -912,27 +937,15 @@
fillRecoEvent(collision, tracks, v0TableThisCollision, centrality);

miniCollTable(static_cast<int8_t>(collision.posZ() * 10), 0x0, nTrackletsColl, centrality, nTracksColl);

for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref)
auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex);
float outerPID = getOuterPID(tk);
candidateTrack.itsnsigma = -999.f;
candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID;
int selMask = getTrackSelMask(candidateTrack);
if (candidateTrack.outerPID < outerPIDMin)
continue;
miniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.outerPID);
fillTableMiniTrack<false>(candidateTrack, tk);
}
}
}
PROCESS_SWITCH(EbyeMaker, processRun3, "process (Run 3)", false);

void processRun2(soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms, aod::CentRun2CL0s, aod::TrackletMults> const& collisions, TracksFull const& tracks, aod::V0s const& V0s, BCsWithRun2Info const&)
void processRun2(soa::Join<aod::Collisions, aod::EvSels, aod::CentRun2V0Ms, aod::CentRun2CL0s, aod::TrackletMults> const& collisions, TracksFullPID const& tracks, aod::V0s const& V0s, BCsWithRun2Info const&)
{
for (const auto& collision : collisions) {
auto bc = collision.bc_as<BCsWithRun2Info>();
Expand Down Expand Up @@ -974,32 +987,38 @@
histos.fill(HIST("QA/V0MvsCL0"), centralityCl0, centrality);
histos.fill(HIST("QA/trackletsVsV0M"), centrality, multTracklets);

collisionEbyeTable(centrality, collision.posZ());

for (const auto& candidateV0 : candidateV0s) {
lambdaEbyeTable(
collisionEbyeTable.lastIndex(),
candidateV0.pt,
candidateV0.eta,
candidateV0.mass,
candidateV0.dcav0pv,
candidateV0.dcav0daugh,
candidateV0.cpa,
candidateV0.globalIndexNeg,
candidateV0.globalIndexPos);
}

for (int iP{0}; iP < kNpart; ++iP) {
for (const auto& candidateTrack : candidateTracks[iP]) { // deuterons + protons
nucleiEbyeTable(
if (fillMini) {
miniCollTable(static_cast<int8_t>(collision.posZ() * 10), 0x0, nTrackletsColl, centrality, nTracksColl);
for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref)
auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex);
fillTableMiniTrack<false>(candidateTrack, tk);
}
} else {
collisionEbyeTable(centrality, collision.posZ());
for (const auto& candidateV0 : candidateV0s) {
lambdaEbyeTable(
collisionEbyeTable.lastIndex(),
candidateTrack.pt,
candidateTrack.eta,
candidateTrack.mass,
candidateTrack.dcapv,
candidateTrack.tpcncls,
candidateTrack.tpcnsigma,
candidateTrack.tofmass);
candidateV0.pt,
candidateV0.eta,
candidateV0.mass,
candidateV0.dcav0pv,
candidateV0.dcav0daugh,
candidateV0.cpa,
candidateV0.globalIndexNeg,
candidateV0.globalIndexPos);
}
for (int iP{0}; iP < kNpart; ++iP) {
for (const auto& candidateTrack : candidateTracks[iP]) { // deuterons + protons
nucleiEbyeTable(
collisionEbyeTable.lastIndex(),
candidateTrack.pt,
candidateTrack.eta,
candidateTrack.mass,
candidateTrack.dcapv,
candidateTrack.tpcncls,
candidateTrack.tpcnsigma,
candidateTrack.tofmass);
}
}
}
}
Expand Down Expand Up @@ -1047,24 +1066,13 @@
if (triggerCut != 0x0 && (trigger & triggerCut) != triggerCut) {
continue;
}
miniCollTable(static_cast<int8_t>(collision.posZ() * 10), trigger, nTrackletsColl, centrality, nTracksColl);

miniCollTable(static_cast<int8_t>(collision.posZ() * 10), trigger, nTrackletsColl, centrality, nTracksColl);
for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref)
auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex);
float outerPID = getOuterPID(tk);
auto [itsSignal, nSigmaITS] = getITSSignal(tk, trackExtraRun2);
histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal);
candidateTrack.itsnsigma = nSigmaITS;
candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID;
int selMask = getTrackSelMask(candidateTrack);
if (candidateTrack.outerPID < outerPIDMin)
continue;
miniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.outerPID);
fillTableMiniTrack<false>(candidateTrack, tk, nSigmaITS);
}
}
}
Expand All @@ -1091,37 +1099,15 @@
fillMcGen(mcParticles, mcLab, collision.mcCollisionId());

miniCollTable(static_cast<int8_t>(collision.posZ() * 10), nChPartGen, nTrackletsColl, centrality, nTracksColl);

for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref)
int selMask = -1;
if (candidateTrack.isreco) {
auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex);
float outerPID = getOuterPID(tk);
candidateTrack.itsnsigma = -999.f;
candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID;
selMask = getTrackSelMask(candidateTrack);
if (candidateTrack.pdgcodemoth > 0)
selMask |= candidateTrack.pdgcodemoth;
} else if (candidateTrack.pdgcodemoth > 0) {
selMask = candidateTrack.pdgcodemoth;
}
if (selMask < 0)
continue;
mcMiniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.outerPID,
candidateTrack.pdgcode > 0 ? candidateTrack.genpt : -candidateTrack.genpt,
static_cast<int8_t>(candidateTrack.geneta * 100),
candidateTrack.isreco);
auto tk = candidateTrack.isreco ? tracks.rawIteratorAt(candidateTrack.globalIndex) : tracks.rawIteratorAt(0);
fillTableMiniTrack<true>(candidateTrack, tk);
}
}
}
PROCESS_SWITCH(EbyeMaker, processMcRun3, "process MC (Run 3)", false);

void processMcRun2(soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentRun2V0Ms> const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFull const& tracks, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&)
void processMcRun2(soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentRun2V0Ms> const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFullPID const& tracks, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, BCsWithRun2Info const&)
{
for (const auto& collision : collisions) {
auto bc = collision.bc_as<BCsWithRun2Info>();
Expand All @@ -1143,40 +1129,46 @@
fillMcEvent(collision, tracks, v0TableThisCollision, centrality, mcParticles, mcLab);
fillMcGen(mcParticles, mcLab, collision.mcCollisionId());

collisionEbyeTable(centrality, collision.posZ());

for (const auto& candidateV0 : candidateV0s) {
mcLambdaEbyeTable(
collisionEbyeTable.lastIndex(),
candidateV0.pt,
candidateV0.eta,
candidateV0.mass,
candidateV0.dcav0pv,
candidateV0.dcav0daugh,
candidateV0.cpa,
candidateV0.globalIndexNeg,
candidateV0.globalIndexPos,
candidateV0.genpt,
candidateV0.geneta,
candidateV0.pdgcode,
candidateV0.isreco);
}

for (int iP{0}; iP < kNpart; ++iP) {
for (const auto& candidateTrack : candidateTracks[iP]) { // deuterons + protons
mcNucleiEbyeTable(
if (fillMini) {
miniCollTable(static_cast<int8_t>(collision.posZ() * 10), nChPartGen, nTrackletsColl, centrality, nTracksColl);
for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref)
auto tk = candidateTrack.isreco ? tracks.rawIteratorAt(candidateTrack.globalIndex) : tracks.rawIteratorAt(0);
fillTableMiniTrack<true>(candidateTrack, tk);
}
} else {
collisionEbyeTable(centrality, collision.posZ());
for (const auto& candidateV0 : candidateV0s) {
mcLambdaEbyeTable(
collisionEbyeTable.lastIndex(),
candidateTrack.pt,
candidateTrack.eta,
candidateTrack.mass,
candidateTrack.dcapv,
candidateTrack.tpcncls,
candidateTrack.tpcnsigma,
candidateTrack.tofmass,
candidateTrack.genpt,
candidateTrack.geneta,
candidateTrack.pdgcode,
candidateTrack.isreco);
candidateV0.pt,
candidateV0.eta,
candidateV0.mass,
candidateV0.dcav0pv,
candidateV0.dcav0daugh,
candidateV0.cpa,
candidateV0.globalIndexNeg,
candidateV0.globalIndexPos,
candidateV0.genpt,
candidateV0.geneta,
candidateV0.pdgcode,
candidateV0.isreco);
}
for (int iP{0}; iP < kNpart; ++iP) {
for (const auto& candidateTrack : candidateTracks[iP]) { // deuterons + protons
mcNucleiEbyeTable(
collisionEbyeTable.lastIndex(),
candidateTrack.pt,
candidateTrack.eta,
candidateTrack.mass,
candidateTrack.dcapv,
candidateTrack.tpcncls,
candidateTrack.tpcnsigma,
candidateTrack.tofmass,
candidateTrack.genpt,
candidateTrack.geneta,
candidateTrack.pdgcode,
candidateTrack.isreco);
}
}
}
}
Expand Down Expand Up @@ -1206,33 +1198,12 @@
fillMcGen(mcParticles, mcLab, collision.mcCollisionId());

miniCollTable(static_cast<int8_t>(collision.posZ() * 10), nChPartGen, nTrackletsColl, centrality, nTracksColl);

for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref)
int selMask = -1;
if (candidateTrack.isreco) {
auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex);
float outerPID = getOuterPID(tk);
auto [itsSignal, nSigmaITS] = getITSSignal(tk, trackExtraRun2);
auto tk = candidateTrack.isreco ? tracks.rawIteratorAt(candidateTrack.globalIndex) : tracks.rawIteratorAt(0);
auto [itsSignal, nSigmaITS] = getITSSignal(tk, trackExtraRun2);
if (candidateTrack.isreco)
histos.fill(HIST("QA/itsSignal"), tk.p(), itsSignal);
candidateTrack.itsnsigma = nSigmaITS;
candidateTrack.outerPID = tk.pt() < antipPtTof ? candidateTrack.outerPID : outerPID;
selMask = getTrackSelMask(candidateTrack);
if (candidateTrack.pdgcodemoth > 0)
selMask |= candidateTrack.pdgcodemoth;
} else if (candidateTrack.pdgcodemoth > 0) {
selMask = candidateTrack.pdgcodemoth;
}
if (selMask < 0)
continue;
mcMiniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.outerPID,
candidateTrack.pdgcode > 0 ? candidateTrack.genpt : -candidateTrack.genpt,
static_cast<int8_t>(candidateTrack.geneta * 100),
candidateTrack.isreco);
fillTableMiniTrack<true>(candidateTrack, tk, nSigmaITS);
}
}
}
Expand Down
Loading