Hi all, I am trying to run a very simple (I guess) code which I generated my MakeCode() and modified slightly to fill and draw an histo and keep getting the following error messgaes ... --------------------- root [0] .x tuple.C Error: No symbol mass in current scope FILE:tuple.C LINE:185 Error: Can't call TH1F::Fill(mass) in current scope FILE:tuple.C LINE:185 Possible candidates are... filename line:size busy function type and name (in TH1F) filename line:size busy function type and name (in TH1) (compiled) 0:0 0 public: virtual Int_t Fill(Axis_t x); (compiled) 0:0 0 public: virtual Int_t Fill(Axis_t x,Stat_t w); filename line:size busy function type and name (in TNamed) filename line:size busy function type and name (in TObject) filename line:size busy function type and name (in TAttLine) filename line:size busy function type and name (in TAttFill) filename line:size busy function type and name (in TAttMarker) filename line:size busy function type and name (in TArrayF) filename line:size busy function type and name (in TArray) Error: No symbol mass in current scope FILE:tuple.C LINE:185 *** Interpreter error recovered *** ------------------------------ Does anyone have any idea ehat i am doing wrong? thanks a lot ahmet the code (tuple.C) reads as: { ////////////////////////////////////////////////////////// // This file has been automatically generated // (Fri Apr 27 10:14:37 2001 by ROOT version2.25/03) // from TTree tuple/Selex reconstruction data // found on file: /export/data2/ayan/root_data/id850.root ////////////////////////////////////////////////////////// //Reset ROOT and connect tree file gROOT->Reset(); TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("/export/data2/ayan/root_data/id850.root"); if (!f) { f = new TFile("/export/data2/ayan/root_data/id850.root"); } TTree *tuple = (TTree*)gDirectory->Get("tuple"); //Declaration of leaves types Float_t RN_run; Float_t RN_event; Float_t RN_ID; Float_t RN_x0b; Float_t RN_y0b; Float_t RN_Pxb; Float_t RN_Pyb; Float_t RN_Pzb; Float_t RN_Pidb; Float_t RN_Xp; Float_t RN_Yp; Float_t RN_Zp; Float_t RN_Sxp; Float_t RN_Syp; Float_t RN_Szp; Float_t RN_Pchi; Float_t RN_Pnf; Float_t RN_Pnt; Float_t RN_Pxs; Float_t RN_Pys; Float_t RN_Pzs; Float_t RN_Es; Float_t RN_Xs; Float_t RN_Ys; Float_t RN_Zs; Float_t RN_Sxs; Float_t RN_Sys; Float_t RN_Szs; Float_t RN_Schi; Float_t RN_Isol; Float_t RN_tgt; Float_t RN_nt; Float_t RN_ns; Float_t RN_Xf; Float_t RN_Pt; Float_t RN_L; Float_t RN_S; Float_t RN_LoS; Float_t RN_pvtx; Float_t RN_smin; Float_t RN_scut; Float_t RN_mass; Float_t RN_X0t1; Float_t RN_Y0t1; Float_t RN_Pxt1; Float_t RN_Pyt1; Float_t RN_Pzt1; Float_t RN_chit1; Float_t RN_masst1; Float_t RN_pidt1; Float_t RN_X0t2; Float_t RN_Y0t2; Float_t RN_Pxt2; Float_t RN_Pyt2; Float_t RN_Pzt2; Float_t RN_chit2; Float_t RN_masst2; Float_t RN_pidt2; Float_t RN_X0t3; Float_t RN_Y0t3; Float_t RN_Pxt3; Float_t RN_Pyt3; Float_t RN_Pzt3; Float_t RN_chit3; Float_t RN_masst3; Float_t RN_pidt3; Float_t RN_X0t4; Float_t RN_Y0t4; Float_t RN_Pxt4; Float_t RN_Pyt4; Float_t RN_Pzt4; Float_t RN_chit4; Float_t RN_masst4; Float_t RN_pidt4; Float_t RN_; //Set branch addresses tuple->SetBranchAddress("RN",&RN_run); tuple->SetBranchAddress("RN",&RN_event); tuple->SetBranchAddress("RN",&RN_ID); tuple->SetBranchAddress("RN",&RN_x0b); tuple->SetBranchAddress("RN",&RN_y0b); tuple->SetBranchAddress("RN",&RN_Pxb); tuple->SetBranchAddress("RN",&RN_Pyb); tuple->SetBranchAddress("RN",&RN_Pzb); tuple->SetBranchAddress("RN",&RN_Pidb); tuple->SetBranchAddress("RN",&RN_Xp); tuple->SetBranchAddress("RN",&RN_Yp); tuple->SetBranchAddress("RN",&RN_Zp); tuple->SetBranchAddress("RN",&RN_Sxp); tuple->SetBranchAddress("RN",&RN_Syp); tuple->SetBranchAddress("RN",&RN_Szp); tuple->SetBranchAddress("RN",&RN_Pchi); tuple->SetBranchAddress("RN",&RN_Pnf); tuple->SetBranchAddress("RN",&RN_Pnt); tuple->SetBranchAddress("RN",&RN_Pxs); tuple->SetBranchAddress("RN",&RN_Pys); tuple->SetBranchAddress("RN",&RN_Pzs); tuple->SetBranchAddress("RN",&RN_Es); tuple->SetBranchAddress("RN",&RN_Xs); tuple->SetBranchAddress("RN",&RN_Ys); tuple->SetBranchAddress("RN",&RN_Zs); tuple->SetBranchAddress("RN",&RN_Sxs); tuple->SetBranchAddress("RN",&RN_Sys); tuple->SetBranchAddress("RN",&RN_Szs); tuple->SetBranchAddress("RN",&RN_Schi); tuple->SetBranchAddress("RN",&RN_Isol); tuple->SetBranchAddress("RN",&RN_tgt); tuple->SetBranchAddress("RN",&RN_nt); tuple->SetBranchAddress("RN",&RN_ns); tuple->SetBranchAddress("RN",&RN_Xf); tuple->SetBranchAddress("RN",&RN_Pt); tuple->SetBranchAddress("RN",&RN_L); tuple->SetBranchAddress("RN",&RN_S); tuple->SetBranchAddress("RN",&RN_LoS); tuple->SetBranchAddress("RN",&RN_pvtx); tuple->SetBranchAddress("RN",&RN_smin); tuple->SetBranchAddress("RN",&RN_scut); tuple->SetBranchAddress("RN",&RN_mass); tuple->SetBranchAddress("RN",&RN_X0t1); tuple->SetBranchAddress("RN",&RN_Y0t1); tuple->SetBranchAddress("RN",&RN_Pxt1); tuple->SetBranchAddress("RN",&RN_Pyt1); tuple->SetBranchAddress("RN",&RN_Pzt1); tuple->SetBranchAddress("RN",&RN_chit1); tuple->SetBranchAddress("RN",&RN_masst1); tuple->SetBranchAddress("RN",&RN_pidt1); tuple->SetBranchAddress("RN",&RN_X0t2); tuple->SetBranchAddress("RN",&RN_Y0t2); tuple->SetBranchAddress("RN",&RN_Pxt2); tuple->SetBranchAddress("RN",&RN_Pyt2); tuple->SetBranchAddress("RN",&RN_Pzt2); tuple->SetBranchAddress("RN",&RN_chit2); tuple->SetBranchAddress("RN",&RN_masst2); tuple->SetBranchAddress("RN",&RN_pidt2); tuple->SetBranchAddress("RN",&RN_X0t3); tuple->SetBranchAddress("RN",&RN_Y0t3); tuple->SetBranchAddress("RN",&RN_Pxt3); tuple->SetBranchAddress("RN",&RN_Pyt3); tuple->SetBranchAddress("RN",&RN_Pzt3); tuple->SetBranchAddress("RN",&RN_chit3); tuple->SetBranchAddress("RN",&RN_masst3); tuple->SetBranchAddress("RN",&RN_pidt3); tuple->SetBranchAddress("RN",&RN_X0t4); tuple->SetBranchAddress("RN",&RN_Y0t4); tuple->SetBranchAddress("RN",&RN_Pxt4); tuple->SetBranchAddress("RN",&RN_Pyt4); tuple->SetBranchAddress("RN",&RN_Pzt4); tuple->SetBranchAddress("RN",&RN_chit4); tuple->SetBranchAddress("RN",&RN_masst4); tuple->SetBranchAddress("RN",&RN_pidt4); tuple->SetBranchAddress("RN",&RN_); // This is the loop skeleton // To read only selected branches, Insert statements like: // tuple->SetBranchStatus("*",0); // disable all branches // TTreePlayer->SetBranchStatus("branchname",1); // activate branchname TH1F *hM = new TH1F("hM", "mass for LoS>0", 20, 2.6, 2.8); Int_t nbytes = 0; Int_t nentries = tuple->GetEntries(); for (Int_t i=0;i<nentries;i++) { tuple->GetEntry(i); hM->Fill(mass); } TCanvas *c1 = new TCanvas("c1","ntuple demo",600,800); c1->Divide(1,2); c1->cd(1); hM->Draw(); } *************** Ahmet Sedat Ayan Physics & Astronomy Dept. Van Allen Hall University of Iowa Iowa City, IA, 52242 Voice : (++ 1 319) 335-2832 (W) (GMT-6) Occupation : Ph.D Candidate (But still dreamer!) e-mail : ayan@cms.physics.uiowa.edu web : http://home.cern.ch/ayan
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:43 MET