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