@@ -165,10 +165,8 @@ struct itsPidQa {
165165 ConfigurableAxis avClsBins{" avClsBins" , {200 , 0 , 20 }, " Binning in average cluster size" };
166166 Configurable<int > trackSelection{" trackSelection" , 1 , " Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks" };
167167 Configurable<bool > applyRapidityCut{" applyRapidityCut" , false , " Flag to apply rapidity cut" };
168- Configurable<bool > enableDeDxPlot{" enableDeDxPlot" , true , " Enables the dEdx plot (reduces memory footprint if off)" };
169168 Configurable<int16_t > minTPCNcls{" minTPCNcls" , 0 , " Minimum number or TPC Clusters for tracks" };
170169 ConfigurableAxis tpcNclsBins{" tpcNclsBins" , {16 , 0 , 160 }, " Binning in number of clusters in TPC" };
171- Configurable<bool > fillTHnSparses{" fillTHnSparses" , false , " Flag to fill multidimensional histograms for nsigma vs pt, eta, Ncls" };
172170
173171 template <typename TrackType>
174172 float averageClusterSizeTrk (const TrackType& track)
@@ -196,7 +194,6 @@ struct itsPidQa {
196194 ptAxis.makeLogarithmic ();
197195 pAxis.makeLogarithmic ();
198196 }
199- const AxisSpec chargeAxis{2 , -2 .f , 2 .f , " Charge" };
200197 const AxisSpec avClsAxis{avClsBins, " <ITS Cls. Size>" };
201198 const AxisSpec avClsEffAxis{avClsBins, " <ITS Cls. Size> / cosh(#eta)" };
202199
@@ -253,8 +250,8 @@ struct itsPidQa {
253250 histos.print ();
254251 }
255252
256- Filter eventFilter = (o2::aod::evsel::sel8 == true );
257- Filter trackFilter = (requireGlobalTrackInFilter());
253+ Filter eventFilter = (o2::aod::evsel::sel8 == true && nabs(o2::aod::collision::posZ) < 10 .f );
254+ // Filter trackFilter = (requireGlobalTrackInFilter());
258255 using CollisionCandidate = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels>>::iterator;
259256 using TrackCandidates = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection,
260257 aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi,
@@ -264,29 +261,22 @@ struct itsPidQa {
264261 aod::pidTOFKa, aod::pidTOFPr, aod::pidTOFDe,
265262 aod::pidTOFTr, aod::pidTOFHe, aod::pidTOFAl>;
266263 void process (CollisionCandidate const & collision,
267- soa::Filtered< TrackCandidates> const & tracks)
264+ TrackCandidates const & tracks)
268265 {
269266 auto tracksWithPid = soa::Attach<TrackCandidates,
270267 aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaMu, aod::pidits::ITSNSigmaPi,
271268 aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr, aod::pidits::ITSNSigmaDe,
272269 aod::pidits::ITSNSigmaTr, aod::pidits::ITSNSigmaHe, aod::pidits::ITSNSigmaAl>(tracks);
273270
274- histos.fill (HIST (" event/evsel" ), 1 );
275- if (!collision.sel8 ()) {
276- return ;
271+ if (tracks.size () != tracksWithPid.size ()) {
272+ LOG (fatal) << " Mismatch in track table size!" << tracks.size () << " vs " << tracksWithPid.size ();
277273 }
278-
274+ histos. fill ( HIST ( " event/evsel " ), 1 );
279275 histos.fill (HIST (" event/evsel" ), 2 );
280-
281- if (std::abs (collision.posZ ()) > 10 .f ) {
282- return ;
283- }
284276 histos.fill (HIST (" event/evsel" ), 3 );
285277 histos.fill (HIST (" event/vertexz" ), collision.posZ ());
286278
287- int nTracks = -1 ;
288279 for (const auto & track : tracksWithPid) {
289- nTracks++;
290280 histos.fill (HIST (" event/trackselection" ), 1 .f );
291281 if (!track.isGlobalTrack ()) { // Skipping non global tracks
292282 continue ;
@@ -312,23 +302,28 @@ struct itsPidQa {
312302 histos.fill (HIST (" event/length" ), track.length ());
313303 histos.fill (HIST (" event/pt" ), track.pt ());
314304 histos.fill (HIST (" event/p" ), track.p ());
315- const auto & t = tracks.iteratorAt (nTracks);
316- histos.fill (HIST (" event/averageClusterSize" ), track.pt (), averageClusterSizeTrk (track));
317- histos.fill (HIST (" event/averageClusterSizePerCoslInv" ), track.pt (), averageClusterSizePerCoslInv (track));
305+ histos.fill (HIST (" event/averageClusterSize" ), track.p (), averageClusterSizeTrk (track));
306+ histos.fill (HIST (" event/averageClusterSizePerCoslInv" ), track.p (), averageClusterSizePerCoslInv (track));
318307 bool discard = false ;
319308 for (int id = 0 ; id < 9 ; id++) {
320309 if (std::abs (nsigmaTPC (track, id)) > tpcSelValues[id]) {
310+ LOG (debug) << " Discarding based on TPC hypothesis " << id << " " << std::abs (nsigmaTPC (track, id)) << " >" << tpcSelValues[id];
321311 discard = true ;
312+ break ;
322313 }
323- if (std::abs (nsigmaTOF (track, id)) > tofSelValues[id]) {
324- discard = true ;
314+ if (track.hasTOF ()) {
315+ if (std::abs (nsigmaTOF (track, id)) > tofSelValues[id]) {
316+ LOG (debug) << " Discarding based on TOF hypothesis " << id << " " << std::abs (nsigmaTOF (track, id)) << " >" << tofSelValues[id];
317+ discard = true ;
318+ break ;
319+ }
325320 }
326321 }
327322 if (discard) {
328323 continue ;
329324 }
330- histos.fill (HIST (" event/SelectedAverageClusterSize" ), track.pt (), averageClusterSizeTrk (track));
331- histos.fill (HIST (" event/SelectedAverageClusterSizePerCoslInv" ), track.pt (), averageClusterSizePerCoslInv (track));
325+ histos.fill (HIST (" event/SelectedAverageClusterSize" ), track.p (), averageClusterSizeTrk (track));
326+ histos.fill (HIST (" event/SelectedAverageClusterSizePerCoslInv" ), track.p (), averageClusterSizePerCoslInv (track));
332327
333328 for (o2::track::PID::ID id = 0 ; id <= o2::track::PID::Last; id++) {
334329 if (!enableParticle[id]) {
@@ -340,10 +335,10 @@ struct itsPidQa {
340335 }
341336 }
342337 const float nsigma = nsigmaITS (track, id);
343- if (t .sign () > 0 ) {
344- hNsigmaPos[id]->Fill (t. p (), nsigma);
338+ if (track .sign () > 0 ) {
339+ hNsigmaPos[id]->Fill (track. pt (), nsigma);
345340 } else {
346- hNsigmaNeg[id]->Fill (t. p (), nsigma);
341+ hNsigmaNeg[id]->Fill (track. pt (), nsigma);
347342 }
348343 }
349344 }
0 commit comments