How to initialize TTreeReaderValue<T> outside the selector class declaration ? ROOT 6.08/04

So , I am writing a code where the names and types of branches to be read ( from the dataset distributed over PROOF cluster) are provided in a text file. Reading this file, an input list is generated on client and added to proof session. Now since the selector determines the types and names of the branches to be read during processing I have some members in selector class of type TTreeReaderValue *rv (Type being float or int mainly) which I currently initialize in SlaveBegin(). I am getting crash in this way though. What’s the proper way to do this ?
Attaching the selectors here and the log on client and one of the workers

.SelSensitivity.h (3.6 KB)
SelSensitivity.C (4.4 KB)
clientlog.txt (16.5 KB)
worker-0.3-ubuntu-log.txt (57.1 KB)

(I do have the branches “energy”,“coredist” and “viewcone” in my dataset)

may be @ganis ca help you as it seems to be a PROOF matter.

Dear Chinmay,

To understand better:

  1. Does it work outside PROOF, with TChain?
  2. Does it work if you comment out in SelSensitivity.h the lines defining fEnergy, fCoreDist, fViewCone?

G Ganis

Okay. So most of the problems are resolved by moving TTreeReaderValue initialization to
Init() function of selector. fEnergy, fCoreDist and fViewCone are not problems any more.
However when I try to initialize TTreeReaderValue **fParameters in Init() function the (new) code
The problem is somehow my MCuts object from “listofcuts” provided by
fProof -> AddInput(listofcuts) are somehow empty. I have checked them on client and they are okay there.
Attaching new code and the new logs.
SelSensitivity.h (5.9 KB)
SelSensitivity.C (3.6 KB)
clientlog.txt (6.5 KB)
worker-0.3-ubuntu-log.txt (15.2 KB)
(In the client log All the “Info in MSimManagerProof :: Sensitivity” lines are the checks for sanity of mcuts on client.)
P.S. When I run the SelSensitivity selector by commenting all the parts related to initializing and using “fParameters” (which is basically initiated after reading in listofcuts) code runs smooth and gives sensible answers as well.

Do you load the MCuts class on the workers? Is it streamable?

G Ganis

Yeah. It turns out that was the problem.
It was not streamable class. :disappointed:
(Sorry for trouble.)
Thanks for the reply.
Just small doubt. What would be appropriate place for such initializations ? Init() or SlaveBegin(). Both of them work now.

Bettes SlaveBegin() (or the constructor) which are executed only once. Init() is called each time you have a new file.

G Ganis

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