Dear all,
I am having the following problem when reading a tree: I would like to change the name of a branch:
TFile *myfile = new TFile(pathData + dataFile,"READ");
TTree *data_Weighted = (TTree*) myfile->Get("data_Weighted");
Double_t varX, varY;
data_Weighted->SetBranchAddress("Low_s31_s23_DTF", &varX);
data_Weighted->SetBranchAddress("High_s31_s23_DTF", &varY);
The true names of the branch data_Weighted
are Low_s31_s23_DTF
and High_s31_s23_DTF
and I need to manipulate them (do TCuts, Draw(), etc…) as varX
and varY
. The output I have is:
Error in <TTreeFormula::Compile>: Bad numerical expression : "varY"
Info in <TSelectorDraw::AbortProcess>: Variable compilation failed: {varY:varX ,flgBkgSubs == 1}
I cannot do any type of operation with varX
or varY
. However, if I replace varX
by Low_s31_s23_DTF
, it works… The root file works well, I can not it send because is too big.
Thanks for your help.
Cheers,
Diego