Accessing a Tree Chain via header file

Hi Experts,

I have a macro with a header file named PtCorr_mix.h, I’m trying to read a root file and attach the tree chain via the header file and proceed to analyze it in the macro. But I am unable to read the contents of the root file in the macro.
Please help me in figuring out what the issue is.

Im attaching the file here, and I run PtCorr_mix.C using sh

Root (91.9 KB)

In “PtCorr_mix.h”, comment out the line: fChain->SetMakeClass(1);

In “PtCorr_mix.h”, add: #include <fstream>

In “PtCorr_mix.C”, add: #include "TRandom.h"

In “”, change the order of loading classes:
.L StFemtoTrack.cxx
.L StFemtoEvent.cxx
.L PtCorr_mix.C

1 Like

Hi @Wile_E_Coyote , Thanks a lot!, this works perfectly.
If it’s not too much, could you explain the SetMakeClass() part, I can’t seem to understand that one.

You use “MakeClass mode 0”: TTree::SetMakeClass

1 Like

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