@@ -85,6 +85,11 @@ struct derivedlambdakzeroanalysis {
8585 // original equation: lArmPt*5>TMath::Abs(lArmAlpha)
8686 Configurable<float > armPodCut{" armPodCut" , 5 .0f , " pT * (cut) > |alpha|, AP cut. Negative: no cut" };
8787
88+ // Track quality
89+ Configurable<int > minTPCrows{" minTPCrows" , 70 , " minimum TPC crossed rows" };
90+ Configurable<bool > requirePosITSonly{" requirePosITSonly" , false , " require that positive track is ITSonly (overrides TPC quality)" };
91+ Configurable<bool > requireNegITSonly{" requireNegITSonly" , false , " require that negative track is ITSonly (overrides TPC quality)" };
92+
8893 // PID (TPC)
8994 Configurable<float > TpcPidNsigmaCut{" TpcPidNsigmaCut" , 5 , " TpcPidNsigmaCut" };
9095
@@ -131,25 +136,30 @@ struct derivedlambdakzeroanalysis {
131136 selK0ShortCTau,
132137 selLambdaCTau,
133138 selK0ShortArmenteros,
139+ selPosGoodTPCTrack,
140+ selNegGoodTPCTrack,
141+ selPosItsOnly,
142+ selNegItsOnly,
134143 selConsiderK0Short, // for mc tagging
135144 selConsiderLambda, // for mc tagging
136145 selConsiderAntiLambda // for mc tagging
137- }; // all bits used
146+ };
138147
139- uint16_t maskTopological;
140- uint16_t maskTopoNoV0Radius;
141- uint16_t maskTopoNoDCANegToPV;
142- uint16_t maskTopoNoDCAPosToPV;
143- uint16_t maskTopoNoCosPA;
144- uint16_t maskTopoNoDCAV0Dau;
148+ uint32_t maskTopological;
149+ uint32_t maskTopoNoV0Radius;
150+ uint32_t maskTopoNoDCANegToPV;
151+ uint32_t maskTopoNoDCAPosToPV;
152+ uint32_t maskTopoNoCosPA;
153+ uint32_t maskTopoNoDCAV0Dau;
154+ uint32_t maskTrackTypes;
145155
146- uint16_t maskK0ShortSpecific;
147- uint16_t maskLambdaSpecific;
148- uint16_t maskAntiLambdaSpecific;
156+ uint32_t maskK0ShortSpecific;
157+ uint32_t maskLambdaSpecific;
158+ uint32_t maskAntiLambdaSpecific;
149159
150- uint16_t maskSelectionK0Short;
151- uint16_t maskSelectionLambda;
152- uint16_t maskSelectionAntiLambda;
160+ uint32_t maskSelectionK0Short;
161+ uint32_t maskSelectionLambda;
162+ uint32_t maskSelectionAntiLambda;
153163
154164 void init (InitContext const &)
155165 {
@@ -161,13 +171,25 @@ struct derivedlambdakzeroanalysis {
161171 maskTopoNoCosPA = (1 << selRadius) | (1 << selDCANegToPV) | (1 << selDCAPosToPV) | (1 << selDCAV0Dau);
162172 maskTopoNoDCAV0Dau = (1 << selCosPA) | (1 << selRadius) | (1 << selDCANegToPV) | (1 << selDCAPosToPV);
163173
174+ maskTrackTypes = 0 ;
175+ if (requirePosITSonly) {
176+ maskTrackTypes = (1 << selPosItsOnly);
177+ } else {
178+ maskTrackTypes = (1 << selPosGoodTPCTrack);
179+ }
180+ if (requireNegITSonly) {
181+ maskTrackTypes = (1 << selNegItsOnly);
182+ } else {
183+ maskTrackTypes = (1 << selNegGoodTPCTrack);
184+ }
185+
164186 maskK0ShortSpecific = (1 << selK0ShortRapidity) | (1 << selK0ShortTPC) | (1 << selK0ShortCTau) | (1 << selK0ShortArmenteros) | (1 << selConsiderK0Short);
165187 maskLambdaSpecific = (1 << selLambdaRapidity) | (1 << selLambdaTPC) | (1 << selLambdaCTau) | (1 << selConsiderLambda);
166188 maskAntiLambdaSpecific = (1 << selLambdaRapidity) | (1 << selAntiLambdaTPC) | (1 << selLambdaCTau) | (1 << selConsiderAntiLambda);
167189
168- maskSelectionK0Short = maskTopological | maskK0ShortSpecific;
169- maskSelectionLambda = maskTopological | maskLambdaSpecific;
170- maskSelectionAntiLambda = maskTopological | maskAntiLambdaSpecific;
190+ maskSelectionK0Short = maskTopological | maskTrackTypes | maskK0ShortSpecific;
191+ maskSelectionLambda = maskTopological | maskTrackTypes | maskLambdaSpecific;
192+ maskSelectionAntiLambda = maskTopological | maskTrackTypes | maskAntiLambdaSpecific;
171193
172194 // Event Counters
173195 histos.add (" hEventSelection" , " hEventSelection" , kTH1F , {{3 , -0 .5f , +2 .5f }});
@@ -238,10 +260,10 @@ struct derivedlambdakzeroanalysis {
238260 }
239261
240262 template <typename TV0, typename TCollision>
241- uint16_t computeReconstructionBitmap (TV0 v0, TCollision collision)
263+ uint32_t computeReconstructionBitmap (TV0 v0, TCollision collision)
242264 // precalculate this information so that a check is one mask operation, not many
243265 {
244- uint16_t bitMap = 0 ;
266+ uint32_t bitMap = 0 ;
245267 // Base topological variables
246268 if (v0.v0radius () > v0radius)
247269 bitset (bitMap, selRadius);
@@ -268,6 +290,21 @@ struct derivedlambdakzeroanalysis {
268290 if (compatibleTPC (v0, spAntiLambda))
269291 bitset (bitMap, selAntiLambdaTPC);
270292
293+ auto posTrackExtra = v0.template posTrackExtra_as <dauTracks>();
294+ auto negTrackExtra = v0.template negTrackExtra_as <dauTracks>();
295+
296+ // TPC quality
297+ if (posTrackExtra.tpcCrossedRows () >= minTPCrows)
298+ bitset (bitMap, selPosGoodTPCTrack);
299+ if (negTrackExtra.tpcCrossedRows () >= minTPCrows)
300+ bitset (bitMap, selNegGoodTPCTrack);
301+
302+ // ITS only tag
303+ if (posTrackExtra.tpcCrossedRows () < 1 )
304+ bitset (bitMap, selPosItsOnly);
305+ if (negTrackExtra.tpcCrossedRows () < 1 )
306+ bitset (bitMap, selNegItsOnly);
307+
271308 // proper lifetime
272309 if (v0.distovertotmom (collision.posX (), collision.posY (), collision.posZ ()) * o2::constants::physics::MassLambda0 < lifetimecut->get (" lifetimecutLambda" ))
273310 bitset (bitMap, selLambdaCTau);
@@ -282,10 +319,10 @@ struct derivedlambdakzeroanalysis {
282319 }
283320
284321 template <typename TV0>
285- uint16_t computeMCAssociation (TV0 v0)
322+ uint32_t computeMCAssociation (TV0 v0)
286323 // precalculate this information so that a check is one mask operation, not many
287324 {
288- uint16_t bitMap = 0 ;
325+ uint32_t bitMap = 0 ;
289326 // check for specific particle species
290327
291328 if (v0.pdgCode () == 310 && v0.pdgCodePositive () == 211 && v0.pdgCodeNegative () == -211 && v0.isPhysicalPrimary ()) {
@@ -300,13 +337,13 @@ struct derivedlambdakzeroanalysis {
300337 return bitMap;
301338 }
302339
303- bool verifyMask (uint16_t bitmap, uint16_t mask)
340+ bool verifyMask (uint32_t bitmap, uint32_t mask)
304341 {
305342 return (bitmap & mask) == mask;
306343 }
307344
308345 template <typename TV0, typename TCollision>
309- void analyseCandidate (TV0 v0, TCollision collision, uint16_t selMap)
346+ void analyseCandidate (TV0 v0, TCollision collision, uint32_t selMap)
310347 // precalculate this information so that a check is one mask operation, not many
311348 {
312349 // __________________________________________
@@ -391,7 +428,7 @@ struct derivedlambdakzeroanalysis {
391428 // fill AP plot for all V0s
392429 histos.fill (HIST (" GeneralQA/h2dArmenterosAll" ), v0.alpha (), v0.qtarm ());
393430
394- uint16_t selMap = computeReconstructionBitmap (v0, collision);
431+ uint32_t selMap = computeReconstructionBitmap (v0, collision);
395432
396433 // consider for histograms for all species
397434 selMap = selMap | (1 << selConsiderK0Short) | (1 << selConsiderLambda) | (1 << selConsiderAntiLambda);
@@ -425,7 +462,7 @@ struct derivedlambdakzeroanalysis {
425462 // fill AP plot for all V0s
426463 histos.fill (HIST (" GeneralQA/h2dArmenterosAll" ), v0.alpha (), v0.qtarm ());
427464
428- uint16_t selMap = computeReconstructionBitmap (v0, collision);
465+ uint32_t selMap = computeReconstructionBitmap (v0, collision);
429466
430467 // consider only associated candidates if asked to do so
431468 if (doMCAssociation) {
0 commit comments