]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
added fFailed data member that tells is file is opened and galise found
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Apr 2002 16:21:10 +0000 (16:21 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Apr 2002 16:21:10 +0000 (16:21 +0000)
PHOS/AliPHOSGetter.cxx
PHOS/AliPHOSGetter.h

index 91e18500daad205ff9b47048652574e74946f63c..857b958f386f457268553540a2f07cf9396ae82e 100644 (file)
@@ -104,11 +104,12 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle )
   fQAFolder        = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Run/Conditions/QA")); 
   fTasksFolder     = dynamic_cast<TFolder*>(gROOT->FindObjectAny("Folders/Tasks")) ; 
 
+  fFailed = kFALSE ; 
+
   if ( fHeaderFile != "aliroot"  ) { // to call the getter without a file
 
     //open headers file
     TFile * file = static_cast<TFile*>(gROOT->GetFile(fHeaderFile.Data() ) ) ;
-    
     if(file == 0){    //if file was not opened yet, read gAlice
       if(fHeaderFile.Contains("rfio")) // if we read file using HPSS
        file =  TFile::Open(fHeaderFile.Data(),"update") ;
@@ -117,7 +118,8 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle )
       
       if (!file->IsOpen()) {
        cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot open " << fHeaderFile.Data() << endl ; 
-       abort() ; 
+       fFailed = kTRUE ;
+        return ;  
       }
       
       gAlice = static_cast<AliRun *>(file->Get("gAlice")) ;
@@ -126,7 +128,8 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* branchTitle )
 
   if (!gAlice) {
     cerr << "ERROR : AliPHOSGetter::AliPHOSGetter -> Cannot find gAlice in " << fHeaderFile.Data() << endl ; 
-    abort() ; 
+    fFailed = kTRUE ;
+    return ; 
   }
   if (!PHOS()) {
     if (fDebug)
index 8bd169e317f77ab64ac864b28a73ac3a6ce52ffd..994e6c1dfb0672ebd59e9ad2cb92c49afe3e8df2 100644 (file)
@@ -61,6 +61,7 @@ class AliPHOSGetter : public TObject {
   
   virtual ~AliPHOSGetter() ; 
   
+  const Bool_t HasFailed() const { return fFailed ; }
   Bool_t PostPrimaries(void ) const ;  
   Bool_t PostHits(void ) const ;  
   Bool_t PostSDigits(      const char * name,  const char * file = 0) const ;  
@@ -223,6 +224,7 @@ private:
   TString        fDigitsTitle ;       //!
   TString        fSDigitsTitle ;      //!
 
+  Bool_t         fFailed ;            //! set if file not opend or galice not found
   Int_t          fDebug ;             // Debug level
 
   Int_t          fNPrimaries ;        //! # of primaries