Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
Hello everyone, I am trying to get nDigiHF
value from the hcalnano_calib.root
, It’s a leaf.
TFile *input = new TFile("hcalnano_calib.root","read"); //Root binary file that includes events
TTree *tree = (TTree*)input->Get("Events"); //Reads file and gets events
double nDigiHF;
float DigiHF_fc0,DigiHF_fc1,DigiHF_fc2;
tree->SetBranchAddress("nDigiHF",&nDigiHF);
tree->SetBranchAddress("DigiHF_fc0",&DigiHF_fc0);
tree->SetBranchAddress("DigiHF_fc1",&DigiHF_fc1);
tree->SetBranchAddress("DigiHF_fc2",&DigiHF_fc2);
int entries = tree->GetEntries();
cout << entries << endl;
for(Int_t i = 1; i<=entries; i++)
{
tree->GetEntry(i);
cout << i << " : " << nDigiHF(i) << endl;
}
There is just 2 entries, I want to see each of them so I can do calculation with it but I am getting an error.
ts_vs_fc.C:62:31: error: called object type 'double' is not a function or function pointer
cout << i << " : " << nDigiHF(i) << endl;
Could someone help me with this problem that I have ? Thanks in advance