@@ -56,7 +56,7 @@ std::shared_ptr<TH2> h2ClsMapPtMoth;
5656std::shared_ptr<TH2> h2ClsMapPtDaug;
5757std::shared_ptr<TH2> h2DeDxDaugSel;
5858std::shared_ptr<TH2> h2KinkAnglePt;
59- std::shared_ptr<TH2> h2SigmaMinusMassPt ;
59+ std::shared_ptr<TH2> h2MothMassPt ;
6060} // namespace
6161
6262struct kinkCandidate {
@@ -89,9 +89,13 @@ struct kinkCandidate {
8989
9090struct kinkBuilder {
9191
92+ enum PartType { kSigmaMinus = 0 ,
93+ kHyperhelium4sigma };
94+
9295 Produces<aod::KinkCands> outputDataTable;
9396 Service<o2::ccdb::BasicCCDBManager> ccdb;
9497
98+ Configurable<int > hypoMoth{" hypoMoth" , kSigmaMinus , " Mother particle hypothesis" };
9599 // Selection criteria
96100 Configurable<float > maxDCAMothToPV{" maxDCAMothToPV" , 0.1 , " Max DCA of the mother to the PV" };
97101 Configurable<float > minDCADaugToPV{" minDCADaugToPV" , 0 ., " Min DCA of the daughter to the PV" };
@@ -107,7 +111,7 @@ struct kinkBuilder {
107111 o2::base::MatLayerCylSet* lut = nullptr ;
108112
109113 // constants
110- float radToDeg = 180 . / M_PI ;
114+ float radToDeg = o2::constants::math::Rad2Deg ;
111115 svPoolCreator svCreator;
112116
113117 // bethe bloch parameters
@@ -141,8 +145,25 @@ struct kinkBuilder {
141145 float mBz ;
142146 std::array<float , 6 > mBBparamsDaug ;
143147
148+ // mother and daughter tracks' properties (absolute charge and mass)
149+ int charge = 1 ;
150+ float mothMass = o2::constants::physics::MassSigmaMinus;
151+ float chargedDauMass = o2::constants::physics::MassPiMinus;
152+ float neutDauMass = o2::constants::physics::MassNeutron;
153+
144154 void init (InitContext const &)
145155 {
156+ if (hypoMoth == kSigmaMinus ) {
157+ charge = 1 ;
158+ mothMass = o2::constants::physics::MassSigmaMinus;
159+ chargedDauMass = o2::constants::physics::MassPiMinus;
160+ neutDauMass = o2::constants::physics::MassNeutron;
161+ } else if (hypoMoth == kHyperhelium4sigma ) {
162+ charge = 2 ;
163+ mothMass = o2::constants::physics::MassHyperHelium4;
164+ chargedDauMass = o2::constants::physics::MassAlpha;
165+ neutDauMass = o2::constants::physics::MassPi0;
166+ }
146167
147168 // dummy values, 1 for mother, 0 for daughter
148169 svCreator.setPDGs (1 , 0 );
@@ -174,13 +195,19 @@ struct kinkBuilder {
174195 const AxisSpec itsClusterMapAxis (128 , 0 , 127 , " ITS cluster map" );
175196 const AxisSpec rigidityAxis{rigidityBins, " #it{p}^{TPC}/#it{z}" };
176197 const AxisSpec ptAxis{rigidityBins, " #it{p}_{T} (GeV/#it{c})" };
177- const AxisSpec sigmaMassAxis{100 , 1.1 , 1.4 , " m (GeV/#it{c}^{2})" };
178198 const AxisSpec kinkAngleAxis{100 , 0 , 180 , " #theta_{kink} (deg)" };
179199 const AxisSpec dedxAxis{dedxBins, " d#it{E}/d#it{x}" };
180200
201+ AxisSpec massAxis (100 , 1.1 , 1.4 , " m (GeV/#it{c}^{2})" );
202+ if (hypoMoth == kSigmaMinus ) {
203+ massAxis = AxisSpec{100 , 1.1 , 1.4 , " m (GeV/#it{c}^{2})" };
204+ } else if (hypoMoth == kHyperhelium4sigma ) {
205+ massAxis = AxisSpec{100 , 3.85 , 4.25 , " m (GeV/#it{c}^{2})" };
206+ }
207+
181208 h2DeDxDaugSel = qaRegistry.add <TH2>(" h2DeDxDaugSel" , " ;p_{TPC}/z (GeV/#it{c}); dE/dx" , HistType::kTH2F , {rigidityAxis, dedxAxis});
182209 h2KinkAnglePt = qaRegistry.add <TH2>(" h2KinkAnglePt" , " ; p_{T} (GeV/#it{c}); #theta_{kink} (deg)" , HistType::kTH2F , {ptAxis, kinkAngleAxis});
183- h2SigmaMinusMassPt = qaRegistry.add <TH2>(" h2SigmaMinusMassPt " , " ; p_{T} (GeV/#it{c}); m (GeV/#it{c}^{2})" , HistType::kTH2F , {ptAxis, sigmaMassAxis });
210+ h2MothMassPt = qaRegistry.add <TH2>(" h2MothMassPt " , " ; p_{T} (GeV/#it{c}); m (GeV/#it{c}^{2})" , HistType::kTH2F , {ptAxis, massAxis });
184211 h2ClsMapPtMoth = qaRegistry.add <TH2>(" h2ClsMapPtMoth" , " ; p_{T} (GeV/#it{c}); ITS cluster map" , HistType::kTH2F , {ptAxis, itsClusterMapAxis});
185212 h2ClsMapPtDaug = qaRegistry.add <TH2>(" h2ClsMapPtDaug" , " ; p_{T} (GeV/#it{c}); ITS cluster map" , HistType::kTH2F , {ptAxis, itsClusterMapAxis});
186213 }
@@ -225,7 +252,7 @@ struct kinkBuilder {
225252 svCreator.clearPools ();
226253 svCreator.fillBC2Coll (collisions, bcs);
227254
228- for (auto & track : tracks) {
255+ for (const auto & track : tracks) {
229256 if (std::abs (track.eta ()) > etaMax)
230257 continue ;
231258
@@ -240,7 +267,7 @@ struct kinkBuilder {
240267 }
241268 auto & kinkPool = svCreator.getSVCandPool (collisions, !unlikeSignBkg);
242269
243- for (auto & svCand : kinkPool) {
270+ for (const auto & svCand : kinkPool) {
244271 kinkCandidate kinkCand;
245272
246273 auto trackMoth = tracks.rawIteratorAt (svCand.tr0Idx );
@@ -338,8 +365,12 @@ struct kinkBuilder {
338365
339366 propMothTrack.getPxPyPzGlo (kinkCand.momMoth );
340367 propDaugTrack.getPxPyPzGlo (kinkCand.momDaug );
341- float pMoth = propMothTrack.getP ();
342- float pDaug = propDaugTrack.getP ();
368+ for (int i = 0 ; i < 3 ; i++) {
369+ kinkCand.momMoth [i] *= charge;
370+ kinkCand.momDaug [i] *= charge;
371+ }
372+ float pMoth = propMothTrack.getP () * charge;
373+ float pDaug = propDaugTrack.getP () * charge;
343374 float spKink = kinkCand.momMoth [0 ] * kinkCand.momDaug [0 ] + kinkCand.momMoth [1 ] * kinkCand.momDaug [1 ] + kinkCand.momMoth [2 ] * kinkCand.momDaug [2 ];
344375 kinkCand.kinkAngle = std::acos (spKink / (pMoth * pDaug));
345376
@@ -348,15 +379,15 @@ struct kinkBuilder {
348379 neutDauMom[i] = kinkCand.momMoth [i] - kinkCand.momDaug [i];
349380 }
350381
351- float piMinusE = std::sqrt (neutDauMom[ 0 ] * neutDauMom[ 0 ] + neutDauMom[ 1 ] * neutDauMom[ 1 ] + neutDauMom[ 2 ] * neutDauMom[ 2 ] + 0.13957 * 0.13957 );
352- float neutronE = std::sqrt (pDaug * pDaug + 0.93957 * 0.93957 );
353- float invMass = std::sqrt ((piMinusE + neutronE ) * (piMinusE + neutronE ) - (pMoth * pMoth));
382+ float chargedDauE = std::sqrt (pDaug * pDaug + chargedDauMass * chargedDauMass );
383+ float neutE = std::sqrt (neutDauMom[ 0 ] * neutDauMom[ 0 ] + neutDauMom[ 1 ] * neutDauMom[ 1 ] + neutDauMom[ 2 ] * neutDauMom[ 2 ] + neutDauMass * neutDauMass );
384+ float invMass = std::sqrt ((chargedDauE + neutE ) * (chargedDauE + neutE ) - (pMoth * pMoth));
354385
355386 h2DeDxDaugSel->Fill (trackDaug.tpcInnerParam () * trackDaug.sign (), trackDaug.tpcSignal ());
356- h2KinkAnglePt->Fill (trackMoth.pt () * trackMoth.sign (), kinkCand.kinkAngle * radToDeg);
357- h2SigmaMinusMassPt ->Fill (trackMoth.pt () * trackMoth.sign (), invMass);
358- h2ClsMapPtMoth->Fill (trackMoth.pt () * trackMoth.sign (), trackMoth.itsClusterMap ());
359- h2ClsMapPtDaug->Fill (trackDaug.pt () * trackDaug.sign (), trackDaug.itsClusterMap ());
387+ h2KinkAnglePt->Fill (trackMoth.pt () * charge * trackMoth.sign (), kinkCand.kinkAngle * radToDeg);
388+ h2MothMassPt ->Fill (trackMoth.pt () * charge * trackMoth.sign (), invMass);
389+ h2ClsMapPtMoth->Fill (trackMoth.pt () * charge * trackMoth.sign (), trackMoth.itsClusterMap ());
390+ h2ClsMapPtDaug->Fill (trackDaug.pt () * charge * trackDaug.sign (), trackDaug.itsClusterMap ());
360391
361392 kinkCand.collisionID = collision.globalIndex ();
362393 kinkCand.mothTrackID = trackMoth.globalIndex ();
@@ -423,7 +454,7 @@ struct kinkBuilder {
423454 // sort kinkCandidates by collisionID to allow joining with collision table
424455 std::sort (kinkCandidates.begin (), kinkCandidates.end (), [](const kinkCandidate& a, const kinkCandidate& b) { return a.collisionID < b.collisionID ; });
425456
426- for (auto & kinkCand : kinkCandidates) {
457+ for (const auto & kinkCand : kinkCandidates) {
427458 outputDataTable (kinkCand.collisionID , kinkCand.mothTrackID , kinkCand.daugTrackID ,
428459 kinkCand.decVtx [0 ], kinkCand.decVtx [1 ], kinkCand.decVtx [2 ],
429460 kinkCand.mothSign , kinkCand.momMoth [0 ], kinkCand.momMoth [1 ], kinkCand.momMoth [2 ],
0 commit comments