Skip to content

Commit b322981

Browse files
prottayCMTProttay Das
andauthored
[PWGLF] updated datamodel and added initial analysis task for spin alignment (#12427)
Co-authored-by: Prottay Das <prottay@alipap1.cern.ch>
1 parent 6ecabda commit b322981

File tree

4 files changed

+344
-45
lines changed

4 files changed

+344
-45
lines changed

PWGLF/DataModel/LFCKSSpinalignmentTables.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace o2::aod
3333
namespace kshortpionevent
3434
{
3535
DECLARE_SOA_COLUMN(Cent, cent, float);
36+
DECLARE_SOA_COLUMN(Posz, posz, float);
3637
DECLARE_SOA_COLUMN(CollIndex, collIndex, float);
3738
DECLARE_SOA_COLUMN(PsiFT0C, psiFT0C, float);
3839
DECLARE_SOA_COLUMN(PsiFT0A, psiFT0A, float);
@@ -41,6 +42,7 @@ DECLARE_SOA_COLUMN(PsiTPC, psiTPC, float);
4142
DECLARE_SOA_TABLE(KShortpionEvents, "AOD", "KSHORTPIONEVENT",
4243
o2::soa::Index<>,
4344
kshortpionevent::Cent,
45+
kshortpionevent::Posz,
4446
kshortpionevent::CollIndex,
4547
kshortpionevent::PsiFT0C,
4648
kshortpionevent::PsiFT0A,
@@ -63,15 +65,14 @@ DECLARE_SOA_COLUMN(KShortMass, kShortMass, float); //! KShort Ma
6365
DECLARE_SOA_COLUMN(PionBachPx, pionBachPx, float); //! Bachelor Pion Px
6466
DECLARE_SOA_COLUMN(PionBachPy, pionBachPy, float); //! Bachelor Pion Py
6567
DECLARE_SOA_COLUMN(PionBachPz, pionBachPz, float); //! Bachelor Pion Pz
66-
DECLARE_SOA_COLUMN(PionBachSign, pionBachSign, int); //! Bachelor Pion Sign
6768
DECLARE_SOA_COLUMN(PionBachTPC, pionBachTPC, float); //! Bachelor Pion nsigmatpc
6869
DECLARE_SOA_COLUMN(PionBachTOFHit, pionBachTOFHit, int); //! Bachelor Pion tof hit availability
6970
DECLARE_SOA_COLUMN(PionBachTOF, pionBachTOF, float); //! Bachelor Pion nsigmatof
7071
DECLARE_SOA_COLUMN(PionBachIndex, pionBachIndex, int); //! Bachelor Pion index
7172
DECLARE_SOA_COLUMN(PionIndex1, pionIndex1, int); //! Daughter Pion index1
7273
DECLARE_SOA_COLUMN(PionIndex2, pionIndex2, int); //! Daughter Pion index2
7374
} // namespace kshortpionpair
74-
DECLARE_SOA_TABLE(KShortpionPairs, "AOD", "KSHORTPIONPAIR",
75+
DECLARE_SOA_TABLE(KShortTracks, "AOD", "KSHORTTRACK",
7576
o2::soa::Index<>,
7677
kshortpionpair::KShortpionEventId,
7778
kshortpionpair::V0Cospa,
@@ -85,17 +86,23 @@ DECLARE_SOA_TABLE(KShortpionPairs, "AOD", "KSHORTPIONPAIR",
8586
kshortpionpair::KShortPy,
8687
kshortpionpair::KShortPz,
8788
kshortpionpair::KShortMass,
89+
kshortpionpair::PionIndex1,
90+
kshortpionpair::PionIndex2);
91+
92+
using KShortTrack = KShortTracks::iterator;
93+
94+
DECLARE_SOA_TABLE(PionTracks, "AOD", "PIONTRACK",
95+
o2::soa::Index<>,
96+
kshortpionpair::KShortpionEventId,
8897
kshortpionpair::PionBachPx,
8998
kshortpionpair::PionBachPy,
9099
kshortpionpair::PionBachPz,
91-
kshortpionpair::PionBachSign,
100+
// kshortpionpair::PionBachSign,
92101
kshortpionpair::PionBachTPC,
93102
kshortpionpair::PionBachTOFHit,
94103
kshortpionpair::PionBachTOF,
95-
kshortpionpair::PionBachIndex,
96-
kshortpionpair::PionIndex1,
97-
kshortpionpair::PionIndex2);
104+
kshortpionpair::PionBachIndex);
98105

99-
using KShortpionPair = KShortpionPairs::iterator;
106+
using PionTrack = PionTracks::iterator;
100107
} // namespace o2::aod
101108
#endif // PWGLF_DATAMODEL_LFCKSSPINALIGNMENTTABLES_H_

PWGLF/TableProducer/Resonances/cksspinalignment.cxx

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ using namespace o2::aod::rctsel;
6060
struct cksspinalignment {
6161

6262
Produces<aod::KShortpionEvents> kshortpionEvent;
63-
Produces<aod::KShortpionPairs> kshortpionPair;
63+
Produces<aod::KShortTracks> kshortTrack;
64+
Produces<aod::PionTracks> pionTrack;
6465

6566
Service<o2::ccdb::BasicCCDBManager> ccdb;
6667

@@ -279,14 +280,14 @@ struct cksspinalignment {
279280
std::vector<float> v0Lifetime = {};
280281
// std::vector<float> armenteros = {};
281282
std::vector<float> pionBachelorIndex = {};
282-
std::vector<float> pionBachelorSign = {};
283+
// std::vector<float> pionBachelorSign = {};
283284
std::vector<float> pionBachelorTPC = {};
284285
std::vector<float> pionBachelorTOF = {};
285286
std::vector<float> pionBachelorTOFHit = {};
286287

287288
int numbV0 = 0;
288289
auto centrality = collision.centFT0C();
289-
// auto vz = collision.posZ();
290+
auto vz = collision.posZ();
290291
int occupancy = collision.trackOccupancyInTimeRange();
291292
auto psiFT0C = collision.psiFT0C();
292293
auto psiFT0A = collision.psiFT0A();
@@ -318,6 +319,8 @@ struct cksspinalignment {
318319

319320
auto track1ID = track1.globalIndex();
320321
auto track1sign = track1.sign();
322+
if (track1sign == 0)
323+
continue;
321324
auto track1nsigTPC = track1.tpcNSigmaPi();
322325
auto track1nsigTOF = -999.9;
323326
auto track1TOFHit = -1;
@@ -327,52 +330,57 @@ struct cksspinalignment {
327330
histos.fill(HIST("hTrkSelInfo"), 4.5);
328331
}
329332
pionbach = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), o2::constants::physics::MassPionCharged);
330-
for (const auto& v0 : V0s) {
331-
histos.fill(HIST("hV0Info"), 0.5);
332-
auto [kshortTag, isValid] = getK0sTags(v0, collision);
333-
if (kshortTag && isValid) {
334-
histos.fill(HIST("hV0Info"), 1.5);
335-
auto postrack1 = v0.template posTrack_as<AllTrackCandidates>();
336-
auto negtrack1 = v0.template negTrack_as<AllTrackCandidates>();
337-
positiveIndex.push_back(postrack1.globalIndex());
338-
negativeIndex.push_back(negtrack1.globalIndex());
339-
v0Cospa.push_back(v0.v0cosPA());
340-
v0Radius.push_back(v0.v0radius());
341-
dcaPositive.push_back(std::abs(v0.dcapostopv()));
342-
dcaNegative.push_back(std::abs(v0.dcanegtopv()));
343-
dcaBetweenDaughter.push_back(std::abs(v0.dcaV0daughters()));
344-
v0Lifetime.push_back(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * (o2::constants::physics::MassK0));
345-
// armenteros.push_back((v0.qtarm() / std::abs(v0.alpha())));
346-
347-
pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassPionCharged);
348-
antiPion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassPionCharged);
349-
kshort = pion + antiPion;
350-
// chargedkstar = kshort + pionbach;
351-
kshortMother.push_back(kshort);
352-
// chargedkstarMother.push_back(chargedkstar);
353-
pionBachelor.push_back(pionbach);
354-
pionBachelorIndex.push_back(track1ID);
355-
pionBachelorSign.push_back(track1sign);
356-
pionBachelorTPC.push_back(track1nsigTPC);
357-
pionBachelorTOF.push_back(track1nsigTOF);
358-
pionBachelorTOFHit.push_back(track1TOFHit);
359-
histos.fill(HIST("hKShortMass"), kshort.M());
360-
}
361-
numbV0 = numbV0 + 1;
333+
pionBachelor.push_back(pionbach);
334+
pionBachelorIndex.push_back(track1ID);
335+
// pionBachelorSign.push_back(track1sign);
336+
pionBachelorTPC.push_back(track1nsigTPC);
337+
pionBachelorTOF.push_back(track1nsigTOF);
338+
pionBachelorTOFHit.push_back(track1TOFHit);
339+
}
340+
for (const auto& v0 : V0s) {
341+
histos.fill(HIST("hV0Info"), 0.5);
342+
auto [kshortTag, isValid] = getK0sTags(v0, collision);
343+
if (kshortTag && isValid) {
344+
histos.fill(HIST("hV0Info"), 1.5);
345+
auto postrack1 = v0.template posTrack_as<AllTrackCandidates>();
346+
auto negtrack1 = v0.template negTrack_as<AllTrackCandidates>();
347+
positiveIndex.push_back(postrack1.globalIndex());
348+
negativeIndex.push_back(negtrack1.globalIndex());
349+
v0Cospa.push_back(v0.v0cosPA());
350+
v0Radius.push_back(v0.v0radius());
351+
dcaPositive.push_back(std::abs(v0.dcapostopv()));
352+
dcaNegative.push_back(std::abs(v0.dcanegtopv()));
353+
dcaBetweenDaughter.push_back(std::abs(v0.dcaV0daughters()));
354+
v0Lifetime.push_back(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * (o2::constants::physics::MassK0));
355+
// armenteros.push_back((v0.qtarm() / std::abs(v0.alpha())));
356+
357+
pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), o2::constants::physics::MassPionCharged);
358+
antiPion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), o2::constants::physics::MassPionCharged);
359+
kshort = pion + antiPion;
360+
// chargedkstar = kshort + pionbach;
361+
kshortMother.push_back(kshort);
362+
// chargedkstarMother.push_back(chargedkstar);
363+
histos.fill(HIST("hKShortMass"), kshort.M());
362364
}
365+
numbV0 = numbV0 + 1;
363366
}
364367
if (numbV0 > 1 && v0Cospa.size() > 1) {
365368
histos.fill(HIST("hEvtSelInfo"), 3.5);
366-
kshortpionEvent(centrality, collision.index(), psiFT0C, psiFT0A, psiTPC);
369+
kshortpionEvent(centrality, vz, collision.index(), psiFT0C, psiFT0A, psiTPC);
367370
auto indexEvent = kshortpionEvent.lastIndex();
368371
//// Fill track table for Charged KStar//////////////////
369372
for (auto icks = kshortMother.begin(); icks != kshortMother.end(); ++icks) {
370373
auto iter = std::distance(kshortMother.begin(), icks);
371374
kshortDummy = kshortMother.at(iter);
372375
// chargedkstarDummy = chargedkstarMother.at(iter);
373-
pionDummy = pionBachelor.at(iter);
374376

375-
kshortpionPair(indexEvent, v0Cospa.at(iter), v0Radius.at(iter), dcaPositive.at(iter), dcaNegative.at(iter), dcaBetweenDaughter.at(iter), v0Lifetime.at(iter), kshortDummy.Px(), kshortDummy.Py(), kshortDummy.Pz(), kshortDummy.M(), pionDummy.Px(), pionDummy.Py(), pionDummy.Pz(), pionBachelorSign.at(iter), pionBachelorTPC.at(iter), pionBachelorTOFHit.at(iter), pionBachelorTOF.at(iter), pionBachelorIndex.at(iter), positiveIndex.at(iter), negativeIndex.at(iter));
377+
kshortTrack(indexEvent, v0Cospa.at(iter), v0Radius.at(iter), dcaPositive.at(iter), dcaNegative.at(iter), dcaBetweenDaughter.at(iter), v0Lifetime.at(iter), kshortDummy.Px(), kshortDummy.Py(), kshortDummy.Pz(), kshortDummy.M(), positiveIndex.at(iter), negativeIndex.at(iter));
378+
}
379+
for (auto ipi = pionBachelor.begin(); ipi != pionBachelor.end(); ++ipi) {
380+
auto iterpi = std::distance(pionBachelor.begin(), ipi);
381+
pionDummy = pionBachelor.at(iterpi);
382+
383+
pionTrack(indexEvent, pionDummy.Px(), pionDummy.Py(), pionDummy.Pz(), pionBachelorTPC.at(iterpi), pionBachelorTOFHit.at(iterpi), pionBachelorTOF.at(iterpi), pionBachelorIndex.at(iterpi));
376384
}
377385
}
378386
}

PWGLF/Tasks/Resonances/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ o2physics_add_dpl_workflow(phianalysis
1919
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
2020
COMPONENT_NAME Analysis)
2121

22+
o2physics_add_dpl_workflow(cksspinalignder
23+
SOURCES cksspinalignder.cxx
24+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
25+
COMPONENT_NAME Analysis)
26+
2227
o2physics_add_dpl_workflow(k892analysis
2328
SOURCES k892analysis.cxx
2429
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

0 commit comments

Comments
 (0)