BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcCalConstMgr Class Reference

#include <MdcCalConstMgr.h>

Public Member Functions

 MdcCalConstMgr ()
 
 ~MdcCalConstMgr ()
 
void init (IMdcGeomSvc *mdcGeomSvc, IMdcCalibFunSvc *mdcFunSvc)
 
void rdConstTcds (MdcCalibConst *calconst)
 
void wrtConstTcds (MdcCalibConst *calconst)
 
void rdConst (MdcCalibConst *calconst)
 
void wrtConst (MdcCalibConst *calconst)
 
 MdcCalConstMgr ()
 
 ~MdcCalConstMgr ()
 
void init (IMdcGeomSvc *mdcGeomSvc, IMdcCalibFunSvc *mdcFunSvc)
 
void rdConstTcds (MdcCalibConst *calconst)
 
void wrtConstTcds (MdcCalibConst *calconst)
 
void rdConst (MdcCalibConst *calconst)
 
void wrtConst (MdcCalibConst *calconst)
 

Detailed Description

Constructor & Destructor Documentation

◆ MdcCalConstMgr() [1/2]

MdcCalConstMgr::MdcCalConstMgr ( )

Definition at line 21 of file MdcCalConstMgr.cxx.

21 {
22 // constructor
23}

◆ ~MdcCalConstMgr() [1/2]

MdcCalConstMgr::~MdcCalConstMgr ( )

Definition at line 25 of file MdcCalConstMgr.cxx.

25 {
26 // destructor
27}

◆ MdcCalConstMgr() [2/2]

MdcCalConstMgr::MdcCalConstMgr ( )

◆ ~MdcCalConstMgr() [2/2]

MdcCalConstMgr::~MdcCalConstMgr ( )

Member Function Documentation

◆ init() [1/2]

void MdcCalConstMgr::init ( IMdcGeomSvc mdcGeomSvc,
IMdcCalibFunSvc mdcFunSvc 
)

Definition at line 29 of file MdcCalConstMgr.cxx.

29 {
30 m_mdcGeomSvc = mdcGeomSvc;
31 m_mdcFunSvc = mdcFunSvc;
32}

◆ init() [2/2]

void MdcCalConstMgr::init ( IMdcGeomSvc mdcGeomSvc,
IMdcCalibFunSvc mdcFunSvc 
)

◆ rdConst() [1/2]

void MdcCalConstMgr::rdConst ( MdcCalibConst calconst)

Definition at line 95 of file MdcCalConstMgr.cxx.

95 {
96 IMessageSvc* msgSvc;
97 Gaudi::svcLocator() -> service("MessageSvc", msgSvc);
98 MsgStream log(msgSvc, "MdcCalConstMgr");
99 log << MSG::WARNING << "read calibration data directly from run directory"
100 << endreq;
101
102 TFile fconst("MdcCalibConst.root");
103 log << MSG::INFO << "open file" << endreq;
104
105// read xttree ------------------------------------------------------------
106 int i;
107 int key;
108 double xtpar;
109 int entry;
110 TTree* xttree = (TTree*)fconst.Get("XtTree");
111 xttree -> SetBranchAddress("xtkey", &key);
112 xttree -> SetBranchAddress("xtpar", &xtpar);
113 entry = (int)xttree -> GetEntries();
114 for(i=0; i<entry; i++){
115 xttree -> GetEntry(i);
116 calconst -> fillXtpar(key, xtpar);
117 }
118 log << MSG::INFO << "read XTtree" << endreq;
119
120// read t0tree ------------------------------------------------------------
121 double t0;
122 double delt0;
123 TTree* t0tree = (TTree*)fconst.Get("T0Tree");
124 t0tree -> SetBranchAddress("t0", &t0);
125 t0tree -> SetBranchAddress("delt0", &delt0);
126 entry = (int)t0tree -> GetEntries();
127 for(i=0; i<entry; i++){
128 t0tree -> GetEntry(i);
129 calconst -> fillT0(t0);
130 calconst -> fillDelT0(delt0);
131 }
132 log << MSG::INFO << "read XTtree" << endreq;
133
134// read qttree ------------------------------------------------------------
135 double qtpar0;
136 double qtpar1;
137 TTree* qttree = (TTree*)fconst.Get("QtTree");
138 qttree -> SetBranchAddress("qtpar0", &qtpar0);
139 qttree -> SetBranchAddress("qtpar1", &qtpar1);
140 entry = (int)qttree -> GetEntries();
141 for(i=0; i<entry; i++){
142 qttree -> GetEntry(i);
143 calconst -> fillQtpar0(qtpar0);
144 calconst -> fillQtpar1(qtpar1);
145 }
146
147// read sdtree ---------------------------------------------------------
148 double sdpar;
149 TTree* sdtree = (TTree*)fconst.Get("SdTree");
150 sdtree -> SetBranchAddress("sdkey", &key);
151 sdtree -> SetBranchAddress("sdpar", &sdpar);
152 entry = sdtree -> GetEntries();
153 for(i=0; i<entry; i++){
154 sdtree -> GetEntry(i);
155 calconst -> fillSdpar(key, sdpar);
156 }
157
158 fconst.Close();
159
160 log << MSG::INFO << "read MdcCalibConst over" << endreq;
161}
data GetEntry(0)
data SetBranchAddress("time",&time)
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition: Taupair.h:42

