Hi,
I’m trying to fill a single Branch (I don’t want to use tree->fill() ).
Therefor I wrote something like:
TFile *file;
TTree *tree;
TBranch *bra;
[…]
void open(void)
{
file = new TFile("./histotree.root",“RECREATE”);
tree= new TTree(“Asim”,“name2”);
bra = new evtree->Branch(“bra”,&blatt,“amp/I:channel/I:rot/I:dist/F:height/F”);
}
void fill(void)
{if(check==1)
{
blatt.amp=1;
blatt.channel=2;
blatt.rot=3;
blatt.dist=4.5;
blatt.height=5.6;
bra->Fill();
}
}
void close(void)
{
tree->Write();
file->Write();
}
If I do write “tree->fill” instead of “bra->fill” everything is fine.
But since I need to create several branches and I have to choose which branch has to be filled, I can’t use “tree->fill”.
As far as I’ve seen in the web, “Fill” should be declared for TBranch, too (?),
so what am I doing wrong ?
I’m using CINT calling
open()
fill()
close().
Cheers;
Asim.