void cpu() { double alice_offline[] = {6e7, 2e8, 5e8}; double frib_offline[] = {1e6, 1e7, 2e7}; double eic_offline[] = {150e3, 2.9e6, 1e8}; double clas12_offline[] = {250e6, 500e6, 500e6}; double gluex_offline[] = {90e6, 200e6, 400e6}; double star_offline[] = {150e6, 400e6, 400e6 }; double sphenix_offline[] = {60e6, 500e6, 750e6}; char *labels[3] = {"present", "2020", "2025"}; TH1F *halice = new TH1F("halice","ALICE offline cpu-hr/yr", 3, 0, 3); TH1F *hfrib = new TH1F("hfrib","FRIB spectrometers offline cpu-hr/yr", 3, 0, 3); TH1F *heic = new TH1F("heic","EIC detectors offline cpu-hr/yr", 3, 0, 3); TH1F *hclas12 = new TH1F("hclas12","CLAS12 offline cpu-hr/yr", 3, 0, 3); TH1F *hgluex = new TH1F("hgluex","GlueX offline cpu-hr/yr", 3, 0, 3); TH1F *hstar = new TH1F("hstar","STAR offline cpu-hr/yr", 3, 0, 3); TH1F *hsphenix = new TH1F("hsphenix","sPHENIX offline cpu-hr/yr", 3, 0, 3); TH1F *hptr[7]; for (int i=0; i<3; ++i) { halice->Fill(labels[i], alice_offline[i]); hptr[0] = halice; hfrib->Fill(labels[i], frib_offline[i]); hptr[1] = hfrib; heic->Fill(labels[i], eic_offline[i]); hptr[2] = heic; hclas12->Fill(labels[i], clas12_offline[i]); hptr[3] = hclas12; hgluex->Fill(labels[i], gluex_offline[i]); hptr[4] = hgluex; hstar->Fill(labels[i], star_offline[i]); hptr[5] = hstar; hsphenix->Fill(labels[i], sphenix_offline[i]); hptr[6] = hsphenix; } THStack *a = new THStack("a","Projected cpu demand for offline"); for (int j=0; j<7; ++j) { hptr[j]->SetStats(0); hptr[j]->SetBarWidth(0.5); hptr[j]->SetBarOffset(0.25); hptr[j]->SetFillColor(j+2); a->Add(hptr[j]); } a->Draw("bar2"); a->GetXaxis()->SetLabelSize(0.05); a->GetYaxis()->SetTitle("cpu-hr / yr"); a->GetYaxis()->SetTitleSize(0.05); c1->Update(); TLegend *legend = new TLegend(0.15,0.46,0.38,0.86); legend->AddEntry(hptr[6], "sPHENIX", "f"); legend->AddEntry(hptr[5], "STAR", "f"); legend->AddEntry(hptr[4], "GlueX", "f"); legend->AddEntry(hptr[3], "CLAS12", "f"); legend->AddEntry(hptr[2], "EIC det", "f"); legend->AddEntry(hptr[1], "FRIB spec", "f"); legend->AddEntry(hptr[0], "ALICE", "f"); legend->Draw(); }