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
64 changes: 33 additions & 31 deletions PWGLF/Tasks/cascadecorrelations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ using namespace o2::framework;
using namespace o2::framework::expressions;
using std::array;

//use parameters + cov mat non-propagated, aux info + (extension propagated)
// use parameters + cov mat non-propagated, aux info + (extension propagated)
using FullTracksExt = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TracksDCA>;
using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA>;
using FullTracksExtWithPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr>;
using FullTracksExtIUWithPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr>;

// Let's try to add a column to the cascdataext table: IsSelected.
// Let's try to add a column to the cascdataext table: IsSelected.
// In the future this will probably also be a way to tell Xi's and Omega's apart
namespace o2::aod
{
Expand All @@ -63,10 +63,10 @@ DECLARE_SOA_COLUMN(IsSelected, isSelected, int); //~!
DECLARE_SOA_TABLE(CascadeFlags, "AOD", "CASCADEFLAGS", //!
cascadeflags::IsSelected);
using CascDataExtSelected = soa::Join<CascDataExt, CascadeFlags>;
}
} // namespace o2::aod

// Should we make a separate struct with "cascadeSelector" here?
// The process function of this would then produce the CascadeFlags table.
// The process function of this would then produce the CascadeFlags table.
struct cascadeSelector {
Produces<aod::CascadeFlags> cascflags;

Expand All @@ -78,40 +78,41 @@ struct cascadeSelector {
},
};

