New ResetDetector method required by AMORE
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 09:09:41 +0000 (09:09 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 09:09:41 +0000 (09:09 +0000)
STEER/AliQADataMaker.cxx
STEER/AliQADataMaker.h
STEER/AliQADataMakerRec.cxx
STEER/AliQADataMakerRec.h
STEER/AliQADataMakerSim.cxx
STEER/AliQADataMakerSim.h
STEER/AliQAManager.cxx
STEER/AliQAManager.h
test/ppbench/recraw/rec.C

index 6eb4685..7c77dfc 100644 (file)
@@ -245,3 +245,4 @@ Bool_t AliQADataMaker::IsValidEventSpecie(Int_t eventSpecieIndex, TObjArray ** l
   else
     return kTRUE ;
 }
+
index 4fec2b8..2496007 100644 (file)
@@ -75,7 +75,7 @@ public:
   Bool_t              IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; }
   Bool_t              IsValidEventSpecie(Int_t eventSpecieIndex, TObjArray ** list) ; 
        void                Reset() { fCycleCounter = 0 ; }
-       virtual void        ResetDetector() {;}
+       virtual void        ResetDetector(AliQAv1::TASKINDEX_t task) = 0 ;
        void                SetCycle(Int_t nevts) { fCycle = nevts ; } 
   void                SetWriteExpert() { fWriteExpert = kTRUE ; }
        virtual void        StartOfCycle(Int_t run = -1)                                                   = 0 ;
index 7cc48d7..f400185 100644 (file)
@@ -362,6 +362,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) 
 {
index d652966..4562d5a 100644 (file)
@@ -60,6 +60,7 @@ public:
        virtual void        InitRecPoints()                     {AliInfo("To be implemented by detectors");}
        virtual void        InitDigits()                        {AliInfo("To be implemented by detectors");}
        virtual void        InitESDs()                          {AliInfo("To be implemented by detectors");}
+  virtual void        ResetDetector(AliQAv1::TASKINDEX_t task) ;
        virtual void        StartOfCycle(Int_t run = -1) ;
        virtual void        StartOfCycle(AliQAv1::TASKINDEX_t task, Int_t run, const Bool_t sameCycle = kFALSE) ;
        virtual void        SetRecoParam(const AliDetectorRecoParam *param) { fRecoParam = param; }
index aaef43b..eba8653 100644 (file)
@@ -269,6 +269,35 @@ void AliQADataMakerSim::Init(AliQAv1::TASKINDEX_t task, TObjArray ** list, Int_t
        } 
 }
 
+//____________________________________________________________________________ 
+void AliQADataMakerSim::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::kHITS ) {
+               list = fHitsQAList ;     
+       } else if ( task == AliQAv1::kSDIGITS ) {
+               list = fSDigitsQAList ; 
+       } else if ( task == AliQAv1::kDIGITS ) {
+               list = fDigitsQAList ; 
+       }
+    //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 AliQADataMakerSim::StartOfCycle(Int_t run) 
 { 
index 59036bb..5715e05 100644 (file)
@@ -55,6 +55,7 @@ public:
        virtual void        Init(AliQAv1::TASKINDEX_t task, TObjArray ** list, Int_t run, Int_t cycles = -1) ;
   virtual void        InitRaws() {AliWarning("Call not valid") ; }
        virtual void        InitRecPoints()                  {AliWarning("Call not valid") ; } 
+  virtual void        ResetDetector(AliQAv1::TASKINDEX_t task) ;
        virtual void        StartOfCycle(Int_t run = -1) ;
        virtual void        StartOfCycle(AliQAv1::TASKINDEX_t task, Int_t run, const Bool_t sameCycle = kFALSE) ;
 
index 2c18c51..898b8ee 100644 (file)
@@ -1103,6 +1103,25 @@ void AliQAManager::Reset(const Bool_t sameCycle)
 }
 
 //_____________________________________________________________________________
+void AliQAManager::ResetDetectors(AliQAv1::TASKINDEX_t task, AliQAv1::DETECTORINDEX_t det)
+{
+    //calls ResetDetector of specified or all detectors
+  UInt_t iDet    = 0 ;
+  UInt_t iDetMax = fgkNDetectors ;    
+  if ( det != AliQAv1::kNULLDET ) {
+    iDet    = det ;
+    iDetMax = det+1 ;    
+  }
+  
+       for (iDet = 0; iDet < iDetMax ; iDet++) {
+               if (IsSelected(AliQAv1::GetDetName(iDet))) {
+                       AliQADataMaker * qadm = GetQADataMaker(iDet);
+                       qadm->ResetDetector(task);
+               }
+       }   
+}
+
+//_____________________________________________________________________________
 AliQAManager * AliQAManager::QAManager(AliQAv1::MODE_t mode, TMap *entryCache, Int_t run) 
 {
   // returns AliQAManager instance (singleton)
index d0f50a9..3028bb9 100644 (file)
@@ -8,7 +8,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 // class for running the QA makers                                           //
-//                                                                           //
+//                                                                           //1
 //   AliQAManager qas;                                                //
 //   qas.Run(AliQAv1::kRAWS, rawROOTFileName);                                 //
 //   qas.Run(AliQAv1::kHITS);                                                  //
@@ -62,6 +62,7 @@ public:
   static           AliQAManager * QAManager(AliQAv1::MODE_t = AliQAv1::kNULLMODE, TMap *entryCache = NULL, Int_t run = -1) ;
   static           AliQAManager * QAManager(AliQAv1::TASKINDEX_t task) ;  
        void             Reset(const Bool_t sameCycle = kFALSE) ;  
+  void             ResetDetectors(AliQAv1::TASKINDEX_t task, AliQAv1::DETECTORINDEX_t det=AliQAv1::kNULLDET) ; 
        TString          Run(const Char_t * detectors, const AliQAv1::TASKINDEX_t taskIndex=AliQAv1::kNULLTASKINDEX, Bool_t const sameCycle = kFALSE, const Char_t * fileName = NULL) ; 
        TString          Run(const Char_t * detectors, AliRawReader * rawReader, Bool_t const sameCycle = kFALSE) ; 
        TString          Run(const Char_t * detectors, const Char_t * filename, Bool_t const sameCycle = kFALSE) ;
index 2100659..95272b1 100644 (file)
@@ -14,6 +14,7 @@ void rec() {
                          Form("local://%s/..",gSystem->pwd()));
   reco.SetRunPlaneEff(kTRUE);
 
+  reco.SetRunReconstruction("ALL -ZDC") ;
   reco.SetRunQA("ALL:ALL") ;
   
   reco.SetQARefDefaultStorage("local://$ALICE_ROOT/QAref") ;