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
156 changes: 156 additions & 0 deletions PWGLF/Tasks/Strangeness/lambdapolsp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include <cmath>
#include <cstdlib>
#include <deque>
#include <iostream>

Check failure on line 61 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <iterator>
#include <set> // <<< CHANGED: for dedup sets
#include <string>
Expand Down Expand Up @@ -99,6 +99,9 @@
Configurable<bool> doRandomPsi{"doRandomPsi", true, "randomize psi"};
Configurable<bool> doRandomPsiAC{"doRandomPsiAC", true, "randomize psiAC"};
Configurable<bool> doRandomPhi{"doRandomPhi", true, "randomize phi"};
Configurable<double> etaMix{"etaMix", 0.1, "eta difference in mixing"};
Configurable<double> ptMix{"ptMix", 0.1, "pt difference in mixing"};
Configurable<double> phiMix{"phiMix", 0.1, "phi difference in mixing"};
} randGrp;
// events
Configurable<float> cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"};
Expand Down Expand Up @@ -386,12 +389,12 @@
template <typename Collision, typename V0>
bool SelectionV0(Collision const& collision, V0 const& candidate)
{
if (TMath::Abs(candidate.dcav0topv()) > cMaxV0DCA) {

Check failure on line 392 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
const float pT = candidate.pt();
const float tranRad = candidate.v0radius();
const float dcaDaughv0 = TMath::Abs(candidate.dcaV0daughters());

Check failure on line 397 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
const float cpav0 = candidate.v0cosPA();

float CtauLambda = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda;
Expand All @@ -414,16 +417,16 @@
if (tranRad > ConfV0TranRadV0Max) {
return false;
}
if (analyzeLambda && TMath::Abs(CtauLambda) > cMaxV0LifeTime) {

Check failure on line 420 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
if (analyzeK0s && TMath::Abs(CtauK0s) > cMaxV0LifeTime) {

Check failure on line 423 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
if (analyzeLambda && TMath::Abs(candidate.yLambda()) > ConfV0Rap) {

Check failure on line 426 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
if (analyzeK0s && TMath::Abs(candidate.yK0Short()) > ConfV0Rap) {

Check failure on line 429 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
return true;
Expand All @@ -448,10 +451,10 @@
return false;
}

if (pid == 0 && TMath::Abs(track.tpcNSigmaPr()) > ConfDaughPIDCuts) {

Check failure on line 454 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
if (pid == 1 && TMath::Abs(track.tpcNSigmaPi()) > ConfDaughPIDCuts) {

Check failure on line 457 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
if (pid == 0 && (candidate.positivept() < cfgDaughPrPt || candidate.negativept() < cfgDaughPiPt)) {
Expand All @@ -464,7 +467,7 @@
return false;
}

if (pid == 0 && (TMath::Abs(candidate.dcapostopv()) < cMinV0DCAPr || TMath::Abs(candidate.dcanegtopv()) < cMinV0DCAPi)) {

Check failure on line 470 in PWGLF/Tasks/Strangeness/lambdapolsp.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
return false;
}
if (pid == 1 && (TMath::Abs(candidate.dcapostopv()) < cMinV0DCAPi || TMath::Abs(candidate.dcanegtopv()) < cMinV0DCAPr)) {
Expand Down Expand Up @@ -1487,6 +1490,159 @@
}
PROCESS_SWITCH(lambdapolsp, processDerivedDataMixed, "Process mixed event using derived data", false);

void processDerivedDataMixed2(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraZDCSP> const& collisions, v0Candidates const& V0s, dauTracks const&)
{
TRandom3 randGen(0);

for (auto& [collision1, collision2] : selfCombinations(colBinning, meGrp.nMix, -1, collisions, collisions)) {

if (collision1.index() == collision2.index()) {
continue;
}

if (!collision1.sel8()) {
continue;
}
if (!collision2.sel8()) {
continue;
}

if (!collision1.triggereventsp()) { // provided by StraZDCSP
continue;
}
if (!collision2.triggereventsp()) { // provided by StraZDCSP
continue;
}

if (rctCut.requireRCTFlagChecker && !rctChecker(collision1)) {
continue;
}
if (rctCut.requireRCTFlagChecker && !rctChecker(collision2)) {
continue;
}

if (additionalEvSel && (!collision1.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision1.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) {
continue;
}
if (additionalEvSel && (!collision2.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision2.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) {
continue;
}
if (additionalEvSel2 && (collision1.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision1.trackOccupancyInTimeRange() < cfgMinOccupancy)) {
continue;
}
if (additionalEvSel2 && (collision2.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision2.trackOccupancyInTimeRange() < cfgMinOccupancy)) {
continue;
}
if (additionalEvSel3 && (!collision1.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision1.selection_bit(aod::evsel::kNoITSROFrameBorder))) {
continue;
}
if (additionalEvSel3 && (!collision2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision2.selection_bit(aod::evsel::kNoITSROFrameBorder))) {
continue;
}
if (additionalEvSel4 && !collision1.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
continue;
}
if (additionalEvSel4 && !collision2.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
continue;
}

auto centrality = collision1.centFT0C();
auto qxZDCA = collision1.qxZDCA();
auto qxZDCC = collision1.qxZDCC();
auto qyZDCA = collision1.qyZDCA();
auto qyZDCC = collision1.qyZDCC();
auto psiZDCC = collision1.psiZDCC();
auto psiZDCA = collision1.psiZDCA();
double modqxZDCA;
double modqyZDCA;
double modqxZDCC;
double modqyZDCC;

modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA);
modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA);
modqxZDCC = TMath::Sqrt((qxZDCC * qxZDCC) + (qyZDCC * qyZDCC)) * TMath::Cos(psiZDCC);
modqyZDCC = TMath::Sqrt((qxZDCC * qxZDCC) + (qyZDCC * qyZDCC)) * TMath::Sin(psiZDCC);

auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane from collision 2

histos.fill(HIST("hCentrality"), centrality);
histos.fill(HIST("hpRes"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA - psiZDCC))));
histos.fill(HIST("hpResSin"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA - psiZDCC))));

// V0s from collision1 to match kinematics
auto v0sCol1 = V0s.sliceBy(tracksPerCollisionV0Mixed, collision1.index());
// V0s from collision2 to test
auto v0sCol2 = V0s.sliceBy(tracksPerCollisionV0Mixed, collision2.index());

for (const auto& v0_2 : v0sCol2) {

bool LambdaTag = isCompatible(v0_2, 0);
bool aLambdaTag = isCompatible(v0_2, 1);
if (!LambdaTag && !aLambdaTag)
continue;
if (!SelectionV0(collision2, v0_2))
continue;
if (LambdaTag) {
Proton = ROOT::Math::PxPyPzMVector(v0_2.pxpos(), v0_2.pypos(), v0_2.pzpos(), massPr);
AntiPion = ROOT::Math::PxPyPzMVector(v0_2.pxneg(), v0_2.pyneg(), v0_2.pzneg(), massPi);
Lambdadummy = Proton + AntiPion;
}
if (aLambdaTag) {
AntiProton = ROOT::Math::PxPyPzMVector(v0_2.pxneg(), v0_2.pyneg(), v0_2.pzneg(), massPr);
Pion = ROOT::Math::PxPyPzMVector(v0_2.pxpos(), v0_2.pypos(), v0_2.pzpos(), massPi);
AntiLambdadummy = AntiProton + Pion;
}
if (shouldReject(LambdaTag, aLambdaTag, Lambdadummy, AntiLambdadummy)) {
continue;
}
if (TMath::Abs(v0_2.eta()) > 0.8)
continue;

// Check if lambda kinematics from collision2 matches with collision1
bool matched = false;
for (const auto& v0_1 : v0sCol1) {
bool LambdaTag1 = isCompatible(v0_1, 0);
bool aLambdaTag1 = isCompatible(v0_1, 1);
if (!LambdaTag1 && !aLambdaTag1)
continue;
if (!SelectionV0(collision1, v0_1))
continue;
if (TMath::Abs(v0_1.eta()) > 0.8)
continue;

double deta = std::abs(v0_1.eta() - v0_2.eta());
double dpt = std::abs(v0_1.pt() - v0_2.pt());
double dphi = RecoDecay::constrainAngle(v0_1.phi() - v0_2.phi(), 0.0);
if (deta < randGrp.etaMix && dpt < randGrp.ptMix && dphi < randGrp.phiMix && ((v0_1.eta() * v0_2.eta()) > 0.0)) {
matched = true;
break;
}
}
if (!matched)
continue;

int taga = LambdaTag;
int tagb = aLambdaTag;

if (LambdaTag) {
Lambda = Proton + AntiPion;
tagb = 0;
double acvalue = 1.0;
fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0_2.mLambda(), v0_2.pt(), v0_2.eta(), acvalue);
}

tagb = aLambdaTag;
if (aLambdaTag) {
AntiLambda = AntiProton + Pion;
taga = 0;
double acvalue = 1.0;
fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0_2.mAntiLambda(), v0_2.pt(), v0_2.eta(), acvalue);
}
}
}
}
PROCESS_SWITCH(lambdapolsp, processDerivedDataMixed2, "Process mixed event2 using derived data", false);

void processDerivedDataMixedFIFO(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraZDCSP> const& collisions, v0Candidates const& V0s, dauTracks const&)
{

Expand Down
Loading