]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliQADataMakerRec.cxx
ooooooooooops
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerRec.cxx
index e2a2d6164ca220371063460ae8253196c7628c07..363e2f38196cd7f829ee6785c67dad4396be747c 100644 (file)
@@ -7,7 +7,7 @@
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
  * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
+ * copies and that both the copyright notice and this permission notifce   *
  * appear in the supporting documentation. The authors make no claims     *
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
@@ -42,7 +42,8 @@ AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) :
   AliQADataMaker(name, title), 
   fESDsQAList(0x0), 
   fRawsQAList(0x0), 
-  fRecPointsQAList(0x0)
+  fRecPointsQAList(0x0),
+  fRecoParam(0x0)
 {
   // ctor
        fDetectorDirName = GetName() ; 
@@ -50,10 +51,11 @@ AliQADataMakerRec::AliQADataMakerRec(const char * name, const char * title) :
 
 //____________________________________________________________________________ 
 AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) :
-    AliQADataMaker(qadm.GetName(), qadm.GetTitle()), 
-    fESDsQAList(qadm.fESDsQAList),
-       fRawsQAList(qadm.fRawsQAList),
-       fRecPointsQAList(qadm.fRecPointsQAList)
+  AliQADataMaker(qadm.GetName(), qadm.GetTitle()), 
+  fESDsQAList(qadm.fESDsQAList),
+  fRawsQAList(qadm.fRawsQAList),
+  fRecPointsQAList(qadm.fRecPointsQAList),
+  fRecoParam(qadm.fRecoParam)
   
 {
   //copy ctor
@@ -62,6 +64,27 @@ AliQADataMakerRec::AliQADataMakerRec(const AliQADataMakerRec& qadm) :
        fDetectorDirName = GetName() ; 
 }
 
+//____________________________________________________________________________ 
+AliQADataMakerRec::~AliQADataMakerRec()
+{
+       //dtor: delete the TObjArray and thei content
+       if ( fESDsQAList ) {
+               if ( fESDsQAList->IsOwner() ) 
+                       fESDsQAList->Delete() ;     
+               delete fESDsQAList ;     
+       }
+       if ( fRawsQAList ) {
+               if ( fRawsQAList->IsOwner() ) 
+                       fRawsQAList->Delete() ;
+               delete fRawsQAList ;
+       }
+       if ( fRecPointsQAList ) {
+               if ( fRecPointsQAList->IsOwner() ) 
+                       fRecPointsQAList->Delete() ; 
+               delete fRecPointsQAList ; 
+       }
+}
+
 //__________________________________________________________________
 AliQADataMakerRec& AliQADataMakerRec::operator = (const AliQADataMakerRec& qadm )
 {
@@ -85,7 +108,7 @@ void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
        else if ( task == AliQA::kESDS )
                list = fESDsQAList ; 
 
-       DefaultEndOfDetectorCycle(task) ;
+       //DefaultEndOfDetectorCycle(task) ;
        EndOfDetectorCycle(task, list) ;
        TDirectory * subDir = 0x0 ;
        if (fDetectorDir) 
@@ -95,6 +118,7 @@ void AliQADataMakerRec::EndOfCycle(AliQA::TASKINDEX_t task)
                if (list) 
                        list->Write() ;
        }
+       //Finish() ; 
 }
  
 //____________________________________________________________________________
@@ -139,16 +163,22 @@ TObjArray *  AliQADataMakerRec::Init(AliQA::TASKINDEX_t task, Int_t run, Int_t c
                SetCycle(cycles) ;  
        
        if ( task == AliQA::kRAWS ) {
-               fRawsQAList = new TObjArray(100) ;       
-               InitRaws() ;
+               if (! fRawsQAList ) { 
+                       fRawsQAList = new TObjArray(100) ;       
+                       InitRaws() ;
+               }
                rv = fRawsQAList ;
        } else if ( task == AliQA::kRECPOINTS ) {
-               fRecPointsQAList = new TObjArray(100) ; 
-               InitRecPoints() ;
+               if ( ! fRecPointsQAList ) {
+                       fRecPointsQAList = new TObjArray(100) ; 
+                       InitRecPoints() ;
+               }
                rv = fRecPointsQAList ;
        } else if ( task == AliQA::kESDS ) {
-               fESDsQAList = new TObjArray(100) ; 
-               InitESDs() ;
+               if ( ! fESDsQAList ) {
+                       fESDsQAList = new TObjArray(100) ; 
+                       InitESDs() ;
+               }
                rv = fESDsQAList ;
        }
        
@@ -203,11 +233,12 @@ void AliQADataMakerRec::StartOfCycle(AliQA::TASKINDEX_t task, const Bool_t sameC
          list = fRecPointsQAList ;
   else if ( task == AliQA::kESDS )  
          list = fESDsQAList ;
-
-       TIter next(list) ;
-       TH1 * h ; 
-       while ( (h = dynamic_cast<TH1 *>(next())) )
-               h->Reset() ;  
+       
+// Should be the choice of detectors
+//     TIter next(list) ;
+//     TH1 * h ; 
+//     while ( (h = dynamic_cast<TH1 *>(next())) )
+//             h->Reset() ;  
 
        StartOfDetectorCycle() ; 
 }