Fixed memory leaks (Marian)
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 May 2008 15:31:38 +0000 (15:31 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 May 2008 15:31:38 +0000 (15:31 +0000)
TPC/AliTPCcalibAlign.cxx
TPC/AliTPCcalibTracks.cxx
TPC/AliTPCcalibTracksGain.cxx
TPC/macros/CalibrateTPC.C

index 40d8eda8aefe8cf7411eb3bd35f90bc0f7932bdb..25f9fae12bda27c972b0d82e2263854c412a8dab 100644 (file)
@@ -67,16 +67,19 @@ void AliTPCcalibAlign::Process(AliTPCseed *seed) {
   TObjArray tracklets=
     AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kKalman,
                                    kFALSE,20,2);
-  TObjArray trackletsL=
-    AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kLinear,
-                                   kFALSE,20,2);
-  TObjArray trackletsQ=
-    AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kQuadratic,
-                                   kFALSE,20,2);
-  TObjArray trackletsR=
-    AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kRiemann,
-                                   kFALSE,20,2);
//  TObjArray trackletsL=
+//     AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kLinear,
+//                                 kFALSE,20,2);
+//   TObjArray trackletsQ=
+//     AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kQuadratic,
+//                                 kFALSE,20,2);
+//   TObjArray trackletsR=
+//     AliTPCTracklet::CreateTracklets(seed,AliTPCTracklet::kRiemann,
+//                                 kFALSE,20,2);
   tracklets.SetOwner();
+ //  trackletsL.SetOwner();
+//   trackletsQ.SetOwner();
+//   trackletsR.SetOwner();
   if (tracklets.GetEntries()==2) {
     AliTPCTracklet *t1=static_cast<AliTPCTracklet*>(tracklets[0]);
     AliTPCTracklet *t2=static_cast<AliTPCTracklet*>(tracklets[1]);
@@ -91,7 +94,7 @@ void AliTPCcalibAlign::Process(AliTPCseed *seed) {
     delete common1;
     delete common2;
   }
-
+  
 }
 
 void AliTPCcalibAlign::ProcessTracklets(const AliExternalTrackParam &tp1,
index 82ad2ee64b481774843188084dda2e19b83c22f4..399849de574e5e6c9563c8dbf32ec53c2d048a17 100644 (file)
@@ -454,6 +454,14 @@ AliTPCcalibTracks::AliTPCcalibTracks(const Text_t *name, const Text_t *title, Al
    fFitterLinZ2 = new TLinearFitter (2,"pol1");  
    fFitterParY  = new TLinearFitter (3,"pol2");
    fFitterParZ  = new TLinearFitter (3,"pol2");
+   //
+   fFitterLinY1->StoreData(kFALSE);
+   fFitterLinZ1->StoreData(kFALSE);
+   fFitterLinY2->StoreData(kFALSE);
+   fFitterLinZ2->StoreData(kFALSE);
+   fFitterParY->StoreData(kFALSE);
+   fFitterParZ->StoreData(kFALSE);
+
 
    if (GetDebugLevel() > 1) cout << "AliTPCcalibTracks object sucessfully constructed: " << GetName() << endl; 
    cout << "end of main constructor" << endl; // TO BE REMOVED
index a365a1d9e13d0f00c70b775b1a53213da73f55bd..822993462fcf5ad77221dee39ca18541bd917c26 100644 (file)
@@ -320,6 +320,14 @@ AliTPCcalibTracksGain::AliTPCcalibTracksGain(const char* name, const char* title
    fFitter1T      = new TLinearFitter(45,"hyp44");
    fFitter2T      = new TLinearFitter(45,"hyp44");
    //
+   // 
+   fFitter0M->StoreData(kFALSE);
+   fFitter1M->StoreData(kFALSE);
+   fFitter2M->StoreData(kFALSE);
+   fFitter0T->StoreData(kFALSE);
+   fFitter1T->StoreData(kFALSE);
+   fFitter2T->StoreData(kFALSE);   
+   //
    //
    // Add profile histograms -JUST for visualization - Not used for real calibration
    // 
index 7d4e12a94dbe85247570d3e8e65ebe246973421b..9993e2049ac1a9df41cc081979e30b08d71872ea 100644 (file)
@@ -5,6 +5,12 @@
   //1. Load needed libraries
   gSystem->Load("libANALYSIS");
   gSystem->Load("libTPCcalib");
+  //increased memstat
+  gSystem->Load("$ROOTSYS/lib/libGui.so");
+  gSystem->Load("$ROOTSYS/lib/libTree.so");
+  gSystem->Load("$MEMSTAT/libMemStat.so");
+  TMemStat memstat(100000000,10000000,kTRUE);
+  memstat->AddStamp("aaaa");
   //
   // Setup analysis manager
   //
   gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
   gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
   AliXRDPROOFtoolkit tool;
-  TChain * chain = tool.MakeChain("chain.txt","esdTree",0,10000000);
+  TChain * chain = tool.MakeChain("chain.txt","esdTree",0,30);
   chain->Lookup();
-  mgr->SetNSysInfo(20);
+  // memory
+  mgr->SetNSysInfo(100); 
+  AliSysInfo::AddCallBack(TMemStatManager::GetInstance()->fStampCallBack);
+  //
   mgr->StartAnalysis("local",chain);
   
 
@@ -49,12 +58,15 @@ AliAnalysisManager * SetupCalibTask() {
   AliTPCcalibTracksCuts *cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018);
 
   AliTPCcalibTracks *calibTracks =  new AliTPCcalibTracks("calibTracks", "Resolution calibration object for tracks", clusterParam, cuts); 
+  AliTPCcalibTracksGain *calibTracksGain =  new AliTPCcalibTracksGain("TPCGainTracks","TPCGainTracks",cuts); 
   calibTracks->SetDebugLevel(5);
   calibTracks->SetStreamLevel(5);
+  calibTracksGain->SetDebugLevel(1);
+  calibTracksGain->SetStreamLevel(1);
  // ---*---*-----*-*-----*----------*---
   // ADD CALIB JOBS HERE!!!!!!!!!!!!!!!!
   task1->AddJob(new AliTPCcalibAlign);//"align","The kewl alignment job"));
-  task1->AddJob(new AliTPCcalibTracksGain("TPCGainTracks","TPCGainTracks",cuts));
+  task1->AddJob(calibTracksGain);
   task1->AddJob(calibTracks);
   //  task1->AddJob(new AliTPCcalibBase);
   // task1->AddJob(new AliTPCcalibV0);