@@ -60,7 +60,8 @@ using namespace o2::aod::rctsel;
6060struct 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 }
0 commit comments