[ROOT] fstream problems

From: Chris Milne (phycm@phy.hw.ac.uk)
Date: Fri Aug 31 2001 - 15:47:37 MEST


Hi there, I have the following loop, which should read in from 4 files, 3 of which are only read when a condition is met.
But for some reason it gives an error for the olp input, when pol[1]!=1, i.e when the file should not be read in. I can't figure it out


      for (Int_t i=0;i<ndata;i++)
      {    
         if (pol[0]==1)
	 {
           ocp >> wavelength[i] >> ocp_fib1[i] >> ocp_fib2[i] >> temp >> temp >> ocp_ref_fib1[i]>>ocp_ref_fib2[i]>>temp>>temp;
         }
	 if (pol[1]==1)
         {
	   olp >> wavelength[i] >> olp_fib1[i] >> olp_fib2[i] >> temp >> temp >> olp_ref_fib1[i]>>olp_ref_fib2[i]>>temp>>temp; //line 287
         }
	 if (pol[2]==1)
         {
	   slp >> wavelength[i] >> slp_fib1[i] >> slp_fib2[i] >> temp >> temp >> slp_ref_fib1[i]>>slp_ref_fib2[i]>>temp>>temp;
         }
	 scp >> wavelength[i] >> scp_fib1[i] >> scp_fib2[i] >> temp >> temp >> scp_ref_fib1[i]>>scp_ref_fib2[i]>>temp>>temp;
      }
      
the error is:

Error: class,struct,union or type unknown not defined  FILE:calc.C LINE:287
Error: Illegal pointer operation (tovalue) FILE:calc.C LINE:287
Error: >> Illegal operator for real number FILE:calc.C LINE:287
Error: >> Illegal operator for real number FILE:calc.C LINE:287
Error: >> Illegal operator for real number FILE:calc.C LINE:287
Error: >> Illegal operator for real number FILE:calc.C LINE:287
*** Interpreter error recovered ***
 
 
Thanks
Chris Milne



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET