]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
correct leaks in trigger
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Jan 2011 09:59:40 +0000 (09:59 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 26 Jan 2011 09:59:40 +0000 (09:59 +0000)
EMCAL/AliEMCALReconstructor.cxx
EMCAL/AliEMCALReconstructor.h
EMCAL/AliEMCALTriggerSTURawStream.cxx
EMCAL/AliEMCALTriggerTRU.cxx

index 0dc6810ece36e922cb196a860fda5f9d99202529..8cd90240850340901b4208a57031b0a8bc2b9fdb 100644 (file)
@@ -76,6 +76,7 @@ AliEMCALRawUtils*           AliEMCALReconstructor::fgRawUtils         = 0;   //
 AliEMCALClusterizer*        AliEMCALReconstructor::fgClusterizer      = 0;   // EMCAL clusterizer class
 TClonesArray*               AliEMCALReconstructor::fgDigitsArr        = 0;   // list of digits, to be used multiple times
 TObjArray*                  AliEMCALReconstructor::fgClustersArr      = 0;   // list of clusters, to be used multiple times
+TClonesArray*               AliEMCALReconstructor::fgTriggerDigits    = 0;   // list of trigger digits, to be used multiple times
 AliEMCALTriggerElectronics* AliEMCALReconstructor::fgTriggerProcessor = 0x0;
 //____________________________________________________________________________
 AliEMCALReconstructor::AliEMCALReconstructor() 
@@ -132,9 +133,9 @@ AliEMCALReconstructor::AliEMCALReconstructor()
   fTriggerData = new AliEMCALTriggerData();
 
   //Init temporary list of digits
-  fgDigitsArr   = new TClonesArray("AliEMCALDigit",1000);
-  fgClustersArr = new TObjArray(1000);
-       
+  fgDigitsArr     = new TClonesArray("AliEMCALDigit",1000);
+  fgClustersArr   = new TObjArray(1000);
+  fgTriggerDigits = new TClonesArray("AliEMCALTriggerRawDigit",1000);  
 } 
 
 //____________________________________________________________________________
@@ -158,6 +159,11 @@ AliEMCALReconstructor::~AliEMCALReconstructor()
     delete fgClustersArr; 
   }
   
+  if(fgTriggerDigits){
+    fgTriggerDigits->Clear("C");
+    delete fgTriggerDigits; 
+  }
+  
   if(fgRawUtils)         delete fgRawUtils;
   if(fgClusterizer)      delete fgClusterizer;
   if(fgTriggerProcessor) delete fgTriggerProcessor;
@@ -338,8 +344,8 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
          AliWarning("Cannot retrieve V0 ESD! Run w/ null V0 charges");
    }
 
-   TClonesArray *trgDigits = new TClonesArray("AliEMCALTriggerRawDigit",1000);
-       
+   if (fgTriggerDigits) fgTriggerDigits->Clear("C");
+
    TBranch *branchtrg = digitsTree->GetBranch("EMTRG");
        
    if (!branchtrg) 
@@ -348,22 +354,22 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
          return;
    }
        
-   branchtrg->SetAddress(&trgDigits);
+   branchtrg->SetAddress(&fgTriggerDigits);
    branchtrg->GetEntry(0);
   
    // Note: fgTriggerProcessor reset done at the end of this method
-   fgTriggerProcessor->Digits2Trigger(trgDigits, v0M, fTriggerData);
+   fgTriggerProcessor->Digits2Trigger(fgTriggerDigits, v0M, fTriggerData);
 
    // Fill ESD
    AliESDCaloTrigger* trgESD = esd->GetCaloTrigger("EMCAL");
   
    if (trgESD)
    {
-         trgESD->Allocate(trgDigits->GetEntriesFast());
+         trgESD->Allocate(fgTriggerDigits->GetEntriesFast());
          
-         for (Int_t i = 0; i < trgDigits->GetEntriesFast(); i++)
+         for (Int_t i = 0; i < fgTriggerDigits->GetEntriesFast(); i++)
          {       
-                 AliEMCALTriggerRawDigit* rdig = (AliEMCALTriggerRawDigit*)trgDigits->At(i);
+                 AliEMCALTriggerRawDigit* rdig = (AliEMCALTriggerRawDigit*)fgTriggerDigits->At(i);
                  
                  Int_t px, py;
                  if (fGeom->GetPositionInEMCALFromAbsFastORIndex(rdig->GetId(), px, py))
index 3cfd4ab2705dc4fe01620e0cd108b1c50455eefa..bbc4fe8a00d221da098af78776bf0e154ea5ca2a 100644 (file)
@@ -98,8 +98,9 @@ private:
                                                // parameters for EMCAL
   static AliEMCALRawUtils*   fgRawUtils;  // raw utilities class -
                                          // only need one per reco
-  static TClonesArray*       fgDigitsArr;   // Array with EMCAL digits
-  static TObjArray*          fgClustersArr; // Array with EMCAL clusters
+  static TClonesArray*       fgDigitsArr;     //-> Array with EMCAL digits
+  static TObjArray*          fgClustersArr;   //   Array with EMCAL clusters
+  static TClonesArray*       fgTriggerDigits; //-> Array with EMCAL trigger digits
 
   AliEMCALCalibData    * fCalibData   ;   //! Calibration database if aval
   AliCaloCalibPedestal * fPedestalData ;   //! Tower status database if aval
index b91407b962b28baf640a71ec4a0029090f4a9694..048528b70e483d61965712d4fe0106495c368c29 100644 (file)
@@ -1,3 +1,4 @@
+
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
@@ -93,7 +94,7 @@ void AliEMCALTriggerSTURawStream::Reset()
 Bool_t AliEMCALTriggerSTURawStream::ReadPayLoad()
 {
        // STU data decoder from Olivier Bourrion LPSC CNRS-IN2P3
-       // bourrion@lpsc.in2p3.fr
+       // bourrion_at_lpsc_dot_in2p3_dot_fr
        
        UInt_t word32[1772]; // 32b words
        for (Int_t i=0;i<1772;i++) word32[i] = 0;
index 3d542d484e9f07db9785e6dcc90c6497e695e984..db1d829b9f50823663708606a9feef4f9a151e18 100644 (file)
@@ -227,6 +227,13 @@ Int_t AliEMCALTriggerTRU::L0()
                if (!nPeaks)
                {
                        ZeroRegion();
+
+                       for (Int_t x = 0; x < xsize; x++)
+                       {
+                         delete [] peaks[x];
+                       }
+                       delete [] peaks;
+
                        continue;
                }
                
@@ -278,6 +285,8 @@ Int_t AliEMCALTriggerTRU::L0()
                                }
                        }
                        
+                       delete [] idx;
+
                        if ( !foundPeak ) 
                        {
                                fPatches->RemoveAt( j );