42 MsgStream log(
msgSvc(), name());
43 log<<MSG::INFO<<
"DedxCalibRunByRun::FillHists()"<<endreq;
50 double dEdx[100]={0},pathlength[100]={0},wid[100]={0},layid[100]={0},dd_in[100]={0},eangle[100]={0},zhit[100]={0};
52 float runNO=0,runFlag=0,costheta=0,tes=0;
53 vector<double> phlist;
54 for(
int i=0; i<
runNo; i++)
57 f =
new TFile(runlist.c_str());
58 n103 = (TTree*)f->Get(
"n103");
71 for(
int j=0;j<n103->GetEntries();j++)
75 for(
int k=0;k<ndedxhit;k++)
77 dEdx[k] =
exsvc->
StandardHitCorrec(0,runFlag,2,runNO,pathlength[k],wid[k],layid[k],dEdx[k],dd_in[k],eangle[k],costheta);
78 phlist.push_back(dEdx[k]);
82 m_rungain[i]->Fill(dedx);
85 cout<<
"runNO = "<<runNO<<endl;
86 m_runNOVector.push_back(runNO);
104 MsgStream log(
msgSvc(), name());
105 log<<MSG::INFO<<
"DedxCalibRunByRun::WriteHists()"<<endreq;
107 TFile* f =
new TFile(
m_rootfile.c_str(),
"recreate");
109 Double_t gainpar=0, resolpar=0;
110 gainpar = m_hist -> GetFunction(
"gaus") -> GetParameter(1);
111 resolpar = m_hist -> GetFunction(
"gaus") -> GetParameter(2);
113 TTree* gain =
new TTree(
"gaincalib",
"gaincalib");
114 gain -> Branch(
"gain", &gainpar,
"gain[1]/D");
116 TTree* resol =
new TTree(
"resolcalib",
"resolcalib");
117 resol -> Branch(
"resol", &resolpar,
"resol[1]/D");
121 Double_t runmean=0, rungain=0, runresol=0;
122 TTree* runbyrun =
new TTree(
"runcalib",
"runcalib");
123 runbyrun -> Branch(
"runno", &runno,
"runno/I");
124 runbyrun -> Branch(
"runmean", &runmean,
"runmean/D");
125 runbyrun -> Branch(
"rungain", &rungain,
"rungain/D");
126 runbyrun -> Branch(
"runresol", &runresol,
"runresol/D");
127 for(
int i=0; i<
runNo; i++)
129 runno = m_runNOVector[i];
130 runmean = m_rungain[i] -> GetFunction(
"gaus") -> GetParameter(1);
131 runresol = m_rungain[i] -> GetFunction(
"gaus") -> GetParameter(2);
133 cout<<
"i = "<<i<<
" runno = "<<runno <<
" @ runmean = "<<runmean<<
" @ rungain = "<<rungain<<
" @ runresol = "<<runresol<<endl;
138 for(
int i=0; i<
runNo; i++) m_rungain[i]->Write();
144 for(
int i=0; i<
runNo; i++)
delete m_rungain[i];
virtual double StandardHitCorrec(int calib_rec_Flag, int runFlag, int ntpFlag, int runNO, 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, double ex, double costheta, double t0) const =0