Check current .root file in TChain and multiply entries with a number

Hi,

If I have a TChain, with 3 .root files a1.root, a2.root, and a3.root, and I want to multiply the their entries with different numbers as shown in the pseudo code
if file_name == “a1”:
then multiply the entries of a1 by A
elif file_name == “a2”:
then multiply the entries of a2 by B
elif file_name == “a3”
then multiply the entries of a3 by C
etc., etc.
then draw the chain with its entries multiplied by A, B, or C according to the file_name
How can I do this?

Thanks

ROOT Version: 6.14.04

Using MakeSelector you will be able to generate a skeleton of a function you will have to modify to do what you need. I guess that with the fChain variable in that function (see the .h file) you will be able to know which file is currently read .

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