GetEntries during Process

Suppose I need the number of entries in the data I’m processing during the Process method, what’s the best way? Actually I’m passing the number of entries via fInput from TChain::GetEntries, but I think it’s stupid because proof actually now this number.

Hi,

Well, the master knows the number, but not the workers, which know nothing of the overall setup.
So, the way is the one you have implemented. Of course, we can automatize it, in the sense we could automatically provide in the input list this kind of information as calculated by the packetizer, so potentially taking into account possible missing files or so.
I’ll think about it.
What kind of other global information do you think it can be useful to have at TSelector::Process level?

Gerri

[quote=“ganis”]Hi,

Well, the master knows the number, but not the workers, which know nothing of the overall setup.
So, the way is the one you have implemented. Of course, we can automatize it, in the sense we could automatically provide in the input list this kind of information as calculated by the packetizer, so potentially taking into account possible missing files or so.
I’ll think about it.
What kind of other global information do you think it can be useful to have at TSelector::Process level?

Gerri[/quote]

In principle there are a lot of information you can pass to the slave, but I don’t know how much they’re userfull, for example the number of files, the index of the file being processed, the name of the file, … but I think the most important is the total number of event to be processed.

Is there now a workaround to do it?

Hi,

The workaround is the one that you implemented, you know the total number of entries and you add a parameter to the input list.

This said, I assume you need the total number of entries for normalization purposes … I am not sure, though, to understand why you may need the total number of files (however, this is something well defined, so in principle it can be added).
But the others that you mention are not defined: there are many files processed at once … Or did you mean the name of the file processed by the worker? That is already in the input list, in the TDSetElement object named ‘PROOF_CurrentElement’ (see tutorials/proof/ProofAux.C for an example).

Gerri

[quote=“ganis”]Hi,

The workaround is the one that you implemented, you know the total number of entries and you add a parameter to the input list.

This said, I assume you need the total number of entries for normalization purposes … I am not sure, though, to understand why you may need the total number of files (however, this is something well defined, so in principle it can be added).
But the others that you mention are not defined: there are many files processed at once … Or did you mean the name of the file processed by the worker? That is already in the input list, in the TDSetElement object named ‘PROOF_CurrentElement’ (see tutorials/proof/ProofAux.C for an example).

Gerri[/quote]

Presently I need only the number of events. I hope there is a better workaround, because with proof I need some second to get the number of entries, but from the master I need some minutes.