@@ -64,6 +64,7 @@ struct ConfCollisionFilters : o2::framework::ConfigurableGroup {
6464
6565struct ConfCollisionBits : o2::framework::ConfigurableGroup {
6666 std::string prefix = std::string(" CollisionBits" );
67+ o2::framework::Configurable<bool > passThrough{" passThrough" , false , " If true, all tracks are passed through. Bits for all selections are stored." };
6768 o2::framework::Configurable<int > sel8{" sel8" , 1 , " Use sel8 (-1: stored in bitmaks; 0 off; 1 on)" };
6869 o2::framework::Configurable<int > noSameBunchPileup{" noSameBunchPileup" , 0 , " Reject collisions in case of pileup with another collision in the same foundBC (-1: stored in bitmaks; 0 off; 1 on)" };
6970 o2::framework::Configurable<int > isVertexItsTpc{" isVertexItsTpc" , 0 , " At least one ITS-TPC track found for the vertex (-1: stored in bitmaks; 0 off; 1 on)" };
@@ -175,7 +176,7 @@ class CollisionSelection : public BaseSelection<float, o2::aod::femtodatatypes::
175176 template <typename T1, typename T2>
176177 void configure (o2::framework::HistogramRegistry* registry, T1 const & filter, T2 const & config)
177178 {
178- // cuts
179+ // filters
179180 mVtxZMin = filter.vtxZMin .value ;
180181 mVtxZMax = filter.vtxZMax .value ;
181182 mMagFieldMin = filter.magFieldMin .value ;
@@ -187,26 +188,48 @@ class CollisionSelection : public BaseSelection<float, o2::aod::femtodatatypes::
187188 mSphericityMin = filter.sphericityMin .value ;
188189 mSphericityMax = filter.sphericityMax .value ;
189190
190- // flags
191- this ->addSelection (kSel8 , collisionSelectionNames.at (kSel8 ), config.sel8 .value );
192- this ->addSelection (kNoSameBunchPileUp , collisionSelectionNames.at (kNoSameBunchPileUp ), config.noSameBunchPileup .value );
193- this ->addSelection (kIsGoodZvtxFt0VsPv , collisionSelectionNames.at (kIsGoodZvtxFt0VsPv ), config.isGoodZvtxFt0VsPv .value );
194- this ->addSelection (kNoCollInTimeRangeNarrow , collisionSelectionNames.at (kNoCollInTimeRangeNarrow ), config.noCollInTimeRangeNarrow .value );
195- this ->addSelection (kNoCollInTimeRangeStrict , collisionSelectionNames.at (kNoCollInTimeRangeStrict ), config.noCollInTimeRangeStrict .value );
196- this ->addSelection (kNoCollInTimeRangeStandard , collisionSelectionNames.at (kNoCollInTimeRangeStandard ), config.noCollInTimeRangeStandard .value );
197- this ->addSelection (kNoCollInRofStrict , collisionSelectionNames.at (kNoCollInRofStrict ), config.noCollInRofStrict .value );
198- this ->addSelection (kNoCollInRofStandard , collisionSelectionNames.at (kNoCollInRofStandard ), config.noCollInRofStandard .value );
199- this ->addSelection (kNoHighMultCollInPrevRof , collisionSelectionNames.at (kNoHighMultCollInPrevRof ), config.noHighMultCollInPrevRof .value );
200- this ->addSelection (kIsGoodItsLayer3 , collisionSelectionNames.at (kIsGoodItsLayer3 ), config.isGoodItsLayer3 .value );
201- this ->addSelection (kIsGoodItsLayer0123 , collisionSelectionNames.at (kIsGoodItsLayer0123 ), config.isGoodItsLayer0123 .value );
202- this ->addSelection (kIsGoodItsLayersAll , collisionSelectionNames.at (kIsGoodItsLayersAll ), config.isGoodItsLayersAll .value );
203- this ->addSelection (kOccupancyMin , collisionSelectionNames.at (kOccupancyMin ), config.occupancyMin .value , limits::kLowerLimit , true , true , false );
204- this ->addSelection (kOccupancyMax , collisionSelectionNames.at (kOccupancyMax ), config.occupancyMax .value , limits::kUpperLimit , true , true , false );
205- this ->addSelection (kSphericityMin , collisionSelectionNames.at (kSphericityMin ), config.sphericityMin .value , limits::kLowerLimit , true , true , false );
206- this ->addSelection (kSphericityMax , collisionSelectionNames.at (kSphericityMax ), config.sphericityMax .value , limits::kUpperLimit , true , true , false );
191+ // if pass through mode is activated, each cut is neutral (i.e. neither minimal nor optional and we do store all bits, so the most permissive bit is not skipped for minimal selections)
192+ mPassThrough = config.passThrough .value ;
193+
194+ if (mPassThrough ) {
195+ this ->addSelection (kSel8 , collisionSelectionNames.at (kSel8 ), 2 );
196+ this ->addSelection (kNoSameBunchPileUp , collisionSelectionNames.at (kNoSameBunchPileUp ), 2 );
197+ this ->addSelection (kIsGoodZvtxFt0VsPv , collisionSelectionNames.at (kIsGoodZvtxFt0VsPv ), 2 );
198+ this ->addSelection (kNoCollInTimeRangeNarrow , collisionSelectionNames.at (kNoCollInTimeRangeNarrow ), 2 );
199+ this ->addSelection (kNoCollInTimeRangeStrict , collisionSelectionNames.at (kNoCollInTimeRangeStrict ), 2 );
200+ this ->addSelection (kNoCollInTimeRangeStandard , collisionSelectionNames.at (kNoCollInTimeRangeStandard ), 2 );
201+ this ->addSelection (kNoCollInRofStrict , collisionSelectionNames.at (kNoCollInRofStrict ), 2 );
202+ this ->addSelection (kNoCollInRofStandard , collisionSelectionNames.at (kNoCollInRofStandard ), 2 );
203+ this ->addSelection (kNoHighMultCollInPrevRof , collisionSelectionNames.at (kNoHighMultCollInPrevRof ), 2 );
204+ this ->addSelection (kIsGoodItsLayer3 , collisionSelectionNames.at (kIsGoodItsLayer3 ), 2 );
205+ this ->addSelection (kIsGoodItsLayer0123 , collisionSelectionNames.at (kIsGoodItsLayer0123 ), 2 );
206+ this ->addSelection (kIsGoodItsLayersAll , collisionSelectionNames.at (kIsGoodItsLayersAll ), 2 );
207+ } else {
208+ this ->addSelection (kSel8 , collisionSelectionNames.at (kSel8 ), config.sel8 .value );
209+ this ->addSelection (kNoSameBunchPileUp , collisionSelectionNames.at (kNoSameBunchPileUp ), config.noSameBunchPileup .value );
210+ this ->addSelection (kIsGoodZvtxFt0VsPv , collisionSelectionNames.at (kIsGoodZvtxFt0VsPv ), config.isGoodZvtxFt0VsPv .value );
211+ this ->addSelection (kNoCollInTimeRangeNarrow , collisionSelectionNames.at (kNoCollInTimeRangeNarrow ), config.noCollInTimeRangeNarrow .value );
212+ this ->addSelection (kNoCollInTimeRangeStrict , collisionSelectionNames.at (kNoCollInTimeRangeStrict ), config.noCollInTimeRangeStrict .value );
213+ this ->addSelection (kNoCollInTimeRangeStandard , collisionSelectionNames.at (kNoCollInTimeRangeStandard ), config.noCollInTimeRangeStandard .value );
214+ this ->addSelection (kNoCollInRofStrict , collisionSelectionNames.at (kNoCollInRofStrict ), config.noCollInRofStrict .value );
215+ this ->addSelection (kNoCollInRofStandard , collisionSelectionNames.at (kNoCollInRofStandard ), config.noCollInRofStandard .value );
216+ this ->addSelection (kNoHighMultCollInPrevRof , collisionSelectionNames.at (kNoHighMultCollInPrevRof ), config.noHighMultCollInPrevRof .value );
217+ this ->addSelection (kIsGoodItsLayer3 , collisionSelectionNames.at (kIsGoodItsLayer3 ), config.isGoodItsLayer3 .value );
218+ this ->addSelection (kIsGoodItsLayer0123 , collisionSelectionNames.at (kIsGoodItsLayer0123 ), config.isGoodItsLayer0123 .value );
219+ this ->addSelection (kIsGoodItsLayersAll , collisionSelectionNames.at (kIsGoodItsLayersAll ), config.isGoodItsLayersAll .value );
220+ }
221+
222+ const bool isMinimalCut = mPassThrough ? false : true ;
223+ const bool isOptionalCut = mPassThrough ? false : true ;
224+ const bool skipMostPermissiveBit = mPassThrough ? false : true ;
225+
226+ this ->addSelection (kOccupancyMin , collisionSelectionNames.at (kOccupancyMin ), config.occupancyMin .value , limits::kLowerLimit , skipMostPermissiveBit, isMinimalCut, false );
227+ this ->addSelection (kOccupancyMax , collisionSelectionNames.at (kOccupancyMax ), config.occupancyMax .value , limits::kUpperLimit , skipMostPermissiveBit, isMinimalCut, false );
228+ this ->addSelection (kSphericityMin , collisionSelectionNames.at (kSphericityMin ), config.sphericityMin .value , limits::kLowerLimit , skipMostPermissiveBit, isMinimalCut, false );
229+ this ->addSelection (kSphericityMax , collisionSelectionNames.at (kSphericityMax ), config.sphericityMax .value , limits::kUpperLimit , skipMostPermissiveBit, isMinimalCut, false );
207230
208231 std::vector<float > triggerValues (config.triggers .value .size (), 1 .f );
209- this ->addSelection (kTriggers , collisionSelectionNames.at (kTriggers ), triggerValues, limits::kEqualArray , false , false , true );
232+ this ->addSelection (kTriggers , collisionSelectionNames.at (kTriggers ), triggerValues, limits::kEqualArray , false , false , isOptionalCut );
210233 this ->addComments (kTriggers , config.triggers .value );
211234
212235 this ->setupContainers <HistName>(registry);
@@ -311,6 +334,8 @@ class CollisionSelection : public BaseSelection<float, o2::aod::femtodatatypes::
311334 this ->assembleBitmask <HistName>();
312335 };
313336
337+ bool passThroughAllCollisions () const { return mPassThrough ; }
338+
314339 protected:
315340 template <typename T>
316341 float computeSphericity (T const & tracks)
@@ -361,6 +386,8 @@ class CollisionSelection : public BaseSelection<float, o2::aod::femtodatatypes::
361386 float mSphericity = 0 .f;
362387 float mCentrality = 0 .f;
363388 float mMultiplicity = 0 .f;
389+
390+ bool mPassThrough = false ;
364391};
365392
366393struct CollisionBuilderProducts : o2::framework::ProducesGroup {
@@ -477,6 +504,11 @@ class CollisionBuilder
477504 template <typename T1>
478505 bool checkCollision (T1 const & col)
479506 {
507+
508+ if (mCollisionSelection .passThroughAllCollisions ()) {
509+ return true ;
510+ }
511+
480512 // check RCT flags first
481513 if (mUseRctFlags ) {
482514 if (!mRctFlagsChecker (col)) {
0 commit comments