37 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
38 MsgStream log(
msgSvc,
"MdcCalConstMgr");
39 log << MSG::INFO <<
"Read calibration data from TCDS by MdcCalibFunSvc"
51 nlayer = m_mdcGeomSvc -> getLayerSize();
52 nwire = m_mdcGeomSvc -> getWireSize();
55 m_mdcFunSvc -> setXtBegin();
56 while( m_mdcFunSvc -> getNextXtpar(
key, val) ){
57 calconst -> fillXtpar(
key, val);
63 for(wid=0; wid<nwire; wid++){
64 t0 = m_mdcFunSvc -> getT0(wid);
65 delt0 = m_mdcFunSvc -> getDelT0(wid);
66 calconst -> fillT0(t0);
67 calconst -> fillDelT0(delt0);
73 for(lay=0; lay<nlayer; lay++){
74 qtpar0 = m_mdcFunSvc -> getQtpar(lay, 0);
75 qtpar1 = m_mdcFunSvc -> getQtpar(lay, 1);
76 calconst -> fillQtpar0(qtpar0);
77 calconst -> fillQtpar1(qtpar1);
81 m_mdcFunSvc -> setSdBegin();
82 while( m_mdcFunSvc -> getNextSdpar(
key, val) ){
83 calconst -> fillSdpar(
key, val);
97 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
98 MsgStream log(
msgSvc,
"MdcCalConstMgr");
99 log << MSG::WARNING <<
"read calibration data directly from run directory"
102 TFile fconst(
"MdcCalibConst.root");
103 log << MSG::INFO <<
"open file" << endreq;
110 TTree* xttree = (TTree*)fconst.Get(
"XtTree");
113 entry = (int)xttree -> GetEntries();
114 for(i=0; i<entry; i++){
116 calconst -> fillXtpar(
key, xtpar);
118 log << MSG::INFO <<
"read XTtree" << endreq;
123 TTree* t0tree = (TTree*)fconst.Get(
"T0Tree");
126 entry = (int)t0tree -> GetEntries();
127 for(i=0; i<entry; i++){
129 calconst -> fillT0(t0);
130 calconst -> fillDelT0(delt0);
132 log << MSG::INFO <<
"read XTtree" << endreq;
137 TTree* qttree = (TTree*)fconst.Get(
"QtTree");
140 entry = (int)qttree -> GetEntries();
141 for(i=0; i<entry; i++){
143 calconst -> fillQtpar0(qtpar0);
144 calconst -> fillQtpar1(qtpar1);
149 TTree* sdtree = (TTree*)fconst.Get(
"SdTree");
152 entry = sdtree -> GetEntries();
153 for(i=0; i<entry; i++){
155 calconst -> fillSdpar(
key, sdpar);
160 log << MSG::INFO <<
"read MdcCalibConst over" << endreq;
167 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
168 MsgStream log(
msgSvc,
"MdcCalConstMgr");
169 log << MSG::INFO <<
"MdcCalConstMgr::wrtConst()" << endreq;
171 TFile fconst(
"MdcCalibConst_new.root",
"recreate");
178 TTree* xttree =
new TTree(
"XtTree",
"XtTree");
179 xttree ->
Branch(
"xtkey", &
key,
"key/I");
180 xttree ->
Branch(
"xtpar", &xtpar,
"xtpar/D");
181 calconst -> setXtBegin();
182 while( calconst -> getNextXtpar(
key, xtpar) ){
190 TTree* t0tree =
new TTree(
"T0Tree",
"T0Tree");
191 t0tree ->
Branch(
"t0", &t0,
"t0/D");
192 t0tree ->
Branch(
"delt0", &delt0,
"delt0/D");
193 entry = calconst -> getT0Size();
194 for(i=0; i<entry; i++){
195 t0 = calconst -> getT0(i);
196 delt0 = calconst -> getDelT0(i);
204 TTree* qttree =
new TTree(
"QtTree",
"QtTree");
205 qttree ->
Branch(
"qtpar0", &qtpar0,
"qtpar0/D");
206 qttree ->
Branch(
"qtpar1", &qtpar1,
"qtpar1/D");
207 entry = calconst -> getQtSize();
208 for(i=0; i<entry; i++){
209 qtpar0 = calconst -> getQtpar0(i);
210 qtpar1 = calconst -> getQtpar1(i);
217 TTree* sdtree =
new TTree(
"SdTree",
"SdTree");
218 sdtree ->
Branch(
"sdkey", &
key,
"key/I");
219 sdtree ->
Branch(
"sdpar", &sdpar,
"sdpar/D");
220 calconst -> setSdBegin();
221 while( calconst -> getNextSdpar(
key, sdpar) ){
237 log << MSG::INFO <<
"MdcCalibConst_new.root was written." << endreq;