void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIUWithPID const&){
for (auto& casc : Cascades){
void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, FullTracksExtIUWithPID const&)
{
for (auto& casc : Cascades) {
auto v0 = casc.v0_as<o2::aod::V0sLinked>();
if (!(v0.has_v0Data())) {
cascflags(0);
continue; // reject if no v0data
}
auto v0data = v0.v0Data();

// Let's try to do some PID
// these are the tracks:
auto bachTrack = casc.bachelor_as<FullTracksExtIUWithPID>();
auto posTrack = v0data.posTrack_as<FullTracksExtIUWithPID>();
auto negTrack = v0data.negTrack_as<FullTracksExtIUWithPID>();

//Bachelor check: Regardless of sign, should be pion (Xi)
// Bachelor check: Regardless of sign, should be pion (Xi)
if (TMath::Abs(bachTrack.tpcNSigmaPi()) > 3) {
cascflags(0);
continue;
}

if (casc.sign() < 0){ // FIXME: only Xi for now, implement Omega's TODO
//Proton check:
if (casc.sign() < 0) { // FIXME: only Xi for now, implement Omega's TODO
// Proton check:
if (TMath::Abs(posTrack.tpcNSigmaPr()) > 3) {
cascflags(0);
continue;
}
//Pion check:
// Pion check:
if (TMath::Abs(negTrack.tpcNSigmaPi()) > 3) {
cascflags(0);
continue;
}
} else {
// //Proton check:
// //Proton check:
// if (TMath::Abs(posTrack.tpcNSigmaPr()) > 3) {
// cascflags(0);
// continue;
Expand All @@ -125,9 +126,8 @@ struct cascadeSelector {
// if we reach here, candidate is good!
cascflags(1);
} // cascade loop
} // process
}; // struct

} // process
}; // struct

struct cascadeCorrelations {
// Basic checks
Expand All @@ -139,10 +139,10 @@ struct cascadeCorrelations {
{"hMassOmegaMinus", "hMassOmegaMinus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},
{"hMassOmegaPlus", "hMassOmegaPlus", {HistType::kTH1F, {{3000, 0.0f, 3.0f, "Inv. Mass (GeV/c^{2})"}}}},

{"hPhi", "hPhi", {HistType::kTH1F, {{100, 0, 2*PI, "#varphi"}}}},
{"hPhi", "hPhi", {HistType::kTH1F, {{100, 0, 2 * PI, "#varphi"}}}},

{"hDeltaPhiSS", "hDeltaPhiSS", {HistType::kTH1F, {{100, -PI/2, 1.5*PI, "#Delta#varphi"}}}},
{"hDeltaPhiOS", "hDeltaPhiOS", {HistType::kTH1F, {{100, -PI/2, 1.5*PI, "#Delta#varphi"}}}},
{"hDeltaPhiSS", "hDeltaPhiSS", {HistType::kTH1F, {{100, -PI / 2, 1.5 * PI, "#Delta#varphi"}}}},
{"hDeltaPhiOS", "hDeltaPhiOS", {HistType::kTH1F, {{100, -PI / 2, 1.5 * PI, "#Delta#varphi"}}}},
},
};

Expand All @@ -158,15 +158,17 @@ struct cascadeCorrelations {
continue; // reject if no v0data
}
auto v0data = v0.v0Data();

if (casc.sign() < 0) { // FIXME: could be done better...
// Check if we don't use the same pion twice in single cascade reco
if (casc.bachelorId() == v0data.negTrackId()) LOGF(info, "autocorrelation in neg cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
if (casc.bachelorId() == v0data.negTrackId())
LOGF(info, "autocorrelation in neg cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
registry.fill(HIST("hMassXiMinus"), casc.mXi());
registry.fill(HIST("hMassOmegaMinus"), casc.mOmega());
} else {
// Check if we don't use the same pion twice in single cascade reco
if (casc.bachelorId() == v0data.posTrackId()) LOGF(info, "autocorrelation in pos cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
if (casc.bachelorId() == v0data.posTrackId())
LOGF(info, "autocorrelation in pos cascade! %d %d", casc.bachelorId(), v0data.negTrackId());
registry.fill(HIST("hMassXiPlus"), casc.mXi());
registry.fill(HIST("hMassOmegaPlus"), casc.mOmega());
}
Expand All @@ -177,23 +179,23 @@ struct cascadeCorrelations {
for (auto& [c0, c1] : combinations(Cascades, Cascades)) { // combinations automatically applies strictly upper in case of 2 identical tables
auto lambda0 = c0.v0_as<o2::aod::V0sLinked>();
auto lambda1 = c1.v0_as<o2::aod::V0sLinked>();
if (!(lambda0.has_v0Data()) || !(lambda1.has_v0Data())) {
continue; // reject if no v0data in either of the lambda's
}
if (!(lambda0.has_v0Data()) || !(lambda1.has_v0Data())) {
continue; // reject if no v0data in either of the lambda's
}
auto v0data0 = lambda0.v0Data();
auto v0data1 = lambda1.v0Data();

LOGF(info, "Found a cascade pair!"); // casc table doesn't have global indices, makes no sense to print them (will just be numbered like 0,1,2,...)
double phi0 = RecoDecay::phi(c0.px(), c0.py());
double phi1 = RecoDecay::phi(c1.px(), c1.py());
double dphi = std::fmod(phi0 - phi1 + 2.5*PI, 2*PI) - 0.5*PI;
if(c0.sign()*c1.sign() < 0){ // OS
double dphi = std::fmod(phi0 - phi1 + 2.5 * PI, 2 * PI) - 0.5 * PI;
if (c0.sign() * c1.sign() < 0) { // OS
registry.fill(HIST("hDeltaPhiOS"), dphi);
} else { // SS
// Let's see if we have many autocorrelations?
// Should only be prevalent in SS due to pions, lambda's
// Let's first check if the lambda's aren't the same:
if(v0data0.v0Id() == v0data1.v0Id()) {
if (v0data0.v0Id() == v0data1.v0Id()) {
LOGF(info, "same v0 in SS correlation! %d %d", v0data0.v0Id(), v0data1.v0Id());
continue;
}
Expand All @@ -203,7 +205,7 @@ struct cascadeCorrelations {
int negId0 = v0data0.negTrackId();
int posId1 = v0data1.posTrackId();
int negId1 = v0data1.negTrackId();
if(bachId0 == bachId1){
if (bachId0 == bachId1) {
LOGF(info, "same bachelor in SS correlation! %d %d", bachId0, bachId1);
continue;
}
Expand All @@ -212,7 +214,7 @@ struct cascadeCorrelations {
LOGF(info, "cascades have a v0-track in common in SS correlation!");
continue;
}
if (c0.sign() < 0){ // min cascade
if (c0.sign() < 0) { // min cascade
if (negId0 == bachId1 || negId1 == bachId0) {
LOGF(info, "bach of casc == v0-pion of other casc in neg SS correlation!");
continue;
Expand All @@ -226,8 +228,8 @@ struct cascadeCorrelations {
registry.fill(HIST("hDeltaPhiSS"), dphi);
}
} // correlations
} // process
}; //struct
} // process
}; // struct

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
Expand Down