2828#include " Framework/runDataProcessing.h"
2929#include " PWGLF/DataModel/LFStrangenessTables.h"
3030#include " ReconstructionDataFormats/Track.h"
31+ #include " Common/Core/TrackSelectionDefaults.h"
3132
3233using namespace o2 ;
3334using namespace o2 ::framework;
3435using namespace constants ::physics;
3536
3637using PIDTracks = soa::Join<
37- aod::Tracks, aod::TracksExtra, aod::TrackSelectionExtension,
38- aod::pidTOFFullPi, aod::pidTOFFullPr, aod::pidTOFFullEl>;
38+ aod::Tracks, aod::TracksExtra, aod::TrackSelectionExtension, aod::TracksDCA, aod::TrackSelection,
39+ aod::pidTOFFullPi, aod::pidTOFFullPr, aod::pidTOFFullEl, aod::pidTOFbeta >;
3940
4041using SelectedCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs>;
4142
@@ -50,16 +51,19 @@ struct DedxAnalysis {
5051 true };
5152
5253 // Configurable Parameters
54+ // Tracks cuts
5355 Configurable<float > minTPCnClsFound{" minTPCnClsFound" , 70 .0f ,
5456 " min number of found TPC clusters" };
5557 Configurable<float > minNCrossedRowsTPC{" minNCrossedRowsTPC" , 70 .0f , " min number of found TPC crossed rows" };
56- Configurable<float > minNClsTPCdEdx{" minNClsTPCdEdx" , 50 .0f , " min number of TPC clusters for PID" };
5758 Configurable<float > maxChi2TPC{" maxChi2TPC" , 4 .0f ,
5859 " max chi2 per cluster TPC" };
5960 Configurable<float > maxChi2ITS{" maxChi2ITS" , 36 .0f ,
6061 " max chi2 per cluster ITS" };
6162 Configurable<float > etaMin{" etaMin" , -0 .8f , " etaMin" };
6263 Configurable<float > etaMax{" etaMax" , +0 .8f , " etaMax" };
64+ Configurable<float > minNCrossedRowsOverFindableClustersTPC{" minNCrossedRowsOverFindableClustersTPC" , 0 .8f , " Additional cut on the minimum value of the ratio between crossed rows and findable clusters in the TPC" };
65+ Configurable<float > maxDCAz{" maxDCAz" , 2 .f , " maxDCAz" };
66+ // v0 cuts
6367 Configurable<float > v0cospaMin{" v0cospaMin" , 0 .998f , " Minimum V0 CosPA" };
6468 Configurable<float > minimumV0Radius{" minimumV0Radius" , 0 .5f ,
6569 " Minimum V0 Radius" };
@@ -78,49 +82,115 @@ struct DedxAnalysis {
7882 " Minimum Mass Gamma" };
7983 Configurable<float > maxMassGamma{" maxMassGamma" , 0 .002022f ,
8084 " Maximum Mass Gamma" };
81- Configurable<float > minReqClusterITS{" minReqClusterITS" , 4 .0f , " min number of clusters required in ITS" };
82- Configurable<float > maxDCAxy{" maxDCAxy" , 0 .1f , " maxDCAxy" };
83- Configurable<float > maxDCAz{" maxDCAz" , 0 .1f , " maxDCAz" };
84- Configurable<bool > eventSelection{" eventSelection" , true , " event selection" };
8585 Configurable<bool > calibrationMode{" calibrationMode" , false , " calibration mode" };
8686 // Histograms names
8787 static constexpr std::string_view kDedxvsMomentumPos [4 ] = {" dEdx_vs_Momentum_all_Pos" , " dEdx_vs_Momentum_Pi_v0_Pos" , " dEdx_vs_Momentum_Pr_v0_Pos" , " dEdx_vs_Momentum_El_v0_Pos" };
8888 static constexpr std::string_view kDedxvsMomentumNeg [4 ] = {" dEdx_vs_Momentum_all_Neg" , " dEdx_vs_Momentum_Pi_v0_Neg" , " dEdx_vs_Momentum_Pr_v0_Neg" , " dEdx_vs_Momentum_El_v0_Neg" };
8989 static constexpr double EtaCut[9 ] = {-0.8 , -0.6 , -0.4 , -0.2 , 0.0 , 0.2 , 0.4 , 0.6 , 0.8 };
90- Configurable<std::vector<float >> calibrationFactor{" calibrationFactor" , {50.8263 , 51.0122 , 50.7456 , 50.0372 , 49.699 , 50.2222 , 50.7263 , 50.8073 }, " calibration factors" };
90+ Configurable<std::vector<float >> calibrationFactorNeg{" calibrationFactorNeg" , {50.4011 , 50.4764 , 50.186 , 49.2955 , 48.8222 , 49.4273 , 49.9292 , 50.0556 }, " negative calibration factors" };
91+ Configurable<std::vector<float >> calibrationFactorPos{" calibrationFactorPos" , {50.5157 , 50.6359 , 50.3198 , 49.3345 , 48.9197 , 49.4931 , 50.0188 , 50.1406 }, " positive calibration factors" };
9192 ConfigurableAxis binP{" binP" , {VARIABLE_WIDTH, 0.1 , 0.12 , 0.14 , 0.16 , 0.18 , 0.2 , 0.25 , 0.3 , 0.35 , 0.4 , 0.45 , 0.5 , 0.55 , 0.6 , 0.65 , 0.7 , 0.75 , 0.8 , 0.85 , 0.9 , 0.95 , 1.0 , 1.1 , 1.2 , 1.3 , 1.4 , 1.5 , 1.6 , 1.7 , 1.8 , 1.9 , 2.0 , 2.1 , 2.2 , 2.3 , 2.4 , 2.5 , 2.6 , 2.7 , 2.8 , 2.9 , 3.0 , 3.2 , 3.4 , 3.6 , 3.8 , 4.0 , 4.5 , 5.0 , 5.5 , 6.0 , 6.5 , 7.0 , 8.0 , 9.0 , 10.0 , 11.0 , 12.0 , 13.0 , 14.0 , 15.0 , 16.0 , 18.0 , 20.0 }, " " };
9293
94+ TrackSelection myTrackSelection ()
95+ {
96+ TrackSelection selectedTracks;
97+ selectedTracks.SetPtRange (0 .1f , 1e10f);
98+ selectedTracks.SetEtaRange (etaMin, etaMax);
99+ selectedTracks.SetRequireITSRefit (true );
100+ selectedTracks.SetRequireTPCRefit (true );
101+ selectedTracks.SetMinNCrossedRowsTPC (minNCrossedRowsTPC);
102+ selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC (minNCrossedRowsOverFindableClustersTPC);
103+ selectedTracks.SetMaxChi2PerClusterTPC (maxChi2TPC);
104+ selectedTracks.SetRequireHitsInITSLayers (1 , {0 , 1 });
105+ selectedTracks.SetMaxChi2PerClusterITS (maxChi2ITS);
106+ selectedTracks.SetMaxDcaXYPtDep ([](float pt) { return 0 .0105f + 0 .0350f / std::pow (pt, 1 .1f ); });
107+ selectedTracks.SetMaxDcaZ (maxDCAz);
108+
109+ return selectedTracks;
110+ }
111+
112+ TrackSelection mySelectionPrim;
113+
93114 void init (InitContext const &)
94115 {
116+ AxisSpec dedxAxis{100 , 0.0 , 100.0 , " dE/dx MIP (a. u.)" };
117+ AxisSpec etaAxis{8 , -0.8 , 0.8 , " #eta" };
118+ AxisSpec pAxis = {binP, " #it{p}/Z (GeV/c)" };
95119 if (calibrationMode) {
96120 // MIP for pions
97121 registryDeDx.add (
98- " hdEdxMIP_vs_eta" , " dE/dx" , HistType::kTH2F ,
99- {{8 , -0.8 , 0.8 , " #eta" }, {100 , 0.0 , 100.0 , " dE/dx MIP (a. u.)" }});
122+ " hdEdx_vs_eta_Neg_Pi" , " dE/dx" , HistType::kTH2F ,
123+ {{etaAxis}, {dedxAxis}});
124+ registryDeDx.add (
125+ " hdEdx_vs_eta_Pos_Pi" , " dE/dx" , HistType::kTH2F ,
126+ {{etaAxis}, {dedxAxis}});
127+ // MIP for electrons
128+ registryDeDx.add (
129+ " hdEdx_vs_eta_vs_p_Neg_El" , " dE/dx" , HistType::kTH3F ,
130+ {{etaAxis}, {dedxAxis}, {pAxis}});
131+ registryDeDx.add (
132+ " hdEdx_vs_eta_vs_p_Pos_El" , " dE/dx" , HistType::kTH3F ,
133+ {{etaAxis}, {dedxAxis}, {pAxis}});
134+ // Pions from TOF
100135 registryDeDx.add (
101- " hdEdxMIP_vs_phi" , " dE/dx" , HistType::kTH2F ,
102- {{100 , 0.0 , 6.4 , " #phi" }, {100 , 0.0 , 100.0 , " dE/dx MIP (a. u.)" }});
136+ " hdEdx_vs_eta_vs_p_Neg_TOF" , " dE/dx" , HistType::kTH3F ,
137+ {{etaAxis}, {dedxAxis}, {pAxis}});
138+ registryDeDx.add (
139+ " hdEdx_vs_eta_vs_p_Pos_TOF" , " dE/dx" , HistType::kTH3F ,
140+ {{etaAxis}, {dedxAxis}, {pAxis}});
103141
104142 } else {
105- AxisSpec pAxis = {binP, " #it{p}/Z (GeV/c)" };
143+ // MIP for pions
144+ registryDeDx.add (
145+ " hdEdx_vs_eta_Neg_calibrated_Pi" , " dE/dx" , HistType::kTH2F ,
146+ {{etaAxis}, {dedxAxis}});
106147
107148 registryDeDx.add (
108- " hdEdxMIP_vs_eta_calibrated" , " dE/dx" , HistType::kTH2F ,
109- {{8 , -0.8 , 0.8 , " #eta" }, {100 , 0.0 , 100.0 , " dE/dx MIP (a. u.)" }});
149+ " hdEdx_vs_eta_Pos_calibrated_Pi" , " dE/dx" , HistType::kTH2F ,
150+ {{etaAxis}, {dedxAxis}});
151+
152+ // MIP for electrons
110153 registryDeDx.add (
111- " hdEdxMIP_vs_phi" , " dE/dx" , HistType::kTH2F ,
112- {{100 , 0.0 , 6.4 , " #phi" }, {100 , 0.0 , 100.0 , " dE/dx MIP (a. u.)" }});
154+ " hdEdx_vs_eta_vs_p_Neg_calibrated_El" , " dE/dx" , HistType::kTH3F ,
155+ {{etaAxis}, {dedxAxis}, {pAxis}});
156+
157+ registryDeDx.add (
158+ " hdEdx_vs_eta_vs_p_Pos_calibrated_El" , " dE/dx" , HistType::kTH3F ,
159+ {{etaAxis}, {dedxAxis}, {pAxis}});
160+
161+ // Pions from TOF
162+ registryDeDx.add (
163+ " hdEdx_vs_eta_vs_p_Neg_calibrated_TOF" , " dE/dx" , HistType::kTH3F ,
164+ {{etaAxis}, {dedxAxis}, {pAxis}});
165+
166+ registryDeDx.add (
167+ " hdEdx_vs_eta_vs_p_Pos_calibrated_TOF" , " dE/dx" , HistType::kTH3F ,
168+ {{etaAxis}, {dedxAxis}, {pAxis}});
113169
114170 // De/Dx for ch and v0 particles
115171 for (int i = 0 ; i < 4 ; ++i) {
116172 registryDeDx.add (kDedxvsMomentumPos [i].data (), " dE/dx" , HistType::kTH3F ,
117- {{pAxis}, {100 , 0.0 , 100.0 , " dE/dx (a. u.) " }, {8 , - 0.8 , 0.8 , " #eta " }});
173+ {{pAxis}, {dedxAxis }, {etaAxis }});
118174 registryDeDx.add (kDedxvsMomentumNeg [i].data (), " dE/dx" , HistType::kTH3F ,
119- {{pAxis}, {100 , 0.0 , 100.0 , " dE/dx (a. u.) " }, {8 , - 0.8 , 0.8 , " #eta " }});
175+ {{pAxis}, {dedxAxis }, {etaAxis }});
120176 }
121177 }
178+
179+ registryDeDx.add (
180+ " hdEdx_vs_phi" , " dE/dx" , HistType::kTH2F ,
181+ {{100 , 0.0 , 6.4 , " #phi" }, {dedxAxis}});
182+
183+ registryDeDx.add (
184+ " hbeta_vs_p_Neg" , " beta" , HistType::kTH2F ,
185+ {{pAxis}, {100 , 0.0 , 1.1 , " #beta" }});
186+
187+ registryDeDx.add (
188+ " hbeta_vs_p_Pos" , " beta" , HistType::kTH2F ,
189+ {{pAxis}, {100 , 0.0 , 1.1 , " #beta" }});
122190 // Event Counter
123191 registryDeDx.add (" histRecVtxZData" , " collision z position" , HistType::kTH1F , {{100 , -20.0 , +20.0 , " z_{vtx} (cm)" }});
192+
193+ mySelectionPrim = myTrackSelection ();
124194 }
125195
126196 // Single-Track Selection
@@ -302,34 +372,92 @@ struct DedxAnalysis {
302372 // Kaons
303373 for (const auto & trk : tracks) {
304374
375+ // track Selection
305376 if (!passedSingleTrackSelection (trk, collision))
306377 continue ;
307- if (!trk.passedTPCRefit ())
378+
379+ if (!mySelectionPrim.IsSelected (trk))
308380 continue ;
381+
309382 float signedP = trk.sign () * trk.tpcInnerParam ();
310383
311- // MIP for pions
384+ // MIP calibration for pions
312385 if (trk.tpcInnerParam () >= 0.35 && trk.tpcInnerParam () <= 0.45 ) {
313386 if (calibrationMode) {
314- registryDeDx.fill (HIST (" hdEdxMIP_vs_eta" ), trk.eta (), trk.tpcSignal ());
315- registryDeDx.fill (HIST (" hdEdxMIP_vs_phi" ), trk.phi (), trk.tpcSignal ());
387+ if (signedP < 0 ) {
388+ registryDeDx.fill (HIST (" hdEdx_vs_eta_Neg_Pi" ), trk.eta (), trk.tpcSignal ());
389+ } else {
390+ registryDeDx.fill (HIST (" hdEdx_vs_eta_Pos_Pi" ), trk.eta (), trk.tpcSignal ());
391+ }
392+
393+ } else {
394+ for (int i = 0 ; i < 8 ; ++i) {
395+ if (trk.eta () > EtaCut[i] && trk.eta () < EtaCut[i + 1 ]) {
396+ if (signedP < 0 ) {
397+ registryDeDx.fill (HIST (" hdEdx_vs_eta_Neg_calibrated_Pi" ), trk.eta (), trk.tpcSignal () * 50 / calibrationFactorNeg->at (i));
398+ } else {
399+ registryDeDx.fill (HIST (" hdEdx_vs_eta_Pos_calibrated_Pi" ), trk.eta (), trk.tpcSignal () * 50 / calibrationFactorPos->at (i));
400+ }
401+ }
402+ }
403+ }
404+ }
405+ // Beta from TOF
406+ if (signedP < 0 ) {
407+ registryDeDx.fill (HIST (" hbeta_vs_p_Neg" ), std::abs (signedP), trk.beta ());
408+ } else {
409+ registryDeDx.fill (HIST (" hbeta_vs_p_Pos" ), signedP, trk.beta ());
410+ }
411+ // Electrons from TOF
412+ if (std::abs (trk.beta () - 1 ) < 0.1 ) { // beta cut
413+ if (calibrationMode) {
414+ if (signedP < 0 ) {
415+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Neg_El" ), trk.eta (), trk.tpcSignal (), std::abs (signedP));
416+ } else {
417+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Pos_El" ), trk.eta (), trk.tpcSignal (), signedP);
418+ }
316419 } else {
317- registryDeDx.fill (HIST (" hdEdxMIP_vs_phi" ), trk.phi (), trk.tpcSignal ());
318420 for (int i = 0 ; i < 8 ; ++i) {
319421 if (trk.eta () > EtaCut[i] && trk.eta () < EtaCut[i + 1 ]) {
320- registryDeDx.fill (HIST (" hdEdxMIP_vs_eta_calibrated" ), trk.eta (), trk.tpcSignal () * 50 / calibrationFactor->at (i));
422+ if (signedP < 0 ) {
423+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Neg_calibrated_El" ), trk.eta (), trk.tpcSignal () * 50 / calibrationFactorNeg->at (i), std::abs (signedP));
424+ } else {
425+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Pos_calibrated_El" ), trk.eta (), trk.tpcSignal () * 50 / calibrationFactorPos->at (i), signedP);
426+ }
427+ }
428+ }
429+ }
430+ }
431+ // pions from TOF
432+ if (trk.beta () > 1 . && trk.beta () < 1.05 ) { // beta cut
433+ if (calibrationMode) {
434+ if (signedP < 0 ) {
435+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Neg_TOF" ), trk.eta (), trk.tpcSignal (), std::abs (signedP));
436+ } else {
437+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Pos_TOF" ), trk.eta (), trk.tpcSignal (), signedP);
438+ }
439+ } else {
440+ for (int i = 0 ; i < 8 ; ++i) {
441+ if (trk.eta () > EtaCut[i] && trk.eta () < EtaCut[i + 1 ]) {
442+ if (signedP < 0 ) {
443+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Neg_calibrated_TOF" ), trk.eta (), trk.tpcSignal () * 50 / calibrationFactorNeg->at (i), std::abs (signedP));
444+ } else {
445+ registryDeDx.fill (HIST (" hdEdx_vs_eta_vs_p_Pos_calibrated_TOF" ), trk.eta (), trk.tpcSignal () * 50 / calibrationFactorPos->at (i), signedP);
446+ }
321447 }
322448 }
323449 }
324450 }
325451
452+ registryDeDx.fill (HIST (" hdEdx_vs_phi" ), trk.phi (), trk.tpcSignal ());
453+
326454 if (!calibrationMode) {
327455 for (int i = 0 ; i < 8 ; ++i) {
328456 if (trk.eta () > EtaCut[i] && trk.eta () < EtaCut[i + 1 ]) {
329457 if (signedP > 0 ) {
330- registryDeDx.fill (HIST (kDedxvsMomentumPos [0 ]), signedP, trk.tpcSignal () * 50 / calibrationFactor ->at (i), trk.eta ());
458+ registryDeDx.fill (HIST (kDedxvsMomentumPos [0 ]), signedP, trk.tpcSignal () * 50 / calibrationFactorPos ->at (i), trk.eta ());
331459 } else {
332- registryDeDx.fill (HIST (kDedxvsMomentumNeg [0 ]), std::abs (signedP), trk.tpcSignal () * 50 / calibrationFactor ->at (i), trk.eta ());
460+ registryDeDx.fill (HIST (kDedxvsMomentumNeg [0 ]), std::abs (signedP), trk.tpcSignal () * 50 / calibrationFactorNeg ->at (i), trk.eta ());
333461 }
334462 }
335463 }
@@ -384,12 +512,10 @@ struct DedxAnalysis {
384512
385513 for (int i = 0 ; i < 8 ; ++i) {
386514 if (negTrack.eta () > EtaCut[i] && negTrack.eta () < EtaCut[i + 1 ]) {
387-
388- registryDeDx.fill (HIST (kDedxvsMomentumNeg [1 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactor->at (i), negTrack.eta ());
515+ registryDeDx.fill (HIST (kDedxvsMomentumNeg [1 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactorNeg->at (i), negTrack.eta ());
389516 }
390517 if (posTrack.eta () > EtaCut[i] && posTrack.eta () < EtaCut[i + 1 ]) {
391-
392- registryDeDx.fill (HIST (kDedxvsMomentumPos [1 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactor->at (i), posTrack.eta ());
518+ registryDeDx.fill (HIST (kDedxvsMomentumPos [1 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactorPos->at (i), posTrack.eta ());
393519 }
394520 }
395521 }
@@ -408,12 +534,10 @@ struct DedxAnalysis {
408534
409535 for (int i = 0 ; i < 8 ; ++i) {
410536 if (negTrack.eta () > EtaCut[i] && negTrack.eta () < EtaCut[i + 1 ]) {
411-
412- registryDeDx.fill (HIST (kDedxvsMomentumNeg [1 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactor->at (i), negTrack.eta ());
537+ registryDeDx.fill (HIST (kDedxvsMomentumNeg [1 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactorNeg->at (i), negTrack.eta ());
413538 }
414539 if (posTrack.eta () > EtaCut[i] && posTrack.eta () < EtaCut[i + 1 ]) {
415-
416- registryDeDx.fill (HIST (kDedxvsMomentumPos [2 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactor->at (i), posTrack.eta ());
540+ registryDeDx.fill (HIST (kDedxvsMomentumPos [2 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactorPos->at (i), posTrack.eta ());
417541 }
418542 }
419543 }
@@ -432,12 +556,10 @@ struct DedxAnalysis {
432556
433557 for (int i = 0 ; i < 8 ; ++i) {
434558 if (negTrack.eta () > EtaCut[i] && negTrack.eta () < EtaCut[i + 1 ]) {
435-
436- registryDeDx.fill (HIST (kDedxvsMomentumNeg [2 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactor->at (i), negTrack.eta ());
559+ registryDeDx.fill (HIST (kDedxvsMomentumNeg [2 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactorNeg->at (i), negTrack.eta ());
437560 }
438561 if (posTrack.eta () > EtaCut[i] && posTrack.eta () < EtaCut[i + 1 ]) {
439-
440- registryDeDx.fill (HIST (kDedxvsMomentumPos [1 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactor->at (i), posTrack.eta ());
562+ registryDeDx.fill (HIST (kDedxvsMomentumPos [1 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactorPos->at (i), posTrack.eta ());
441563 }
442564 }
443565 }
@@ -456,12 +578,10 @@ struct DedxAnalysis {
456578
457579 for (int i = 0 ; i < 8 ; ++i) {
458580 if (negTrack.eta () > EtaCut[i] && negTrack.eta () < EtaCut[i + 1 ]) {
459-
460- registryDeDx.fill (HIST (kDedxvsMomentumNeg [3 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactor->at (i), negTrack.eta ());
581+ registryDeDx.fill (HIST (kDedxvsMomentumNeg [3 ]), std::abs (signedPneg), negTrack.tpcSignal () * 50 / calibrationFactorNeg->at (i), negTrack.eta ());
461582 }
462583 if (posTrack.eta () > EtaCut[i] && posTrack.eta () < EtaCut[i + 1 ]) {
463-
464- registryDeDx.fill (HIST (kDedxvsMomentumPos [3 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactor->at (i), posTrack.eta ());
584+ registryDeDx.fill (HIST (kDedxvsMomentumPos [3 ]), signedPpos, posTrack.tpcSignal () * 50 / calibrationFactorPos->at (i), posTrack.eta ());
465585 }
466586 }
467587 }
0 commit comments