/////////////////////////////////////////////////////////////////////////////// // assumes libStntuple_oracle.so is loaded /////////////////////////////////////////////////////////////////////////////// //---------------------------------------- // // TODO: improve good run list // //---------------------------------------- TGraph* gr; int get_jobset(int RunNumber = 195409, const char* Pass = "17") { TString query; TString pass_name, retired; int process_run; int jobset, rc; TSQLResult* res; query = "select cps.passname, cps.retired, cus.process_run , cus.jobset "; query += "from used_sets cus, passes cps, passcalibs cpsc "; query += Form("where cus.process_run=%i and cus.process_name=cps.process_name ",RunNumber); query += "and cus.process_run >= cpsc.lorun "; query += "and cus.process_run <= cpsc.hirun "; query += "and cus.proc_calib_version=cpsc.proc_calib_version "; query += Form("and cpsc.pass_index=cps.pass_index and cps.passname='%s' and decode(cps.retired,NULL,'N','Y') != 'Y'",Pass) ; cdfofprd.Query(query.Data(),res); TOracleRow* row = (TOracleRow*) res->Next(); if (row == 0) { rc = -1; } else { pass_name = TCdfOracle::Strip(row->GetFieldData( 0)); retired = TCdfOracle::Strip(row->GetFieldData( 1)); process_run = *((int*) row->GetFieldData( 2)); jobset = *((int*) row->GetFieldData( 3)); rc = jobset; } delete res; return rc; } //----------------------------------------------------------------------------- int get_calib_run(int RunNumber, const char* TableName, const char* Pass) { TString query; TSQLResult* res; TString system, calib_table; int jobset, calib_run, rc; jobset = get_jobset(RunNumber,Pass); if (jobset < 0) return -1; query = "select ctp.system, crl.calib_run, crl.calib_table "; query += "from calibrunlists crl, calib_properties ctp, set_run_maps csrm "; query += Form("where crl.cid=csrm.cid and csrm.jobset=%i ",jobset); query += Form("and crl.calib_table=ctp.calib_table and crl.calib_table='%s'",TableName); cdfofprd.Query(query.Data(),res); TOracleRow* row = (TOracleRow*) res->Next(); if (row == 0) { rc = -1; } else { system = TCdfOracle::Strip(row->GetFieldData( 0)); calib_run = *((int*) row->GetFieldData( 1)); system = TCdfOracle::Strip(row->GetFieldData( 2)); rc = calib_run; } delete res; return rc; } //----------------------------------------------------------------------------- int get_n_tables(int RunNumber, const char* Pass="17", int debug=0) { TString query; TSQLResult* res; TString system, calib_table; int jobset, calib_run, n_tables, rc; jobset = get_jobset(RunNumber,Pass); if (jobset < 0) return -1; query = "select ctp.system, crl.calib_run, crl.calib_table "; query += "from calibrunlists crl, calib_properties ctp, set_run_maps csrm "; query += Form("where crl.cid=csrm.cid and csrm.jobset=%i ",jobset); query += "and crl.calib_table=ctp.calib_table order by ctp.system"; cdfofprd.Query(query.Data(),res); n_tables = 0; while ((row = (TOracleRow*) res->Next())) { if (row == 0) { rc = -1; printf (" rc = -1\n"); } else { n_tables++; if (debug) { calib_table = TCdfOracle::Strip(row->GetFieldData( 2)); printf ("%s\n",calib_table.Data()); } } } delete res; return n_tables; } struct CalibTableData_t { TString name; int cid; int calib_run; }; //----------------------------------------------------------------------------- int get_table(const char* Name, int RunNumber, const char* Pass="17", CalibTableData_t* Table, int debug=0) { TString query; TSQLResult* res; TString system, calib_table; int jobset, calib_run, n_tables, rc(0); jobset = get_jobset(RunNumber,Pass); if (jobset < 0) return -1; query = "select crl.cid, crl.calib_run, crl.calib_table "; query += "from calibrunlists crl, calib_properties ctp, set_run_maps csrm "; query += Form("where crl.cid=csrm.cid and csrm.jobset=%i ",jobset); query += Form("and crl.calib_table=ctp.calib_table and crl.calib_table=\'%s\'",Name); if (debug) { printf("%s\n",query.Data()); } cdfofprd.Query(query.Data(),res); while ((row = (TOracleRow*) res->Next())) { if (row == 0) { rc = -1; printf (" rc = -1\n"); break; } else { Table->cid = *((int* ) row->GetFieldData(0)); Table->calib_run = *((int* ) row->GetFieldData(1)); Table->name = TCdfOracle::Strip(row->GetFieldData(2)); } } delete res; return 0; } int n_table = 0; int* run_table = 0; int* cid_table = 0; //----------------------------------------------------------------------------- int print_table(const char* Name, int MinRun, int MaxRun, const char* Pass="17", int savePlot=0) { TString query; TSQLResult* res; CalibTableData_t table; int debug(0); TString system, calib_table; int jobset, calib_run, n_tables, rn, rc; TObjArray* list_of_runs = new TObjArray(10000); TStnRunSummary* rs; int flag = cdfofprd.ForceDisconnect(); cdfofprd.SetForceDisconnect(0); cdfofprd.GetListOfGoodRuns (list_of_runs,MinRun,MaxRun, 2); int nruns = list_of_runs->GetEntriesFast(); // global variables n_table = nruns; run_table = new int[nruns]; cid_table = new int[nruns]; int npt = 0; for (int i=0; iAt(i); if (rs) rn = rs->RunNumber(); get_table(Name,rn,Pass,&table); printf("%6i %i %i %s\n",rn,table.cid,table.calib_run,table.name.Data()); run_table[npt] = rn; cid_table[npt] = table.cid; npt++; } gr = new TGraph(npt,run_table,cid_table); char title[200]; sprintf(title,"%s_%d_%d",Name,MinRun,MaxRun); printf("%s : CID vs run number (%i-%i)\n",Name,MinRun,MaxRun); TCanvas* c = new_slide("a","a",1,1,600,400); TPad* p1 = (TPad*) c->GetPrimitive("p1"); p1->cd(1); gr->SetTitle(title); gr->Draw("PAL"); char filename[200]; sprintf(filename,"%s_%d_%d.gif",Name,MinRun,MaxRun); if (savePlot) { printf("saving plot to %s\n",filename); c->Print(filename); } cdfofprd.SetForceDisconnect(flag); return 0; } //----------------------------------------------------------------------------- int plot_chaoffler(int savePlot=0) { TString query; TSQLResult* res; int debug(0); printf("Unique CIDs:\n"); int oldcid=0; int* ciddump = new int[n_table]; int ndump = 0; for(int i=0; iNext()) { float ler = *((float*)row->GetFieldData( 0)); if(debug>0) printf("%f\n",ler); h->Fill(ler); } char ctitle[200]; sprintf(ctitle,"C_CHAOFFLER_%d",ciddump[i]); TCanvas* c = new TCanvas(ctitle,ctitle,1,1,600,400); h->Draw(); char filename[200]; sprintf(filename,"CHAOFFLER_values_%d.gif",ciddump[i]); if (savePlot) { printf("saving plot to %s\n",filename); c->Print(filename); } } // loop over ndump return 0; } //----------------------------------------------------------------------------- float glumi; TStnRunSummary* grs; struct BeamlineData_t { int cid; int channelid; double x; double y; double slopex; double slopey; int flag0; int flag1; double x_err; double y_err; double slopex_err; double slopey_err; int rc; int svxStatusBit; int islStatusBit; int cotStatusBit; }; //_____________________________________________________________________________ int get_beamline(const char* Detector, int RunNumber, const char* Pass="17", BeamlineData_t* Data, int debug=0) { // detector = "svx" or "cot" TString query; TSQLResult* res; TStnRunSummary rs; TString cmd, system, calib_table; TObjArray data(100); TObjString *ostr; int jobset, cid, channelid, calib_run, n_tables, rc(0), flag0, flag1; float beamx, beamy; char* line; char buf[1000]; jobset = get_jobset(RunNumber,Pass); cdfofprd.GetRunSummary(RunNumber,&rs); // if (debug) printf(" run, jobset = %i %i\n",RunNumber, jobset); if (jobset < 0) return -1; cmd = Form(". cdfopr/scripts/db_queries; get_beamline %s %i %s",Detector,RunNumber,Pass); FILE* pipe = gSystem->OpenPipe(cmd.Data(),"r"); while (fgets(buf,10000,pipe)) { data.Add(new TObjString(buf)); } gSystem->ClosePipe(pipe); TIter itt(&data); istringstream istr1; while (ostr = (TObjString*) itt.Next()) { line = (char*) ostr->String().Data(); //sscanf has limitation of only up to 12 arguments!!! RL //sscanf(line,"%i %i %lf %lf %lf %lf %i %i %lf %lf %lf %lf", //&Data->cid,&Data->channelid,&Data->x,&Data->y,&Data->slopex,&Data->slopey,&Data->flag0,&Data->flag1, &Data->x_err, &Data->y_err, &Data->slopex_err, &Data->slopey_err); istr1.str(line); istr1 >> Data->cid >> Data->channelid >> Data->x >> Data->y >> Data->slopex >> Data->slopey >> Data->flag0 >> Data->flag1 >> Data->x_err >> Data->y_err >> Data->slopex_err >> Data->slopey_err; Data->rc = Data->flag0; Data->svxStatusBit = rs.SvxStatusBit(); Data->islStatusBit = rs.IslStatusBit(); Data->cotStatusBit = rs.CotStatusBit(); if ((Data->flag0 < 1.e6) || (debug != 0)) { printf("%3s %7i %10i %10.3f %2i %2i %2i %7i %7i %10.5f %10.5f 0x%08x 0x%08x %20s\n", Detector, RunNumber, jobset, rs.LumiTape(), rs.SvxStatusBit(), rs.IslStatusBit(), rs.CotStatusBit(), Data->cid, Data->channelid, Data->x, Data->y, Data->flag0, Data->flag1, rs.TriggerTableName().Data()); } } return Data->rc; } //_____________________________________________________________________________ int get_whaler(int RunNumber, const char* Table, const char* Pass, int* cid, int* geomid, float* response, float* sigma, int debug=0) { // Table: WHALINERESPONSE or WHAOFFLER // call: // int cid [10000], geomid[10000]; // float response[10000], sigma [10000]; // get_whaler(168889,"WHAOFFLER","17",cid,geomid,response,sigma,1) TString query; TSQLResult* res; TStnRunSummary rs; TString system, calib_table; int jobset, calib_run, nchannels(0), rc(0); jobset = get_jobset(RunNumber,Pass); cdfofprd.GetRunSummary(RunNumber,&rs); if (debug) printf(" run, jobset = %i %i\n",RunNumber, jobset); if (jobset < 0) return -1; query = "select wha.cid, wha.geomid, wha.response, wha.deltaresp "; query += Form("from %s wha, set_run_maps csrm ",Table); query += Form("where wha.cid=csrm.cid and csrm.jobset=%i",jobset); cdfofprd.Query(query.Data(),res); while ((row = (TOracleRow*) res->Next())) { cid [nchannels] = *((int* ) row->GetFieldData(0)); geomid [nchannels] = *((int* ) row->GetFieldData(1)); response [nchannels] = *((float*) row->GetFieldData(2)); sigma [nchannels] = *((float*) row->GetFieldData(3)); if (debug != 0) { printf ("run, cid, geomid, response, sigma = %7i %7i %7i %10.5f %10.5f\n", RunNumber, cid[nchannels],geomid[nchannels],response[nchannels], sigma[nchannels]); } nchannels++; } printf("nchannels = %5i\n", nchannels); delete res; return rc; } //----------------------------------------------------------------------------- // check SVX alignment, tables are: // // SIALIGNBARREL // SIALIGNFRAME // SIALIGNLADDER // SIALIGNWAFER // SIALIGNWARP //----------------------------------------------------------------------------- int plot_svx_alignment_run(const char* Table, int MinRun, int MaxRun, const char* Pass, int savePlot=0) { int rn, calib_run; TObjArray* list_of_runs = new TObjArray(10000); TStnRunSummary* rs; int flag = cdfofprd.ForceDisconnect(); cdfofprd.SetForceDisconnect(0); cdfofprd.GetListOfGoodRuns (list_of_runs,MinRun,MaxRun, 2); int nruns = list_of_runs->GetEntriesFast(); float* x = new float[nruns]; float* y = new float[nruns]; for (int i=0; iAt(i); if (rs) { rn = rs->RunNumber(); calib_run = get_calib_run(rn,Table,Pass); if (calib_run >=0) printf("run, calib_run = %7i %7i\n",rn,calib_run); x[i] = rn; y[i] = calib_run; } else { printf("i = %i\n",i); } } printf("Total number of runs = %7i\n",nruns); gr = new TGraph(nruns,x,y); gr->SetTitle(Form("%s_%06d_%06d",Table,MinRun,MaxRun)); gr->SetMarkerStyle(20); gr->SetMarkerSize(1); gr->GetXaxis()->SetLabelSize(0.02); gr->Draw("AP"); if (savePlot) c1->Print(Form("%s_%06d_%06d.gif",Table,MinRun,MaxRun)); return 0; } //_____________________________________________________________________________ TGraph* g_n_tables; int plot_n_tables(int MinRun, int MaxRun, const char* Pass="17", int savePlot=0) { int rn, n_tables; TObjArray* list_of_runs = new TObjArray(10000); TStnRunSummary* rs; int flag = cdfofprd.ForceDisconnect(); cdfofprd.SetForceDisconnect(0); cdfofprd.GetListOfGoodRuns (list_of_runs,MinRun,MaxRun,2); int nruns = list_of_runs->GetEntriesFast(); float* x = new float[nruns]; float* y = new float[nruns]; for (int i=0; iAt(i); if (rs) { rn = rs->RunNumber(); n_tables = get_n_tables(rn,Pass); if (n_tables >=0) printf("run, n_tables = %7i %7i\n",rn,n_tables); x[i] = rn; y[i] = n_tables; } else { printf("i = %i\n",i); } } g_n_tables = new TGraph(nruns,x,y); g_n_tables->SetTitle(Form("plot_n_table_%06d_%06d",MinRun,MaxRun)); g_n_tables->SetMarkerStyle(20); g_n_tables->SetMarkerSize(1); g_n_tables->GetXaxis()->SetLabelSize(0.02); g_n_tables->Draw("AP"); if (savePlot) c1->Print(Form("plot_n_table_%06d_%06d.gif",MinRun,MaxRun)); return 0; } int npt = 0; float* run = 0; float* lum = 0; int* svx_status_bit= 0; int* isl_status_bit= 0; int* cot_status_bit= 0; int* cot_flag0 = 0; int* cot_flag1 = 0; int* svx_flag0 = 0; int* svx_flag1 = 0; float* cot_rc = 0; float* cot_x = 0; float* cot_y = 0; float* cot_slope_x = 0; float* cot_slope_y = 0; float* cot_x_err = 0; float* cot_y_err = 0; float* cot_slope_x_err = 0; float* cot_slope_y_err = 0; float* cot_cid = 0; float* svx_rc = 0; float* svx_x = 0; float* svx_y = 0; float* svx_slope_x = 0; float* svx_slope_y = 0; float* svx_x_err = 0; float* svx_y_err = 0; float* svx_slope_x_err = 0; float* svx_slope_y_err = 0; float* svx_cid = 0; float* dx = 0; float* dy = 0; float* dx_slope = 0; float* dy_slope = 0; TGraph* g_beamline_fit; //_____________________________________________________________________________ int fill_beamlines(int MinRun, int MaxRun, const char* Pass="17",int Debug=0) { int rn, cot_qual, svx_qual; BeamlineData_t cot_beam; BeamlineData_t svx_beam; TObjArray* list_of_runs = new TObjArray(10000); int flag = cdfofprd.ForceDisconnect(); cdfofprd.SetForceDisconnect(0); //'2' means here "offline good runs only" cdfofprd.GetListOfGoodRuns (list_of_runs,MinRun,MaxRun, 2); int nruns = list_of_runs->GetEntriesFast(); if (run) { delete [] run; delete [] lum; delete [] svx_status_bit; delete [] isl_status_bit; delete [] cot_status_bit; delete [] cot_flag0; delete [] cot_flag1; delete [] svx_flag0; delete [] svx_flag1; delete [] cot_rc; delete [] cot_x; delete [] cot_y; delete [] cot_slope_x; delete [] cot_slope_y; delete [] cot_cid; delete [] svx_rc; delete [] svx_x; delete [] svx_y; delete [] svx_slope_x; delete [] svx_slope_y; delete [] svx_x_err; delete [] svx_y_err; delete [] svx_slope_x_err; delete [] svx_slope_y_err; delete [] svx_cid; delete [] dx; delete [] dy; delete [] dx_slope; delete [] dy_slope; } // these are globals... run = new float[nruns]; lum = new float[nruns]; svx_status_bit = new int[nruns]; isl_status_bit = new int[nruns]; cot_status_bit = new int[nruns]; cot_flag0 = new int[nruns]; cot_flag1 = new int[nruns]; svx_flag0 = new int[nruns]; svx_flag1 = new int[nruns]; cot_rc = new float[nruns]; cot_x = new float[nruns]; cot_y = new float[nruns]; cot_slope_x = new float[nruns]; cot_slope_y = new float[nruns]; cot_x_err = new float[nruns]; cot_y_err = new float[nruns]; cot_slope_x_err = new float[nruns]; cot_slope_y_err = new float[nruns]; cot_cid = new float[nruns]; svx_rc = new float[nruns]; svx_x = new float[nruns]; svx_y = new float[nruns]; svx_slope_x = new float[nruns]; svx_slope_y = new float[nruns]; svx_x_err = new float[nruns]; svx_y_err = new float[nruns]; svx_slope_x_err = new float[nruns]; svx_slope_y_err = new float[nruns]; svx_cid = new float[nruns]; dx = new float[nruns]; dy = new float[nruns]; dx_slope = new float[nruns]; dy_slope = new float[nruns]; npt=0; for (int i=0; iAt(i); if (grs && (grs->TriggerTableName().Index("PHYSICS") >= 0) && (grs->TriggerTableName().Index("TEST") < 0) ) { rn = grs->RunNumber(); glumi = grs->LumiTape(); cot_qual = get_beamline("cot",grs->RunNumber(),Pass,&cot_beam,1); svx_qual = get_beamline("svx",grs->RunNumber(),Pass,&svx_beam,1); if (Debug) { printf("run, cot_qual, svx_qual = %7i %7i %7i\n",rn,cot_qual,svx_qual); } run [npt] = rn; lum [npt] = glumi; svx_status_bit[npt] = svx_beam.svxStatusBit; isl_status_bit[npt] = svx_beam.islStatusBit; cot_status_bit[npt] = cot_beam.cotStatusBit; cot_flag0[npt] = cot_beam.flag0; cot_flag1[npt] = cot_beam.flag1; svx_flag0[npt] = svx_beam.flag0; svx_flag1[npt] = svx_beam.flag1; cot_rc [npt] = cot_beam.rc; cot_x [npt] = cot_beam.x; cot_y [npt] = cot_beam.y; cot_slope_x [npt] = cot_beam.slopex; cot_slope_y [npt] = cot_beam.slopey; cot_x_err [npt] = cot_beam.x_err; cot_y_err [npt] = cot_beam.y_err; cot_slope_x_err [npt] = cot_beam.slopex_err; cot_slope_y_err [npt] = cot_beam.slopey_err; cot_cid[npt] = cot_beam.cid; svx_rc [npt] = svx_beam.rc; svx_x [npt] = svx_beam.x; svx_y [npt] = svx_beam.y; svx_slope_x [npt] = svx_beam.slopex; svx_slope_y [npt] = svx_beam.slopey; svx_x_err [npt] = svx_beam.x_err; svx_y_err [npt] = svx_beam.y_err; svx_slope_x_err [npt] = svx_beam.slopex_err; svx_slope_y_err [npt] = svx_beam.slopey_err; svx_cid[npt] = svx_beam.cid; dx [npt] = cot_beam.x-svx_beam.x; dy [npt] = cot_beam.y-svx_beam.y; dx_slope [npt] = cot_beam.slopex-svx_beam.slopex; dy_slope [npt] = cot_beam.slopey-svx_beam.slopey; npt++; } else { if (grs == 0) printf("i = %i\n",i); } } cdfofprd.SetForceDisconnect(flag); cdfofprd.Disconnect(); return 0; } //_____________________________________________________________________________ int plot_beamlines(const char* Plot, int MinRun, int MaxRun, int savePlot=0) { // detector = "svx" or "cot" // 'Plot' = "cot_fit_code", "svx_fit_code", "cot_x","svx_x","cot_y","svx_y", // "cot_slope_x", "svx_slope_x", "cot_slope_y", "svx_slope_y" // "dx", "dy", "dx_slope", "dy_slope" if (strcmp(Plot,"cot_fit_code") == 0) g_beamline_fit = new TGraph(npt,run,cot_rc); else if (strcmp(Plot,"svx_fit_code") == 0) g_beamline_fit = new TGraph(npt,run,svx_rc); else if (strcmp(Plot,"cot_x") == 0) g_beamline_fit = new TGraph(npt,run,cot_x ); else if (strcmp(Plot,"cot_y") == 0) g_beamline_fit = new TGraph(npt,run,cot_y ); else if (strcmp(Plot,"cot_slope_x") == 0) g_beamline_fit = new TGraph(npt,run,cot_slope_x ); else if (strcmp(Plot,"cot_slope_y") == 0) g_beamline_fit = new TGraph(npt,run,cot_slope_y ); else if (strcmp(Plot,"cot_cid") == 0) g_beamline_fit = new TGraph(npt,run,cot_cid); else if (strcmp(Plot,"svx_x") == 0) { g_beamline_fit = new TGraph(npt,run,svx_x ); for(int i=0; i>16),(svx_flag0[i]&0xFFFF),svx_flag1[i], (cot_flag0[i]>>16),(cot_flag0[i]&0xFFFF),cot_flag1[i]); } } else if (strcmp(Plot,"svx_y") == 0) { g_beamline_fit = new TGraph(npt,run,svx_y ); for(int i=0; i>16),(svx_flag0[i]&0xFFFF),svx_flag1[i], (cot_flag0[i]>>16),(cot_flag0[i]&0xFFFF),cot_flag1[i]); } } else if (strcmp(Plot,"svx_slope_x") == 0) g_beamline_fit = new TGraph(npt,run,svx_slope_x ); else if (strcmp(Plot,"svx_slope_y") == 0) g_beamline_fit = new TGraph(npt,run,svx_slope_y ); else if (strcmp(Plot,"svx_cid") == 0) g_beamline_fit = new TGraph(npt,run,svx_cid); else if (strcmp(Plot,"dx") == 0) { g_beamline_fit = new TGraph(npt,run,dx); for(int i=0; i0.0030) printf("Large dx: %6d %9.4f %9.4f %9.4f %1d %1d %1d %2d %2d %2d %2d %2d %2d\n", run[i],svx_x[i],cot_x[i],svx_x[i]-cot_x[i], svx_status_bit[i],isl_status_bit[i],cot_status_bit[i], (svx_flag0[i]>>16),(svx_flag0[i]&0xFFFF),svx_flag1[i], (cot_flag0[i]>>16),(cot_flag0[i]&0xFFFF),cot_flag1[i]); } } else if (strcmp(Plot,"dy") == 0) { g_beamline_fit = new TGraph(npt,run,dy ); for(int i=0; i0.0030) printf("Large dy: %6d %9.4f %9.4f %9.4f %1d %1d %1d %2d %2d %2d %2d %2d %2d\n", run[i],svx_y[i],cot_y[i],svx_y[i]-cot_y[i], svx_status_bit[i],isl_status_bit[i],cot_status_bit[i], (svx_flag0[i]>>16),(svx_flag0[i]&0xFFFF),svx_flag1[i], (cot_flag0[i]>>16),(cot_flag0[i]&0xFFFF),cot_flag1[i]); } } else if (strcmp(Plot,"dx_slope") == 0) g_beamline_fit = new TGraph(npt,run,dx_slope ); else if (strcmp(Plot,"dy_slope") == 0) g_beamline_fit = new TGraph(npt,run,dy_slope ); g_beamline_fit->SetTitle(Form("%s_%06d_%06d",Plot,MinRun,MaxRun)); g_beamline_fit->SetMarkerStyle(20); g_beamline_fit->SetMarkerSize(1); g_beamline_fit->GetXaxis()->SetLabelSize(0.02); g_beamline_fit->Draw("AP"); if (savePlot) c1->Print(Form("%s_%06d_%06d.gif",Plot,MinRun,MaxRun)); } //------------------------------------------------------------------------------ int plot_init_lumi(int MinRun, int MaxRun) { // detector = "svx" or "cot" TGraph* g_init_lumi; int rn, qual; float lumi; int debug(0); TObjArray* list_of_runs = new TObjArray(10000); int flag = cdfofprd.ForceDisconnect(); cdfofprd.SetForceDisconnect(0); //should be used only for obtaining run number (not all information //about runs is there) ///if you want full info about run, use 'GetRunSummary' cdfofprd.GetListOfGoodRuns (list_of_runs,MinRun,MaxRun, 2); int nruns = list_of_runs->GetEntriesFast(); float* x = new float[nruns]; float* y = new float[nruns]; int npt=0; for (int i=0; iAt(i); if (grs && (grs->TriggerTableName().Index("PHYSICS") >= 0) && (grs->TriggerTableName().Index("TEST") < 0) ) { rn = grs->RunNumber(); lumi = grs->B0InitLumi(); x[npt] = rn; y[npt] = lumi; npt++; } else { if (grs == 0) printf("i = %i\n",i); } } g_init_lumi = new TGraph(npt,x,y); g_init_lumi->SetTitle("Initial Luminosity"); g_init_lumi->SetMarkerStyle(20); g_init_lumi->SetMarkerSize(1); g_init_lumi->GetXaxis()->SetLabelSize(0.02); g_init_lumi->Draw("AP"); cdfofprd.SetForceDisconnect(flag); cdfofprd.Disconnect(); return 0; }