/////////////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////////// #include "TFile.h" #include "TTree.h" #include "TBranch.h" #include "CompModel/TDetectorModel.hh" ClassImp(TDetectorModel) ClassImp(TDetectorModel::Data_t) // I'm not sure about inst lumi numbers for 2002-2003 //namespace { // TDetectorModel::Data_t kData [] = { //----------------------------------------------------------------------------- // analysis of the l3_rates.C output (runs up to 204402, Sep 17) // do not use l3 rate in MB/sec - the numbers are too high and not realistic // rate in Hz comes from the DB (average rate per run, N(L3 //----------------------------------------------------------------------------- // cat raw_data_files_2005.txt | awk '{ nev += $3; sz+=$2 } // END {print nev, sz, sz*1024/nev}' // // total number of events in the raw data files //----------------------------------+-------------------------------+---------------------------------- // | | data to be processed // %physr | %physr+icalir+icosmr | *physr-dphysr-iphysr //----------------------------------+-------------------------------+---------------------------------- // year ncsl size(MB) size | ncsl size(MB) size/ev | ncsl // ---------------------------------+-------------------------------+---------------------------------- // 2002 295642269 76345399 264.433 | 538217882 95262925 181.245 | 263174092 69623944 270.904 0.73 // 2003 341649376 74980493 224.733 | 539921010 92118948 174.710 | 314150917 68869523 224.486 0.75 // 2004 555811875 84048385 154.847 | 759354918 107335592 144.743 | 510149065 72726686 145.981 0.68 // 2005 878485554 124297280 144.886 | 1012402454 134691463 136.234 | 834632912 110405279 135.455 0.82 // ---------------------------------+-------------------------------+---------------------------------- // information below: good runs only, this includes stream D // // root [0] .L cdfopr/CompModel/scripts/l3_rates.C // root [1] plot_l3_rates("l3_rates_hz.txt") // // ----------------------------------------- // year NL3 NCSL Rate // ----------------------------------------- // 2002 238385170 265647588 33.799 // 2003 305790229 337697513 48.475 // 2004 491619832 549508263 52.893 // 2005 773296240 855232363 64.316 // ----------------------------------------- // standard conversion: x[TB] = x[MB]/1024/1024.; // for year < 2004 ops efficiency is a fudge factor which gives the right // number of events // event size: for the part of raw data data to be processed (A+B+C+E+F+G+H+J) //--------------------------------------------------------------------------------------------- // CSL // year int_lum inst_lum l3_rate ops_eff l3_rate N(L3) N(CSL) event total data processed // fb-1 1e32 MB/sec (Hz) size size (TB) fraction // unused KB //--------------------------------------------------------------------------------------------- // { 2002, 0.08, 0.10, 20., 0.50, 34., 238.e6, 266.e6, 270.9, 0.0696 , 0.73 }, // { 2003, 0.22, 0.15, 20., 0.50, 48., 306.e6, 338.e6, 224.5, 0.0715 , 0.75 }, // { 2004, 0.38, 0.27, 20., 0.65, 53., 492.e6, 550.e6, 146.0, 0.1024 , 0.68 }, // { 2005, 0.67, 0.40, 30., 0.85, 64., 773.e6, 855.e6, 135.5, 0.1285 , 0.82 }, // { 2006, 0.87, 0.60, 60., 0.90, 109., -1, -1., -1., -1. , 0.82 }, // { 2007, 1.81, 1.00, 60., 0.90, 150., -1, -1., -1., -1. , 0.82 }, // { 2008, 1.95, 1.20, 60., 0.90, 150., -1, -1., -1., -1. , 0.82 }, // { 2009, 2.15, 1.30, 60., 0.90, 150., -1, -1., -1., -1. , 0.82 }, // { 2010, -1., -1., -1., -1., -1., -1, -1., -1., -1. , 0.82 } // }; // }; //_____________________________________________________________________________ TDetectorModel::TDetectorModel() { } //_____________________________________________________________________________ TDetectorModel::~TDetectorModel() { } //_____________________________________________________________________________ int TDetectorModel::Read(const char* Name) { FILE* f = fopen(Name,"r"); if (f == 0) { Error("Read",Form("... Cant open %s, exit",Name)); return -1; } char c[1000]; int year; float int_lum, inst_lum, l3_rate_mb, ops_eff, l3_rate_hz, nl3, ncsl, event_size_kb; float total_size_tb, proc_fraction; int np (0), done(0); while ( ((c[0]=getc(f)) != EOF) && !done) { // check if it is a comment line if (c[0] != '#') { ungetc(c[0],f); // read channel number, fscanf(f,"%i",&year ); fscanf(f,"%f",&int_lum ); fscanf(f,"%f",&inst_lum ); fscanf(f,"%f",&l3_rate_mb ); fscanf(f,"%f",&ops_eff); fscanf(f,"%f",&l3_rate_hz ); fscanf(f,"%f",&nl3 ); fscanf(f,"%f",&ncsl ); fscanf(f,"%f",&event_size_kb ); fscanf(f,"%f",&total_size_tb ); fscanf(f,"%f",&proc_fraction ); fData[np].fYear = year; fData[np].fDeliveredLumi = int_lum; fData[np].fAverageInstLumi = inst_lum; fData[np].fL3MBytesSec = l3_rate_mb; fData[np].fL3Rate = l3_rate_hz; fData[np].fOpsEff = ops_eff; fData[np].fNL3Events = nl3; fData[np].fNCslEvents = ncsl; fData[np].fCslEventSize = event_size_kb; fData[np].fTotalDataSize = total_size_tb; fData[np].fProcessedFract = proc_fraction; np++; } fgets(c,100,f); } // close the file fclose(f); return 0; } //_____________________________________________________________________________ int TDetectorModel::Init(const char* Name) { if (strcmp(Name,"60mb") == 0) { Read("cdfopr/CompModel/data/detector_model.60mb.dat"); } else if (strcmp(Name,"80mb") == 0) { Read("cdfopr/CompModel/data/detector_model.80mb.dat"); } } //_____________________________________________________________________________ float TDetectorModel::ProcessedFraction(int Year) { float x; int loc ; loc = Year-fData[0].fYear; x = fData[loc].fProcessedFract; return x; } //_____________________________________________________________________________ float TDetectorModel::PhysicsPerCpu(int Year) { float x; int loc ; loc = Year-fData[0].fYear; x = fData[loc].fPhysicsPerCpu; return x; } //_____________________________________________________________________________ float TDetectorModel::NL3EventsGR(int Year) { float x; int loc ; loc = Year-fData[0].fYear; x = fData[loc].fNL3Events; return x; } //_____________________________________________________________________________ float TDetectorModel::NCslEventsGR(int Year) { float x; int loc ; loc = Year-fData[0].fYear; x = fData[loc].fNCslEvents; return x; } //_____________________________________________________________________________ float TDetectorModel::OpsEff(int Year) { // ops efficiency: 100 hours per week (roughly speaking, 60%) float eff; int loc ; loc = Year-fData[0].fYear; eff = fData[loc].fOpsEff; return eff; } //_____________________________________________________________________________ float TDetectorModel::L3Rate(int Year) { // average L3 rate, Hz, average = max*0.6 float rate; int loc ; loc = Year-fData[0].fYear; rate = fData[loc].fL3Rate; return rate; } //_____________________________________________________________________________ float TDetectorModel::CslRate(int Year) { // average CSL rate, Hz , take it <1.11> L3 rate, yes, 1.11 float rate; int loc; loc = Year-fData[0].fYear; rate = 1.11*fData[loc].fL3Rate; return rate; } //_____________________________________________________________________________ float TDetectorModel::CslEventSize(int Year, float Lumi) { // average event size out of CSL as function of the instantaneous // luminosity (in units of 1e32) int loc; float sz; if (Year < 2005) { //----------------------------------------------------------------------------- // didn't have the fit data before that //----------------------------------------------------------------------------- loc = Year-fData[0].fYear; sz = fData[loc].fCslEventSize; } else { //--------------------------------------------------------------------------- // use fit to 2005 data: // --------------------- // root [6] x.h2[2]->ProfileX()->Fit("pol1","","",0.2,1.2) // FCN=229.411 FROM MIGRAD STATUS=CONVERGED 33 CALLS 34 TOTAL // EDM=4.21933e-20 STRATEGY= 1 ERROR MATRIX ACCURATE // EXT PARAMETER STEP FIRST // NO. NAME VALUE ERROR SIZE DERIVATIVE // 1 p0 1.14108e+02 1.41445e-01 5.29590e-04 2.68337e-10 // 2 p1 4.68900e+01 2.68132e-01 1.00392e-03 1.20320e-09 //--------------------------------------------------------------------------- sz = 114.1 + 46.9*Lumi; } return sz; }