Fixed memory leaks (Marian)
[u/mrichter/AliRoot.git] / TPC / macros / CalibrateTPC.C
CommitLineData
1037b1ac 1/*
2 Simple calibration analysis
3
4
5 //1. Load needed libraries
6 gSystem->Load("libANALYSIS");
7 gSystem->Load("libTPCcalib");
cbc19295 8 //increased memstat
9 gSystem->Load("$ROOTSYS/lib/libGui.so");
10 gSystem->Load("$ROOTSYS/lib/libTree.so");
11 gSystem->Load("$MEMSTAT/libMemStat.so");
12 TMemStat memstat(100000000,10000000,kTRUE);
13 memstat->AddStamp("aaaa");
1037b1ac 14 //
15 // Setup analysis manager
16 //
17 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
18 .L $ALICE_ROOT/TPC/macros/CalibrateTPC.C
19 AliAnalysisManager * mgr = SetupCalibTask();
20 //
21 // Process data - chain
22 //
23 gSystem->AddIncludePath("-I$ALICE_ROOT/TPC/macros");
ae28e92e 24 gROOT->LoadMacro("$ALICE_ROOT/TPC/macros/AliXRDPROOFtoolkit.cxx+")
1037b1ac 25 AliXRDPROOFtoolkit tool;
cbc19295 26 TChain * chain = tool.MakeChain("chain.txt","esdTree",0,30);
ae28e92e 27 chain->Lookup();
cbc19295 28 // memory
29 mgr->SetNSysInfo(100);
30 AliSysInfo::AddCallBack(TMemStatManager::GetInstance()->fStampCallBack);
31 //
1037b1ac 32 mgr->StartAnalysis("local",chain);
33
34
35*/
36
37
38AliAnalysisManager * SetupCalibTask() {
39 //
40 //
41 //
42 TStopwatch stopwatch;
43 stopwatch.Start();
44
45 AliAnalysisManager *mgr=new AliAnalysisManager("TestManager");
46
47 AliESDInputHandler* esdH=new AliESDInputHandler;
48 esdH->SetActiveBranches("ESDfriend");
49 mgr->SetInputEventHandler(esdH);
ae28e92e 50 //
51 //
52 AliCDBManager::Instance()->SetRun(1) ;
53 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
54 AliTPCClusterParam * clusterParam = AliTPCcalibDB::Instance()->GetClusterParam();
1037b1ac 55
56 AliTPCAnalysisTaskcalib *task1=new AliTPCAnalysisTaskcalib("foo bar");
57
58 AliTPCcalibTracksCuts *cuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018);
59
ae28e92e 60 AliTPCcalibTracks *calibTracks = new AliTPCcalibTracks("calibTracks", "Resolution calibration object for tracks", clusterParam, cuts);
cbc19295 61 AliTPCcalibTracksGain *calibTracksGain = new AliTPCcalibTracksGain("TPCGainTracks","TPCGainTracks",cuts);
ae28e92e 62 calibTracks->SetDebugLevel(5);
63 calibTracks->SetStreamLevel(5);
cbc19295 64 calibTracksGain->SetDebugLevel(1);
65 calibTracksGain->SetStreamLevel(1);
ae28e92e 66 // ---*---*-----*-*-----*----------*---
1037b1ac 67 // ADD CALIB JOBS HERE!!!!!!!!!!!!!!!!
68 task1->AddJob(new AliTPCcalibAlign);//"align","The kewl alignment job"));
cbc19295 69 task1->AddJob(calibTracksGain);
ae28e92e 70 task1->AddJob(calibTracks);
1037b1ac 71 // task1->AddJob(new AliTPCcalibBase);
72 // task1->AddJob(new AliTPCcalibV0);
73 // -*----*----*---*-*------*-------**--
74 // -------*--*---------*-----*-------*-
75
76 mgr->AddTask(task1);
77
78 AliAnalysisDataContainer *cinput1
79 =mgr->CreateContainer("cchain1",TChain::Class(),
80 AliAnalysisManager::kInputContainer);
81 AliAnalysisDataContainer *coutput1
82 =mgr->CreateContainer("asdofhaw",TObjArray::Class(),
83 AliAnalysisManager::kOutputContainer,
84 "CalibObjects.root");
85
86 mgr->ConnectInput(task1,0,cinput1);
87 mgr->ConnectOutput(task1,0,coutput1);
88
89 if (!mgr->InitAnalysis()) return;
90 mgr->PrintStatus();
91
92 stopwatch.Stop();
93 stopwatch.Print();
94 return mgr;
95}