3 Double_t chik, kvx, kvy, kvz, ndofk, probk;
4 TChain*
t =
new TChain(
"kalvtx");
5 t->Add(
"run_0009903_dst_pvtx2.root");
6 t->Add(
"run_0009903_dst_pvtx3.root");
7 t->SetBranchAddress(
"chik", &chik );
8 t->SetBranchAddress(
"kvx", &kvx );
9 t->SetBranchAddress(
"kvy", &kvy );
10 t->SetBranchAddress(
"kvz", &kvz );
11 t->SetBranchAddress(
"ndofk", &ndofk );
12 t->SetBranchAddress(
"probk", &probk );
16 TH1D* m_vertex_x_kal =
new TH1D(
"x of vertex in kal",
"x of vertex in kal", 60, -0.6, 0.6);
17 TH1D* m_vertex_y_kal =
new TH1D(
"y of vertex in kal",
"y of vertex in kal", 60, -0.6, 0.1);
18 TH1D* m_vertex_z_kal =
new TH1D(
"z of vertex in kal",
"z of vertex in kal", 60, -6, 6);
22 m_vertex_x_kal->Fill(kvx);
23 m_vertex_y_kal->Fill(kvy);
24 m_vertex_z_kal->Fill(kvz);
28 TCanvas *myC =
new TCanvas(
"myC",
"myC", 1200, 400);
29 TPad *background = (TPad*)gPad;
30 background->SetFillColor(10);
34 TF1 *func =
new TF1(
"func",
"gaus", -0.6, 0.6);
35 m_vertex_x_kal->Fit(
"func",
"R+");
36 Double_t MeanXKal = func->GetParameter(1);
37 Double_t SigmaXKal = func->GetParameter(2);
38 Double_t ErrMeanXKal = func->GetParError(1);
39 Double_t ErrSigmaXKal = func->GetParError(2);
42 TF1 *funcY =
new TF1(
"funcY",
"gaus", -0.6, 0.1);
43 m_vertex_y_kal->Fit(
"funcY",
"R+");
44 Double_t MeanYKal = funcY->GetParameter(1);
45 Double_t SigmaYKal = funcY->GetParameter(2);
46 Double_t ErrMeanYKal = funcY->GetParError(1);
47 Double_t ErrSigmaYKal = funcY->GetParError(2);
50 TF1 *funcZ =
new TF1(
"funcZ",
"gaus", -6, 6);
51 m_vertex_z_kal->Fit(
"funcZ",
"R+");
52 Double_t MeanZKal = funcZ->GetParameter(1);
53 Double_t SigmaZKal = funcZ->GetParameter(2);
54 Double_t ErrMeanZKal = funcZ->GetParError(1);
55 Double_t ErrSigmaZKal = funcZ->GetParError(2);
57 cout <<
"Kal: Mean X, Y, Z = "<<MeanXKal <<
" " << MeanYKal <<
" " << MeanZKal << endl;
58 cout <<
"Kal: Sigma X, Y, Z = "<<SigmaXKal<<
" " <<SigmaYKal <<
" " << SigmaZKal << endl;
60 figs_name =
"figs.ps";
61 myC->SaveAs(figs_name);
65 cout << MeanXKal <<
" "<< MeanYKal <<
" "<< MeanZKal <<
" "<< SigmaXKal <<
" " << SigmaYKal <<
" " << SigmaZKal << endl;
66 cout << ErrMeanXKal <<
" " << ErrMeanYKal<<
" " << ErrMeanZKal <<
" " << ErrSigmaXKal <<
" " << ErrSigmaYKal <<
" " << ErrSigmaZKal << endl;