QA data were not correctly saved for simulation
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Oct 2008 15:44:35 +0000 (15:44 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Oct 2008 15:44:35 +0000 (15:44 +0000)
STEER/AliQADataMakerSim.cxx
STEER/AliQADataMakerSteer.cxx
STEER/AliQADataMakerSteer.h
STEER/AliSimulation.cxx

index eaf3561..128ef56 100644 (file)
@@ -114,18 +114,16 @@ 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() ;
-      }
     }
     if (WriteExpert()) {
       TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; 
@@ -133,11 +131,8 @@ void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX_t task)
         expertDir->cd() ;
         next.Reset() ; 
         while ( (obj = dynamic_cast<TH1 *>(next())) ) {
-          TString name(obj->GetTitle()) ;
-          if (name.Contains(AliQA::GetExpert())) 
+          if (!obj->TestBit(AliQA::GetExpertBit()))
             continue ; 
-          name.ReplaceAll(AliQA::GetExpert(), "") ;
-          obj->SetTitle(name) ; 
           obj->Write() ;
         }      
       }
index 2b78a24..11c5218 100644 (file)
@@ -424,6 +424,28 @@ void  AliQADataMakerSteer::EndOfCycle(TObjArray * detArray)
 }
 
 //_____________________________________________________________________________
+void  AliQADataMakerSteer::EndOfCycle(TString detectors) 
+{
+       // End of cycle QADataMakers 
+       
+       for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
+               if (IsSelected(AliQA::GetDetName(iDet))) {
+                       AliQADataMaker * qadm = GetQADataMaker(iDet) ;
+                       if (!qadm) 
+                               continue ;      
+                       // skip non active detectors
+      if (!detectors.Contains(AliQA::GetDetName(iDet))) 
+        continue ;
+               for (UInt_t taskIndex = 0; taskIndex < AliQA::kNTASKINDEX; taskIndex++) {
+                               if ( fTasks.Contains(Form("%d", taskIndex)) ) 
+                                       qadm->EndOfCycle(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex))) ;
+                       }
+                       qadm->Finish();
+               }
+       }
+}
+
+//_____________________________________________________________________________
 void AliQADataMakerSteer::Increment()
 {
   // Increments the cycle counter for all QA Data Makers
@@ -748,9 +770,10 @@ TString AliQADataMakerSteer::Run(const char * detectors, AliRawReader * rawReade
                rawReader->RewindEvents() ;
        }       
        
-       if ( !Init(AliQA::kRAWS) ) 
-               return kFALSE ; 
-       fRawReaderDelete = kFALSE ; 
+       if (!fCycleSame) 
+    if ( !Init(AliQA::kRAWS) ) 
+      return kFALSE ; 
+  fRawReaderDelete = kFALSE ; 
 
        DoIt(AliQA::kRAWS) ; 
        return  fDetectorsW ;
@@ -782,8 +805,9 @@ TString AliQADataMakerSteer::Run(const char * detectors, const char * fileName,
                }
        }
        
-       if ( !Init(AliQA::kRAWS, fileName) ) 
-               return kFALSE ; 
+       if (!fCycleSame) 
+    if ( !Init(AliQA::kRAWS, fileName) ) 
+      return kFALSE ; 
        
        DoIt(AliQA::kRAWS) ; 
        return  fDetectorsW ;
@@ -818,17 +842,18 @@ TString AliQADataMakerSteer::Run(const char * detectors, const AliQA::TASKINDEX_
 
        if ( taskIndex == AliQA::kNULLTASKINDEX) { 
                for (UInt_t task = 0; task < AliQA::kNTASKINDEX; task++) {
-                       if ( fTasks.Contains(Form("%d", task)) ) {
+                       if ( fTasks.Contains(Form("%d", task)) && ! fCycleSame ) {
                                if ( !Init(AliQA::GetTaskIndex(AliQA::GetTaskName(task)), fileName) ) 
                                        return kFALSE ; 
                                DoIt(AliQA::GetTaskIndex(AliQA::GetTaskName(task))) ;
                        }
                }
        } else {
-               if ( !Init(taskIndex, fileName) ) 
-                       return kFALSE ; 
-               DoIt(taskIndex) ; 
-       }               
+    if (! fCycleSame )
+      if ( !Init(taskIndex, fileName) ) 
+        return kFALSE ; 
+      DoIt(taskIndex) ; 
+  }            
        
        return fDetectorsW ;
 
index b6a0f4b..4e2e431 100644 (file)
@@ -41,6 +41,7 @@ public:
        AliQADataMakerSteer & operator = (const AliQADataMakerSteer & qas) ; 
        virtual ~AliQADataMakerSteer() ; 
        void        EndOfCycle(TObjArray * detArray=0x0) ; 
+  void        EndOfCycle(TString detectors) ; 
        UInt_t      GetCurrentEvent() const { return fCurrentEvent ; }
        TObjArray * GetFromOCDB(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, const char * year) const ; 
        AliQADataMaker * GetQADataMaker(const Int_t iDet) ; 
index c70e1d6..a7786a7 100644 (file)
@@ -1809,6 +1809,8 @@ Bool_t AliSimulation::RunQA()
        detectorsw = fQASteer->Run(fQADetectors.Data()) ; 
        if ( detectorsw.IsNull() ) 
                rv = kFALSE ; 
+  else 
+    fQASteer->EndOfCycle(detectorsw) ; 
        return rv ; 
 }