88 TH1D* x_of_vertex_in_kal;
89 TH1D* y_of_vertex_in_kal;
90 TH1D* z_of_vertex_in_kal;
91 f.GetObject(
"/zhsVER/x_of_vertex_in_kal",x_of_vertex_in_kal);
92 f.GetObject(
"/zhsVER/y_of_vertex_in_kal",y_of_vertex_in_kal);
93 f.GetObject(
"/zhsVER/z_of_vertex_in_kal",z_of_vertex_in_kal);
98 func =
new TF1(
"func",
"gaus", -0.6, 0.6);
99 funcY =
new TF1(
"funcY",
"gaus", -0.6, 0.2);
100 funcZ =
new TF1(
"funcZ",
"gaus", -6, 6);
103 func =
new TF1(
"func",
"gaus", 0., 1.8);
104 funcY =
new TF1(
"funcY",
"gaus", -1., 1.);
105 funcZ =
new TF1(
"funcZ",
"gaus", -6, 6);
107 x_of_vertex_in_kal->Fit(
"func",
"RQ");
108 Double_t MeanXKal = func->GetParameter(1);
109 Double_t SigmaXKal = func->GetParameter(2);
111 y_of_vertex_in_kal->Fit(
"funcY",
"RQ");
112 Double_t MeanYKal = funcY->GetParameter(1);
113 Double_t SigmaYKal = funcY->GetParameter(2);
115 z_of_vertex_in_kal->Fit(
"funcZ",
"RQ");
116 Double_t MeanZKal = funcZ->GetParameter(1);
117 Double_t SigmaZKal = funcZ->GetParameter(2);
119 if(MeanXKal<-0.05 || MeanXKal>0.25 || SigmaXKal>0.12 || SigmaXKal<0.){
120 std::cout<<
"--------------x_of_vertex_in_kal-------out of range--runID is:"<<
runNo<<std::endl;
123 if(MeanYKal<-0.4 || MeanYKal>0 || SigmaYKal>0.12 || SigmaYKal<0)
125 std::cout<<
"--------------y_of_vertex_in_kal-------out of range--runID is:"<<
runNo<<std::endl;
128 if(MeanZKal<-1 || MeanZKal>1.0 || SigmaZKal>1.5 || SigmaZKal<0)
130 std::cout<<
"--------------z_of_vertex_in_kal-------out of range--runID is:"<<
runNo<<std::endl;
135 if(MeanXKal<0.6 || MeanXKal>1.2 || SigmaXKal>0.18 || SigmaXKal<0.){
136 std::cout<<
"--------------x_of_vertex_in_kal-------out of range--runID is:"<<
runNo<<std::endl;
139 if(MeanYKal<-0.4 || MeanYKal>0 || SigmaYKal>0.12 || SigmaYKal<0.)
141 std::cout<<
"--------------y_of_vertex_in_kal-------out of range--runID is:"<<
runNo<<std::endl;
144 if(MeanZKal<-0.8 || MeanZKal>0.8 || SigmaZKal>1.5 || SigmaZKal<0.)
146 std::cout<<
"--------------z_of_vertex_in_kal-------out of range--runID is:"<<
runNo<<std::endl;
151 char VerFitFunc[] =
"Kalman";
152 char DistFitFunc[] =
"single Gaussian";
154 double AcSigmaVx, AcSigmaVy;
158 char query[1024*100];
162 sprintf(query,
"INSERT INTO BeamPar(BeamParSerNo,RunNo,Vx,Vy,Vz,SigmaVx,SigmaVy,SigmaVz,VerFitFunc,DistFitFunc,SftVer,Creator,AcSigmaVx,AcSigmaVy,ParVer) values(0,'%d','%f','%f','%f','%f','%f','%f','%s','%s','%s','%s','%f','%f','%s')",
runNo,MeanXKal,MeanYKal,MeanZKal,SigmaXKal,SigmaYKal,SigmaZKal,VerFitFunc,DistFitFunc,
SftVer,
Creator,AcSigmaVx,AcSigmaVy,
ParVer);
169 char query[1024*100];
179 sprintf(query,
"select Vx,Vy,Vz,SigmaVx,SigmaVy,SigmaVz,RunNo,SftVer,ParVer from BeamPar where RunNo='%d' && SftVer='%s' && ParVer='%s'",
runNo-irun,
SftVer,
ParVer);
194 sprintf(query,
"update BeamPar set Vx='%s',SigmaVx='%s' where RunNo='%d' && SftVer='%s' && ParVer='%s'",Vx.c_str(),SigmaVx.c_str(),
runNo,
SftVer,
ParVer);
197 std::cout<<
"------------------update Vx,SigmaVx successful!--------"<<std::endl;
200 sprintf(query,
"update BeamPar set Vy='%s',SigmaVy='%s' where RunNo='%d' && SftVer='%s' && ParVer='%s'",Vy.c_str(),SigmaVy.c_str(),
runNo,
SftVer,
ParVer);
203 std::cout<<
"------------------update Vy,SigmaVy successful!---------"<<std::endl;
206 sprintf(query,
"update BeamPar set Vz='%s',SigmaVz='%s' where RunNo='%d' && SftVer='%s' && ParVer='%s'",Vz.c_str(),SigmaVz.c_str(),
runNo,
SftVer,
ParVer);
209 std::cout<<
"------------------update Vz,SigmaVz successful!---------"<<std::endl;
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)