Protection against the absence of galice.root
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Oct 2007 17:17:01 +0000 (17:17 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Oct 2007 17:17:01 +0000 (17:17 +0000)
STEER/AliQADataMakerSteer.cxx

index 70d46d8..70485b3 100644 (file)
@@ -189,30 +189,30 @@ Bool_t AliQADataMakerSteer::Init(const AliQA::TASKINDEX taskIndex, const  char *
                fRunNumber = fRawReader->GetRunNumber() ; 
                fRawReader->RewindEvents();
                fNumberOfEvents = 999999 ;
-               
+       } else if (taskIndex == AliQA::kESDS) {
+               if (!gSystem->AccessPathName("AliESDs.root")) { // AliESDs.root exists
+                       TFile * esdFile = TFile::Open("AliESDs.root") ;
+                       fESDTree = dynamic_cast<TTree *> (esdFile->Get("esdTree")) ; 
+                       fESD     = new AliESDEvent() ;
+                       fESD->ReadFromTree(fESDTree) ;
+                       fESDTree->GetEntry(0) ; 
+                       fRunNumber = fESD->GetRunNumber() ; 
+                       fNumberOfEvents = fESDTree->GetEntries() ;
+               } else {
+                       AliError("AliESDs.root not found") ; 
+                       return kFALSE ; 
+               }                       
        } else {
                if ( !InitRunLoader() ) {
                        AliError("Problems in getting the Run Loader") ; 
                        return kFALSE ; 
                } else {
-                       fRunNumber      = fRunLoader->GetAliRun()->GetRunNumber() ; 
+                       if (fRunLoader->GetAliRun()) 
+                               fRunNumber      = fRunLoader->GetAliRun()->GetRunNumber() ; 
                        fNumberOfEvents = fRunLoader->GetNumberOfEvents() ;
                }
-               if (taskIndex == AliQA::kESDS) {
-                       if (!gSystem->AccessPathName("AliESDs.root")) { // AliESDs.root exists
-                               TFile * esdFile = TFile::Open("AliESDs.root") ;
-                               fESDTree = dynamic_cast<TTree *> (esdFile->Get("esdTree")) ; 
-                               fESD     = new AliESDEvent() ;
-                               fESD->ReadFromTree(fESDTree) ;
-                               fESDTree->GetEntry(0) ; 
-                               fRunNumber = fESD->GetRunNumber() ; 
-                               fNumberOfEvents = fESDTree->GetEntries() ;
-                       } else {
-                               AliError("AliESDs.root not found") ; 
-                               return kFALSE ; 
-                       }
-               }
-       }       
+       }
+               
        // Initialize all QA data makers for all detectors
        for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
                AliQADataMaker * qadm = GetQADataMaker(iDet) ;