Re: [ROOT] Script

From: cstrato@EUnet.at
Date: Sat Jun 10 2000 - 17:09:42 MEST


Hi Alexey,

You are using two variables, "old" and "new", however, in C++
"new" is a reserved keyword and thus cannot be used.

Regards
Christian
Christian Stratowa, Vienna, Austria


Alexey Toptygin wrote:

> Hi
>
> When I try to run the following code by doing:
>
> root -b <script.C
>
> I get:
>
> Limitation: Can't instantiate precompiled template >
> FILE:/tmp/fileG4CKti_cint LINE:15
> Error: G__getvariable: expression  FILE:/tmp/fileG4CKti_cint LINE:15
> Syntax Error: > FILE:/tmp/fileG4CKti_cint LINE:15
> Error: type > not defined FILE:/tmp/fileG4CKti_cint LINE:15
> *** Interpreter error recovered ***
>
> I can't see anything wrong. Do you know what's causing this?
>
> Here's the script:
>
> #include <fstream.h>
>
> {
>   Int_t i,j,x,y;
>   Char_t c,c1;
>   Float_t mean0,sdev0,mean1,sdev1;
>
>   ifstream old("pedestal.old",ios::in);
>   ifstream new("pedestal.new",ios::in);
>
>   TFile file("Comp.root","Recreate");
>   TNtuple nt("nt","Diffirence","inx:iny:diff");
>
>   for(j=0;j<56;j++){
>     for(i=0;i<12;i++){
>       old >> c >> c1 >> x >> y >> mean0 >> sdev0;
>       if((x!=i)||(y!=j)){
>         cerr << "Error 1" << endl;
>       }
>       new >> c >> c1 >> x >> y >> mean1 >> sdev1;
>       if((x!=i)||(y!=j)){
>         cerr << "Error 2" << endl;
>       }
>       nt.Fill(i,j,(mean1-mean0));
>     }
>   }
>   nt.Write();
>   file.Close();
>
>   old.close();
>   new.close();
> }
> .q



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:27 MET