Fixing some memory issues
authorcnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Nov 2012 21:24:40 +0000 (21:24 +0000)
committercnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Nov 2012 21:24:40 +0000 (21:24 +0000)
PWGLF/totEt/AliAnalysisEt.cxx
PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx
PWGLF/totEt/AliAnalysisEtRecEffCorrection.cxx

index 61d0dac..7ed7302 100644 (file)
@@ -161,6 +161,8 @@ AliAnalysisEt::AliAnalysisEt() : AliAnalysisEtCommon()
 
 AliAnalysisEt::~AliAnalysisEt()
 {//Destructor
+  delete fTmCorrections;
+  delete fReCorrections;
   if(fDepositTree){
     fDepositTree->Clear();
     delete fDepositTree; // optional TTree
@@ -682,6 +684,7 @@ Int_t AliAnalysisEt::ReadCorrections(TString filename)
     fTmCorrections = dynamic_cast<AliAnalysisEtTrackMatchCorrections*>(f->Get(name));
     if(!fTmCorrections)
     {
+      cout<<"No corrections with name "<<name<<endl;
       Printf("Could not load TM corrections");
       return -1;
     }
index 0e1eb20..ac23e94 100644 (file)
@@ -314,6 +314,8 @@ AliAnalysisEtMonteCarlo::~AliAnalysisEtMonteCarlo()
     delete fHistPiPlusMultAcc; // enter comment here
     delete fHistPiMinusMultAcc; // enter comment here
     delete fHistPiZeroMultAcc; // enter comment here
+    delete fHistGammasFound; // enter comment here
+    delete fHistGammasGenerated; // enter comment here
 }
 
 Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
@@ -567,6 +569,7 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
     //return -1;
 //    }
 
+//Note that this only returns clusters for the selected detector.  fSelector actually calls the right GetClusters... for the detector
     TRefArray *caloClusters = fSelector->GetClusters();
 
     Int_t nCluster = caloClusters->GetEntries();
index 2ca7363..0bee4ef 100644 (file)
 ClassImp(AliAnalysisEtRecEffCorrection);
 
 AliAnalysisEtRecEffCorrection::AliAnalysisEtRecEffCorrection() : TNamed("RecEff","RecEff")
-    ,fEnergyCorrection("ReCorr","pol1",0.01)
+                                                              ,fEnergyCorrection()//"ReCorr","1",0.01)
     ,fMaxEnergy(0)
-{}
+{
+  fEnergyCorrection.SetName("ReCorr");
+}
 
 AliAnalysisEtRecEffCorrection::AliAnalysisEtRecEffCorrection(TString name, const TF1 &correction, const Double_t maxEnergy) : TNamed(name, name)
     ,fEnergyCorrection(correction)
@@ -28,7 +30,8 @@ AliAnalysisEtRecEffCorrection::AliAnalysisEtRecEffCorrection(const AliAnalysisEt
 
 //! Destructor
 AliAnalysisEtRecEffCorrection::~AliAnalysisEtRecEffCorrection()
-{}
+{
+}
 
 //! Assignment operator
 AliAnalysisEtRecEffCorrection& AliAnalysisEtRecEffCorrection::operator=(const AliAnalysisEtRecEffCorrection &other)
@@ -46,7 +49,7 @@ bool AliAnalysisEtRecEffCorrection::operator==(const AliAnalysisEtRecEffCorrecti
 {
     if (this == &other) return true;
     return false;
-//     return (fMaxEnergy == other.fMaxEnergy && fEnergyCorrection == other.fEnergyCorrection);
+    //return (fMaxEnergy == other.fMaxEnergy && fEnergyCorrection == other.fEnergyCorrection);
 }
 
 Double_t AliAnalysisEtRecEffCorrection::CorrectedEnergy(Double_t energy)