◆ rdConst() [2/2]

void MdcCalConstMgr::rdConst ( MdcCalibConst calconst)

◆ rdConstTcds() [1/2]

void MdcCalConstMgr::rdConstTcds ( MdcCalibConst calconst)

Definition at line 35 of file MdcCalConstMgr.cxx.

35 {
36 IMessageSvc* msgSvc;
37 Gaudi::svcLocator() -> service("MessageSvc", msgSvc);
38 MsgStream log(msgSvc, "MdcCalConstMgr");
39 log << MSG::INFO << "Read calibration data from TCDS by MdcCalibFunSvc"
40 << endreq;
41
42 int lay;
43 int wid;
44
45 int nlayer;
46 int nwire;
47
48 int key;
49 double val;
50
51 nlayer = m_mdcGeomSvc -> getLayerSize();
52 nwire = m_mdcGeomSvc -> getWireSize();
53
54// read XT data -----------------------------------------------------------
55 m_mdcFunSvc -> setXtBegin();
56 while( m_mdcFunSvc -> getNextXtpar(key, val) ){
57 calconst -> fillXtpar(key, val);
58 }
59
60// read T0 data -----------------------------------------------------------
61 double t0;
62 double delt0;
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);
68 }
69
70// read QT data -----------------------------------------------------------
71 double qtpar0;
72 double qtpar1;
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);
78 }
79
80// read spatial resolution data -------------------------------------------
81 m_mdcFunSvc -> setSdBegin();
82 while( m_mdcFunSvc -> getNextSdpar(key, val) ){
83 calconst -> fillSdpar(key, val);
84 }
85}

◆ rdConstTcds() [2/2]

void MdcCalConstMgr::rdConstTcds ( MdcCalibConst calconst)

◆ wrtConst() [1/2]

void MdcCalConstMgr::wrtConst ( MdcCalibConst calconst)

Definition at line 165 of file MdcCalConstMgr.cxx.

165 {
166 IMessageSvc* msgSvc;
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// XT parameter tree -------------------------------------------------------
174 int i;
175 int key;
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// T0 parameter tree -------------------------------------------------------
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// QT parameter tree -------------------------------------------------------
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// Spacial Resolution parameter tree ---------------------------------------
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}
curve Branch("CurveSize",&CurveSize,"CurveSize/I")
curve Fill()
curve Write()

◆ wrtConst() [2/2]

void MdcCalConstMgr::wrtConst ( MdcCalibConst calconst)

◆ wrtConstTcds() [1/2]

void MdcCalConstMgr::wrtConstTcds ( MdcCalibConst calconst)

Definition at line 89 of file MdcCalConstMgr.cxx.

89 {
90
91}

◆ wrtConstTcds() [2/2]

void MdcCalConstMgr::wrtConstTcds ( MdcCalibConst calconst)

The documentation for this class was generated from the following files: