260 {
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;}
266
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;}
274
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;}
278
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;}
284
285 TFile fnew("TofQElecConst.root","RECREATE");
286 t11->Write();
287 t12->Write();
288 t21->Write();
289 t22->Write();
290 t23->Write();
291 t31->Write();
292 t41->Write();
293 t42->Write();
294 f1.Close();
295 f2.Close();
296 f3.Close();
297 f4.Close();
298 fnew.Close();
299 t11=NULL;
300 t12=NULL;
301 t21=NULL;
302 t22=NULL;
303 t23=NULL;
304 t31=NULL;
305 t41=NULL;
306 t42=NULL;
307 return true;
308}