Re: [ROOT] Problem (?) with MakeSelector

From: Ben Morgan (B.Morgan@sheffield.ac.uk)
Date: Wed May 22 2002 - 11:16:12 MEST


Hi Rene,
        Thanks for the help - your suggestion to add the + sign solves the 
problem of seg faults for multiple runs and the loading/unloading problem. 
However, when ACLiC creates the shared library, the messages:

Info in <ACLiC>: creating shared library 
/home/morgan/Analysis/drift1/protodrift/TDriftEvent/./EventSelector_C.so
Class EventSelector: Streamer() not declared 
Class EventSelector: ShowMembers() not declared

Is this a problem?
Also, when I make changes to EventSelector's ProcessCut() method and rerun 
Analyse.C, ACLiC recognises that changes have been made, but it fails to 
recreate the shared library correctly - it puts out the message:

Warning in <ACLiC>: modified script has already been compiled and loaded
Warning in <ACLiC>: it will be regenerated and reloaded!
Function Analyse() busy. loaded after 
"/home/morgan/Analysis/drift1/protodrift/TDriftEvent/./EventSelector_C.so"
Error: G__unloadfile() Can not unload 
"/home/morgan/Analysis/drift1/protodrift/TDriftEvent/./EventSelector_C.so", 
file busy  FILE:Analyse.C LINE:18

I thought this might be due to the Process call being made within a for 
loop (this is line 18), so I made the selector external, as this alos 
saves ACLiC making checks on every pass through the loop. I've included the 
modified code below (ROOT v3.02/07 RH7.1 on Intel PC), but I still get the 
same error message as above - line 18 is still the start of the for loop. 
Again, any suggestions for a solution would be gratefully received! 
Thanks,

Ben Morgan.


#include <iostream.h>

int Analyse()
{
  char filedirectory[100];
  char filename[100];
  int lowrun, uprun;

  cout<<"Enter directory containing files to be analysed: "<<endl;
  cin>>filedirectory;

  cout<<"Enter run number bounds to be analysed: ";
  cin>>lowrun>>uprun;
  cout<<endl;

  TSelector *sel = TSelector::GetSelector("EventSelector.C+");

  for(int i=lowrun; i<(uprun+1); i++)
    {
      if(gROOT->FindObject(filename))
	delete gROOT->FindObject(filename);

      sprintf(filename,"%s/Trun0%d.root",filedirectory,i);

      cout<<"Start of loop for file "<<filename<<endl;
      TFile *f = new TFile(filename,"update");

      cout<<"Address of Tfile Object is "<<f<<endl;
      TTree *t4 = (TTree*)f->Get("DriftEventData");
  
      t4->Process(sel,"fillList");

      cout<<"End of loop "<<i<<endl<<endl;
    }

  if(gROOT->FindObject(filename))
    delete gROOT->FindObject(filename);

  return 0;
}
 

-- 
-------------------------------------------------------------------------------
Mr. Ben Morgan
Postgraduate Student
University of Sheffield
Department of Physics & Astronomy
Hicks Building
Hounsfield Road
Sheffield  S3 7RH
-------------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:53 MET