#include <T0MdcCalib.h>
Inheritance diagram for T0MdcCalib:
Public Member Functions | |
void | clear () |
void | clear () |
int | fillHist (MdcCalEvent *event) |
int | fillHist (MdcCalEvent *event) |
void | initialize (TObjArray *hlist, IMdcGeomSvc *mdcGeomSvc, IMdcCalibFunSvc *mdcFunSvc) |
void | initialize (TObjArray *hlist, IMdcGeomSvc *mdcGeomSvc, IMdcCalibFunSvc *mdcFunSvc) |
virtual void | read_file (std::vector< std::string > path) |
virtual void | read_file (std::vector< std::string > path) |
void | setParam (MdcCalParams ¶m) |
void | setParam (MdcCalParams ¶m) |
virtual void | settuple (std::string path) |
virtual void | settuple (std::string path) |
T0MdcCalib () | |
T0MdcCalib () | |
int | updateConst (MdcCalibConst *calconst) |
int | updateConst (MdcCalibConst *calconst) |
~T0MdcCalib () | |
~T0MdcCalib () | |
Private Attributes | |
double | m_docaMax [MdcCalNLayer] |
double | m_docaMin [MdcCalNLayer] |
TFolder * | m_fdResiWire |
TFolder * | m_fdResiWire |
TFolder * | m_fdT0 |
TFolder * | m_fdT0 |
TH1F * | m_hleft [MdcCalTotCell] |
TH1F * | m_hleft [MdcCalTotCell] |
TObjArray * | m_hlist |
TObjArray * | m_hlist |
TH1F * | m_hLrResiSub |
TH1F * | m_hLrResiSub |
TH1F * | m_hLrResiSum |
TH1F * | m_hLrResiSum |
TH1F * | m_hright [MdcCalTotCell] |
TH1F * | m_hright [MdcCalTotCell] |
IMdcCalibFunSvc * | m_mdcFunSvc |
IMdcCalibFunSvc * | m_mdcFunSvc |
IMdcGeomSvc * | m_mdcGeomSvc |
IMdcGeomSvc * | m_mdcGeomSvc |
MdcCalParams | m_param |
double | m_vdr |
|
00013 { 00014 for(int lay=0; lay<MdcCalNLayer; lay++){ 00015 if(lay < 8){ 00016 m_docaMin[lay] = 1.2; // mm 00017 m_docaMax[lay] = 4.8; // mm 00018 } else{ 00019 m_docaMin[lay] = 1.6; // mm 00020 m_docaMax[lay] = 6.4; // mm 00021 } 00022 } 00023 }
|
|
00025 { 00026 }
|
|
|
|
|
|
Implements MdcCalib. |
|
Implements MdcCalib. 00028 { 00029 for(int i=0; i<MdcCalTotCell; i++){ 00030 delete m_hleft[i]; 00031 delete m_hright[i]; 00032 } 00033 delete m_hLrResiSum; 00034 delete m_hLrResiSub; 00035 delete m_fdT0; 00036 delete m_fdResiWire; 00037 00038 MdcCalib::clear(); 00039 }
|
|
Implements MdcCalib. |
|
Implements MdcCalib. 00089 { 00090 IMessageSvc* msgSvc; 00091 Gaudi::svcLocator() -> service("MessageSvc", msgSvc); 00092 MsgStream log(msgSvc, "T0MdcCalib"); 00093 log << MSG::DEBUG << "T0MdcCalib::fillHist()" << endreq; 00094 00095 MdcCalib::fillHist(event); 00096 00097 // get EsTimeCol 00098 bool esCutFg = event->getEsCutFlag(); 00099 if( ! esCutFg ) return -1; 00100 00101 int i; 00102 int k; 00103 int ntrk; 00104 int nhit; 00105 int stat; 00106 00107 int lay; 00108 int cel; 00109 int wir; 00110 int lr; 00111 double dmeas; 00112 double doca; 00113 double resi; 00114 00115 bool fgHitLay[MdcCalNLayer]; 00116 00117 MdcCalRecTrk* rectrk; 00118 MdcCalRecHit* rechit; 00119 00120 ntrk = event -> getNTrk(); 00121 if((ntrk < m_param.nTrkCut[0]) || (ntrk > m_param.nTrkCut[1])) return -1; 00122 00123 for(i=0; i<ntrk; i++){ 00124 rectrk = event -> getRecTrk(i); 00125 nhit = rectrk -> getNHits(); 00126 00127 // dr cut 00128 double dr = rectrk->getDr(); 00129 if(fabs(dr) > m_param.drCut) continue; 00130 00131 // dz cut 00132 double dz = rectrk->getDz(); 00133 if(fabs(dz) > m_param.dzCut) continue; 00134 00135 for(lay=0; lay<MdcCalNLayer; lay++) fgHitLay[lay] = false; 00136 for(k=0; k<nhit; k++){ 00137 rechit = rectrk -> getRecHit(k); 00138 lay = rechit -> getLayid(); 00139 fgHitLay[lay] = true; 00140 } 00141 00142 int nhitlay = 0; 00143 for(lay=0; lay<MdcCalNLayer; lay++) if(fgHitLay[lay]) nhitlay++; 00144 if(nhitlay < m_param.nHitLayCut) continue; 00145 00146 log << MSG::DEBUG << "nhits: " << nhit << endreq; 00147 for(k=0; k<nhit; k++){ 00148 rechit = rectrk -> getRecHit(k); 00149 lay = rechit -> getLayid(); 00150 cel = rechit -> getCellid(); 00151 wir = m_mdcGeomSvc -> Wire(lay, cel) -> Id(); 00152 lr = rechit -> getLR(); 00153 doca = rechit -> getDocaExc(); 00154 dmeas = rechit -> getDmeas(); 00155 resi = rechit -> getResiExc(); 00156 stat = rechit -> getStat(); 00157 00158 if(1 != stat) continue; 00159 00160 if( (fabs(doca) < m_docaMin[lay]) || 00161 (fabs(doca) > m_docaMax[lay]) || 00162 (fabs(resi) > m_param.maxResi) ){ 00163 continue; 00164 } 00165 00166 if(0 == lay){ 00167 if( ! fgHitLay[1] ) continue; 00168 } else if(42 == lay){ 00169 if( ! fgHitLay[41] ) continue; 00170 } else{ 00171 if( (!fgHitLay[lay-1]) && (!fgHitLay[lay+1]) ) continue; 00172 } 00173 00174 if(wir < (m_mdcGeomSvc->getWireSize()) ){ 00175 if( 0 == lr ){ 00176 m_hleft[wir] -> Fill(resi); 00177 }else if( 1 == lr ){ 00178 m_hright[wir] -> Fill(resi); 00179 } 00180 }else{ 00181 std::cout << "wireid: " << wir << std::endl; 00182 } 00183 } 00184 } 00185 return 1; 00186 }
|
|
Implements MdcCalib. |
|
Implements MdcCalib. 00042 { 00043 IMessageSvc* msgSvc; 00044 Gaudi::svcLocator() -> service("MessageSvc", msgSvc); 00045 MsgStream log(msgSvc, "T0MdcCalib"); 00046 log << MSG::INFO << "T0MdcCalib::initialize()" << endreq; 00047 00048 m_hlist = hlist; 00049 m_mdcGeomSvc = mdcGeomSvc; 00050 m_mdcFunSvc = mdcFunSvc; 00051 00052 m_vdr = 0.03; 00053 00054 MdcCalib::initialize(m_hlist, m_mdcGeomSvc, m_mdcFunSvc); 00055 00056 int i; 00057 int nwire; 00058 int lay; 00059 int cel; 00060 char hname[200]; 00061 00062 m_fdT0 = new TFolder("fdT0", "fdT0"); 00063 m_hlist -> Add(m_fdT0); 00064 00065 m_fdResiWire = new TFolder("ResiWire", "ResiWire"); 00066 m_hlist->Add(m_fdResiWire); 00067 00068 nwire = m_mdcGeomSvc -> getWireSize(); 00069 for(i=0; i<nwire; i++){ 00070 lay = m_mdcGeomSvc -> Wire(i) -> Layer(); 00071 cel = m_mdcGeomSvc -> Wire(i) -> Cell(); 00072 00073 sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_L", i, lay, cel); 00074 m_hleft[i] = new TH1F(hname, "", 400, -2.0, 2.0); 00075 m_fdT0 -> Add(m_hleft[i]); 00076 00077 sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_R", i, lay, cel); 00078 m_hright[i] = new TH1F(hname, "", 400, -2.0, 2.0); 00079 m_fdT0 -> Add(m_hright[i]); 00080 } 00081 00082 m_hLrResiSum = new TH1F("LrResiSum", "", 200, -0.5, 0.5); 00083 m_fdResiWire->Add(m_hLrResiSum); 00084 00085 m_hLrResiSub = new TH1F("LrResiSub", "", 200, -0.5, 0.5); 00086 m_fdResiWire->Add(m_hLrResiSub); 00087 }
|
|
Reimplemented from MdcCalib. |
|
Reimplemented from MdcCalib. 00288 { 00289 MdcCalib::read_file(path); 00290 }
|
|
Implements MdcCalib. |
|
Implements MdcCalib. 00043 { 00044 MdcCalib::setParam(param); 00045 m_param = param; 00046 }
|
|
Reimplemented from MdcCalib. |
|
Reimplemented from MdcCalib. 00251 { 00252 MdcCalib::settuple(path); 00253 TFile *f1 = new TFile(path.c_str()); 00254 std::cout<<path<<std::endl; 00255 // 00256 // m_mdcGeomSvc = mdcGeomSvc; 00257 // m_mdcFunSvc = mdcFunSvc; 00258 00259 m_vdr = 0.03; 00260 00261 int i; 00262 int nwire; 00263 int lay; 00264 int cel; 00265 char hname[200]; 00266 00267 m_fdT0=(TFolder *)f1->Get("fdT0;1"); 00268 m_fdResiWire=(TFolder *)f1->Get("ResiWire;1"); 00269 00270 nwire = m_mdcGeomSvc -> getWireSize(); 00271 for(i=0; i<nwire; i++){ 00272 lay = m_mdcGeomSvc -> Wire(i) -> Layer(); 00273 cel = m_mdcGeomSvc -> Wire(i) -> Cell(); 00274 00275 sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_L", i, lay, cel); 00276 m_hleft[i]=(TH1F *) m_fdT0 ->FindObject(hname); 00277 00278 sprintf(hname, "Resi%04d_Lay%02d_Cell%03d_R", i, lay, cel); 00279 m_hright[i]=(TH1F *)m_fdT0 ->FindObject(hname); 00280 } 00281 00282 m_hLrResiSum=(TH1F *) m_fdResiWire->FindObject("LrResiSum"); 00283 m_hLrResiSub=(TH1F *) m_fdResiWire->FindObject("LrResiSub"); 00284 00285 }
|
|
Implements MdcCalib. |
|
Implements MdcCalib. 00188 { 00189 IMessageSvc* msgSvc; 00190 Gaudi::svcLocator() -> service("MessageSvc", msgSvc); 00191 MsgStream log(msgSvc, "T0MdcCalib"); 00192 log << MSG::INFO << "T0MdcCalib::updateConst()" << endreq; 00193 00194 MdcCalib::updateConst(calconst); 00195 00196 int i; 00197 int lay; 00198 int nwire; 00199 double t0; 00200 double delt0; 00201 double resiLrSum; 00202 double resiLrSub; 00203 00204 Stat_t entry_l; 00205 double mean_l; 00206 // double gmean_l; // mean of fit with the gaussian distribution 00207 // double sigma_l; 00208 // double rms_l; 00209 00210 Stat_t entry_r; 00211 double mean_r; 00212 // double gmean_r; 00213 // double sigma_r; 00214 // double rms_r; 00215 00216 nwire = m_mdcGeomSvc -> getWireSize(); 00217 std::cout << "totwire: " << nwire << std::endl; 00218 for(i=0; i<nwire; i++){ 00219 lay = m_mdcGeomSvc -> Wire(i) -> Layer(); 00220 00221 if(1 == m_param.fgCalib[lay]){ 00222 entry_l = m_hleft[i] -> GetEntries(); 00223 mean_l = m_hleft[i] -> GetMean(); 00224 // m_hleft[i] -> Fit("gaus", "Q"); 00225 // gmean_l = m_hleft[i] -> GetFunction("gaus") -> GetParameter(1); 00226 00227 entry_r = m_hright[i] -> GetEntries(); 00228 mean_r = m_hright[i] -> GetMean(); 00229 // m_hright[i] -> Fit("gaus", "Q"); 00230 // gmean_r = m_hright[i] -> GetFunction("gaus") -> GetParameter(1); 00231 00232 delt0 = 0.5 * (mean_l + mean_r) / m_vdr; 00233 } else{ 00234 delt0 = 0.0; 00235 } 00236 00237 resiLrSum = 0.5 * (mean_l + mean_r); 00238 resiLrSub = 0.5 * (mean_l - mean_r); 00239 m_hLrResiSum->Fill(resiLrSum); 00240 m_hLrResiSub->Fill(resiLrSub); 00241 00242 t0 = calconst -> getT0(i); 00243 t0 += delt0; 00244 00245 calconst -> resetT0(i, t0); 00246 calconst -> resetDelT0(i, delt0); 00247 } 00248 return 1; 00249 }
|
|
Reimplemented from MdcCalib. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from MdcCalib. |
|
Reimplemented from MdcCalib. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Reimplemented from MdcCalib. |
|
Reimplemented from MdcCalib. |
|
Reimplemented from MdcCalib. |
|
Reimplemented from MdcCalib. |
|
Reimplemented from MdcCalib. |
|
|