Hi, I cannot reproduce your problem. I can read your ascii file, fill the Tree, and draw the 3 plots. It must be something connected with your project set-up. Please, do not send large files as you did (5 times) to roottalk. You are blocking the activity of the newsgroup. Rene Brun On Wed, 13 Nov 2002, payman hosseini wrote: > hi > > as a simple script, the tree::draw(branch1:branch2) works fine under > windows > > but, in a project, i get the run time error > > attached is a simple c++ file that is almost the same as the one in the > OhRoot project that i sent you > however > in the ohroot project, i get the run time error > > thanks > > Paymon Hosseini > > On Tue, 12 Nov 2002, Rene Brun wrote: > > > Could you send me your full script as well as the input ascii file? > > > > Rene Brun > > > > On Tue, 12 Nov 2002, payman hosseini wrote: > > > > > hi > > > > > > When i try to graph two branches of a tree against each other > > > > > > tree->Draw("contrast:outcome"); > > > > > > i get this error at run time: > > > > > > " > > > Microsoft Visual C++ Runtime Library > > > Runtime Error! > > > abnormal program termination > > > " > > > > > > > > > > > > > > > i can draw each branch separately > > > any ideas? > > > > > > here is the code: > > > > > > struct plaid_data_t > > > { > > > ULong_t trial_number; > > > Int_t outcome; > > > Float_t ang1; > > > Float_t ang2; > > > Int_t coh; > > > Int_t contrast; > > > }; > > > plaid_data_t plaid_data; > > > > > > > > > FILE * fp = fopen(file_title,"r"); > > > char line[1024]; > > > TFile *f = new TFile("plaid_data_test.txt","RECREATE"); > > > TTree *tree = new TTree("tree","plaid data from tab delimited > > > file"); > > > //creat a branch > > > > > > tree->Branch("trial_number",&plaid_data.trial_number,"trial_number/i"); > > > tree->Branch("outcome",&plaid_data.outcome,"outcome/I"); > > > tree->Branch("ang1",&plaid_data.ang1,"ang1/F"); > > > tree->Branch("ang2",&plaid_data.ang2,"ang2/F"); > > > tree->Branch("coh",&plaid_data.coh,"coh/I"); > > > tree->Branch("contrast",&plaid_data.contrast,"contrast/I"); > > > > > > > > > > > > //fill tree from values in ascii file > > > fgets(line,1024,fp);//remove header > > > while(fgets(line,1024,fp)) > > > { > > > sscanf(&line[0],"%lu%d%f%f%d%d", > > > &plaid_data.trial_number, > > > &plaid_data.outcome, > > > &plaid_data.ang1, > > > &plaid_data.ang2, > > > &plaid_data.coh, > > > &plaid_data.contrast); > > > tree->Fill(); > > > }; > > > TCanvas *can2 = new TCanvas(); > > > can2->Divide(2,1); > > > > > > can2->cd(1); > > > tree->Draw("contrast"); > > > > > > > > > > > > can2->cd(2); > > > tree->Draw("contrast:outcome"); > > > > > > thanks > > > > > > Paymon Hosseini > > > University of Chicago > > > > > > > > >
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:17 MET