]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changed AliLevel3::Init to public, and this should then be called after
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Apr 2002 15:01:08 +0000 (15:01 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Apr 2002 15:01:08 +0000 (15:01 +0000)
the ctor. Here one should provide the path where the data are located,
and also the parameter file. Else, some cleaning where done, -> fOutputFile
was no longer needing, and has been removed. For example script how to run
the new AliLevel3 class, checkout latest version of test.C in exa.

HLT/src/AliL3Transform.cxx
HLT/src/AliL3Transform.h
HLT/src/AliLevel3.cxx
HLT/src/AliLevel3.h

index a704376bdfb31195150c192ce2774cb81a51bd27..bf73b0b41835db53d6e90a8fe073f70a42d5cda6 100644 (file)
 ClassImp(AliL3Transform);
 
 
-AliL3Transform::AliL3Transform(){
+AliL3Transform::AliL3Transform()
+{
   //constructor
+  
+  LOG(AliL3Log::kWarning,"AliL3Transform::AliL3Transform()","Init")
+    <<"You are using the _old_ version of parameter inits. V3.06 only! Use the ctor AliL3Transform(char*) instead."<<ENDLOG;
   Init();
 }
 
-AliL3Transform::AliL3Transform(const char* pathname){
+AliL3Transform::AliL3Transform(const Char_t* pathname){
   //constructor
   Init(pathname);
 }
@@ -30,10 +34,8 @@ AliL3Transform::~AliL3Transform(){
 }
 
 /// old init function used by Anders for AliRoot version 3.06
-void AliL3Transform::Init(){
-  
-  LOG(AliL3Log::kWarning,"AliL3Transform::Init()","Init")
-    <<"You are using the _old_ version of parameter inits. V3.06 only!"<<ENDLOG;
+void AliL3Transform::Init()
+{
   
   //sector:
   fNTimeBins = 446;
@@ -412,10 +414,10 @@ void AliL3Transform::Init(){
   fNPads[175] = 139;
 }
 
-void AliL3Transform::Init(const char* path){
+void AliL3Transform::Init(const Char_t* path){
   Init(); //call the old init function to have some initial values
 
-  char *pathname=new char[1024];
+  Char_t *pathname=new Char_t[1024];
   strcpy(pathname,path);
   strcat(pathname,"/l3transform.config");
 
@@ -426,9 +428,9 @@ void AliL3Transform::Init(const char* path){
     return;
   }
 
-  char d1[250], d2[100], d3[100];
-  int dummy=0;
-  double ddummy=0.0;
+  Char_t d1[250], d2[100], d3[100];
+  Int_t dummy=0;
+  Double_t ddummy=0.0;
 
   while(!feof(fptr)) {
     fscanf(fptr,"%s",d1);
index c0fd48a70591a1e77c18b74241aeb5e94a4efc8f..5e9b7d24568cbac45144095d01e2062c1c63dc83 100644 (file)
@@ -29,7 +29,7 @@ class AliL3Transform {
   AliL3Transform(const char *pathname);
   virtual ~AliL3Transform();
   void Init(); //old init used by Anders for AliRoot <= 3.06
-  void Init(const char* path); //new init for all AliRoot versions
+  void Init(const Char_t* path); //new init for all AliRoot versions
 
   Double_t GetPadPitchWidthLow() {return fPadPitchWidthLow;}
   Double_t GetPadPitchWidthUp() {return fPadPitchWidthUp;}
index 143a39cc748f7cd559f81f661688feca8303e87a..97dc2a915faf9d396cff4efecc1259ece07e6454 100644 (file)
 
 ClassImp(AliLevel3)
 
-AliLevel3::AliLevel3(){
+AliLevel3::AliLevel3()
+{
   fInputFile=0;
-  fOutputFile=0;
-  Init();
 }
 
-AliLevel3::AliLevel3(Char_t *infile,Char_t *outfile){
+AliLevel3::AliLevel3(Char_t *infile)
+{
   //Constructor. Calls constructor of the tracker, vertexfinder and merger classes.
-
-  fOutputFile = new TFile(outfile,"NEW");
   
-  if(!fOutputFile->IsOpen())
-    {
-    LOG(AliL3Log::kWarning, "AliLevel3::AliLevel3","File Open")
-    <<"Delete your old "<<outfile<<" file!"<<ENDLOG;
-    }
   fInputFile = new TFile(infile,"READ");
   
   if(!fInputFile->IsOpen())
     {
-    LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open")
-    <<"Inputfile "<<infile<<" does not exist"<<ENDLOG;
-    return;
+      LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open")
+       <<"Inputfile "<<infile<<" does not exist"<<ENDLOG;
+      return;
     }
   
-  Init();
 }
 
-AliLevel3::AliLevel3(TFile *in, TFile *out){
-  fOutputFile = out;
+AliLevel3::AliLevel3(TFile *in)
+{
   fInputFile  =  in;
   if(!in){
     LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open")
     <<"Pointer to InFile 0x0!"<<ENDLOG;
     return;
   }  
-  if(!out){
-    LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open")
-    <<"Pointer to OutFile 0x0!"<<ENDLOG;
-    return;
-  }  
   
-  if(!fOutputFile->IsOpen())
-    {
-    LOG(AliL3Log::kWarning,"AliLevel3::AliLevel3","File Open")
-    <<"no output file!"<<ENDLOG;
-      return;
-    }
   if(!fInputFile->IsOpen())
     {
     LOG(AliL3Log::kError,"AliLevel3::AliLevel3","File Open")
     <<"Inputfile does not exist"<<ENDLOG;
       return;
     }
-  Init();
 }
 
-void AliLevel3::Init(Int_t npatches=6){
+void AliLevel3::Init(Char_t *path,Bool_t binary=kTRUE,Int_t npatches=6)
+{
+  if(!binary && !fInputFile)
+    {
+      LOG(AliL3Log::kError,"AliLevel3::Init","Files")
+       <<"You have not supplied the input rootfile; use the appropriate ctor!"<<ENDLOG;
+      return;
+    }
   fWriteOut = kFALSE;
   fGlobalMerger=0;
-  fTransformer = new AliL3Transform();
+  fTransformer = new AliL3Transform(path);
   fDoRoi = kFALSE;
   fDoNonVertex = kFALSE;
   fClusterDeconv = kTRUE;
   fEta[0] = 0.;
   fEta[1] = 0.9;
-  fUseBinary =kFALSE;
-  SetPath("");
+  fUseBinary = binary;
+  SetPath(path);
   fFindVertex =kFALSE;
   fEvent=0;
 
@@ -172,12 +159,12 @@ void AliLevel3::Init(Int_t npatches=6){
   fTracker = new AliL3ConfMapper();
   fTrackMerger = new AliL3TrackMerger(fNPatch);
   fInterMerger = new AliL3InterMerger();
-  #ifdef use_aliroot
+#ifdef use_aliroot
   fFileHandler = new AliL3FileHandler();
   fFileHandler->SetAliInput(fInputFile);
-  #else
+#else
   fFileHandler = new AliL3MemHandler();
-  #endif
+#endif
   fBenchmark = new AliL3Benchmark();
 }
 
index f5cd43f257d7a362cf5a33f88ee7508aec835537..b367a798af80aa5ab595a168537a9419fb96f064 100644 (file)
@@ -54,12 +54,11 @@ class AliLevel3 : public TObject {
   AliL3Transform *fTransformer; //!
   TDirectory *savedir;
   TFile *fInputFile;
-  TFile *fOutputFile;
   Bool_t fFindVertex;
   Bool_t fDoNonVertex;
   Bool_t fClusterDeconv;
   Int_t fEvent;
-  void Init(Int_t npatches=6);
+  //void Init(Int_t npatches=6);
   void WriteSpacePoints(UInt_t npoints,AliL3SpacePointData *points,
                                              Int_t slice,Int_t patch);
   void WriteResults();
@@ -71,10 +70,11 @@ class AliLevel3 : public TObject {
   void SetPath(char *p){sprintf(fPath,"%s",p);}
  public:
   AliLevel3 ();
-  AliLevel3(Char_t *infile,Char_t *outfile);
-  AliLevel3(TFile *in, TFile *out);
+  AliLevel3(Char_t *infile);
+  AliLevel3(TFile *in);
   virtual ~AliLevel3();
   
+  void Init(Char_t *path,Bool_t binary=kTRUE,Int_t npatches=6);
   void SetTrackerParam(Int_t phi_segments=50,Int_t eta_segments=100,
                       Int_t trackletlength=3,Int_t tracklength=5,
                       Int_t rowscopetracklet=2,Int_t rowscopetrack=3,
@@ -87,7 +87,7 @@ class AliLevel3 : public TObject {
   void ProcessEvent(Int_t first,Int_t last,Int_t event=0);
   void ProcessSlice(Int_t slice);
 
-  void UseBinaryInput(char *path){SetPath(path);fUseBinary=kTRUE;}
+  //void UseBinaryInput(char *path){SetPath(path);fUseBinary=kTRUE;}
   void DoMc(char* file="point_mc.dat");
   void DoNonVertexTracking() {fDoNonVertex=kTRUE;}
   void FindVertex() {fFindVertex=kTRUE;}