/////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// #include "TFile.h" #include "TTree.h" #include "TBranch.h" #include "CompModel/TTapeRobotModel.hh" ClassImp(TTapeRobotModel) namespace { int kYearAcquired [] = { 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -1} ; int kNAcquired [] = { 10, 13, 5, 0, 5, 18, 0, 0, } ; float kSpeedAcquired[] = { 10, 30, 30, 0, 30, 60, 0, 0, } ; float kPriceAcquired[] = { 30, 30, 30, 0, 16, 16, 0, 0, } ; int kYearRetired [] = { 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -1} ; int kNRetired [] = { 0, 0, 10, 0, 0, 23, 0, 0, -1} ; float kSpeedRetired[] = { 0, 0, 10, 0, 0, 30, 0, 0, -1} ; }; //_____________________________________________________________________________ TTapeRobotModel::TTapeRobotModel() { } //_____________________________________________________________________________ TTapeRobotModel::~TTapeRobotModel() { } //_____________________________________________________________________________ float TTapeRobotModel::NUsedSlots(int Year) { Error("UsedSlots","not implemented yet"); return -1; } //_____________________________________________________________________________ float TTapeRobotModel::DriveCost(int Year) { // in $10^3 int loc = Year-kYearAcquired[0]; float cost = kPriceAcquired[loc]; return cost; } //_____________________________________________________________________________ float TTapeRobotModel::NDrives(int Year) { float n_drives(0); for (int i=0; (kNAcquired[i] >= 0) && (kYearAcquired[i] <= Year); i++) { n_drives += kNAcquired[i] ; } for (int i=0; (kNRetired[i] >= 0) && (kYearRetired[i] <= Year); i++) { n_drives -= kNRetired[i]; } return n_drives; } //_____________________________________________________________________________ float TTapeRobotModel::TotalBandwidth(int Year) { // average bandwidth (per sec) float bw_total(0); for (int i=0; (kNAcquired[i] >= 0) && (kYearAcquired[i] <= Year); i++) { bw_total += kNAcquired[i]*kSpeedAcquired[i] ; } for (int i=0; (kNRetired[i] >= 0) && (kYearRetired[i] <= Year); i++) { bw_total -= kNRetired[i]*kSpeedRetired[i] ; } return bw_total; } //_____________________________________________________________________________ int TTapeRobotModel::PlotHist(const char* Name) { float x; TString name = Name; name.ToUpper(); // if (name == "EVENT_SIZE") { // fHist = new TH1F("event_size","event size, KBytes",8,2001.5,2009.5); // fHist->SetMinimum(0); // fHist->GetXaxis()->SetTitle("Year"); // for (int year=2002; year<2010; year++) { // x = L3EventSize(year); // fHist->Fill(year,x); // } // fHist->SetMarkerSize(1); // fHist->SetMarkerStyle(20); // fHist->Draw("p"); // } return 0; }