]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMakerSim.cxx
AliVertexerTracks works now with the new AliVEvent and AliVTrack classes (A. Dainese)
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerSim.cxx
index 369bc870429edb50292a4e2456f8e192ac675d0f..128ef56b8c14ab17238c3ada09167c18adca7cf0 100644 (file)
@@ -114,33 +114,31 @@ void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX_t task)
   if ( ! list ) 
     return ; 
        EndOfDetectorCycle(task, list) ; 
-       TDirectory * subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ; 
+  TDirectory * subDir = NULL ;
+       if (fDetectorDir) 
+    subDir = fDetectorDir->GetDirectory(AliQA::GetTaskName(task)) ; 
        if (subDir) { 
                subDir->cd() ; 
     TIter next(list) ; 
     TH1 * obj ; 
     while ( (obj = dynamic_cast<TH1 *>(next())) ) {
-      TString name(obj->GetTitle()) ;
-      if (name.Contains(AliQA::GetExpert())) {
-        name.ReplaceAll(AliQA::GetExpert(), "") ;
-        obj->SetTitle(name) ; 
+      if (!obj->TestBit(AliQA::GetExpertBit()))
         obj->Write() ;
-      }
     }
-    TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; 
-    if ( expertDir ) {
-      expertDir->cd() ;
-      next.Reset() ; 
-      while ( (obj = dynamic_cast<TH1 *>(next())) ) {
-        TString name(obj->GetTitle()) ;
-        if (name.Contains(AliQA::GetExpert())) 
-          continue ; 
-        name.ReplaceAll(AliQA::GetExpert(), "") ;
-        obj->SetTitle(name) ; 
-        obj->Write() ;
-      }      
+    if (WriteExpert()) {
+      TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; 
+      if ( expertDir ) {
+        expertDir->cd() ;
+        next.Reset() ; 
+        while ( (obj = dynamic_cast<TH1 *>(next())) ) {
+          if (!obj->TestBit(AliQA::GetExpertBit()))
+            continue ; 
+          obj->Write() ;
+        }      
+      }
     }
   }
+  fOutput->Save() ; 
   ResetCycle() ; 
 }