2TString
str_old =
"../WireGain/DedxConst_test.root";
7 Int_t runno, evtfrom, evtto;
8 Double_t runmean, rungain, runresol;
10 TFile fdedx(
"DedxConst_test.root",
"recreate");
11 TTree* runbyrun =
new TTree(
"runcalib",
"runcalib");
12 runbyrun ->
Branch(
"runno", &runno,
"runno/I");
13 runbyrun ->
Branch(
"runmean", &runmean,
"runmean/D");
14 runbyrun ->
Branch(
"rungain", &rungain,
"rungain/D");
15 runbyrun ->
Branch(
"runresol", &runresol,
"runresol/D");
16 runbyrun ->
Branch(
"evtfrom", &evtfrom,
"evtfrom/I");
17 runbyrun ->
Branch(
"evtto", &evtto,
"evtto/I");
21 TTree *tree_rung = (TTree*)fconst0.Get(
"runcalib");
29 long NRUN = tree_rung -> GetEntries();
30 cout<<
"Run Number == "<<NRUN<<endl;
31 for(
long runid =0; runid<NRUN; runid++){
32 tree_rung->GetEntry(runid);
36 TTree *tree_resg = (TTree*)fconst0.Get(
"resolcalib");
41 TTree *tree_gaing = (TTree*)fconst0.Get(
"gaincalib");
47 cout<<
"runbyrun const OK!!!"<<endl;
52 TTree *tree_wireg = (TTree*)fconst1.Get(
"wiregcalib");
56 cout<<
"wiregcalib const OK!!!"<<endl;
60 Double_t ggs0[43], ggs1[43], ggs2[43], ggs3[43];
61 TTree *tree_ggs = (TTree*)fconst2.Get(
"ggscalib");
66 tree_ggs->GetEntry(0);
68 cout<<
"ggscalib const OK!!!"<<endl;
72 Double_t ddg0[43], ddg1[43], ddg2[43], ddg3[43];
73 TTree *tree_ddg = (TTree*)fconst3.Get(
"ddgcalib");
80 cout<<
"ddgcalib const OK!!!"<<endl;
84 Double_t entra0[43], entra1[43], entra2[43], entra3[43];
85 TTree *tree_entra = (TTree*)fconst4.Get(
"entracalib");
94 tree_entra->GetEntry(0);
100 int entry[1];
double denangle[100];
101 TTree *tree_entra1 = (TTree*)fconst4_1.Get(
"entracalib");
104 tree_entra1 ->GetEntry(0);
106 cout<<
"entrance angle const OK!!!"<<endl;
110 Double_t zdep0[43], zdep1[43], zdep2[43], zdep3[43];
111 TTree *tree_zdep = (TTree*)fconst5.Get(
"zdepcalib");
116 tree_zdep->GetEntry(0);
118 cout<<
"zdepcalib const OK!!!"<<endl;
123 TTree *tree_layerg = (TTree*)fconst6.Get(
"layergcalib");
125 tree_layerg->GetEntry(0);
127 cout<<
"layergcalib const OK!!!"<<endl;
133 TTree *tree_costheta = (TTree*)fconst7.Get(
"ggscalib");
134 double gcostheta[80];
135 tree_costheta ->SetBranchAddress(
"costheta",gcostheta);
136 tree_costheta->GetEntry(0);
138 cout<<
"costhetacalib const OK!!!"<<endl;
142 TTree *tree_t0=(TTree*)fconst8.Get(
"gaincalib");
146 tree_t0->SetBranchAddress(
"t0",gt0);
147 tree_t0->SetBranchAddress(
"dedx",gdedx);
148 for(
int i=0; i<tree_t0->GetEntries(); i++)
150 tree_t0->GetEntry(i);
155 cout<<
"t0calib const OK!!!"<<endl;
159 TFile fconst9(
"docaeangle.root");
161 double Iner_gain[
n], Iner_chi[
n], Iner_hits[
n];
162 double Out_gain[
n], Out_chi[
n], Out_hits[
n];
163 double Id_doca[
n], Ip_eangle[
n];
165 TTree *tree_docasin = (TTree*)fconst9.Get(
"ddgcalib");
177 cout<<
"ddgcalib const OK!!!"<<endl;
184 TTree *tree_hadron = (TTree*)fconst10.Get(
"ggscalib");
187 tree_hadron->GetEntry(0);
189 cout<<
"hadron const OK!!!"<<endl;
193 TTree* gain =
new TTree(
"gaincalib",
"gaincalib");
194 gain ->
Branch(
"gain", gainpar,
"gain[1]/D");
195 gain ->
Branch(
"t0", gt0,
"t0[35]/D");
196 gain ->
Branch(
"dedx", gdedx,
"dedx[35]/D");
198 TTree* resol =
new TTree(
"resolcalib",
"resolcalib");
199 resol ->
Branch(
"resol", resolpar,
"resol[1]/D");
201 TTree* wireg =
new TTree(
"wiregcalib",
"wiregcalib");
202 wireg ->
Branch(
"wireg", gwire,
"wireg[6796]/D");
203 wireg-> SetBasketSize(
"wireg",2000000);
205 TTree* ggs =
new TTree(
"ggscalib",
"ggscalib");
206 ggs ->
Branch(
"ggs0", ggs0,
"ggs[43]/D");
207 ggs ->
Branch(
"ggs1", ggs1,
"ggs[43]/D");
208 ggs ->
Branch(
"ggs2", ggs2,
"ggs[43]/D");
209 ggs ->
Branch(
"ggs3", ggs3,
"ggs[43]/D");
210 ggs ->
Branch(
"costheta", gcostheta,
"costheta[80]/D");
211 ggs ->
Branch(
"hadron",ghadron,
"hadron[5]/D");
212 ggs ->
Branch(
"hadronNo",&hadronNo,
"hadronNo/I");
214 TTree* ddg =
new TTree(
"ddgcalib",
"ddgcalib");
215 ddg ->
Branch(
"ddg0", ddg0,
"ddg[43]/D");
216 ddg ->
Branch(
"ddg1", ddg1,
"ddg[43]/D");
217 ddg ->
Branch(
"ddg2", ddg2,
"ddg[43]/D");
218 ddg ->
Branch(
"ddg3", ddg3,
"ddg[43]/D");
219 ddg ->
Branch(
"Iner_gain", Iner_gain,
"Iner_gain[1600]/D");
220 ddg ->
Branch(
"Out_gain", Out_gain,
"Out_gain[1600]/D");
221 ddg ->
Branch(
"Iner_chi", Iner_chi,
"Iner_chi[1600]/D");
222 ddg ->
Branch(
"Out_chi", Out_chi,
"Out_chi[1600]/D");
223 ddg ->
Branch(
"Iner_hits", Iner_hits,
"Iner_hits[1600]/D");
224 ddg ->
Branch(
"Out_hits", Out_hits,
"Out_hits[1600]/D");
225 ddg ->
Branch(
"Id_doca", Id_doca,
"Id_doca[1600]/D");
226 ddg ->
Branch(
"Ip_eangle", Ip_eangle,
"Ip_eangle[1600]/D");
228 TTree* entra =
new TTree(
"entracalib",
"entracalib");
229 entra ->
Branch(
"entra0", entra0,
"entra[43]/D");
230 entra ->
Branch(
"entra1", entra1,
"entra[43]/D");
231 entra ->
Branch(
"entra2", entra2,
"entra[43]/D");
232 entra ->
Branch(
"entra3", entra3,
"entra[43]/D");
233 entra ->
Branch(
"1denangle_entry", entry,
"1denangle_entry[1]/I");
234 entra ->
Branch(
"1denangle", denangle,
"1denangle[100]/D");
236 TTree* zdep =
new TTree(
"zdepcalib",
"zdepcalib");
237 zdep ->
Branch(
"zdep0", zdep0,
"zdep[43]/D");
238 zdep ->
Branch(
"zdep1", zdep1,
"zdep[43]/D");
239 zdep ->
Branch(
"zdep2", zdep2,
"zdep[43]/D");
240 zdep ->
Branch(
"zdep3", zdep3,
"zdep[43]/D");
242 TTree* layerg =
new TTree(
"layergcalib",
"layergcalib");
243 layerg ->
Branch(
"layerg", glayer,
"layerg[43]/D");
266 cout<<
"All const OK!!!"<<endl;
curve Branch("CurveSize",&CurveSize,"CurveSize/I")
data SetBranchAddress("time",&time)