10 Double_t runmean, rungain, runresol;
12 TFile fdedx(
"DedxConst_before.root",
"recreate" );
14 TTree* runbyrun =
new TTree(
"runcalib",
"runcalib" );
15 runbyrun->Branch(
"runno", &runno,
"runno/I" );
16 runbyrun->Branch(
"runmean", &runmean,
"runmean/D" );
17 runbyrun->Branch(
"rungain", &rungain,
"rungain/D" );
18 runbyrun->Branch(
"runresol", &runresol,
"runresol/D" );
20 TFile fconst0(
"rungain.root" );
21 TTree* tree_rung = (TTree*)fconst0.Get(
"runcalib" );
22 tree_rung->SetBranchAddress(
"rungain", &rungain );
23 tree_rung->SetBranchAddress(
"runmean", &runmean );
24 tree_rung->SetBranchAddress(
"runno", &runno );
25 tree_rung->SetBranchAddress(
"runresol", &runresol );
27 long NRUN = tree_rung->GetEntries();
28 cout <<
"Run Number == " << NRUN << endl;
29 for (
long runid = 0; runid < NRUN; runid++ )
31 tree_rung->GetEntry( runid );
32 if ( runno < 12739 ) runbyrun->Fill();
35 TTree* tree_resg = (TTree*)fconst0.Get(
"resolcalib" );
37 tree_resg->SetBranchAddress(
"resol", resolpar );
38 tree_resg->GetEntry( 0 );
40 TTree* tree_gaing = (TTree*)fconst0.Get(
"gaincalib" );
42 tree_gaing->SetBranchAddress(
"gain", gainpar );
43 tree_gaing->GetEntry( 0 );
46 cout <<
"runbyrun const OK!!!" << endl;
49 TFile fconst1(
"/ihepbatch/besd26/anff/662/Calib/const_file/WireGain/"
50 "wiregain_before_new.root" );
61 TTree* tree_wireg = (TTree*)fconst1.Get(
"wiregcalib" );
62 tree_wireg->SetBranchAddress(
"wireg", gwire );
63 tree_wireg->GetEntry( 0 );
65 cout <<
"wiregcalib const OK!!!" << endl;
68 TFile fconst2(
"../Eangle1D/DedxConst_test.root" );
69 Double_t ggs0[43], ggs1[43], ggs2[43], ggs3[43];
70 TTree* tree_ggs = (TTree*)fconst2.Get(
"ggscalib" );
71 tree_ggs->SetBranchAddress(
"ggs0", ggs0 );
72 tree_ggs->SetBranchAddress(
"ggs1", ggs1 );
73 tree_ggs->SetBranchAddress(
"ggs2", ggs2 );
74 tree_ggs->SetBranchAddress(
"ggs3", ggs3 );
75 tree_ggs->GetEntry( 0 );
77 cout <<
"ggscalib const OK!!!" << endl;
80 TFile fconst3(
"../Eangle1D/DedxConst_test.root" );
81 Double_t ddg0[43], ddg1[43], ddg2[43], ddg3[43];
82 TTree* tree_ddg = (TTree*)fconst3.Get(
"ddgcalib" );
83 tree_ddg->SetBranchAddress(
"ddg0", ddg0 );
84 tree_ddg->SetBranchAddress(
"ddg1", ddg1 );
85 tree_ddg->SetBranchAddress(
"ddg2", ddg2 );
86 tree_ddg->SetBranchAddress(
"ddg3", ddg3 );
87 tree_ddg->GetEntry( 0 );
89 cout <<
"ddgcalib const OK!!!" << endl;
92 TFile fconst4(
"../Eangle1D/DedxConst_test.root" );
93 Double_t entra0[43], entra1[43], entra2[43], entra3[43];
94 TTree* tree_entra = (TTree*)fconst4.Get(
"entracalib" );
95 tree_entra->SetBranchAddress(
"entra0", entra0 );
96 tree_entra->SetBranchAddress(
"entra1", entra1 );
97 tree_entra->SetBranchAddress(
"entra2", entra2 );
98 tree_entra->SetBranchAddress(
"entra3", entra3 );
103 tree_entra->GetEntry( 0 );
106 TFile fconst4_1(
"/ihepbatch/besd26/anff/662/Calib/draw/calib/eangle/EAngle.root" );
109 double denangle[100];
110 TTree* tree_entra1 = (TTree*)fconst4_1.Get(
"entracalib" );
111 tree_entra1->SetBranchAddress(
"1denangle_entry", entry );
112 tree_entra1->SetBranchAddress(
"1denangle", denangle );
113 tree_entra1->GetEntry( 0 );
115 cout <<
"entrance angle const OK!!!" << endl;
118 TFile fconst5(
"../Eangle1D/DedxConst_test.root" );
119 Double_t zdep0[43], zdep1[43], zdep2[43], zdep3[43];
120 TTree* tree_zdep = (TTree*)fconst5.Get(
"zdepcalib" );
121 tree_zdep->SetBranchAddress(
"zdep0", zdep0 );
122 tree_zdep->SetBranchAddress(
"zdep1", zdep1 );
123 tree_zdep->SetBranchAddress(
"zdep2", zdep2 );
124 tree_zdep->SetBranchAddress(
"zdep3", zdep3 );
125 tree_zdep->GetEntry( 0 );
127 cout <<
"zdepcalib const OK!!!" << endl;
130 TFile fconst6(
"../Eangle1D/DedxConst_test.root" );
132 TTree* tree_layerg = (TTree*)fconst6.Get(
"layergcalib" );
133 tree_layerg->SetBranchAddress(
"layerg", glayer );
134 tree_layerg->GetEntry( 0 );
136 cout <<
"layergcalib const OK!!!" << endl;
142 TFile fconst7(
"/ihepbatch/besd26/anff/662/Calib/const_file/Costheta/costheta_new.root" );
143 TTree* tree_costheta = (TTree*)fconst7.Get(
"costhetacalib" );
144 double gcostheta[80];
145 tree_costheta->SetBranchAddress(
"costheta", gcostheta );
146 tree_costheta->GetEntry( 0 );
148 cout <<
"costhetacalib const OK!!!" << endl;
151 TFile fconst8(
"/afs/ihep.ac.cn/bes3/offline/CalibConst/dedx/6.5.3/Jpsi/t0calib.root" );
153 TTree* tree_t0 = (TTree*)fconst8.Get(
"t0calib" );
157 tree_t0->SetBranchAddress(
"t0", &t0 );
158 tree_t0->SetBranchAddress(
"dedx", &dedx );
159 for (
int i = 0; i < tree_t0->GetEntries(); i++ )
161 tree_t0->GetEntry( i );
166 cout <<
"t0calib const OK!!!" << endl;
172 "/ihepbatch/besd26/anff/662/Calib/const_file/DocaEAngle/docaeangle_new.root" );
174 double Iner_gain[
n], Iner_chi[
n], Iner_hits[
n];
175 double Out_gain[
n], Out_chi[
n], Out_hits[
n];
176 double Id_doca[
n], Ip_eangle[
n];
178 TTree* tree_docasin = (TTree*)fconst9.Get(
"ddgcalib" );
179 tree_docasin->SetBranchAddress(
"Iner_gain", Iner_gain );
180 tree_docasin->SetBranchAddress(
"Iner_chi", Iner_chi );
181 tree_docasin->SetBranchAddress(
"Iner_hits", Iner_hits );
182 tree_docasin->SetBranchAddress(
"Out_gain", Out_gain );
183 tree_docasin->SetBranchAddress(
"Out_chi", Out_chi );
184 tree_docasin->SetBranchAddress(
"Out_hits", Out_hits );
185 tree_docasin->SetBranchAddress(
"Id_doca", Id_doca );
186 tree_docasin->SetBranchAddress(
"Ip_eangle", Ip_eangle );
187 tree_docasin->GetEntry( 0 );
190 cout <<
"ddgcalib const OK!!!" << endl;
192 TFile fconst10(
"/panfs/panfs.ihep.ac.cn/home/data/anff/dEdxCal/662_cal/Hadron/constfile/"
193 "Hadron_11414-14604.root" );
200 TTree* tree_hadron = (TTree*)fconst10.Get(
"ggscalib" );
201 tree_hadron->SetBranchAddress(
"hadron", ghadron );
202 tree_hadron->SetBranchAddress(
"hadronNo", &hadronNo );
203 tree_hadron->GetEntry( 0 );
205 cout <<
"hadron const OK!!!" << endl;
209 TTree* gain =
new TTree(
"gaincalib",
"gaincalib" );
210 gain->Branch(
"gain", gainpar,
"gain[1]/D" );
211 gain->Branch(
"t0", gt0,
"t0[35]/D" );
212 gain->Branch(
"dedx", gdedx,
"dedx[35]/D" );
214 TTree* resol =
new TTree(
"resolcalib",
"resolcalib" );
215 resol->Branch(
"resol", resolpar,
"resol[1]/D" );
217 TTree* wireg =
new TTree(
"wiregcalib",
"wiregcalib" );
218 wireg->Branch(
"wireg", gwire,
"wireg[6796]/D" );
219 wireg->SetBasketSize(
"wireg", 2000000 );
221 TTree* ggs =
new TTree(
"ggscalib",
"ggscalib" );
222 ggs->Branch(
"ggs0", ggs0,
"ggs[43]/D" );
223 ggs->Branch(
"ggs1", ggs1,
"ggs[43]/D" );
224 ggs->Branch(
"ggs2", ggs2,
"ggs[43]/D" );
225 ggs->Branch(
"ggs3", ggs3,
"ggs[43]/D" );
226 ggs->Branch(
"costheta", gcostheta,
"costheta[80]/D" );
227 ggs->Branch(
"hadron", ghadron,
"hadron[5]/D" );
228 ggs->Branch(
"hadronNo", &hadronNo,
"hadronNo/I" );
230 TTree* ddg =
new TTree(
"ddgcalib",
"ddgcalib" );
231 ddg->Branch(
"ddg0", ddg0,
"ddg[43]/D" );
232 ddg->Branch(
"ddg1", ddg1,
"ddg[43]/D" );
233 ddg->Branch(
"ddg2", ddg2,
"ddg[43]/D" );
234 ddg->Branch(
"ddg3", ddg3,
"ddg[43]/D" );
235 ddg->Branch(
"Iner_gain", Iner_gain,
"Iner_gain[1600]/D" );
236 ddg->Branch(
"Out_gain", Out_gain,
"Out_gain[1600]/D" );
237 ddg->Branch(
"Iner_chi", Iner_chi,
"Iner_chi[1600]/D" );
238 ddg->Branch(
"Out_chi", Out_chi,
"Out_chi[1600]/D" );
239 ddg->Branch(
"Iner_hits", Iner_hits,
"Iner_hits[1600]/D" );
240 ddg->Branch(
"Out_hits", Out_hits,
"Out_hits[1600]/D" );
241 ddg->Branch(
"Id_doca", Id_doca,
"Id_doca[1600]/D" );
242 ddg->Branch(
"Ip_eangle", Ip_eangle,
"Ip_eangle[1600]/D" );
244 TTree* entra =
new TTree(
"entracalib",
"entracalib" );
245 entra->Branch(
"entra0", entra0,
"entra[43]/D" );
246 entra->Branch(
"entra1", entra1,
"entra[43]/D" );
247 entra->Branch(
"entra2", entra2,
"entra[43]/D" );
248 entra->Branch(
"entra3", entra3,
"entra[43]/D" );
249 entra->Branch(
"1denangle_entry", entry,
"1denangle_entry[1]/I" );
250 entra->Branch(
"1denangle", denangle,
"1denangle[100]/D" );
252 TTree* zdep =
new TTree(
"zdepcalib",
"zdepcalib" );
253 zdep->Branch(
"zdep0", zdep0,
"zdep[43]/D" );
254 zdep->Branch(
"zdep1", zdep1,
"zdep[43]/D" );
255 zdep->Branch(
"zdep2", zdep2,
"zdep[43]/D" );
256 zdep->Branch(
"zdep3", zdep3,
"zdep[43]/D" );
258 TTree* layerg =
new TTree(
"layergcalib",
"layergcalib" );
259 layerg->Branch(
"layerg", glayer,
"layerg[43]/D" );
282 cout <<
"All const OK!!!" << endl;