59 {
60
61 MsgStream log(
msgSvc(),
"TreeTofCalibDataCnv");
62 log<<MSG::DEBUG<<"SetProperty"<<endreq;
63
65
67
68 TBufferFile *buf1 = new TBufferFile(TBuffer::kRead);
69 TBufferFile *buf2 = new TBufferFile(TBuffer::kRead);
70 TBufferFile *buf3 = new TBufferFile(TBuffer::kRead);
71 TBufferFile *buf4 = new TBufferFile(TBuffer::kRead);
72
73 buf1->SetBuffer((*records)["BarTofPar"],512000,kFALSE);
74 buf2->SetBuffer((*records)["EndTofPar"],512000,kFALSE);
75 buf3->SetBuffer((*records)["TofConPar"],512000,kFALSE);
76 buf4->SetBuffer((*records)["BarTof"],512000,kFALSE);
77
78 std::cout<<" SftVer is "<<(*records)["SftVer"];
79 std::cout<<" CalVerSft is "<<(*records)["CalParVer"];
80 std::cout<<" File name is "<<(*records)["FileName"]<<std::endl;
81
82 TTree *btoftree= new TTree();
83 TTree *etoftree= new TTree();
84 TTree *btofcommontree = new TTree();
85 TTree *CalibInfo = new TTree();
86
87 btoftree->Streamer(*buf1);
88 etoftree->Streamer(*buf2);
89 btofcommontree->Streamer(*buf3);
90 CalibInfo->Streamer(*buf4);
91
92 int nentri = btoftree -> GetEntries();
93 int nentri1 = etoftree -> GetEntries();
94 int nentri2 = btofcommontree->GetEntries();
95 int nentri3 = CalibInfo->GetEntries();
96
101
102 std::vector<CalibData::bTofCalibBase> tmpbTof;
103 std::vector<CalibData::eTofCalibBase> tmpeTof;
104 std::vector<CalibData::bTofCommonCalibBase> tmpbTofCommon;
105 std::vector<CalibData::tofCalibInfoBase> tofinfoCol;
106
107
108 int cnt;
109
125
126 char brname[10];
127 for(
unsigned int i=0; i<
nBarAtten; i++ ) {
128 sprintf( brname, "Atten%i", i );
130 }
131 for(
unsigned int i=0; i<
nBarSpeed; i++ ) {
132 sprintf( brname, "Speed%i", i );
134 }
135 for(
unsigned int i=0; i<
nBarPar; i++ ) {
136 sprintf( brname, "P%i", i );
138 }
139 for(
unsigned int i=0; i<
nBarPar; i++ ) {
140 sprintf( brname,
"P%i", i+
nBarPar );
142 }
144 sprintf( brname, "Bunch0_Poff%i", i );
146 }
148 sprintf( brname,
"Bunch0_Poff%i", i+
nBarParOff );
150 }
152 sprintf( brname, "Bunch1_Poff%i", i );
154 }
156 sprintf( brname,
"Bunch1_Poff%i", i+
nBarParOff );
158 }
160 sprintf( brname, "Bunch2_Poff%i", i );
162 }
164 sprintf( brname,
"Bunch2_Poff%i", i+
nBarParOff );
166 }
168 sprintf( brname, "Bunch3_Poff%i", i );
170 }
172 sprintf( brname,
"Bunch3_Poff%i", i+
nBarParOff );
174 }
175 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
176 sprintf( brname, "FLeft%i", i );
178 }
179 for(
unsigned int i=0; i<
nBarSigma; i++ ) {
180 sprintf( brname, "FRight%i", i );
182 }
184 sprintf( brname, "FCounter%i", i );
186 }
187
188 for(cnt=0; cnt<176; cnt++){
192 bTof.
setP1( cnvBarPar1 );
193 bTof.
setP2( cnvBarPar2 );
205 tmpbTof.push_back(bTof);
206 }
207
208
213
214 char ecname[10];
215 for(
unsigned int i=0; i<
nEndAtten; i++ ) {
216 sprintf( ecname, "Atten%i", i );
218 }
219 for(
unsigned int i=0; i<
nEndSpeed; i++ ) {
220 sprintf( ecname, "Speed%i", i );
222 }
223 for(
unsigned int i=0; i<
nEndPar; i++ ) {
224 sprintf( ecname, "P%i", i );
226 }
227 for(
unsigned int i=0; i<
nEndSigma; i++ ) {
228 sprintf( ecname, "FCounter%i", i );
230 }
231
232 for(cnt=0; cnt<96; cnt++){
236 eTof.
setP( cnvEndPar );
237 eTof.
setFP( cnvEndFPar );
238 tmpeTof.push_back(eTof);
239 }
240
241
245 sprintf( brname, "sigmaCorr%i", i );
247 }
249 sprintf( brname, "t0offset%i", i );
251 }
252
253 int entries = btofcommontree->GetEntries();
254 for(cnt=0;cnt<entries;cnt++){
255 btofcommontree->GetEntry(cnt);
258 tmpbTofCommon.push_back(bTofCommon);
259 }
260
261 int m_run1, m_run2, m_version;
262 int m_qCorr, m_qElec, m_misLable;
263 int m_tofidEast[5], m_tofidWest[5], m_tofidEndcap[5];
264
265
266 CalibInfo->SetBranchAddress("Run1",&m_run1);
267 CalibInfo->SetBranchAddress("Run2",&m_run2);
268 CalibInfo->SetBranchAddress("Version",&m_version);
269 CalibInfo->SetBranchAddress("ebrId0",&m_tofidEast[0]);
270 CalibInfo->SetBranchAddress("ebrId1",&m_tofidEast[1]);
271 CalibInfo->SetBranchAddress("ebrId2",&m_tofidEast[2]);
272 CalibInfo->SetBranchAddress("ebrId3",&m_tofidEast[3]);
273 CalibInfo->SetBranchAddress("ebrId4",&m_tofidEast[4]);
274 CalibInfo->SetBranchAddress("ecId0",&m_tofidEndcap[0]);
275 CalibInfo->SetBranchAddress("ecId1",&m_tofidEndcap[1]);
276 CalibInfo->SetBranchAddress("ecId2",&m_tofidEndcap[2]);
277 CalibInfo->SetBranchAddress("ecId3",&m_tofidEndcap[3]);
278 CalibInfo->SetBranchAddress("ecId4",&m_tofidEndcap[4]);
279 CalibInfo->SetBranchAddress("wbrId0",&m_tofidWest[0]);
280 CalibInfo->SetBranchAddress("wbrId1",&m_tofidWest[1]);
281 CalibInfo->SetBranchAddress("wbrId2",&m_tofidWest[2]);
282 CalibInfo->SetBranchAddress("wbrId3",&m_tofidWest[3]);
283 CalibInfo->SetBranchAddress("wbrId4",&m_tofidWest[4]);
284 CalibInfo->SetBranchAddress("misLable",&m_misLable);
285 CalibInfo->SetBranchAddress("qCorr",&m_qCorr);
286 CalibInfo->SetBranchAddress("qElec",&m_qElec);
287
288 entries= CalibInfo->GetEntries();
289 for(cnt=0;cnt<entries;cnt++){
290 CalibInfo->GetEntry(cnt);
300 tofinfoCol.push_back(tofinfo);
301 }
302
304
305 refpObject=tmpObject;
306 delete btoftree;
307 delete etoftree;
308 delete btofcommontree;
309 delete CalibInfo;
310
311 return StatusCode::SUCCESS;
312}
data SetBranchAddress("time",&time)
const unsigned int nBarOffset
const unsigned int nBarParOff
const unsigned int nEndPar
const unsigned int nBarPar
const unsigned int nBarSigma
const unsigned int nEndSigma
const unsigned int nBarSigCor
const unsigned int nEndSpeed
const unsigned int nBarSpeed
const unsigned int nEndAtten
const unsigned int nBarAtten
const unsigned int nBarSigCnt
void setP2(const double *TofP2)
void setPoff1_bunch3(const double *TofPoff1_bunch3)
void setFPleft(const double *FP1)
void setPoff2_bunch1(const double *TofPoff2_bunch1)
void setSpeed(const double *Speed)
void setAtten(const double *Atten)
void setPoff1_bunch0(const double *TofPoff1_bunch0)
void setPoff2_bunch2(const double *TofPoff2_bunch2)
void setPoff1_bunch1(const double *TofPoff1_bunch1)
void setFPcounter(const double *FP3)
void setPoff1_bunch2(const double *TofPoff1_bunch2)
void setPoff2_bunch3(const double *TofPoff2_bunch3)
void setFPright(const double *FP2)
void setPoff2_bunch0(const double *TofPoff2_bunch0)
void setP1(const double *TofP1)
void setSigmaCorr(const double *sigmaCorr)
void setOffset(const double *offset)
void setAtten(const double *Atten)
void setP(const double *TofP)
void setFP(const double *FP)
void setSpeed(const double *Speed)
void setBrWest(const int *tofidWest)
void setRunEnd(const int run2)
void setVersion(const int version)
void setMisLable(const int misLable)
void setRunBegin(const int run1)
void setBrEast(const int *tofidEast)
void setQElec(const int qElec)
void setQCorr(const int qCorr)
void setEndcap(const int *tofidEndcap)
virtual DatabaseRecord * pp()