Passing parameters to chain in selector

Dear experts,

I would like to pass a class with input parameters to a TChain and then run my selector. In PROOF I use


auto my_params  = new MyClassWithParameters("param");
// adding all info
//....
//load and run
my_proof->AddInput(my_params)
my_proof->Load("MyClassWithParameters.h+")
my_proof->Process(dataset, "MySelector.C+")

which works fine for my scripts. Is there an equivalent and fast way to implement this on a Chain?

Thanks for the attention.

Best regards,
Francesco


ROOT Version: 6.10/04
Platform: Not Provided
Compiler: Not Provided


Hi,

TChain does not provide the same functionality.
Probably you can work around by instantiating the selector and adding my_params to its input list. Something like this:

auto my_params  = new MyClassWithParameters("param");
// Instantiate the selector
gSystem->Load("MyClassWithParameters.h+");
auto my_sel = TSelector::GetSelector("MySelector.C+");
my_sel->GetInputList()->Add(my_params);
my_chain->Process(my_sel);

You have to create the input list (protected member fInput) in the constructor of MySelector .

Hope it helps,

G Ganis

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.