@@ -87,7 +87,8 @@ class TPCSectorCompletionPolicy
8787 return std::regex_match (device.name .begin (), device.name .end (), std::regex (expression.c_str ()));
8888 };
8989
90- auto callback = [bRequireAll = mRequireAll , inputMatchers = mInputMatchers , externalInputMatchers = mExternalInputMatchers ](framework::CompletionPolicy::InputSet inputs) -> framework::CompletionPolicy::CompletionOp {
90+ auto callback = [bRequireAll = mRequireAll , inputMatchers = mInputMatchers , externalInputMatchers = mExternalInputMatchers , pTpcSectorMask = mTpcSectorMask ](framework::CompletionPolicy::InputSet inputs) -> framework::CompletionPolicy::CompletionOp {
91+ unsigned long tpcSectorMask = pTpcSectorMask ? *pTpcSectorMask : 0xFFFFFFFFF ;
9192 std::bitset<NSectors> validSectors = 0 ;
9293 bool haveMatchedInput = false ;
9394 uint64_t activeSectors = 0 ;
@@ -126,8 +127,8 @@ class TPCSectorCompletionPolicy
126127 if (sectorHeader == nullptr ) {
127128 throw std::runtime_error (" TPC sector header missing on header stack" );
128129 }
129- activeSectors |= sectorHeader->activeSectors ;
130- validSectors |= sectorHeader->sectorBits ;
130+ activeSectors |= ( sectorHeader->activeSectors & tpcSectorMask) ;
131+ validSectors |= ( sectorHeader->sectorBits & tpcSectorMask) ;
131132 break ;
132133 }
133134 }
@@ -141,8 +142,8 @@ class TPCSectorCompletionPolicy
141142 if (sectorHeader == nullptr ) {
142143 throw std::runtime_error (" TPC sector header missing on header stack" );
143144 }
144- activeSectors |= sectorHeader->activeSectors ;
145- validSectorsExternal[idx] |= sectorHeader->sectorBits ;
145+ activeSectors |= ( sectorHeader->activeSectors & tpcSectorMask) ;
146+ validSectorsExternal[idx] |= ( sectorHeader->sectorBits & tpcSectorMask) ;
146147 break ;
147148 }
148149 }
@@ -208,6 +209,8 @@ class TPCSectorCompletionPolicy
208209 }
209210 } else if constexpr (std::is_same<Type, std::vector<o2::framework::InputSpec>*>::value) {
210211 mExternalInputMatchers = arg;
212+ } else if constexpr (std::is_same<Type, unsigned long *>::value) {
213+ mTpcSectorMask = arg;
211214 } else {
212215 static_assert (framework::always_static_assert_v<Type>);
213216 }
@@ -222,6 +225,7 @@ class TPCSectorCompletionPolicy
222225 // - They are controlled externally and the external entity can modify them, e.g. after parsing command line arguments.
223226 // - They are all matched independently, it is not sufficient that one of them is present for all sectors
224227 const std::vector<framework::InputSpec>* mExternalInputMatchers = nullptr ;
228+ unsigned long * mTpcSectorMask = nullptr ;
225229 bool mRequireAll = false ;
226230};
227231} // namespace tpc
0 commit comments