]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMakerRec.cxx
Fix for bug #66122: Backward compatibility in AliMultiplicity
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerRec.cxx
index 58bd7d1f39928e162def1c9f92f0d97b2dd2718b..04d9423e14f8e7efd4862424e9f1363ab3dfd5f3 100644 (file)
@@ -148,7 +148,8 @@ void AliQADataMakerRec::EndOfCycle(AliQAv1::TASKINDEX_t task)
 {
        // Finishes a cycle of QA 
        
-       TObjArray ** list = NULL ; 
+    
+  TObjArray ** list = NULL ; 
        
        if ( task == AliQAv1::kRAWS )     
                list = fRawsQAList ; 
@@ -165,6 +166,9 @@ void AliQADataMakerRec::EndOfCycle(AliQAv1::TASKINDEX_t task)
   //DefaultEndOfDetectorCycle(task) ;
        EndOfDetectorCycle(task, list) ;
   
+  if (! AliQAManager::QAManager(AliQAv1::kRECMODE)->IsSaveData())
+    return ; 
+
   fDetectorDir = fOutput->GetDirectory(GetDetectorDirName()) ; 
   if (!fDetectorDir)
     fDetectorDir = fOutput->mkdir(GetDetectorDirName()) ; 
@@ -323,6 +327,7 @@ void AliQADataMakerRec::Init(AliQAv1::TASKINDEX_t task, TObjArray ** list, Int_t
 //____________________________________________________________________________
 void AliQADataMakerRec::InitRecoParams() 
 {
+  // Get the recoparam form the OCDB 
   if (!fRecoParam) {
     AliDebug(AliQAv1::GetQADebugLevel(), Form("Loading reconstruction parameter objects for detector %s", GetName()));
     AliCDBPath path(GetName(),"Calib","RecoParam");
@@ -358,6 +363,37 @@ void AliQADataMakerRec::InitRecoParams()
   }
 }
 
+//____________________________________________________________________________ 
+void AliQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
+{
+    // default reset that resets all the QA objects.
+    // to be overloaded by detectors, if necessary
+
+  TObjArray ** list = NULL ; 
+  if ( task == AliQAv1::kRAWS ) {
+               list = fRawsQAList ;     
+       } else if ( task == AliQAv1::kDIGITSR ) {
+               list = fDigitsQAList ; 
+       } else if ( task == AliQAv1::kRECPOINTS ) {
+               list = fRecPointsQAList ; 
+       } else if ( task == AliQAv1::kESDS ) {
+               list = fESDsQAList ; 
+       }
+    //list was not initialized, skip
+  if (!list) 
+    return ; 
+  
+  for (int spec = 0; spec < AliRecoParam::kNSpecies; spec++) {
+    if (!AliQAv1::Instance()->IsEventSpecieSet(AliRecoParam::ConvertIndex(spec)))
+      continue;
+    TIter next(list[spec]) ; 
+    TH1 * histo = NULL ; 
+    while ( (histo = dynamic_cast<TH1*> (next())) ) {
+      histo->Reset() ;
+    }
+  }
+}
+
 //____________________________________________________________________________
 void AliQADataMakerRec::StartOfCycle(Int_t run) 
 {