@@ -69,6 +69,43 @@ struct tpcPidQaSignal {
6969 histos.print ();
7070 }
7171
72+ template <typename T>
73+ bool isTrackSelected (const T& track)
74+ {
75+ if (t.itsNCls () < 6 ) {
76+ return false ;
77+ }
78+ if (t.tpcNClsFindable () <= 0 ) {
79+ return false ;
80+ }
81+ if (t.tpcNClsFound () < minTPCNcls) {
82+ return false ;
83+ }
84+ if (t.tpcCrossedRowsOverFindableCls () < 0 .8f ) {
85+ return false ;
86+ }
87+ if (t.tpcNClsCrossedRows () < minNClsCrossedRows) {
88+ return false ;
89+ }
90+ switch (trdSelection) {
91+ case 0 :
92+ break ;
93+ case -1 :
94+ if (t.hasTRD ()) {
95+ return false ;
96+ }
97+ break ;
98+ case 1 :
99+ if (!t.hasTRD ()) {
100+ return false ;
101+ }
102+ break ;
103+ default :
104+ LOG (fatal) << " Invalid TRD selection" ;
105+ }
106+ return true ;
107+ }
108+
72109 Filter trackFilterEta = (nabs(aod::track::eta) < 0 .8f );
73110 Filter trackFilterITS = (aod::track::itsChi2NCl < 36 .f);
74111 Filter trackFilterTPC = ((aod::track::tpcChi2NCl < 4 .f));
@@ -95,19 +132,7 @@ struct tpcPidQaSignal {
95132 histos.fill (HIST (" event/vertexz" ), collision.posZ ());
96133
97134 for (const auto & t : tracks) {
98- if (t.itsNCls () < 6 ) {
99- continue ;
100- }
101- if (t.tpcNClsFindable () <= 0 ) {
102- continue ;
103- }
104- if (t.tpcNClsFound () < minTPCNcls) {
105- continue ;
106- }
107- if (t.tpcCrossedRowsOverFindableCls () < 0 .8f ) {
108- continue ;
109- }
110- if (t.tpcNClsCrossedRows () < minNClsCrossedRows) {
135+ if (!isTrackSelected (t)) {
111136 continue ;
112137 }
113138 switch (trdSelection) {
@@ -158,37 +183,10 @@ struct tpcPidQaSignal {
158183 histos.fill (HIST (" event/vertexz" ), collision.posZ ());
159184
160185 for (const auto & t : tracks) {
161- if (t.itsNCls () < 6 ) {
162- continue ;
163- }
164- if (t.tpcNClsFindable () <= 0 ) {
165- continue ;
166- }
167- if (t.tpcNClsFound () < minTPCNcls) {
168- continue ;
169- }
170- if (t.tpcCrossedRowsOverFindableCls () < 0 .8f ) {
186+ if (!isTrackSelected (t)) {
171187 continue ;
172188 }
173- if (t.tpcNClsCrossedRows () < minNClsCrossedRows) {
174- continue ;
175- }
176- switch (trdSelection) {
177- case 0 :
178- break ;
179- case -1 :
180- if (t.hasTRD ()) {
181- continue ;
182- }
183- break ;
184- case 1 :
185- if (!t.hasTRD ()) {
186- continue ;
187- }
188- break ;
189- default :
190- LOG (fatal) << " Invalid TRD selection" ;
191- }
189+
192190 hdedx->Fill (t.tpcInnerParam (), t.tpcSignal (), t.sign ());
193191 if (enabledEdxPerID) {
194192 hdedx_perID[t.pidForTracking ()]->Fill (t.tpcInnerParam (), t.tpcSignal (), t.sign ());
0 commit comments