]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Removed fAlice and changed ReadTreeK to make it look as the others. Event now require...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 24 Sep 2002 11:32:06 +0000 (11:32 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 24 Sep 2002 11:32:06 +0000 (11:32 +0000)
EMCAL/AliEMCALGetter.cxx
EMCAL/AliEMCALGetter.h
PHOS/AliPHOSGetter.cxx
PHOS/AliPHOSGetter.h

index 97ece73256b2c3f6e35a0ebdbf14ad73b05cf091..5c4717ad72958ad43e3b75ae419cc6d81fcb01ad 100644 (file)
@@ -188,10 +188,6 @@ AliEMCALGetter::AliEMCALGetter(const char* headerFile, const char* branchTitle,
 
   fDebug  = 0 ; 
 
-  fAlice  = 0 ; 
-
-
-
   fToSplit    = toSplit ;
 
   fHeaderFile = headerFile ; 
@@ -354,10 +350,6 @@ void AliEMCALGetter::CloseFile()
 
   gAlice = 0 ; 
 
-  delete fAlice ; 
-
-  fAlice = 0 ; 
-
 }
 
 
@@ -2970,17 +2962,12 @@ TTree * AliEMCALGetter::TreeK(TString filename)
 
   file = static_cast<TFile*>(gROOT->GetFile(filename.Data() ) ) ;
 
-  if (file && (filename != fHeaderFile) ) {  // file already open 
-
-    file->Close() ; 
+  if (!file)  {  // file not yet open 
 
-    delete fAlice ; 
+    file = TFile::Open(filename.Data(), "read") ; 
 
   }    
 
-  file = TFile::Open(filename.Data(), "read") ; 
-
-  fAlice = static_cast<AliRun *>(file->Get("gAlice")) ; 
 
   TString treeName("TreeK") ; 
 
@@ -3160,14 +3147,7 @@ const TParticle * AliEMCALGetter::Primary(Int_t index) const
 
   TParticle *  p = 0 ;
 
-  if (fAlice) 
-
-    p = fAlice->Particle(index) ; 
-
-  else 
-
-    p = gAlice->Particle(index) ; 
-
+  p = gAlice->Particle(index) ; 
   
 
   return p ; 
@@ -4228,7 +4208,6 @@ void AliEMCALGetter::ReadPrimaries()
 
     fNPrimaries = gAlice->GetNtrack() ; 
 
-    fAlice = 0 ; 
 
 
 
@@ -4318,7 +4297,7 @@ void AliEMCALGetter::Event(const Int_t event, const char* opt)
 
  
 
-  if( strstr(opt,"P") || (strcmp(opt,"")==0) )
+  if( strstr(opt,"P") )
 
     ReadPrimaries() ;
 
index 30ffacb8b2ab3af3cc5895e2742ddf77d3d7f016..777d446bec37d1f4537c5b37d77942c8fd028b8a 100644 (file)
@@ -470,8 +470,6 @@ class AliEMCALGetter : public TObject {
 
   Int_t          fDebug ;             // Debug level
 
-  AliRun *       fAlice ;             //! needed to read TreeK if in an other file than fHeaderFile
-
   Int_t          fNPrimaries ;        //! # of primaries 
 
   TObjArray *    fPrimaries ;         //! list of lists of primaries-for the case of mixing
index 87c974ed97ca0f117ee272d99b30894e4ebaaa5d..4c7992600bab3fbee53f3d075af85022408ffeaa 100644 (file)
@@ -91,7 +91,6 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle, co
 
   fFailed = kFALSE ;   
   fDebug  = 0 ; 
-  fAlice  = 0 ; 
 
   fToSplit    = toSplit ;
   fHeaderFile = headerFile ; 
@@ -174,8 +173,6 @@ void AliPHOSGetter::CloseFile()
 {
   delete gAlice ;  
   gAlice = 0 ; 
-  delete fAlice ; 
-  fAlice = 0 ; 
 }
 
 //____________________________________________________________________________ 
@@ -1479,12 +1476,9 @@ TTree * AliPHOSGetter::TreeK(TString filename)
 
   TFile * file = 0 ; 
   file = static_cast<TFile*>(gROOT->GetFile(filename.Data() ) ) ;
-  if (file && (filename != fHeaderFile) ) {  // file already open 
-    file->Close() ; 
-    delete fAlice ; 
+  if (!file) {  // file not yet open 
+    file = TFile::Open(filename.Data(), "read") ;    
   }    
-  file = TFile::Open(filename.Data(), "read") ; 
-  fAlice = static_cast<AliRun *>(file->Get("gAlice")) ; 
   TString treeName("TreeK") ; 
   treeName += EventNumber()  ; 
   TTree * tree = static_cast<TTree *>(file->Get(treeName.Data())) ;
@@ -1574,10 +1568,8 @@ const TParticle * AliPHOSGetter::Primary(Int_t index) const
   if(index < 0) 
     return 0 ;
   TParticle *  p = 0 ;
-  if (fAlice) 
-    p = fAlice->Particle(index) ; 
-  else 
-    p = gAlice->Particle(index) ; 
+
+  p = gAlice->Particle(index) ; 
   
   return p ; 
     
@@ -2107,7 +2099,6 @@ void AliPHOSGetter::ReadPrimaries()
     if (fDebug) 
       cout << "INFO: AliPHOSGetter::ReadPrimaries -> TreeK found in " << fHeaderFile.Data() << endl ; 
     fNPrimaries = gAlice->GetNtrack() ; 
-    fAlice = 0 ; 
   
   } else { // treeK not found in header file
     
@@ -2152,7 +2143,7 @@ void AliPHOSGetter::Event(const Int_t event, const char* opt)
   if( strstr(opt,"Q") )
     ReadTreeQA() ;
  
-  if( strstr(opt,"P") || (strcmp(opt,"")==0) )
+  if( strstr(opt,"P"))
     ReadPrimaries() ;
   
 }
index 66259f54101293662314d33c95c2fb9df2220aa2..88bc1101003f41fbb0f3fc9cf4492c3790260652 100644 (file)
@@ -232,7 +232,6 @@ private:
   TString        fSDigitsFileName ;      //!
   Bool_t         fFailed ;            //! set if file not opend or galice not found
   Int_t          fDebug ;             //! Debug level
-  AliRun *       fAlice ;             //! needed to read TreeK if in an other file than fHeaderFile
   Int_t          fNPrimaries ;        //! # of primaries  
   TObjArray *    fPrimaries ;         //! list of lists of primaries-for the case of mixing
   TFolder *      fModuleFolder ;      //!Folder that contains the modules