@@ -20,10 +20,6 @@ using namespace o2;
2020using namespace o2 ::framework;
2121using namespace o2 ::framework::expressions;
2222
23- const int Np = 9 ;
24- const TString pN[Np] = {" El" , " Mu" , " Pi" , " Ka" , " Pr" , " De" , " Tr" , " He" , " Al" };
25- const TString pT[Np] = {" #mu" , " #pi" , " K" , " p" , " d" , " t" , " ^{3}He" , " #alpha" };
26-
2723void customize (std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2824{
2925 std::vector<ConfigParamSpec> options{
@@ -54,50 +50,20 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
5450 h->GetXaxis ()->Set (nbins, binp); \
5551 }
5652
57- struct TPCPIDQASignalwTOFTask {
58- HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
59-
60- void init (o2::framework::InitContext&)
61- {
62- for (int i = 0 ; i < Np; i++) {
63- histos.add (" signal/htpcsignal" + pN[i], " ;#it{p} (GeV/#it{c});TPC Signal;N_{#sigma}^{TPC}(" + pT[i] + " )" , kTH3D , {{1000 , 0.001 , 20 }, {1000 , 0 , 1000 }, {20 , -10 , 10 }});
64- makelogaxis (histos.get <TH3>(" hexp" + pN[i]));
65- }
66- }
67-
68- // Filters
69- CANDIDATE_SELECTION
70-
71- Filter trackFilterTOF = (aod::track::tofSignal > 0 ); // Skip tracks without TOF
72- using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTPC, aod::pidRespTOF, aod::TrackSelection>>;
73- void process (TrackCandidates::iterator const & track)
74- {
75- // const float mom = track.p();
76- const float mom = track.tpcInnerParam ();
77- histos.fill (" htpcsignalEl" , mom, track.tpcSignal (), track.tofNSigmaEl ());
78- histos.fill (" htpcsignalMu" , mom, track.tpcSignal (), track.tofNSigmaMu ());
79- histos.fill (" htpcsignalPi" , mom, track.tpcSignal (), track.tofNSigmaPi ());
80- histos.fill (" htpcsignalKa" , mom, track.tpcSignal (), track.tofNSigmaKa ());
81- histos.fill (" htpcsignalPr" , mom, track.tpcSignal (), track.tofNSigmaPr ());
82- histos.fill (" htpcsignalDe" , mom, track.tpcSignal (), track.tofNSigmaDe ());
83- histos.fill (" htpcsignalTr" , mom, track.tpcSignal (), track.tofNSigmaTr ());
84- histos.fill (" htpcsignalHe" , mom, track.tpcSignal (), track.tofNSigmaHe ());
85- histos.fill (" htpcsignalAl" , mom, track.tpcSignal (), track.tofNSigmaAl ());
86- }
87- };
88-
53+ constexpr int Np = 9 ;
8954struct TPCSpectraTask {
55+ static constexpr const char * pT[Np] = {" e" , " #mu" , " #pi" , " K" , " p" , " d" , " t" , " ^{3}He" , " #alpha" };
56+ static constexpr const char * hp[Np] = {" p/El" , " p/Mu" , " p/Pi" , " p/Ka" , " p/Pr" , " p/De" , " p/Tr" , " p/He" , " p/Al" };
57+ static constexpr const char * hpt[Np] = {" pt/El" , " pt/Mu" , " pt/Pi" , " pt/Ka" , " pt/Pr" , " pt/De" , " pt/Tr" , " pt/He" , " pt/Al" };
9058 HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
91- HistogramRegistry pt{" pt" , {}, OutputObjHandlingPolicy::AnalysisObject};
92- HistogramRegistry p{" pt" , {}, OutputObjHandlingPolicy::AnalysisObject};
9359
9460 void init (o2::framework::InitContext&)
9561 {
9662 histos.add (" p/Unselected" , " Unselected;#it{p} (GeV/#it{c})" , kTH1F , {{100 , 0 , 20 }});
9763 histos.add (" pt/Unselected" , " Unselected;#it{p}_{T} (GeV/#it{c})" , kTH1F , {{100 , 0 , 20 }});
9864 for (int i = 0 ; i < Np; i++) {
99- histos.add (" p/ " + pN [i], pT[i] + " ;#it{p} (GeV/#it{c})" , kTH1F , {{100 , 0 , 20 }});
100- histos.add (" pt/ " + pN [i], pT[i] + " ;#it{p}_{T} (GeV/#it{c})" , kTH1F , {{100 , 0 , 20 }});
65+ histos.add (hp [i], Form ( " %s ;#it{p} (GeV/#it{c})" , pT[i]) , kTH1F , {{100 , 0 , 20 }});
66+ histos.add (hpt [i], Form ( " %s ;#it{p}_{T} (GeV/#it{c})" , pT[i]) , kTH1F , {{100 , 0 , 20 }});
10167 }
10268 }
10369
@@ -112,18 +78,54 @@ struct TPCSpectraTask {
11278 const float nsigma[Np] = {track.tpcNSigmaEl (), track.tpcNSigmaMu (), track.tpcNSigmaPi (),
11379 track.tpcNSigmaKa (), track.tpcNSigmaPr (), track.tpcNSigmaDe (),
11480 track.tpcNSigmaTr (), track.tpcNSigmaHe (), track.tpcNSigmaAl ()};
115- p .fill (" Unselected" , track.p ());
116- pt .fill (" Unselected" , track.pt ());
81+ histos .fill (" p/ Unselected" , track.p ());
82+ histos .fill (" pt/ Unselected" , track.pt ());
11783 for (int i = 0 ; i < Np; i++) {
11884 if (abs (nsigma[i]) > nsigmacut.value ) {
11985 continue ;
12086 }
121- p .fill (pN [i], track.p ());
122- pt .fill (pN [i], track.pt ());
87+ histos .fill (hp [i], track.p ());
88+ histos .fill (hpt [i], track.pt ());
12389 }
12490 }
12591};
12692
93+ struct TPCPIDQASignalwTOFTask {
94+ static constexpr const char * pT[Np] = {" e" , " #mu" , " #pi" , " K" , " p" , " d" , " t" , " ^{3}He" , " #alpha" };
95+ static constexpr const char * htpcsignal[Np] = {" tpcsignal/El" , " tpcsignal/Mu" , " tpcsignal/Pi" ,
96+ " tpcsignal/Ka" , " tpcsignal/Pr" , " tpcsignal/De" ,
97+ " tpcsignal/Tr" , " tpcsignal/He" , " tpcsignal/Al" };
98+ HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
99+
100+ void init (o2::framework::InitContext&)
101+ {
102+ for (int i = 0 ; i < Np; i++) {
103+ histos.add (htpcsignal[i], Form (" ;#it{p} (GeV/#it{c});TPC Signal;N_{#sigma}^{TPC}(%s)" , pT[i]), kTH3D , {{1000 , 0.001 , 20 }, {1000 , 0 , 1000 }, {20 , -10 , 10 }});
104+ makelogaxis (histos.get <TH3>(htpcsignal[i]));
105+ }
106+ }
107+
108+ // Filters
109+ CANDIDATE_SELECTION
110+
111+ Filter trackFilterTOF = (aod::track::tofSignal > 0 .f); // Skip tracks without TOF
112+ using TrackCandidates = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::pidRespTPC, aod::pidRespTOF, aod::TrackSelection>>;
113+ void process (TrackCandidates::iterator const & track)
114+ {
115+ // const float mom = track.p();
116+ const float mom = track.tpcInnerParam ();
117+ histos.fill (htpcsignal[0 ], mom, track.tpcSignal (), track.tofNSigmaEl ());
118+ histos.fill (htpcsignal[1 ], mom, track.tpcSignal (), track.tofNSigmaMu ());
119+ histos.fill (htpcsignal[2 ], mom, track.tpcSignal (), track.tofNSigmaPi ());
120+ histos.fill (htpcsignal[3 ], mom, track.tpcSignal (), track.tofNSigmaKa ());
121+ histos.fill (htpcsignal[4 ], mom, track.tpcSignal (), track.tofNSigmaPr ());
122+ histos.fill (htpcsignal[5 ], mom, track.tpcSignal (), track.tofNSigmaDe ());
123+ histos.fill (htpcsignal[6 ], mom, track.tpcSignal (), track.tofNSigmaTr ());
124+ histos.fill (htpcsignal[7 ], mom, track.tpcSignal (), track.tofNSigmaHe ());
125+ histos.fill (htpcsignal[8 ], mom, track.tpcSignal (), track.tofNSigmaAl ());
126+ }
127+ };
128+
127129WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
128130{
129131 int TPCwTOF = cfgc.options ().get <int >(" add-tof-histos" );
0 commit comments