hello,
i am trying to create a tree with a branch that contains a single object as follows:
#include <stdio.h>
#include
#include “TFile.h”
#include “TTree.h”
using namespace std;
int littlerTest()
{
typedef struct ROCDelay25Branch{
float pass;
float suggestedDelaySetting;
float rocName;
};
TFile myFile(“treeTest.root”,“RECREATE”);
ROCDelay25Branch *theBranch = 0;
TTree *tree = new TTree(“LevelSummary”, “canichangethis?”);
tree->Branch(“ROC Summary”, &theBranch, “pass/F:suggestedDelaySetting/F:rocName/F”);
theBranch = new ROCDelay25Branch;
theBranch->pass = 23.23;
theBranch->suggestedDelaySetting = 3.14159;
theBranch->rocName = 217.712;
tree->Fill();
myFile.Write();
myFile.Close();
delete theBranch;
return 0;
}
after executing the code, i open a TBroswer to view the values saved into the branch of the tree. when i click on any of the leafs, the root terminal outputs:
Error in TTreeFormula::Compile: Bad numerical expression : “ROCSummary.pass”
clearly i am doing something wrong, but i don’t see where my mistake is. can someone give me a hand?
thanks,
james