35 #include "AliSysInfo.h"
40 TCut
cutVM(
"cutVM",
"deltaVM>10");
41 TCut
cutDT(
"cutDT",
"deltaT>2");
45 Float_t
TopUsage(TTree*
tree,
const char *exp,
const char*
cut, Int_t order);
51 void PInit(
const char *log=
"syswatch.log",
const char *out=
"syswatch.root"){
55 fout =
new TFile(out,
"recreate");
60 void MakePlots(
const char *log=
"syswatch.log",
const char *out=
"syswatch.root", Int_t top=10){
74 fout->mkdir(
"cpuDetector");
75 fout->mkdir(
"VMDetector");
77 fout->cd(
"VMDetector");
81 fout->cd(
"cpuDetector");
97 cutVM = TCut(
"cutDT",Form(
"deltaVM>%f",thVM));
100 printf(
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n\n");
101 printf(
"TOP Virtual memory user\n");
102 tree->Scan(
"deltaVM:sname",
cutVM,
"colsize=20");
103 printf(
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n\n");
105 tree->Draw(
"deltaVM:sname>>hhh",
"1"+
cutVM,
"*");
106 his2 = (TH2F*)(
tree->GetHistogram())->Clone(
"dvmsname");
107 delete tree->GetHistogram();
108 his2->SetYTitle(
"Delta Virtual Memory (MBy)");
109 his2->SetMarkerStyle(22);
110 his2->SetMarkerSize(1);
112 his2->Write(
"DVMvsName");
115 tree->Draw(
"VM:sname>>hhh",
"id2<3"+
cutVM,
"*");
116 his2 = (TH2F*)(
tree->GetHistogram())->Clone(
"vmsname");
117 delete tree->GetHistogram();
118 his2->SetYTitle(
"Delta Virtual Memory (MBy)");
119 his2->SetMarkerStyle(22);
120 his2->SetMarkerSize(1);
122 his2->Write(
"VMvsName");
126 tree->Draw(
"VM:T>>hhh",
"deltaVM>1",
"line*");
127 his = (TH1*)
tree->GetHistogram()->Clone(
"vmt");
128 delete tree->GetHistogram();
129 his->SetXTitle(
"Time (sec)");
130 his->SetYTitle(
"Virtual Memory (MBy)");
131 his->GetYaxis()->SetTitleOffset(1.2);
132 his->SetMarkerStyle(22);
133 his->SetMarkerSize(1);
135 his->Write(
"VMvsTime");
145 cutDT = TCut(
"cutDT",Form(
"deltaT>%f",thDT));
147 printf(
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
148 printf(
"/n/n/nTOP CPU user\n");
149 tree->Scan(
"deltaT:sname",
cutDT,
"colsize=20");
150 printf(
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
152 tree->Draw(
"deltaT:sname>>hhh",
"id2<3"+
cutDT,
"*");
153 his2 = (TH2F*)(
tree->GetHistogram())->Clone(
"tsname");
154 delete tree->GetHistogram();
155 his2->SetName(
"VMsanme");
156 his2->SetYTitle(
"Delta CPU time(sec)");
157 his2->SetMarkerStyle(22);
158 his2->SetMarkerSize(1);
159 his2->GetXaxis()->SetLabelSize(0.03);
161 his2->Write(
"CPUvsName");
174 for (Int_t idet=0; idet<12; idet++){
177 sprintf(cdet,
"id0==%d",idet);
179 sprintf(expr,
"deltaVM:sname>>hhh");
182 sprintf(cdvm,
"%s&&deltaT>%f",cdet, thDVM);
186 tree->Draw(expr,cdvm,
"*");
187 his2 = (TH2F*)(
tree->GetHistogram())->Clone(
"xxx");
188 delete tree->GetHistogram();
189 his2->SetYTitle(
"Delta Virtual Memory (MBy)");
190 his2->SetMarkerStyle(22);
191 his2->SetMarkerSize(1);
193 his2->Write(Form(
"DVMvsName_%d",idet));
197 sprintf(expr,
"VM:sname>>hhh");
198 tree->Draw(expr,cdvm,
"*");
199 his2 = (TH2F*)(
tree->GetHistogram())->Clone(
"yyy");
200 delete tree->GetHistogram();
201 his2->SetYTitle(
"Delta Virtual Memory (MBy)");
202 his2->SetMarkerStyle(22);
203 his2->SetMarkerSize(1);
205 his2->Write(Form(
"VMvsName_%d",idet));
220 for (Int_t idet=0; idet<12; idet++){
223 sprintf(cdet,
"id0==%d",idet);
225 sprintf(expr,
"deltaT:sname>>hhh");
228 sprintf(cdtime,
"%s&&deltaT>%f",cdet, thDT);
230 tree->Draw(expr,cdtime,
"*");
231 his2 = (TH2F*)(
tree->GetHistogram())->Clone(
"dtsname");
232 delete tree->GetHistogram();
233 his2->SetYTitle(
"Delta CPU time(sec)");
234 his2->SetMarkerStyle(22);
235 his2->SetMarkerSize(1);
236 his2->GetXaxis()->SetLabelSize(0.03);
238 his2->Write(Form(
"CPUvsName_%d",idet));
252 Int_t entries = tree->Draw(Form(
"%s>>hhh1",exp),cut,
"goff");
254 if (tree->GetHistogram())
delete tree->GetHistogram();
255 printf(
"%s\t No entries\n",cut);
258 if (!tree->GetV1()) {
259 printf(
"%s\t No entries\n",cut);
262 Int_t *index =
new Int_t[entries];
263 TMath::Sort(entries, tree->GetV1(), index);
264 Int_t oindex = TMath::Min(order, entries);
265 Float_t val = tree->GetV1()[index[oindex-1]];
266 if (tree->GetHistogram())
delete tree->GetHistogram();
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void PInit(const char *log="syswatch.log", const char *out="syswatch.root")
void MakePlots(const char *log="syswatch.log", const char *out="syswatch.root", Int_t top=10)
TCut cutDT("cutDT","deltaT>2")
Float_t TopUsage(TTree *tree, const char *exp, const char *cut, Int_t order)
TCut cutVM("cutVM","deltaVM>10")