4 unsigned int index=ring-1;
7 TCanvas *
c1=
new TCanvas(
"c1",
"Alignment results",1200,800);
9 gStyle->SetTitleYOffset(1.5);
11 ifstream cdcfile(
"cdc_alignment.dat");
13 unsigned int numstraws[28]={42,42,54,54,66,66,80,80,93,93,106,106,123,123,
14 135,135,146,146,158,158,170,170,182,182,197,197,
18 TH1F *
h1=
new TH1F(
"h1",
"h1",numstraws[index],0.5,numstraws[index]+0.5);
21 h1->SetXTitle(
"Straw");
22 h1->SetYTitle(
"#Deltax [cm]");
24 sprintf(mytitle,
"Offsets at wire center for Ring %d\n",ring);
25 h1->SetTitle(mytitle);
26 h1->SetMarkerStyle(20);
28 TH1F *
h2=
new TH1F(
"h2",
"h2",numstraws[index],0.5,numstraws[index]+0.5);
31 h2->SetXTitle(
"Straw");
32 h2->SetYTitle(
"#Deltay [cm]");
33 h2->SetTitle(mytitle);
34 h2->SetMarkerStyle(20);
36 TH1F *
h3=
new TH1F(
"h3",
"h3",numstraws[index],0.5,numstraws[index]+0.5);
38 h3->SetMinimum(-0.01);
39 h3->SetXTitle(
"Straw");
40 h3->SetYTitle(
"dx/dz");
42 sprintf(mytitle,
"Slopes for Ring %d\n",ring);
43 h3->SetTitle(mytitle);
44 h3->SetMarkerStyle(20);
46 TH1F *
h4=
new TH1F(
"h4",
"h4",numstraws[index],0.5,numstraws[index]+0.5);
48 h4->SetMinimum(-0.01);
49 h4->SetXTitle(
"Straw");
50 h4->SetYTitle(
"dx/dz");
51 h4->SetTitle(mytitle);
52 h4->SetMarkerStyle(20);
56 cdcfile.getline(sdummy,40);
58 for (
unsigned int i=0;i<28;i++){
59 for (
unsigned int j=0;j<numstraws[i];j++){
61 double dxd,dyd,dxu,dyu;
70 h1->Fill(mystraw,0.5*(dxu+dxd));
71 h2->Fill(mystraw,0.5*(dyu+dyd));
72 h3->Fill(mystraw,(dxd-dxu)/150.);
73 h4->Fill(mystraw,(dyd-dyu)/150.);
79 TF1 *
f1=
new TF1(
"f1",
"[1]*(-0.05*(sin(0.1*(x-1+[0]))+sin(0.2*(x-1+[0]))))",0,numstraws[index]+1);
80 TF1 *
f2=
new TF1(
"f2",
"[1]*(-0.05*(cos(0.1*(x-1+[0]))+cos(0.2*(x-1+[0]))))",0,numstraws[index]+1);
82 TF1 *f3=
new TF1(
"f3",
"[1]*(-0.05*(sin(0.1*(x-1+[0]))-sin(0.2*(x-1+[0]))))/75.",0,numstraws[index]+1);
83 TF1 *f4=
new TF1(
"f4",
"[1]*(-0.05*(cos(0.1*(x-1+[0]))-cos(0.2*(x-1+[0]))))/75.",0,numstraws[index]+1);
88 f1->SetParameters(ring,0.);
94 f2->SetParameters(ring,0);
100 f3->SetParameters(ring,0);
106 f4->SetParameters(ring,0);
sprintf(text,"Post KinFit Cut")
static char index(char c)
void plot_cdc_offsets(unsigned int ring)