expert QA data are written on demand only. The cycles array has been extended to...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Aug 2008 18:15:39 +0000 (18:15 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Aug 2008 18:15:39 +0000 (18:15 +0000)
STEER/AliQADataMaker.cxx
STEER/AliQADataMaker.h
STEER/AliQADataMakerRec.cxx
STEER/AliQADataMakerSim.cxx
STEER/AliReconstruction.cxx
STEER/AliReconstruction.h

index 9a08428..6142b13 100644 (file)
@@ -51,6 +51,7 @@ AliQADataMaker::AliQADataMaker(const char * name, const char * title) :
   fCurrentCycle(0), 
   fCycle(9999999), 
   fCycleCounter(0), 
+  fWriteExpert(kFALSE),
   fParameterList(0x0), 
   fRun(0)
 {
@@ -67,6 +68,7 @@ AliQADataMaker::AliQADataMaker(const AliQADataMaker& qadm) :
   fCurrentCycle(qadm.fCurrentCycle), 
   fCycle(qadm.fCycle), 
   fCycleCounter(qadm.fCycleCounter), 
+  fWriteExpert(qadm.fWriteExpert),
   fParameterList(qadm.fParameterList),  
   fRun(qadm.fRun)
 {
index 320ef2f..9e7ea6c 100644 (file)
@@ -64,8 +64,11 @@ public:
        const Bool_t        IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; }
        void                Reset() { fCycleCounter = 0 ; }
        void                SetCycle(Int_t nevts) { fCycle = nevts ; } 
+  void                SetWriteExpert() { fWriteExpert = kTRUE ; }
        virtual void        StartOfCycle(Int_t run = -1)                                                      = 0 ;
        virtual void        StartOfCycle(AliQA::TASKINDEX_t, Int_t run, const Bool_t sameCycle = kFALSE) = 0 ;
+  void                UnSetWriteExpert() { fWriteExpert = kFALSE ; }
+  Bool_t              WriteExpert() { return fWriteExpert ; }
 
        virtual void        SetRecoParam(const AliDetectorRecoParam */*param*/) { return; }
          
@@ -103,6 +106,7 @@ protected:
        Int_t          fCurrentCycle ;    //! current cycle number
        Int_t          fCycle ;           //! length (# events) of the QA data acquisition cycle  
        Int_t          fCycleCounter ;    //! cycle counter
+  Bool_t         fWriteExpert ;     //! flag to write or not the expert QA data
   TList *        fParameterList ;   //! list of QA data parameters
        Int_t          fRun ;             //! run number
 
index c19ee37..c519ace 100644 (file)
@@ -138,18 +138,20 @@ void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
           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) ; 
+      if (WriteExpert()) {
+        TDirectory * expertDir = subDir->GetDirectory(AliQA::GetExpert()) ; 
+        if ( expertDir ) { // Write only if requested
+          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 (fObject && GetName() == AliQA::kCORR) {
index 369bc87..49207b2 100644 (file)
@@ -127,18 +127,20 @@ void AliQADataMakerSim::EndOfCycle(AliQA::TASKINDEX_t task)
         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())) ) {
+          TString name(obj->GetTitle()) ;
+          if (name.Contains(AliQA::GetExpert())) 
+            continue ; 
+          name.ReplaceAll(AliQA::GetExpert(), "") ;
+          obj->SetTitle(name) ; 
+          obj->Write() ;
+        }      
+      }
     }
   }
   ResetCycle() ; 
index 3185568..bf69c94 100644 (file)
@@ -374,8 +374,11 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) :
     fReconstructor[iDet] = NULL;
     fLoader[iDet] = NULL;
     fTracker[iDet] = NULL;
-    fQACycles[iDet] = rec.fQACycles[iDet];     
-  }
+  }  
+  
+  for (Int_t iDet = 0; iDet < AliQA::kNDET; iDet++) 
+    fQACycles[iDet] = rec.fQACycles[iDet];
+
   for (Int_t i = 0; i < rec.fSpecCDBUri.GetEntriesFast(); i++) {
     if (rec.fSpecCDBUri[i]) fSpecCDBUri.Add(rec.fSpecCDBUri[i]->Clone());
   }
@@ -448,9 +451,11 @@ AliReconstruction& AliReconstruction::operator = (const AliReconstruction& rec)
     delete fReconstructor[iDet]; fReconstructor[iDet] = NULL;
     delete fLoader[iDet]; fLoader[iDet] = NULL;
     delete fTracker[iDet]; fTracker[iDet] = NULL;
-    fQACycles[iDet] = rec.fQACycles[iDet];     
   }
-
+  
+  for (Int_t iDet = 0; iDet < AliQA::kNDET; iDet++) 
+    fQACycles[iDet] = rec.fQACycles[iDet];
+  
   fVertexer             = NULL;
   delete fDiamondProfile; fDiamondProfile = NULL;
   if (rec.fDiamondProfile) fDiamondProfile = new AliESDVertex(*rec.fDiamondProfile);
@@ -1286,7 +1291,7 @@ void AliReconstruction::SlaveBegin(TTree*)
   if (fRunQA) {
     fQASteer = new AliQADataMakerSteer("rec") ; 
     fQASteer->SetActiveDetectors(fQADetectors) ; 
-    for (Int_t det = 0 ; det < fgkNDetectors ; det++)
+    for (Int_t det = 0 ; det < AliQA::kNDET ; det++)
       fQASteer->SetCycleLength(AliQA::DETECTORINDEX_t(det), fQACycles[det]) ;  
     if (!fRawReader && fQATasks.Contains(AliQA::kRAWS))
       fQATasks.ReplaceAll(Form("%d",AliQA::kRAWS), "") ;
index 02eb818..ec15f41 100644 (file)
@@ -265,7 +265,7 @@ private:
   Bool_t        fSetRunNumberFromDataCalled;  //! flag to check if run number is already loaded from run loader
 
   //Quality Assurance
-  Int_t fQACycles[      fgkNDetectors]; // # events over which QA data are accumulated
+  Int_t fQACycles[      AliQA::kNDET];  // # events over which QA data are accumulated
   TString               fQADetectors ;  // list of detectors to be QA'ed       
   AliQADataMakerSteer * fQASteer    ;   //! steering class to run QA
   TString               fQATasks ;      // list of QA tasks to be performed