1313// / \brief f0980 resonance analysis in PbPb collisions
1414// / \author Junlee Kim (jikim1290@gmail.com)
1515
16+ #include < CommonConstants/MathConstants.h>
1617#include < Framework/Configurable.h>
1718#include < cmath>
1819#include < array>
@@ -140,7 +141,8 @@ struct f0980pbpbanalysis {
140141 double relPhi;
141142 double relPhiRot;
142143
143- double massPi = o2::constants::physics::MassPionCharged;
144+ // double massPi = o2::constants::physics::MassPionCharged;
145+ double massPtl;
144146
145147 TRandom* rn = new TRandom();
146148 // float theta2;
@@ -150,7 +152,7 @@ struct f0980pbpbanalysis {
150152 Filter cutDCAFilter = (nabs(aod::track::dcaXY) < cfgMaxDCArToPVcut) && (nabs(aod::track::dcaZ) < cfgMaxDCAzToPVcut);
151153
152154 using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::FV0Mults, aod::TPCMults, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::Mults, aod::Qvectors>>;
153- using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi>>;
155+ using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTPCFullKa >>;
154156
155157 template <typename T>
156158 int getDetId (const T& name)
@@ -262,8 +264,7 @@ struct f0980pbpbanalysis {
262264 if (std::fabs (track.tpcNSigmaPi ()) > cMaxTPCnSigmaPionS) {
263265 return 0 ;
264266 }
265- }
266- if (cfgSelectType == 1 ) {
267+ } else if (cfgSelectType == 1 ) {
267268 if (cfgUSETOF) {
268269 if (track.hasTOF ()) {
269270 if (std::fabs (track.tofNSigmaPi ()) > cMaxTOFnSigmaPion) {
@@ -282,11 +283,49 @@ struct f0980pbpbanalysis {
282283 return 0 ;
283284 }
284285 }
286+ } else if (cfgSelectType == 2 ) {
287+ if (cfgUSETOF) {
288+ if (track.hasTOF ()) {
289+ if (std::fabs (track.tofNSigmaKa ()) > 3 ) {
290+ return 0 ;
291+ }
292+ if (std::fabs (track.tpcNSigmaKa ()) > 3 ) {
293+ return 0 ;
294+ }
295+ } else {
296+ if (std::fabs (track.tpcNSigmaKa ()) > 3 ) {
297+ return 0 ;
298+ }
299+ }
300+ } else {
301+ if (std::fabs (track.tpcNSigmaKa ()) > 3 ) {
302+ return 0 ;
303+ }
304+ }
285305 }
286-
287306 return 1 ;
288307 }
289308
309+ template <typename TrackType>
310+ float getTpcNSigma (const TrackType track)
311+ {
312+ if (cfgSelectType == 2 ) {
313+ return track.tpcNSigmaKa ();
314+ } else {
315+ return track.tpcNSigmaPi ();
316+ }
317+ }
318+
319+ template <typename TrackType>
320+ float getTofNSigma (const TrackType track)
321+ {
322+ if (cfgSelectType == 2 ) {
323+ return track.tofNSigmaKa ();
324+ } else {
325+ return track.tofNSigmaPi ();
326+ }
327+ }
328+
290329 template <bool IsMC, typename CollisionType, typename TracksType>
291330 void fillHistograms (const CollisionType& collision,
292331 const TracksType& dTracks, int nmode)
@@ -314,9 +353,9 @@ struct f0980pbpbanalysis {
314353 continue ;
315354 }
316355
317- histos.fill (HIST (" QA/Nsigma_TPC" ), trk1.pt (), trk1. tpcNSigmaPi ( ));
318- histos.fill (HIST (" QA/Nsigma_TOF" ), trk1.pt (), trk1. tofNSigmaPi ( ));
319- histos.fill (HIST (" QA/TPC_TOF" ), trk1. tpcNSigmaPi ( ), trk1. tofNSigmaPi ( ));
356+ histos.fill (HIST (" QA/Nsigma_TPC" ), trk1.pt (), getTpcNSigma (trk1 ));
357+ histos.fill (HIST (" QA/Nsigma_TOF" ), trk1.pt (), getTofNSigma (trk1 ));
358+ histos.fill (HIST (" QA/TPC_TOF" ), getTpcNSigma (trk1 ), getTofNSigma (trk1 ));
320359
321360 for (const auto & trk2 : dTracks) {
322361 if (!trackSelected (trk2)) {
@@ -329,13 +368,13 @@ struct f0980pbpbanalysis {
329368 }
330369
331370 if (trk1.index () == trk2.index ()) {
332- histos.fill (HIST (" QA/Nsigma_TPC_selected" ), trk1.pt (), trk1. tpcNSigmaPi ( ));
333- histos.fill (HIST (" QA/Nsigma_TOF_selected" ), trk1.pt (), trk1. tofNSigmaPi ( ));
334- histos.fill (HIST (" QA/TPC_TOF_selected" ), trk1. tpcNSigmaPi ( ), trk1. tofNSigmaPi ( ));
371+ histos.fill (HIST (" QA/Nsigma_TPC_selected" ), trk1.pt (), getTpcNSigma (trk2 ));
372+ histos.fill (HIST (" QA/Nsigma_TOF_selected" ), trk1.pt (), getTofNSigma (trk2 ));
373+ histos.fill (HIST (" QA/TPC_TOF_selected" ), getTpcNSigma (trk2 ), getTofNSigma (trk2 ));
335374 }
336375
337- pion1.SetXYZM (trk1.px (), trk1.py (), trk1.pz (), massPi );
338- pion2.SetXYZM (trk2.px (), trk2.py (), trk2.pz (), massPi );
376+ pion1.SetXYZM (trk1.px (), trk1.py (), trk1.pz (), massPtl );
377+ pion2.SetXYZM (trk2.px (), trk2.py (), trk2.pz (), massPtl );
339378 reco = pion1 + pion2;
340379
341380 if (reco.Rapidity () > cfgMaxRap || reco.Rapidity () < cfgMinRap) {
@@ -356,7 +395,7 @@ struct f0980pbpbanalysis {
356395 for (int nr = 0 ; nr < cfgNRotBkg; nr++) {
357396 auto randomPhi = rn->Uniform (o2::constants::math::PI * 5.0 / 6.0 , o2::constants::math::PI * 7.0 / 6.0 );
358397 randomPhi += pion2.Phi ();
359- pion2Rot.SetXYZM (pion2.Pt () * std::cos (randomPhi), pion2.Pt () * std::sin (randomPhi), trk2.pz (), massPi );
398+ pion2Rot.SetXYZM (pion2.Pt () * std::cos (randomPhi), pion2.Pt () * std::sin (randomPhi), trk2.pz (), massPtl );
360399 recoRot = pion1 + pion2Rot;
361400 relPhiRot = TVector2::Phi_0_2pi ((recoRot.Phi () - eventPlaneDet) * static_cast <float >(nmode));
362401 histos.fill (HIST (" hInvMass_f0980_USRot_EPA" ), recoRot.M (), recoRot.Pt (), centrality, relPhiRot);
@@ -369,28 +408,28 @@ struct f0980pbpbanalysis {
369408 void init (o2::framework::InitContext&)
370409 {
371410 AxisSpec epAxis = {6 , 0.0 , 2.0 * o2::constants::math::PI};
372- AxisSpec centQaAxis = {110 , 0 , 110 };
373- AxisSpec vzQaAxis = {100 , -20 , 20 };
374- AxisSpec PIDqaAxis = {100 , -10 , 10 };
375- AxisSpec pTqaAxis = {200 , 0 , 20 };
376- AxisSpec epQaAxis = {100 , -1.0 * o2::constants::math::PI, o2::constants::math::PI};
411+ AxisSpec qaCentAxis = {110 , 0 , 110 };
412+ AxisSpec qaVzAxis = {100 , -20 , 20 };
413+ AxisSpec qaPIDAxis = {100 , -10 , 10 };
414+ AxisSpec qaPtAxis = {200 , 0 , 20 };
415+ AxisSpec qaEpAxis = {100 , -1.0 * o2::constants::math::PI, o2::constants::math::PI};
377416 AxisSpec epresAxis = {102 , -1.02 , 1.02 };
378417
379- histos.add (" QA/CentDist" , " " , {HistType::kTH1F , {centQaAxis }});
380- histos.add (" QA/Vz" , " " , {HistType::kTH1F , {vzQaAxis }});
418+ histos.add (" QA/CentDist" , " " , {HistType::kTH1F , {qaCentAxis }});
419+ histos.add (" QA/Vz" , " " , {HistType::kTH1F , {qaVzAxis }});
381420
382- histos.add (" QA/Nsigma_TPC" , " " , {HistType::kTH2F , {pTqaAxis, PIDqaAxis }});
383- histos.add (" QA/Nsigma_TOF" , " " , {HistType::kTH2F , {pTqaAxis, PIDqaAxis }});
384- histos.add (" QA/TPC_TOF" , " " , {HistType::kTH2F , {PIDqaAxis, PIDqaAxis }});
421+ histos.add (" QA/Nsigma_TPC" , " " , {HistType::kTH2F , {qaPtAxis, qaPIDAxis }});
422+ histos.add (" QA/Nsigma_TOF" , " " , {HistType::kTH2F , {qaPtAxis, qaPIDAxis }});
423+ histos.add (" QA/TPC_TOF" , " " , {HistType::kTH2F , {qaPIDAxis, qaPIDAxis }});
385424
386- histos.add (" QA/Nsigma_TPC_selected" , " " , {HistType::kTH2F , {pTqaAxis, PIDqaAxis }});
387- histos.add (" QA/Nsigma_TOF_selected" , " " , {HistType::kTH2F , {pTqaAxis, PIDqaAxis }});
388- histos.add (" QA/TPC_TOF_selected" , " " , {HistType::kTH2F , {PIDqaAxis, PIDqaAxis }});
425+ histos.add (" QA/Nsigma_TPC_selected" , " " , {HistType::kTH2F , {qaPtAxis, qaPIDAxis }});
426+ histos.add (" QA/Nsigma_TOF_selected" , " " , {HistType::kTH2F , {qaPtAxis, qaPIDAxis }});
427+ histos.add (" QA/TPC_TOF_selected" , " " , {HistType::kTH2F , {qaPIDAxis, qaPIDAxis }});
389428
390- histos.add (" QA/EPhist" , " " , {HistType::kTH2F , {centQaAxis, epQaAxis }});
391- histos.add (" QA/EPResAB" , " " , {HistType::kTH2F , {centQaAxis , epresAxis}});
392- histos.add (" QA/EPResAC" , " " , {HistType::kTH2F , {centQaAxis , epresAxis}});
393- histos.add (" QA/EPResBC" , " " , {HistType::kTH2F , {centQaAxis , epresAxis}});
429+ histos.add (" QA/EPhist" , " " , {HistType::kTH2F , {qaCentAxis, qaEpAxis }});
430+ histos.add (" QA/EPResAB" , " " , {HistType::kTH2F , {qaCentAxis , epresAxis}});
431+ histos.add (" QA/EPResAC" , " " , {HistType::kTH2F , {qaCentAxis , epresAxis}});
432+ histos.add (" QA/EPResBC" , " " , {HistType::kTH2F , {qaCentAxis , epresAxis}});
394433
395434 histos.add (" hInvMass_f0980_US_EPA" , " unlike invariant mass" ,
396435 {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, epAxis}});
@@ -401,8 +440,8 @@ struct f0980pbpbanalysis {
401440 histos.add (" hInvMass_f0980_USRot_EPA" , " unlike invariant mass Rotation" ,
402441 {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, epAxis}});
403442 // if (doprocessMCLight) {
404- // histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, {pTqaAxis });
405- // histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", HistType::kTH3F, {massAxis, pTqaAxis , centAxis});
443+ // histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, {qaPtAxis });
444+ // histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", HistType::kTH3F, {massAxis, qaPtAxis , centAxis});
406445 // }
407446
408447 detId = getDetId (cfgQvecDetName);
@@ -416,6 +455,12 @@ struct f0980pbpbanalysis {
416455 refBId = 5 ;
417456 }
418457
458+ if (cfgSelectType == 2 ) {
459+ massPtl = o2::constants::physics::MassKaonCharged;
460+ } else {
461+ massPtl = o2::constants::physics::MassPionCharged;
462+ }
463+
419464 fMultPVCutLow = new TF1 (" fMultPVCutLow" , " [0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)" , 0 , 100 );
420465 fMultPVCutLow ->SetParameters (2834.66 , -87.0127 , 0.915126 , -0.00330136 , 332.513 , -12.3476 , 0.251663 , -0.00272819 , 1.12242e-05 );
421466 fMultPVCutHigh = new TF1 (" fMultPVCutHigh" , " [0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)" , 0 , 100 );
@@ -443,7 +488,7 @@ struct f0980pbpbanalysis {
443488 histos.fill (HIST (" QA/Vz" ), collision.posZ (), 1.0 );
444489
445490 fillHistograms<false >(collision, tracks, 2 ); // second order
446- };
491+ }
447492 PROCESS_SWITCH (f0980pbpbanalysis, processData, " Process Event for data" , true );
448493};
449494
0 commit comments