53{
54 MsgStream log(
msgSvc(), name());
55 log<<MSG::INFO<<"DedxCalibDocaEAng::FillHists()"<<endreq;
56
58 TTree* n103, *t_test(0);
59 string runlist;
60
61 double doca_test(0), eang_test(0);
62 int ndedxhit=0;
63 double dEdx[100]={0},pathlength[100]={0},wid[100]={0},layid[100]={0},dd_in[100]={0},eangle[100]={0},zhit[100]={0};
66 if(m_debug){ f_test = new TFile("doca_eangle_test.root","recreate");
67 t_test = new TTree("inftest", "information for test doca eangle calibration");
68 t_test->Branch("idoca", &m_idoca_test, "idoca/I");
69 t_test->Branch("ieang", &m_ieang_test, "ieang/I");
70 t_test->Branch("doca", &doca_test, "doca/D");
71 t_test->Branch("eang", &eang_test, "eang/D");
72 }
73
76 cout<<"runlist: "<<runlist.c_str()<<endl;
77 f =
new TFile(runlist.c_str());
78 n103 = (TTree*)
f->Get(
"n103");
79 if(
f==0){ cout <<
"the file is empty" << endl;
continue;}
80 if(n103==0){ cout << "the tree is empty" << endl; continue;}
98
99 vector<double> m_phlist_test(0);
100 for(int j=0;j<n103->GetEntries();j++){
101 n103->GetEntry(j);
102 if(
ptrk>pMax ||
ptrk<pMin)
continue;
103 if(tes>1400) continue;
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118 for(int k=0;k<ndedxhit;k++){
119
120 dd_in[k] = dd_in[k]/doca_norm[int(layid[k])];
121 if(eangle[k] >0.25) eangle[k] = eangle[k] -0.5;
122 else if(eangle[k] <-0.25) eangle[k] = eangle[k] +0.5;
124 {
125 if(layid[k] <4) continue;
126
127
128
129
131 int iEAng = 0;
132 for(int i =0; i<14; i++)
133 {
134 if(eangle[k] < Eangle_value_cut[i] || eangle[k] >= Eangle_value_cut[i+1]) continue;
135 else if(eangle[k] >= Eangle_value_cut[i] && eangle[k] < Eangle_value_cut[i+1])
136 {
137 for(int m =0; m<i; m++)
138 {
139 iEAng += Eangle_cut_bin[m];
140 }
141 double eangle_bin_cut_step = (Eangle_value_cut[i+1] - Eangle_value_cut[i])/Eangle_cut_bin[i];
142 int temp_bin = int((eangle[k]-Eangle_value_cut[i])/eangle_bin_cut_step);
143 iEAng += temp_bin;
144 }
145 }
146 if(m_debug && (iDoca==m_idoca_test) && (iEAng==m_ieang_test)){
147 doca_test = dd_in[k];
148 eang_test = eangle[k];
149 t_test->Fill();
150 cout << "dedx before cor: " << dEdx[k]*1.5/pathlength[k] << endl;
151 }
152 dEdx[k] =
exsvc->
StandardHitCorrec(0,runFlag,2,runNO,evtNO,pathlength[k],wid[k],layid[k],dEdx[k],(dd_in[k])*(doca_norm[
int(layid[k])]),eangle[k],
costheta);
154 m_docaeangle[iDoca][iEAng]->Fill(dEdx[k]);
155 if(m_debug && (iDoca==m_idoca_test) && (iEAng==m_ieang_test)){
156 cout << "dedx after cor: " << dEdx[k] << endl << endl;
157 }
158 }
159 }
160 }
161 f->Close();
f = 0; n103 = 0;
162 }
163 if(m_debug){ f_test->cd(); t_test->Write(); f_test->Close(); }
164}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
data SetBranchAddress("time",&time)
vector< string > m_recFileVector
virtual double StandardHitCorrec(int calib_rec_Flag, int runFlag, int ntpFlag, int runNO, int evtNO, double pathl, int wid, int layid, double adc, double dd, double eangle, double costheta) const =0
virtual double StandardTrackCorrec(int calib_rec_Flag, int typFlag, int ntpFlag, int runNO, int evtNO, double ex, double costheta, double t0) const =0