TENDER becomes Tender
[u/mrichter/AliRoot.git] / PWGPP / PilotTrain / memoryCheck.C
CommitLineData
91fa10c5 1void memoryCheck()
2{
3// include path
4 gSystem->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD ");
5 gSystem->AddIncludePath("-I$ALICE_ROOT/include");
6
7// Load analysis framework libraries
8 gSystem->Load("libANALYSIS");
9 gSystem->Load("libANALYSISalice");
10 gSystem->Load("libCORRFW");
11
12// Add aditional AliRoot libraries
af472fff 13 gSystem->Load("libTender.so");
91fa10c5 14 gSystem->Load("libPWG0base.so");
15 gSystem->Load("libPWG0dep.so");
16 gSystem->Load("libPWG0selectors.so");
2bfe5463 17 gSystem->Load("libPWGPP.so");
91fa10c5 18 gSystem->Load("libPWG2.so");
19 gSystem->Load("libPWG2forward.so");
20 gSystem->Load("libEMCALUtils.so");
21 gSystem->Load("libPWG4PartCorrBase.so");
22 gSystem->Load("libPWG4PartCorrDep.so");
40a0a69c 23 gSystem->Load("libPWGHFbase.so");
24 gSystem->Load("libPWGmuon.so");
25 gSystem->Load("libPWGmuondep.so");
91fa10c5 26 TFile *f = new TFile("QA/syswatch.root");
27 if (!f) return;
28 TTree *t = (TTree*)f->Get("syswatch");
29// read the analysis manager from file
30 TFile *file = TFile::Open("QA/QA.root");
31 if (!file) return;
32 TIter nextkey(file->GetListOfKeys());
33 AliAnalysisManager *mgr = 0;
34 TKey *key;
35 while ((key=(TKey*)nextkey())) {
36 if (!strcmp(key->GetClassName(), "AliAnalysisManager"))
37 mgr = (AliAnalysisManager*)file->Get(key->GetName());
38 };
39 if (!mgr) {
40 ::Error("mrmoryCheck", "No analysis manager found in file QA.root");
41 return;
42 }
43
44 TString task_name;
45 TIter next(mgr->GetTasks());
46 TObject *task;
47 while ((task=next())) task_name += Form("%s ", task->GetName());
48 t->SetAlias("event", "id0");
49 t->SetAlias("RM","pI.fMemResident");
50 TCanvas *canvas = new TCanvas("SysInfo",Form("sysinfo QA for %s", task_name.Data()),10,10,1200,1000);
51 canvas->Divide(1,2);
52 canvas->cd(1)->SetBorderMode(0);
53 t->SetMarkerStyle(kCircle);
54 t->SetMarkerColor(kRed);
55 t->Draw("VM:event","id1==-1 && id2==-1","", 1234567890, 0);
56 TH1* hist = (TH1*)gPad->GetListOfPrimitives()->FindObject("htemp");
57 if (hist) {
58 hist->SetTitle(Form("VM[MB] %s",task_name.Data()));
59 hist->GetYaxis()->SetTitle("VM [MB]");
60 }
61 canvas->cd(2)->SetBorderMode(0);
62 t->SetMarkerStyle(kOpenSquare);
63 t->SetMarkerColor(kBlue);
64 t->Draw("RM:event","id1==-1 && id2==-1","", 1234567890, 0);
65 TH1* hist = (TH1*)gPad->GetListOfPrimitives()->FindObject("htemp");
66 if (hist) {
67 hist->SetTitle(Form("RM[MB] %s", task_name.Data()));
68 hist->GetYaxis()->SetTitle("RM [MB]");
69 }
70 canvas->SaveAs("syswatch.gif");
71 delete t;
72}