TObjArray ownership assignment
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Aug 2010 13:22:26 +0000 (13:22 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 Aug 2010 13:22:26 +0000 (13:22 +0000)
EMCAL/AliCaloCalibPedestal.cxx
EMCAL/AliEMCALBiasAPD.cxx
EMCAL/AliEMCALCalibAbs.cxx
EMCAL/AliEMCALCalibMapAPD.cxx
EMCAL/AliEMCALCalibReference.cxx

index b2f1cfc..c3ec750 100644 (file)
@@ -211,6 +211,28 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
   fPeakMinusPedHighGainHisto.Compress();
   fDeadMap.Compress();
 
+  // set owner ship for everyone
+  fPedestalLowGain.SetOwner(kTRUE);
+  fPedestalHighGain.SetOwner(kTRUE);
+  fPedestalLEDRefLowGain.SetOwner(kTRUE);
+  fPedestalLEDRefHighGain.SetOwner(kTRUE);
+  fPeakMinusPedLowGain.SetOwner(kTRUE);
+  fPeakMinusPedHighGain.SetOwner(kTRUE);
+  fPeakMinusPedHighGainHisto.SetOwner(kTRUE);
+  fPedestalLowGainDiff.SetOwner(kTRUE);
+  fPedestalHighGainDiff.SetOwner(kTRUE);
+  fPedestalLEDRefLowGainDiff.SetOwner(kTRUE);
+  fPedestalLEDRefHighGainDiff.SetOwner(kTRUE);
+  fPeakMinusPedLowGainDiff.SetOwner(kTRUE);
+  fPeakMinusPedHighGainDiff.SetOwner(kTRUE);
+  fPedestalLowGainRatio.SetOwner(kTRUE);
+  fPedestalHighGainRatio.SetOwner(kTRUE);
+  fPedestalLEDRefLowGainRatio.SetOwner(kTRUE);
+  fPedestalLEDRefHighGainRatio.SetOwner(kTRUE);
+  fPeakMinusPedLowGainRatio.SetOwner(kTRUE);
+  fPeakMinusPedHighGainRatio.SetOwner(kTRUE);
+  fDeadMap.SetOwner(kTRUE);
+
 }
 
 // dtor
@@ -218,7 +240,29 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(kDetType detectorType) :
 AliCaloCalibPedestal::~AliCaloCalibPedestal()
 {
   if (fReference) delete fReference;//Delete the reference object, if it has been loaded
-  //TObjArray will delete the histos/profiles when it is deleted.
+
+  // delete also TObjArray's 
+  fPedestalLowGain.Delete();
+  fPedestalHighGain.Delete();
+  fPedestalLEDRefLowGain.Delete();
+  fPedestalLEDRefHighGain.Delete();
+  fPeakMinusPedLowGain.Delete();
+  fPeakMinusPedHighGain.Delete();
+  fPeakMinusPedHighGainHisto.Delete();
+  fPedestalLowGainDiff.Delete();
+  fPedestalHighGainDiff.Delete();
+  fPedestalLEDRefLowGainDiff.Delete();
+  fPedestalLEDRefHighGainDiff.Delete();
+  fPeakMinusPedLowGainDiff.Delete();
+  fPeakMinusPedHighGainDiff.Delete();
+  fPedestalLowGainRatio.Delete();
+  fPedestalHighGainRatio.Delete();
+  fPedestalLEDRefLowGainRatio.Delete();
+  fPedestalLEDRefHighGainRatio.Delete();
+  fPeakMinusPedLowGainRatio.Delete();
+  fPeakMinusPedHighGainRatio.Delete();
+  fDeadMap.Delete();
+
 }
 
 // copy ctor
@@ -292,8 +336,30 @@ AliCaloCalibPedestal::AliCaloCalibPedestal(const AliCaloCalibPedestal &ped) :
   fPeakMinusPedLowGain.Compress();
   fPeakMinusPedHighGain.Compress();
   fPeakMinusPedHighGainHisto.Compress();
-
   fDeadMap.Compress();
+
+  // set owner ship for everyone
+  fPedestalLowGain.SetOwner(kTRUE);
+  fPedestalHighGain.SetOwner(kTRUE);
+  fPedestalLEDRefLowGain.SetOwner(kTRUE);
+  fPedestalLEDRefHighGain.SetOwner(kTRUE);
+  fPeakMinusPedLowGain.SetOwner(kTRUE);
+  fPeakMinusPedHighGain.SetOwner(kTRUE);
+  fPeakMinusPedHighGainHisto.SetOwner(kTRUE);
+  fPedestalLowGainDiff.SetOwner(kTRUE);
+  fPedestalHighGainDiff.SetOwner(kTRUE);
+  fPedestalLEDRefLowGainDiff.SetOwner(kTRUE);
+  fPedestalLEDRefHighGainDiff.SetOwner(kTRUE);
+  fPeakMinusPedLowGainDiff.SetOwner(kTRUE);
+  fPeakMinusPedHighGainDiff.SetOwner(kTRUE);
+  fPedestalLowGainRatio.SetOwner(kTRUE);
+  fPedestalHighGainRatio.SetOwner(kTRUE);
+  fPedestalLEDRefLowGainRatio.SetOwner(kTRUE);
+  fPedestalLEDRefHighGainRatio.SetOwner(kTRUE);
+  fPeakMinusPedLowGainRatio.SetOwner(kTRUE);
+  fPeakMinusPedHighGainRatio.SetOwner(kTRUE);
+  fDeadMap.SetOwner(kTRUE);
+
 }
 
 // assignment operator; use copy ctor to make life easy..
index 8f9ac02..6610e5f 100644 (file)
@@ -39,6 +39,7 @@ AliEMCALBiasAPD::AliEMCALBiasAPD(const int nSM) :
     fSuperModuleData.Add(new AliEMCALSuperModuleBiasAPD(i));
   }
   fSuperModuleData.Compress(); // compress the TObjArray
+  fSuperModuleData.SetOwner(kTRUE); 
 }
 
 //____________________________________________________________________________
index b63b9b4..56faa7c 100644 (file)
@@ -39,6 +39,7 @@ AliEMCALCalibAbs::AliEMCALCalibAbs(const int nSM) :
     fSuperModuleData.Add(new AliEMCALSuperModuleCalibAbs(i));
   }
   fSuperModuleData.Compress(); // compress the TObjArray
+  fSuperModuleData.SetOwner(kTRUE); 
 }
 
 //____________________________________________________________________________
index 82b888b..038b72c 100644 (file)
@@ -39,6 +39,7 @@ AliEMCALCalibMapAPD::AliEMCALCalibMapAPD(const int nSM) :
     fSuperModuleData.Add(new AliEMCALSuperModuleCalibMapAPD(i));
   }
   fSuperModuleData.Compress(); // compress the TObjArray
+  fSuperModuleData.SetOwner(kTRUE); 
 }
 
 //____________________________________________________________________________
index b0c3d23..9dee8c5 100644 (file)
@@ -39,6 +39,7 @@ AliEMCALCalibReference::AliEMCALCalibReference(const int nSM) :
     fSuperModuleData.Add(new AliEMCALSuperModuleCalibReference(i));
   }
   fSuperModuleData.Compress(); // compress the TObjArray
+  fSuperModuleData.SetOwner(kTRUE); 
 }
 
 //____________________________________________________________________________