1111
1212// / \file spectraKinkPiKa.cxx
1313// / \brief Example of a simple task for the analysis of the muon from Kaon pion using kink topology
14- // / \author
14+ // / \author sandeep dudi sandeep.dudi@cern.ch
1515
1616#include " PWGLF/DataModel/LFKinkDecayTables.h"
1717
@@ -54,6 +54,8 @@ struct spectraKinkPiKa {
5454 Configurable<float > cutzvertex{" cutzvertex" , 10 .0f , " Accepted z-vertex range (cm)" };
5555 Configurable<float > cutNSigmaPi{" cutNSigmaPi" , 4 , " NSigmaTPCPion" };
5656 Configurable<float > cutNSigmaKa{" cutNSigmaKa" , 4 , " NSigmaTPCKaon" };
57+ Configurable<float > rapCut{" rapCut" , 0.8 , " rapCut" };
58+
5759 Configurable<int > pid{" pidMother" , 321 , " " };
5860 Configurable<bool > d0pid{" dopid" , 0 , " " };
5961
@@ -118,10 +120,10 @@ struct spectraKinkPiKa {
118120 auto mothTrack = kinkCand.trackMoth_as <TracksFull>();
119121 bool kaon = false ;
120122 bool pion = false ;
121- if (abs (mothTrack.tpcNSigmaKa ()) < cutNSigmaKa) {
123+ if (std:: abs (mothTrack.tpcNSigmaKa ()) < cutNSigmaKa) {
122124 kaon = true ;
123125 }
124- if (abs (mothTrack.tpcNSigmaPi ()) < cutNSigmaPi) {
126+ if (std:: abs (mothTrack.tpcNSigmaPi ()) < cutNSigmaPi) {
125127 pion = true ;
126128 }
127129 if (!kaon && !pion)
@@ -132,34 +134,31 @@ struct spectraKinkPiKa {
132134 float pMoth = v0.P ();
133135 float pDaug = v1.P ();
134136 float spKink = mothTrack.px () * dauTrack.px () + mothTrack.py () * dauTrack.py () + mothTrack.pz () * dauTrack.pz ();
135- float kink_angle = std::acos (spKink / (pMoth * pDaug));
137+ float kinkangle = std::acos (spKink / (pMoth * pDaug));
136138 if (kaon) {
137139 rpiKkink.fill (HIST (" h2_moth_pt_vs_eta_rec" ), v0.Pt (), v0.Eta ());
138140 rpiKkink.fill (HIST (" h2_dau_pt_vs_eta_rec" ), v1.Pt (), v1.Eta ());
139141 rpiKkink.fill (HIST (" h2_pt_moth_vs_dau_rec" ), v0.Pt (), v1.Pt ());
140- rpiKkink.fill (HIST (" h2_kink_angle" ), kink_angle );
142+ rpiKkink.fill (HIST (" h2_kink_angle" ), kinkangle );
141143 }
142144 if (pion) {
143145 rpiKkink.fill (HIST (" h2_moth_pt_vs_eta_rec_pion" ), v0.Pt (), v0.Eta ());
144146 rpiKkink.fill (HIST (" h2_dau_pt_vs_eta_rec_pion" ), v1.Pt (), v1.Eta ());
145147 rpiKkink.fill (HIST (" h2_pt_moth_vs_dau_rec_pion" ), v0.Pt (), v1.Pt ());
146- rpiKkink.fill (HIST (" h2_kink_angle_pion" ), kink_angle );
148+ rpiKkink.fill (HIST (" h2_kink_angle_pion" ), kinkangle );
147149 }
148- ROOT::Math::Boost boost (-v0.BoostToCM ());
149- ROOT::Math::PxPyPzMVector dBoosted = boost (v1);
150- TVector3 p_d_rest (dBoosted.Px (), dBoosted.Py (), dBoosted.Pz ()); // Daughter in mother rest frame
150+ TVector3 pdlab (v1.Px (), v1.Py (), v1.Pz ());
151151 // Compute transverse component
152- TVector3 boostDir (v0.Px (), v0.Py (), v0.Pz ());
153- boostDir = boostDir.Unit ();
154- double pt_d = p_d_rest.Perp (boostDir); // or p_d_rest.Mag() * sin(theta)
152+ TVector3 motherDir (v0.Px (), v0.Py (), v0.Pz ());
153+ double ptd = pdlab.Perp (motherDir); // or p_d_lab.Mag() * sin(theta)
155154
156155 if (kaon) {
157- rpiKkink.fill (HIST (" h2_qt" ), pt_d );
158- rpiKkink.fill (HIST (" h2_qt_vs_pt" ), pt_d , v1.Pt ());
156+ rpiKkink.fill (HIST (" h2_qt" ), ptd );
157+ rpiKkink.fill (HIST (" h2_qt_vs_pt" ), ptd , v1.Pt ());
159158 }
160159 if (pion) {
161- rpiKkink.fill (HIST (" h2_qt_pion" ), pt_d );
162- rpiKkink.fill (HIST (" h2_qt_vs_ptpion" ), pt_d , v1.Pt ());
160+ rpiKkink.fill (HIST (" h2_qt_pion" ), ptd );
161+ rpiKkink.fill (HIST (" h2_qt_vs_ptpion" ), ptd , v1.Pt ());
163162 }
164163 }
165164 }
@@ -187,10 +186,10 @@ struct spectraKinkPiKa {
187186 }
188187 bool kaon = false ;
189188 bool pion = false ;
190- if (abs (mothTrack.tpcNSigmaKa ()) < cutNSigmaKa) {
189+ if (std:: abs (mothTrack.tpcNSigmaKa ()) < cutNSigmaKa) {
191190 kaon = true ;
192191 }
193- if (abs (mothTrack.tpcNSigmaPi ()) < cutNSigmaPi) {
192+ if (std:: abs (mothTrack.tpcNSigmaPi ()) < cutNSigmaPi) {
194193 pion = true ;
195194 }
196195 if (!kaon && !pion)
@@ -202,21 +201,19 @@ struct spectraKinkPiKa {
202201 float pMoth = v0.P ();
203202 float pDaug = v1.P ();
204203 float spKink = mothTrack.px () * dauTrack.px () + mothTrack.py () * dauTrack.py () + mothTrack.pz () * dauTrack.pz ();
205- float kink_angle = std::acos (spKink / (pMoth * pDaug));
204+ float kinkangle = std::acos (spKink / (pMoth * pDaug));
206205
207206 rpiKkink.fill (HIST (" h2_moth_pt_vs_eta_rec" ), v0.Pt (), v0.Eta ());
208207 rpiKkink.fill (HIST (" h2_dau_pt_vs_eta_rec" ), v1.Pt (), v1.Eta ());
209208 rpiKkink.fill (HIST (" h2_pt_moth_vs_dau_rec" ), v0.Pt (), v1.Pt ());
210- rpiKkink.fill (HIST (" h2_kink_angle" ), kink_angle );
209+ rpiKkink.fill (HIST (" h2_kink_angle" ), kinkangle );
211210
212- ROOT::Math::Boost boost (-v0.BoostToCM ());
213- ROOT::Math::PxPyPzMVector dBoosted = boost (v1);
214- TVector3 p_d_rest (dBoosted.Px (), dBoosted.Py (), dBoosted.Pz ()); // Daughter in mother rest frame
211+ TVector3 pdlab (v1.Px (), v1.Py (), v1.Pz ());
215212 // Compute transverse component
216- TVector3 boostDir (v0.Px (), v0.Py (), v0.Pz ());
217- boostDir = boostDir. Unit ();
218- double pt_d = p_d_rest. Perp (boostDir); // or p_d_rest.Mag() * sin(theta)
219- rpiKkink.fill (HIST (" h2_qt" ), pt_d );
213+ TVector3 motherDir (v0.Px (), v0.Py (), v0.Pz ());
214+ double ptd = pdlab. Perp (motherDir); // or p_d_lab.Mag() * sin(theta)
215+
216+ rpiKkink.fill (HIST (" h2_qt" ), ptd );
220217
221218 // do MC association
222219 auto mcLabMoth = trackLabelsMC.rawIteratorAt (mothTrack.globalIndex ());
@@ -227,15 +224,15 @@ struct spectraKinkPiKa {
227224 if (!mcTrackDau.has_mothers ()) {
228225 continue ;
229226 }
230- for (auto & piMother : mcTrackDau.mothers_as <aod::McParticles>()) {
227+ for (const auto & piMother : mcTrackDau.mothers_as <aod::McParticles>()) {
231228 if (piMother.globalIndex () != mcTrackMoth.globalIndex ()) {
232229 continue ;
233230 }
234231 if (std::abs (mcTrackMoth.pdgCode ()) != pid || std::abs (mcTrackDau.pdgCode ()) != kMuonPlus ) {
235232 continue ;
236233 }
237234 // rpiKkink.fill(HIST("h2MassPtMCRec"), kinkCand.ptMoth(), v1.Pt());
238- rpiKkink.fill (HIST (" h2_qt_rec" ), pt_d );
235+ rpiKkink.fill (HIST (" h2_qt_rec" ), ptd );
239236 }
240237 }
241238 }
@@ -244,10 +241,10 @@ struct spectraKinkPiKa {
244241 ROOT::Math::PxPyPzMVector v0;
245242 ROOT::Math::PxPyPzMVector v1;
246243
247- if (!d0pid && (std::abs (mcPart.pdgCode ()) != pid || std::abs (mcPart.y ()) > 0.8 )) {
244+ if (!d0pid && (std::abs (mcPart.pdgCode ()) != pid || std::abs (mcPart.y ()) > rapCut )) {
248245 continue ;
249246 }
250- if (d0pid && (std::abs (mcPart.pdgCode ()) != kD0 || std::abs (mcPart.pdgCode ()) != kDPlus || std::abs (mcPart.pdgCode ()) != kDStar || std::abs (mcPart.y ()) > 0.8 )) {
247+ if (d0pid && (std::abs (mcPart.pdgCode ()) != kD0 || std::abs (mcPart.pdgCode ()) != kDPlus || std::abs (mcPart.pdgCode ()) != kDStar || std::abs (mcPart.y ()) > rapCut )) {
251248 continue ;
252249 }
253250
@@ -278,23 +275,20 @@ struct spectraKinkPiKa {
278275
279276 float pMoth = v0.P ();
280277 float pDaug = v1.P ();
281- float spKink = v0.Px () * v1.Px () + v0.Py () * v1.Py () + v0.Pz () * v0 .Pz ();
282- float kink_angle = std::acos (spKink / (pMoth * pDaug));
278+ float spKink = v0.Px () * v1.Px () + v0.Py () * v1.Py () + v0.Pz () * v1 .Pz ();
279+ float kinkangle = std::acos (spKink / (pMoth * pDaug));
283280
284281 // std::cout<< kinkCand.ptMoth()<<" check "<<v0.Pt()<<std::endl;
285282 rpiKkink.fill (HIST (" h2_moth_pt_vs_eta_gen" ), v0.Pt (), v0.Eta ());
286283 rpiKkink.fill (HIST (" h2_dau_pt_vs_eta_gen" ), v1.Pt (), v1.Eta ());
287284 rpiKkink.fill (HIST (" h2_pt_moth_vs_dau_gen" ), v0.Pt (), v1.Pt ());
288- rpiKkink.fill (HIST (" h2_kink_angle_gen" ), kink_angle );
285+ rpiKkink.fill (HIST (" h2_kink_angle_gen" ), kinkangle );
289286
290- ROOT::Math::Boost boost (-v0.BoostToCM ());
291- ROOT::Math::PxPyPzMVector dBoosted = boost (v1);
292- TVector3 p_d_rest (dBoosted.Px (), dBoosted.Py (), dBoosted.Pz ()); // Daughter in mother rest frame
287+ TVector3 pdlab (v1.Px (), v1.Py (), v1.Pz ());
293288 // Compute transverse component
294- TVector3 boostDir (v0.Px (), v0.Py (), v0.Pz ());
295- boostDir = boostDir.Unit ();
296- double pt_d = p_d_rest.Perp (boostDir); // or p_d_rest.Mag() * sin(theta)
297- rpiKkink.fill (HIST (" h2_qt_gen" ), pt_d);
289+ TVector3 motherDir (v0.Px (), v0.Py (), v0.Pz ());
290+ double ptd = pdlab.Perp (motherDir); // or p_d_lab.Mag() * sin(theta)
291+ rpiKkink.fill (HIST (" h2_qt_gen" ), ptd);
298292 }
299293 }
300294 PROCESS_SWITCH (spectraKinkPiKa, processMC, " MC processing" , false );
0 commit comments