Read NTuple values with Instance column

Hello,

I would like to read NTuple values, but my ntuple
has an Instance Column too.

This is how my ntuple looks like with Scan()


  • Row * Instance * px *

  •    0 *        0 * 0.9896690 *
    
  •    1 *        0 * 1.0881818 *
    

In the examples i found, the ntuples looks like


  • Row * px *

  •    0 * 3167.6771 *
    
  •    1 * 3122.3247 *
    

(there is no the Instance column)

So if i use the common example for my ntuple:

TFile *f = new TFile(“tree1.root”);
TTree t1 = (TTree)f->Get(“t1”);
Float_t px;
t1->SetBranchAddress(“px”,&px);
t1->GetEntry(1);
cout<<px<<endl;

i get zero back (6.82814e-33)

How can i overpass this?

regards,
Charilaos

Hi,

[quote]I would like to read NTuple values, but my ntuple
has an Instance Column too. [/quote]This means that your variable ‘px’ is actually an array than can have more than one value per entry/event.

To read it, you need to pass to SetBranchAddress the address of an array large enough to hold the largest array in the data set.

The easiest way is to use the result of MakeSelector (or MakeProxy) to setup your analysis.

Cheers,
Philippe