@@ -190,7 +190,7 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const
190190 requestedTables.emplace_back (route);
191191 }
192192 }
193-
193+ int level = originLevelMapping. empty () ? - 1 : 0 ;
194194 auto fileCounter = std::make_shared<int >(0 );
195195 auto numTF = std::make_shared<int >(-1 );
196196 return adaptStateless ([TFNumberHeader,
@@ -200,7 +200,7 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const
200200 numTF,
201201 watchdog,
202202 maxRate,
203- didir, reportTFN, reportTFFileName](Monitoring& monitoring, DataAllocator& outputs, ControlService& control, DeviceSpec const & device, DataProcessingStats& dpstats) {
203+ didir, reportTFN, reportTFFileName, level ](Monitoring& monitoring, DataAllocator& outputs, ControlService& control, DeviceSpec const & device, DataProcessingStats& dpstats) {
204204 // Each parallel reader device.inputTimesliceId reads the files fileCounter*device.maxInputTimeslices+device.inputTimesliceId
205205 // the TF to read is numTF
206206 assert (device.inputTimesliceId < device.maxInputTimeslices );
@@ -319,10 +319,10 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const
319319 // Check if the next timeframe is available or
320320 // if there are more files to be processed. If not, simply exit.
321321 ntf = *numTF + 1 ;
322- // first route with level 0
323- auto firstRoute = std::ranges::find_if (requestedTables, [&didir](auto const & route) {
322+ // first route with level 0 or -1 if no mapping requested
323+ auto firstRoute = std::ranges::find_if (requestedTables, [&didir,level ](auto const & route) {
324324 auto concrete = DataSpecUtils::asConcreteDataMatcher (route.matcher );
325- return didir->getLevelForOrigin (concrete.origin ) == 0 ;
325+ return didir->getLevelForOrigin (concrete.origin ) == level ;
326326 });
327327 auto concrete = DataSpecUtils::asConcreteDataMatcher (firstRoute->matcher );
328328 auto dh = header::DataHeader (concrete.description , concrete.origin , concrete.subSpec );
0 commit comments