13 TTree* t1=
new TTree(
"QElecBarParEast",
"barrel parameters of east end");
14 TTree* t2=
new TTree(
"QElecBarParWest",
"barrel parameters of west end");
15 TTree* t3=
new TTree(
"BarBoardNum",
"barrel electronics number");
20 for(
int i=0;i<11;i++){
21 sprintf(brname,
"P%d",i);
22 sprintf(ptname,
"p%d/D",i);
23 t1->Branch(brname,&p1[i],ptname);
24 t2->Branch(brname,&p2[i],ptname);
28 sprintf(brname,
"Board");
29 sprintf(ptname,
"board/D");
30 t3->Branch(brname,&
num[0],ptname);
31 sprintf(brname,
"Crate");
32 sprintf(ptname,
"crate/D");
33 t3->Branch(brname,&
num[1],ptname);
34 sprintf(brname,
"Fee");
35 sprintf(ptname,
"fee/D");
36 t3->Branch(brname,&
num[2],ptname);
37 sprintf(brname,
"Channel");
38 sprintf(ptname,
"channel/D");
39 t3->Branch(brname,&
num[3],ptname);
41 const unsigned int N = 2;
42 bool is_open[N]={
false};
44 char inTxtFile[N][500]={
"ElecBarEast.txt",
"ElecBarWest.txt"};
46 infile[m].open(inTxtFile[m],ios::in);
50 std::cerr<<
"file: "<<inTxtFile[N]<<
" can't be found!"<<std::endl;
53 for(
int k=0;k<176;k++){
56 for(
unsigned int j=0; j<4; j++ ) {
59 for(
unsigned int j=0; j<9; j++ ) {
66 for(
unsigned int j=0; j<4; j++ ) {
69 for(
unsigned int j=0; j<9; j++ ) {
81 TFile f(
"BarTofQElecPar.root",
"RECREATE");
161 TTree* t1=
new TTree(
"SimQElecBarParEast",
"barrel parameters of east end");
162 TTree* t2=
new TTree(
"SimQElecBarParWest",
"barrel parameters of west end");
167 for(
int i=0;i<11;i++){
168 sprintf(brname,
"P%d",i);
169 sprintf(ptname,
"p%d/D",i);
170 t1->Branch(brname,&p1[i],ptname);
171 t2->Branch(brname,&p2[i],ptname);
174 const unsigned int N = 2;
175 bool is_open[N]={
false};
177 char inTxtFile[N][500]={
"ElecBarEast-Curve.txt",
"ElecBarWest-Curve.txt"};
178 for(
int m=0;m<N;m++){
179 infile[m].open(inTxtFile[m],ios::in);
183 std::cerr<<
"file: "<<inTxtFile[N]<<
" can't be found!"<<std::endl;
186 for(
int k=0;k<176;k++){
189 for(
unsigned int j=0; j<11; j++ ) {
194 for(
unsigned int j=0; j<11; j++ ) {
206 TFile f(
"SimBarTofQElecPar.root",
"RECREATE");
261 TFile
f1(
"EndTofQElecPar.root");
262 TTree* t11=(TTree*)
f1.Get(
"QElecEndPar");
263 if(0==t11) { std::cerr<<
" can't get tree :QElecEndPar in file EndTofQElecPar.root"<<std::endl;
return false;}
264 TTree* t12=(TTree*)
f1.Get(
"EndBoardNum");
265 if(0==t12) { std::cerr<<
" can't get tree :EndBoardNum in file EndTofQElecPar.root"<<std::endl;
return false;}
267 TFile f2(
"BarTofQElecPar.root");
268 TTree* t21=(TTree*)f2.Get(
"QElecBarParEast");
269 if(0==t21) { std::cerr<<
" can't get tree :QElecBarParEast in file BarTofQElecPar.root"<<std::endl;
return false;}
270 TTree* t22=(TTree*)f2.Get(
"QElecBarParWest");
271 if(0==t22) { std::cerr<<
" can't get tree :QElecBarParWest in file BarTofQElecPar.root"<<std::endl;
return false;}
272 TTree* t23=(TTree*)f2.Get(
"BarBoardNum");
273 if(0==t23) { std::cerr<<
" can't get tree :BarBoardNum in file BarTofQElecPar.root"<<std::endl;
return false;}
275 TFile f3(
"SimEndTofQElecPar.root");
276 TTree* t31=(TTree*)f3.Get(
"SimQElecEndPar");
277 if(0==t31) { std::cerr<<
" can't get tree :SimQElecEndPar in file SimEndTofQElecPar.root"<<std::endl;
return false;}
279 TFile f4(
"SimBarTofQElecPar.root");
280 TTree* t41=(TTree*)f4.Get(
"SimQElecBarParEast");
281 if(0==t41) { std::cerr<<
" can't get tree :SimQElecBarParEast in file SimBarTofQElecPar.root"<<std::endl;
return false;}
282 TTree* t42=(TTree*)f4.Get(
"SimQElecBarParWest");
283 if(0==t42) { std::cerr<<
" can't get tree :SimQElecBarParWest in file SimBarTofQElecPar.root"<<std::endl;
return false;}
285 TFile fnew(
"TofQElecConst.root",
"RECREATE");