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++){
23 t1->Branch(brname,&p1[i],ptname);
24 t2->Branch(brname,&p2[i],ptname);
30 t3->Branch(brname,&
num[0],ptname);
33 t3->Branch(brname,&
num[1],ptname);
36 t3->Branch(brname,&
num[2],ptname);
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");
96 TTree* t1=
new TTree(
"QElecEndPar",
"endcap parameters of east end");
97 TTree* t2=
new TTree(
"EndBoardNum",
"endcap electronics number");
101 for(
int i=0;i<11;i++){
104 t1->Branch(brname,&p[i],ptname);
110 t2->Branch(brname,&
num[0],ptname);
113 t2->Branch(brname,&
num[1],ptname);
116 t2->Branch(brname,&
num[2],ptname);
119 t2->Branch(brname,&
num[3],ptname);
123 char inTxtFile[500]=
"ElecEndcap.txt";
124 infile.open(inTxtFile,ios::in);
128 std::cerr<<
"file: "<<inTxtFile<<
" can't be found!"<<std::endl;
130 for(
int k=0;k<96;k++){
133 for(
unsigned int j=0; j<4; j++ ) {
136 for(
unsigned int j=0; j<9; j++ ) {
148 TFile
f(
"EndTofQElecPar.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++){
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");
218 TTree*
t=
new TTree(
"SimQElecEndPar",
"endcap parameters of east end");
222 for(
int i=0;i<11;i++){
225 t->Branch(brname,&p[i],ptname);
230 char inTxtFile[500]=
"ElecEndcap-Curve.txt";
231 infile.open(inTxtFile,ios::in);
235 std::cerr<<
"file: "<<inTxtFile<<
" can't be found!"<<std::endl;
237 for(
int k=0;k<96;k++){
240 for(
unsigned int j=0; j<11; j++ ) {
251 TFile
f(
"SimEndTofQElecPar.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");
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)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
bool sim_endcap_conv2root()
bool sim_barrel_conv2root()