1 static const int NCRATE=14;
2 static const char* CRATE[NCRATE]={
"L1",
"BC1",
"MXQ",
"MIX",
"BCW",
"BCE",
"FEQ",
3 "BBC",
"BBQ",
"FMS",
"QT1",
"QT2",
"QT3",
"QT4"};
4 static const int color[NCRATE]= {kGreen,kBlue,kBlue,kBlue,kBlue,kBlue,kRed,
5 kBlue,kRed,kBlue,kOrange,kRed,kGreen,kYellow};
7 static const int NEVT=10000;
9 static int diff[NCRATE][NEVT];
10 static TGraph* g[NCRATE];
12 void read(
int runnum){
16 sprintf(file,
"%d.txt",runnum);
17 FILE* f=fopen(file,
"r");
18 if(!f) { printf(
"Failed to open %s\n",file);
return; }
19 printf(
"Reading %s\n",file);
23 for(
int i=0; i<NEVT; i++){
25 float rmean,rrms,rmax;
26 fscanf(f,
"%6s %d %d %d %d %d %d\n",
28 &diff[2][i],&diff[10][i],&diff[11][i],&diff[12][i],&diff[13][i]);
29 printf(
"%6s %d %d %d %d %d %d\n",
31 diff[2][i],diff[10][i],diff[11][i],diff[12][i],diff[13][i]);
32 for(
int j=0; j<NCRATE; j++){
33 g[j]->SetPoint(i,
double(tcu[i]),
double(diff[j][i]));
39 void plot(
double xmin=0.0,
double xmax=0.0,
double ymin=0.0,
double ymax=500.0){
40 TH2F *frame =
new TH2F(
"frame",
"",1,xmin,xmax,1,ymin,ymax); frame->Draw();
41 for(
int i=0; i<NCRATE; i++){
46 void time(
int run=17084043,
47 double xmin=71225190.0,
double xmax=118061728.0,
48 double ymin=0.0,
double ymax=65536.0*2.5){
49 for(
int i=0; i<NCRATE; i++){
51 g[i]->SetMarkerStyle(20);
52 g[i]->SetMarkerSize(1);
53 g[i]->SetLineColor(color[i]);
55 gStyle->SetOptStat(0);
58 c1 =
new TCanvas(
"c1",Form(
"%d",run),50,0,700,720);
59 plot(xmin,xmax,ymin,ymax);
61 TLine *l =
new TLine(xmin, 65536.0 , xmax, 65536.0); l->Draw();
63 t=
new TText(0.7,0.03,
"TCU counter[xing]"); t->SetNDC(); t->SetTextSize(0.03); t->Draw();
64 t=
new TText(0.05,0.95,
"RCC-TCU[xing]"); t->SetNDC(); t->SetTextSize(0.03); t->Draw();
65 t=
new TText(0.5,0.4,
"Memory Overwrite above"); t->SetNDC(); t->SetTextSize(0.03); t->Draw();
66 t=
new TText(0.2,0.8,
"MXQ"); t->SetNDC(); t->SetTextSize(0.03); t->SetTextColor(color[2]); t->Draw();
67 t=
new TText(0.2,0.75,
"QT1"); t->SetNDC(); t->SetTextSize(0.03); t->SetTextColor(color[10]); t->Draw();
68 t=
new TText(0.2,0.70,
"QT2"); t->SetNDC(); t->SetTextSize(0.03); t->SetTextColor(color[11]); t->Draw();
69 t=
new TText(0.2,0.65,
"QT3"); t->SetNDC(); t->SetTextSize(0.03); t->SetTextColor(color[12]); t->Draw();
70 t=
new TText(0.2,0.60,
"QT4"); t->SetNDC(); t->SetTextSize(0.03); t->SetTextColor(color[13]); t->Draw();
102 sprintf(file,
"rcc_time_%d.png",run);
104 printf(
"Create %s\n",file);