@@ -340,7 +340,7 @@ struct tofSpectra {
340340 const AxisSpec phiAxis{200 , 0 , 7 , " #it{#varphi} (rad)" };
341341 const AxisSpec dcaZAxis{binsOptions.binsDca , " DCA_{z} (cm)" };
342342 const AxisSpec lengthAxis{100 , 0 , 600 , " Track length (cm)" };
343- const AxisSpec decayLengthAxis{100 , 0 , 0.1 , " Decay Length (cm)" };
343+ const AxisSpec decayLengthAxis{100 , 0 , 0.5 , " Decay Length (cm)" };
344344
345345 if (enableTrackCutHistograms) {
346346 const AxisSpec chargeAxis{2 , -2 .f , 2 .f , " Charge" };
@@ -1650,12 +1650,15 @@ struct tofSpectra {
16501650 histos.fill (HIST (hdcaxystr[i]), track.pt (), track.dcaXY ());
16511651 histos.fill (HIST (hdcazstr[i]), track.pt (), track.dcaZ ());
16521652 }
1653- if (mcParticle.has_daughters ()) {
1654- auto daughter0 = mcParticle.template daughters_as <aod::McParticles>().begin ();
1655- double vertexDau[3 ] = {daughter0.vx (), daughter0.vy (), daughter0.vz ()};
1656- double vertexPrimary[3 ] = {mcCollision.posX (), mcCollision.posY (), mcCollision.posZ ()};
1657- auto decayLength = RecoDecay::distance (vertexPrimary, vertexDau) / 10000 ;
1658- hDecayLengthStr[i]->Fill (track.pt (), decayLength);
1653+
1654+ if (mcParticle.has_mothers ()) {
1655+ for (const auto & mother : mcParticle.template mothers_as <aod::McParticles>()) {
1656+ auto daughter0 = mother.template daughters_as <aod::McParticles>().begin ();
1657+ double vertexDau[3 ] = {daughter0.vx (), daughter0.vy (), daughter0.vz ()};
1658+ double vertexMoth[3 ] = {mother.vx (), mother.vy (), mother.vz ()};
1659+ auto decayLength = RecoDecay::distance (vertexMoth, vertexDau);
1660+ hDecayLengthStr[i]->Fill (track.pt (), decayLength);
1661+ }
16591662 }
16601663 } else {
16611664 if (enableDCAxyzHistograms) {
@@ -1722,23 +1725,25 @@ struct tofSpectra {
17221725 hDcaZMCNotHF[i]->Fill (track.pt (), track.dcaZ ());
17231726 }
17241727
1725- if (mcParticle.has_daughters ()) {
1726- auto daughter0 = mcParticle.template daughters_as <aod::McParticles>().begin ();
1727- double vertexDau[3 ] = {daughter0.vx (), daughter0.vy (), daughter0.vz ()};
1728- double vertexPrimary[3 ] = {mcCollision.posX (), mcCollision.posY (), mcCollision.posZ ()};
1729- auto decayLength = RecoDecay::distance (vertexPrimary, vertexDau) / 10000 ;
1728+ if (mcParticle.has_mothers ()) {
1729+ for (const auto & mother : mcParticle.template mothers_as <aod::McParticles>()) {
1730+ auto daughter0 = mother.template daughters_as <aod::McParticles>().begin ();
1731+ double vertexDau[3 ] = {daughter0.vx (), daughter0.vy (), daughter0.vz ()};
1732+ double vertexMoth[3 ] = {mother.vx (), mother.vy (), mother.vz ()};
1733+ auto decayLength = RecoDecay::distance (vertexMoth, vertexDau);
17301734
1731- if (IsD0Mother) {
1732- hDecayLengthMCD0[i]->Fill (track.pt (), decayLength);
1733- }
1734- if (IsCharmMother) {
1735- hDecayLengthMCCharm[i]->Fill (track.pt (), decayLength);
1736- }
1737- if (IsBeautyMother) {
1738- hDecayLengthMCBeauty[i]->Fill (track.pt (), decayLength);
1739- }
1740- if (IsNotHFMother) {
1741- hDecayLengthMCNotHF[i]->Fill (track.pt (), decayLength);
1735+ if (IsD0Mother) {
1736+ hDecayLengthMCD0[i]->Fill (track.pt (), decayLength);
1737+ }
1738+ if (IsCharmMother) {
1739+ hDecayLengthMCCharm[i]->Fill (track.pt (), decayLength);
1740+ }
1741+ if (IsBeautyMother) {
1742+ hDecayLengthMCBeauty[i]->Fill (track.pt (), decayLength);
1743+ }
1744+ if (IsNotHFMother) {
1745+ hDecayLengthMCNotHF[i]->Fill (track.pt (), decayLength);
1746+ }
17421747 }
17431748 }
17441749 }
0 commit comments