3535#include < string>
3636#include < vector>
3737
38+ #include " Framework/DataSpecUtils.h"
3839#include " Framework/runDataProcessing.h"
3940#include " Framework/AnalysisTask.h"
4041#include " Framework/AnalysisDataModel.h"
@@ -486,6 +487,7 @@ struct StrangenessBuilder {
486487 LOGF (info, " Configuring tables to generate" );
487488 auto & workflows = context.services ().get <RunningWorkflowInfo const >();
488489
490+ TString listOfRequestors[nTables];
489491 for (int i = 0 ; i < nTables; i++) {
490492 // adjust bookkeeping histogram
491493 h->GetXaxis ()->SetBinLabel (i + 1 , tableNames[i].c_str ());
@@ -503,9 +505,17 @@ struct StrangenessBuilder {
503505 for (auto const & input : device.inputs ) {
504506 if (device.name .compare (" strangenessbuilder-initializer" ) == 0 )
505507 continue ; // don't listen to the initializer
506- if (input.matcher .binding == tableNames[i]) {
507- LOGF (info, " Device %s has subscribed to %s" , device.name , tableNames[i]);
508- mEnabledTables [i] = 1 ;
508+ if (DataSpecUtils::partialMatch (input.matcher , o2::header::DataOrigin (" AOD" ))) {
509+ auto && [origin, description, version] = DataSpecUtils::asConcreteDataMatcher (input.matcher );
510+ std::string tableNameWithVersion = tableNames[i];
511+ if (version > 0 ) {
512+ tableNameWithVersion += Form (" _%03d" , version);
513+ }
514+ if (input.matcher .binding == tableNameWithVersion) {
515+ LOGF (info, " Device %s has subscribed to %s (version %i)" , device.name , tableNames[i], version);
516+ listOfRequestors[i].Append (Form (" %s " , device.name .c_str ()));
517+ mEnabledTables [i] = 1 ;
518+ }
509519 }
510520 }
511521 }
@@ -540,7 +550,7 @@ struct StrangenessBuilder {
540550 for (int i = 0 ; i < nTables; i++) {
541551 // printout to be improved in the future
542552 if (mEnabledTables [i]) {
543- LOGF (info, " -~> Table enabled: %s" , tableNames[i]);
553+ LOGF (info, " -~> Table enabled: %s, requested by %s " , tableNames[i], listOfRequestors[i]. Data () );
544554 h->SetBinContent (i + 1 , 0 ); // mark enabled
545555 }
546556 }
0 commit comments