@@ -45,6 +45,7 @@ struct sigmaminustask {
4545 // Configurable for event selection
4646 Configurable<float > cutzvertex{" cutzvertex" , 10 .0f , " Accepted z-vertex range (cm)" };
4747 Configurable<float > cutNSigmaPi{" cutNSigmaPi" , 4 , " NSigmaTPCPion" };
48+ Configurable<float > cutEtaMotherMC{" cutEtaMotherMC" , 1 .0f , " Eta cut for mother Sigma in MC" };
4849
4950 Configurable<bool > fillOutputTree{" fillOutputTree" , true , " If true, fill the output tree with Kink candidates" };
5051
@@ -92,7 +93,7 @@ struct sigmaminustask {
9293 for (const auto & kinkCand : KinkCands) {
9394 auto dauTrack = kinkCand.trackDaug_as <TracksFull>();
9495
95- if (abs (dauTrack.tpcNSigmaPi ()) > cutNSigmaPi) {
96+ if (std:: abs (dauTrack.tpcNSigmaPi ()) > cutNSigmaPi) {
9697 continue ;
9798 }
9899
@@ -131,7 +132,7 @@ struct sigmaminustask {
131132 LOG (info) << " Skipping kink candidate with opposite sign daughter and mother: " << kinkCand.globalIndex ();
132133 continue ; // Skip if the daughter has the opposite sign as the mother
133134 }
134- if (abs (dauTrack.tpcNSigmaPi ()) > cutNSigmaPi) {
135+ if (std:: abs (dauTrack.tpcNSigmaPi ()) > cutNSigmaPi) {
135136 continue ;
136137 }
137138
@@ -161,7 +162,13 @@ struct sigmaminustask {
161162
162163 float MotherMassMC = std::sqrt (piMother.e () * piMother.e () - piMother.p () * piMother.p ());
163164 float MotherpTMC = piMother.pt ();
164- float decayRadiusMC = std::sqrt (mcTrackPiDau.vx () * mcTrackPiDau.vx () + mcTrackPiDau.vy () * mcTrackPiDau.vy ());
165+ float deltaXMother = mcTrackPiDau.vx () - piMother.vx ();
166+ float deltaYMother = mcTrackPiDau.vy () - piMother.vy ();
167+ float decayRadiusMC = std::sqrt (deltaXMother * deltaXMother + deltaYMother * deltaYMother);
168+
169+ // Check coherence of MCcollision Id for daughter MCparticle and reconstructed collision
170+ auto mcCollision = mcTrackPiDau.template mcCollision_as <aod::McCollisions>();
171+ bool mcCollisionIdCheck = collision.mcCollisionId () == mcCollision.globalIndex ();
165172
166173 rSigmaMinus.fill (HIST (" h2MassPtMCRec" ), kinkCand.mothSign () * kinkCand.ptMoth (), kinkCand.mSigmaMinus ());
167174 if (mcTrackSigma.pdgCode () > 0 ) {
@@ -182,7 +189,7 @@ struct sigmaminustask {
182189 dauTrack.tpcNSigmaPi (), dauTrack.tpcNSigmaPr (), dauTrack.tpcNSigmaKa (),
183190 dauTrack.tofNSigmaPi (), dauTrack.tofNSigmaPr (), dauTrack.tofNSigmaKa (),
184191 mcTrackSigma.pdgCode (), mcTrackPiDau.pdgCode (),
185- MotherpTMC, MotherMassMC, decayRadiusMC);
192+ MotherpTMC, MotherMassMC, decayRadiusMC, mcCollisionIdCheck );
186193 }
187194 }
188195 } // MC association and selection
@@ -191,7 +198,7 @@ struct sigmaminustask {
191198
192199 // Loop over all generated particles to fill MC histograms
193200 for (const auto & mcPart : particlesMC) {
194- if (std::abs (mcPart.pdgCode ()) != 3112 || std::abs (mcPart.y ()) > 1.0 ) { // only sigma mothers and rapidity cut
201+ if (std::abs (mcPart.pdgCode ()) != 3112 || std::abs (mcPart.y ()) > cutEtaMotherMC ) { // only sigma mothers and rapidity cut
195202 continue ;
196203 }
197204 if (!mcPart.has_daughters ()) {
@@ -214,7 +221,7 @@ struct sigmaminustask {
214221 continue ; // Skip if no pi/proton daughter found
215222 }
216223 float mcMass = std::sqrt (mcPart.e () * mcPart.e () - mcPart.p () * mcPart.p ());
217- float mcDecayRadius = std::sqrt (secVtx[0 ] * secVtx[0 ] + secVtx[1 ] * secVtx[1 ]);
224+ float mcDecayRadius = std::sqrt (( secVtx[0 ] - mcPart. vx ()) * ( secVtx[0 ] - mcPart. vx ()) + ( secVtx[1 ] - mcPart. vy ()) * ( secVtx[1 ] - mcPart. vy ()) );
218225 int sigmaSign = mcPart.pdgCode () > 0 ? 1 : -1 ; // Determine the sign of the Sigma
219226 rSigmaMinus.fill (HIST (" h2MassPtMCGen" ), sigmaSign * mcPart.pt (), mcMass);
220227
@@ -228,7 +235,7 @@ struct sigmaminustask {
228235 -999 , -999 , -999 ,
229236 -999 , -999 , -999 ,
230237 mcPart.pdgCode (), daug_pdg,
231- mcPart.pt (), mcMass, mcDecayRadius);
238+ mcPart.pt (), mcMass, mcDecayRadius, false );
232239 }
233240 }
234241 }
0 commit comments