Skip to content

Commit 67dedda

Browse files
prottayCMTProttay Das
andauthored
[PWGLF] updated datamodel of spin spin correlation with MC information (#12114)
Co-authored-by: Prottay Das <prottay@alipap1.cern.ch>
1 parent 15a4eba commit 67dedda

File tree

2 files changed

+155
-1
lines changed

2 files changed

+155
-1
lines changed

PWGLF/DataModel/LFSpincorrelationTables.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,59 @@ DECLARE_SOA_TABLE(LambdaPairs, "AOD", "LAMBDAPAIR",
8080
lambdapair::PionIndex);
8181

8282
using LambdaPair = LambdaPairs::iterator;
83+
84+
namespace lambdaeventmc
85+
{
86+
DECLARE_SOA_COLUMN(Centmc, centmc, float);
87+
DECLARE_SOA_COLUMN(Poszmc, poszmc, float);
88+
} // namespace lambdaeventmc
89+
DECLARE_SOA_TABLE(LambdaEventmcs, "AOD", "LAMBDAEVENTMC",
90+
o2::soa::Index<>,
91+
lambdaeventmc::Centmc,
92+
lambdaeventmc::Poszmc)
93+
using LambdaEventmc = LambdaEventmcs::iterator;
94+
95+
namespace lambdapairmc
96+
{
97+
DECLARE_SOA_INDEX_COLUMN(LambdaEventmc, lambdaeventmc);
98+
DECLARE_SOA_COLUMN(V0Statusmc, v0Statusmc, int); //! Lambda or Anti-Lambda status in montecarlo
99+
DECLARE_SOA_COLUMN(DoubleStatusmc, doubleStatusmc, bool); //! Double status in montecarlo
100+
DECLARE_SOA_COLUMN(V0Cospamc, v0Cospamc, float); //! V0 Cospa in montecarlo
101+
DECLARE_SOA_COLUMN(V0Radiusmc, v0Radiusmc, float); //! V0 Radius in montecarlo
102+
DECLARE_SOA_COLUMN(DcaPositivemc, dcaPositivemc, float); //! DCA Positive in montecarlo
103+
DECLARE_SOA_COLUMN(DcaNegativemc, dcaNegativemc, float); //! DCA Negative in montecarlo
104+
DECLARE_SOA_COLUMN(DcaBetweenDaughtermc, dcaBetweenDaughtermc, float); //! DCA between daughters in montecarlo
105+
DECLARE_SOA_COLUMN(LambdaPtmc, lambdaPtmc, float); //! Lambda Pt in montecarlo
106+
DECLARE_SOA_COLUMN(LambdaEtamc, lambdaEtamc, float); //! Lambda Eta in montecarlo
107+
DECLARE_SOA_COLUMN(LambdaPhimc, lambdaPhimc, float); //! Lambda Phi in montecarlo
108+
DECLARE_SOA_COLUMN(LambdaMassmc, lambdaMassmc, float); //! Lambda Mass in montecarlo
109+
DECLARE_SOA_COLUMN(ProtonPtmc, protonPtmc, float); //! Proton Pt in montecarlo
110+
DECLARE_SOA_COLUMN(ProtonEtamc, protonEtamc, float); //! Proton Eta in montecarlo
111+
DECLARE_SOA_COLUMN(ProtonPhimc, protonPhimc, float); //! Proton Phi in montecarlo
112+
DECLARE_SOA_COLUMN(ProtonIndexmc, protonIndexmc, int); //! Proton index in montecarlo
113+
DECLARE_SOA_COLUMN(PionIndexmc, pionIndexmc, int); //! Pion index in montecarlo
114+
} // namespace lambdapairmc
115+
DECLARE_SOA_TABLE(LambdaPairmcs, "AOD", "LAMBDAPAIRMC",
116+
o2::soa::Index<>,
117+
lambdapairmc::LambdaEventmcId,
118+
lambdapairmc::V0Statusmc,
119+
lambdapairmc::DoubleStatusmc,
120+
lambdapairmc::V0Cospamc,
121+
lambdapairmc::V0Radiusmc,
122+
lambdapairmc::DcaPositivemc,
123+
lambdapairmc::DcaNegativemc,
124+
lambdapairmc::DcaBetweenDaughtermc,
125+
lambdapairmc::LambdaPtmc,
126+
lambdapairmc::LambdaEtamc,
127+
lambdapairmc::LambdaPhimc,
128+
lambdapairmc::LambdaMassmc,
129+
lambdapairmc::ProtonPtmc,
130+
lambdapairmc::ProtonEtamc,
131+
lambdapairmc::ProtonPhimc,
132+
lambdapairmc::ProtonIndexmc,
133+
lambdapairmc::PionIndexmc);
134+
135+
using LambdaPairmc = LambdaPairmcs::iterator;
136+
83137
} // namespace o2::aod
84138
#endif // PWGLF_DATAMODEL_LFSPINCORRELATIONTABLES_H_

PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ struct lambdaspincorrelation {
6060

6161
Produces<aod::LambdaEvents> lambdaEvent;
6262
Produces<aod::LambdaPairs> lambdaPair;
63+
Produces<aod::LambdaEventmcs> lambdaEventmc;
64+
Produces<aod::LambdaPairmcs> lambdaPairmc;
6365

6466
Service<o2::ccdb::BasicCCDBManager> ccdb;
6567

@@ -340,7 +342,105 @@ struct lambdaspincorrelation {
340342
}
341343
}
342344
}
343-
PROCESS_SWITCH(lambdaspincorrelation, processData, "Process data", true);
345+
PROCESS_SWITCH(lambdaspincorrelation, processData, "Process data", false);
346+
347+
void processMc(EventCandidates::iterator const& collision, AllTrackCandidates const&, ResoV0s const& V0s)
348+
{
349+
std::vector<ROOT::Math::PxPyPzMVector> lambdaMother, protonDaughter, pionDaughter;
350+
std::vector<int> v0Status = {};
351+
std::vector<bool> doubleStatus = {};
352+
std::vector<float> v0Cospa = {};
353+
std::vector<float> v0Radius = {};
354+
std::vector<float> dcaPositive = {};
355+
std::vector<float> dcaNegative = {};
356+
std::vector<int> positiveIndex = {};
357+
std::vector<int> negativeIndex = {};
358+
std::vector<float> dcaBetweenDaughter = {};
359+
int numbV0 = 0;
360+
// LOGF(info, "event collisions: (%d)", collision.index());
361+
auto centrality = collision.centFT0C();
362+
auto vz = collision.posZ();
363+
int occupancy = collision.trackOccupancyInTimeRange();
364+
histos.fill(HIST("hEvtSelInfo"), 0.5);
365+
if ((rctCut.requireRCTFlagChecker && rctChecker(collision)) && collision.selection_bit(aod::evsel::kNoSameBunchPileup) && collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV) && collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) && collision.sel8() && collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll) && occupancy < cfgCutOccupancy) {
366+
histos.fill(HIST("hEvtSelInfo"), 1.5);
367+
for (const auto& v0 : V0s) {
368+
// LOGF(info, "v0 index 0 : (%d)", v0.index());
369+
auto [lambdaTag, aLambdaTag, isValid] = getLambdaTags(v0, collision);
370+
if (isValid) {
371+
// LOGF(info, "v0 index 1 : (%d)", v0.index());
372+
if (lambdaTag) {
373+
histos.fill(HIST("hV0Info"), 0.5);
374+
}
375+
if (aLambdaTag) {
376+
histos.fill(HIST("hV0Info"), 1.5);
377+
}
378+
if (lambdaTag && aLambdaTag) {
379+
doubleStatus.push_back(true);
380+
if (std::abs(v0.mLambda() - 1.1154) < std::abs(v0.mAntiLambda() - 1.1154)) {
381+
lambdaTag = true;
382+
aLambdaTag = false;
383+
} else {
384+
lambdaTag = false;
385+
aLambdaTag = true;
386+
}
387+
} else {
388+
doubleStatus.push_back(false);
389+
}
390+
if (lambdaTag) {
391+
histos.fill(HIST("hV0Info"), 2.5);
392+
}
393+
if (aLambdaTag) {
394+
histos.fill(HIST("hV0Info"), 3.5);
395+
}
396+
// LOGF(info, "v0 index2: (%d)", v0.index());
397+
auto postrack1 = v0.template posTrack_as<AllTrackCandidates>();
398+
auto negtrack1 = v0.template negTrack_as<AllTrackCandidates>();
399+
positiveIndex.push_back(postrack1.globalIndex());
400+
negativeIndex.push_back(negtrack1.globalIndex());
401+
v0Cospa.push_back(v0.v0cosPA());
402+
v0Radius.push_back(v0.v0radius());
403+
dcaPositive.push_back(std::abs(v0.dcapostopv()));
404+
dcaNegative.push_back(std::abs(v0.dcanegtopv()));
405+
dcaBetweenDaughter.push_back(std::abs(v0.dcaV0daughters()));
406+
if (lambdaTag) {
407+
v0Status.push_back(0);
408+
proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassProton);
409+
antiPion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassPionCharged);
410+
lambda = proton + antiPion;
411+
lambdaMother.push_back(lambda);
412+
protonDaughter.push_back(proton);
413+
pionDaughter.push_back(antiPion);
414+
histos.fill(HIST("hLambdaMass"), lambda.M());
415+
} else if (aLambdaTag) {
416+
v0Status.push_back(1);
417+
antiProton = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassProton);
418+
pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassPionCharged);
419+
antiLambda = antiProton + pion;
420+
lambdaMother.push_back(antiLambda);
421+
protonDaughter.push_back(antiProton);
422+
pionDaughter.push_back(pion);
423+
histos.fill(HIST("hLambdaMass"), lambda.M());
424+
}
425+
numbV0 = numbV0 + 1;
426+
}
427+
}
428+
if (numbV0 > 1 && v0Cospa.size() > 1) {
429+
histos.fill(HIST("hEvtSelInfo"), 2.5);
430+
lambdaEventmc(centrality, vz);
431+
auto indexEvent = lambdaEventmc.lastIndex();
432+
//// Fill track table for V0//////////////////
433+
for (auto if1 = lambdaMother.begin(); if1 != lambdaMother.end(); ++if1) {
434+
auto i5 = std::distance(lambdaMother.begin(), if1);
435+
lambdaDummy = lambdaMother.at(i5);
436+
protonDummy = protonDaughter.at(i5);
437+
pionDummy = pionDaughter.at(i5);
438+
lambdaPairmc(indexEvent, v0Status.at(i5), doubleStatus.at(i5), v0Cospa.at(i5), v0Radius.at(i5), dcaPositive.at(i5), dcaNegative.at(i5), dcaBetweenDaughter.at(i5), lambdaDummy.Pt(), lambdaDummy.Eta(), lambdaDummy.Phi(), lambdaDummy.M(), protonDummy.Pt(), protonDummy.Eta(), protonDummy.Phi(), positiveIndex.at(i5), negativeIndex.at(i5));
439+
}
440+
}
441+
}
442+
}
443+
PROCESS_SWITCH(lambdaspincorrelation, processMc, "Process montecarlo", true);
344444
};
345445
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
346446
{

0 commit comments

Comments
 (0)