00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 void LaserStraightTrackTable(const Char_t * filename="stktreeR2805.root"){
00018 Int_t numb[6][7];
00019 Float_t axs[6][7], azs[6][7], x0s[6][7], z0s[6][7];
00020 Float_t eaxs[6][7], eazs[6][7], ex0s[6][7], ez0s[6][7];
00021 Float_t zmin[6] = {28, 58, 89, 119, 150, 178};
00022 Float_t zmax[6] = {32, 60, 91, 121, 152, 180};
00023 Float_t axmin[7][6] = {0.75, 1.75, 0.8, 1.67, 0.8, 1.9,
00024 .37, .95, .45, .89, .45, .96,
00025 .31, .19, .30, .25, .32, .29,
00026 -.01, -.01, -.01, -.01, -.01, 0.0,
00027 -.32, -.23, -.32, -.3, -.35, -.23,
00028 -.48, -.5, -.48, -.45, -.48, -.44,
00029 -.85, -1.2, -.85, -1.25, -.8, -1.2 };
00030 Float_t axmax[7][6] = {0.85, 2.1, 0.85, 2.0, 0.85, 2.1,
00031 .46, 1.05, .5, .99, .48, .99,
00032 .35, .30, .37, .31, .37, .30,
00033 .015, .02, .01, .05, .01, .02,
00034 -.29, -.21, -.30, -.22, -.25, -.22,
00035 -.45, -.4, -.42, -.4, -.35, -.43,
00036 -.75, -1.0, -.75, -1.0, -.7, -1.0 };
00037 TString file("/disk1/star/laser/");
00038 file += filename;
00039 cout << "Read file "<< file << endl;
00040 TFile f(file->Data());
00041 TTree *stks = (TTree*)f.Get("stks");
00042 Int_t entr = stks->GetEntries();
00043 Int_t i,m;
00044 char selection[200];
00045 stks->SetEstimate(entr);
00046 cout <<" mirror bundle n px +- x0 +- pz +- z0 +-" << endl;
00047 i=0;
00048 for (i=0; i<6; i++){
00049 Float_t avgx0 = 0; Float_t avgz0 = 0;
00050 for (m=0;m<7;m++){
00051 sprintf(selection,"fTracks.fBz> %f && fTracks.fBz< %f && (fTracks.fPx/fTracks.fPy)> %f && (fTracks.fPx/fTracks.fPy)< %f",
00052 zmin[i], zmax[i], axmin[m][i], axmax[m][i]);
00053
00054 stks->Draw("fTracks.fPx>>h1",selection,"goff");
00055 TH1F *h1 = (TH1F*)f.Get("h1");
00056
00057 numb[i][m] = h1->GetEntries();
00058 axs[i][m] = h1->GetMean(1);
00059 eaxs[i][m] = h1->GetRMS(1);
00060 delete h1;
00061
00062 stks->Draw("fTracks.fBx>>h2",selection,"goff");
00063 TH1F *h2 = (TH1F*)f.Get("h2");
00064 x0s[i][m] = h2->GetMean(1);
00065 ex0s[i][m] = h2->GetRMS(1);
00066 avgx0 += x0s[i][m];
00067 delete h2;
00068 stks->Draw("fTracks.fPz>>h3",selection,"goff");
00069 TH1F *h3 = (TH1F*)f.Get("h3");
00070 azs[i][m] = h3->GetMean(1);
00071 eazs[i][m] = h3->GetRMS(1);
00072 delete h3;
00073 stks->Draw("fTracks.fBz>>h4",selection,"goff");
00074 TH1F *h4 = (TH1F*)f.Get("h4");
00075 z0s[i][m] = h4->GetMean(1);
00076 ez0s[i][m] = h4->GetRMS(1);
00077 avgz0 += z0s[i][m];
00078 delete h4;
00079
00080 printf("%5d %5d %6d %10.4f %7.4f %10.4f %7.4f %8.4f %7.4f %10.4f %7.4f \n",
00081 m+1, 6-i, numb[i][m], axs[i][m], eaxs[i][m],
00082 x0s[i][m], ex0s[i][m], azs[i][m], eazs[i][m],
00083 z0s[i][m], ez0s[i][m]); }
00084 avgx0 /= 7.0; avgz0 /= 7.0;
00085 printf(" mean x0 %15.4f mean z0 %15.4f \n",
00086 avgx0,avgz0);
00087 cout << endl;
00088 }
00089 }