165 {
167 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
168 MsgStream log(
msgSvc,
"MdcCalConstMgr");
169 log << MSG::INFO << "MdcCalConstMgr::wrtConst()" << endreq;
170
171 TFile fconst("MdcCalibConst_new.root", "recreate");
172
173
174 int i;
176 int entry;
177 double xtpar;
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) ){
183 xttree -> Fill();
184 }
185
186
187 double t0;
188 double delt0;
189
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);
197 t0tree -> Fill();
198 }
199
200
201 double qtpar0;
202 double qtpar1;
203
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);
211 qttree -> Fill();
212 }
213
214
215 double sdpar;
216
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) ){
222 sdtree -> Fill();
223 }
224
225 xttree -> Write();
226 t0tree -> Write();
227 qttree -> Write();
228 sdtree -> Write();
229
230 delete xttree;
231 delete t0tree;
232 delete qttree;
233 delete sdtree;
234
235 fconst.Close();
236
237 log << MSG::INFO << "MdcCalibConst_new.root was written." << endreq;
238}