9 #include "St_sdm_Maker.h"
10 #include "St_DataSetIter.h"
12 #include "tables/St_sdm_condition_par_Table.h"
13 #include "tables/St_sdm_geom_par_Table.h"
14 #include "tables/St_sdm_calib_par_Table.h"
15 #include "tables/St_sdm_calib_db_Table.h"
16 #include "tables/St_sdm_condition_db_Table.h"
40 St_sdm_Maker::~St_sdm_Maker()
44 Int_t St_sdm_Maker::Init(){
45 m_DBRandom =
new TRandom();
48 cout<<
" **** Path for Parameter Tables not set : Take default Parameter Tables "<<endl;
55 cout<<
"Parameter Tables Path : "<<m_ParPath->Data()<<endl;
56 cout<<
"DB Tables Path : "<<m_DBPath->Data()<<endl;
58 if (!(LoadConditionPar()))
60 cout<<
" *** Condition Parameter Table not found : Take default parameters ***"<<endl;
64 if (!(LoadCalibPar()))
66 cout<<
" *** Calibration Parameter Table not found : Take default parameters ***"<<endl;
72 cout<<
" *** Geometry Parameter Table not found : Take default parameters ***"<<endl;
77 sdm_geom_par_st *m_geom_par_t = m_geom_par->GetTable();
79 mSsdLayer = m_geom_par_t[0].N_layer;
80 mSsdTotLadder = m_geom_par_t[0].N_ladder;
81 mSsdTotWafer = mSsdTotLadder*m_geom_par_t[0].N_waf_per_ladder;
82 mSsdTotPlane = 2*mSsdTotWafer;
83 mSsdTotA128 = m_geom_par_t[0].N_alice_per_side*mSsdTotPlane;
84 mSsdTotStrip = mSsdTotPlane*m_geom_par_t[0].N_strip_per_side;
88 cout<<
" **** Path for DataBase Tables not set : Write in Local Directory "<<endl;
89 m_DBPath =
new TString(
".");
92 TString *fCalibDBName =
new TString(
"sdm_calib_db.root");
93 TFile m_CalibDBFile(((*m_DBPath)+(*fCalibDBName)).Data(),
"RECREATE");
94 m_CalibDBFile.Close();
96 TString *fCondDBName =
new TString(
"sdm_condition_db.root");
97 TFile m_CondDBFile(((*m_DBPath)+(*fCondDBName)).Data(),
"RECREATE");
102 return StMaker::Init();
112 void St_sdm_Maker::PrintInfo()
114 printf(
"**************************************************************\n");
115 printf(
"* $Id: St_sdm_Maker.cxx,v 1.3 2007/04/28 17:56:53 perev Exp $\n");
116 printf(
"**************************************************************\n");
117 if (Debug()) StMaker::PrintInfo();
120 void St_sdm_Maker::SetParamPath(Char_t *ParPath)
122 if (ParPath) m_ParPath =
new TString(ParPath);
125 void St_sdm_Maker::SetDBPath(Char_t *DBPath)
127 if (DBPath) m_DBPath =
new TString(DBPath);
130 Bool_t St_sdm_Maker::LoadConditionPar()
132 TString *fCondName =
new TString(
"sdm_condition_par.root");
133 TFile *fCond =
new TFile(((*m_ParPath)+(*fCondName)).Data());
135 if (!fCond->IsOpen())
return kFALSE;
136 St_sdm_condition_par *file_cond_par = ((St_sdm_condition_par*)fCond->Get(
"sdm_condition_par"));
138 m_cond_par =
new St_sdm_condition_par(
"sdm_condition_par",1);
140 sdm_condition_par_st *m_cond_par_t = m_cond_par->GetTable();
141 sdm_condition_par_st *file_cond_par_t = file_cond_par->GetTable();
143 m_cond_par->SetNRows(file_cond_par->GetNRows());
145 m_cond_par_t[0].i_seed = file_cond_par_t[0].i_seed;
146 m_cond_par_t[0].N_active_ladder[0] = file_cond_par_t[0].N_active_ladder[0] ;
147 m_cond_par_t[0].N_active_ladder[1] = file_cond_par_t[0].N_active_ladder[1] ;
148 m_cond_par_t[0].N_active_ladder[2] = file_cond_par_t[0].N_active_ladder[2] ;
149 m_cond_par_t[0].N_active_ladder[3] = file_cond_par_t[0].N_active_ladder[3] ;
150 m_cond_par_t[0].N_active_ladder[4] = file_cond_par_t[0].N_active_ladder[4] ;
151 m_cond_par_t[0].N_active_ladder[5] = file_cond_par_t[0].N_active_ladder[5] ;
152 m_cond_par_t[0].N_active_ladder[6] = file_cond_par_t[0].N_active_ladder[6] ;
153 m_cond_par_t[0].N_active_ladder[7] = file_cond_par_t[0].N_active_ladder[7] ;
154 m_cond_par_t[0].N_active_ladder[8] = file_cond_par_t[0].N_active_ladder[8] ;
155 m_cond_par_t[0].N_active_ladder[9] = file_cond_par_t[0].N_active_ladder[9] ;
156 m_cond_par_t[0].N_active_ladder[10] = file_cond_par_t[0].N_active_ladder[10] ;
157 m_cond_par_t[0].N_active_ladder[11] = file_cond_par_t[0].N_active_ladder[11] ;
158 m_cond_par_t[0].N_active_ladder[12] = file_cond_par_t[0].N_active_ladder[12] ;
159 m_cond_par_t[0].N_active_ladder[13] = file_cond_par_t[0].N_active_ladder[13] ;
160 m_cond_par_t[0].N_active_ladder[14] = file_cond_par_t[0].N_active_ladder[14] ;
161 m_cond_par_t[0].N_active_ladder[15] = file_cond_par_t[0].N_active_ladder[15] ;
162 m_cond_par_t[0].N_active_ladder[16] = file_cond_par_t[0].N_active_ladder[16] ;
163 m_cond_par_t[0].N_active_ladder[17] = file_cond_par_t[0].N_active_ladder[17] ;
164 m_cond_par_t[0].N_active_ladder[18] = file_cond_par_t[0].N_active_ladder[18] ;
165 m_cond_par_t[0].N_active_ladder[19] = file_cond_par_t[0].N_active_ladder[19] ;
166 m_cond_par_t[0].p_bad_wafer = file_cond_par_t[0].p_bad_wafer ;
167 m_cond_par_t[0].p_bad_alice = file_cond_par_t[0].p_bad_alice ;
168 m_cond_par_t[0].p_bad_strip = file_cond_par_t[0].p_bad_strip ;
173 if (!m_cond_par)
return kFALSE;
178 Bool_t St_sdm_Maker::LoadGeomPar()
180 TString *fGeomName =
new TString(
"sdm_geom_par.root");
181 TFile *fGeom =
new TFile(((*m_ParPath)+(*fGeomName)).Data());
183 if (!fGeom->IsOpen())
return kFALSE;
185 St_sdm_geom_par *file_geom_par = ((St_sdm_geom_par*)fGeom->Get(
"sdm_geom_par"));
187 m_geom_par =
new St_sdm_geom_par(
"sdm_geom_par",1);
189 sdm_geom_par_st *m_geom_par_t = m_geom_par->GetTable();
191 sdm_geom_par_st *file_geom_par_t = file_geom_par->GetTable();
193 m_geom_par->SetNRows(file_geom_par->GetNRows());
195 m_geom_par_t[0].N_layer = file_geom_par_t[0].N_layer ;
196 m_geom_par_t[0].N_ladder = file_geom_par_t[0].N_ladder ;
197 m_geom_par_t[0].N_waf_per_ladder = file_geom_par_t[0].N_waf_per_ladder ;
198 m_geom_par_t[0].N_alice_per_side = file_geom_par_t[0].N_alice_per_side ;
199 m_geom_par_t[0].N_strip_per_side = file_geom_par_t[0].N_strip_per_side ;
200 m_geom_par_t[0].L_strip_pitch = file_geom_par_t[0].L_strip_pitch ;
201 m_geom_par_t[0].L_stereo_angle = file_geom_par_t[0].L_stereo_angle ;
202 m_geom_par_t[0].L_wafer_tot_l = file_geom_par_t[0].L_wafer_tot_l ;
203 m_geom_par_t[0].L_wafer_tot_w = file_geom_par_t[0].L_wafer_tot_w ;
204 m_geom_par_t[0].L_wafer_tot_t = file_geom_par_t[0].L_wafer_tot_t ;
205 m_geom_par_t[0].L_wafer_act_l = file_geom_par_t[0].L_wafer_act_l ;
206 m_geom_par_t[0].L_wafer_act_w = file_geom_par_t[0].L_wafer_act_w ;
211 if (!m_geom_par)
return kFALSE;
216 Bool_t St_sdm_Maker::LoadCalibPar()
218 TString *fCalibName =
new TString(
"sdm_calib_par.root");
219 TFile *fCalib =
new TFile(((*m_ParPath)+(*fCalibName)).Data());
221 if (!fCalib->IsOpen())
return kFALSE;
223 St_sdm_calib_par *file_cal_par = ((St_sdm_calib_par*)fCalib->Get(
"sdm_calib_par"));
225 m_cal_par =
new St_sdm_calib_par(
"sdm_calib_par",1);
227 sdm_calib_par_st *m_cal_par_t = m_cal_par->GetTable();
229 sdm_calib_par_st *file_cal_par_t = file_cal_par->GetTable();
231 m_cal_par->SetNRows(file_cal_par->GetNRows());
233 m_cal_par_t[0].i_seed = file_cal_par_t[0].i_seed ;
234 m_cal_par_t[0].barrel_ped = file_cal_par_t[0].barrel_ped ;
235 m_cal_par_t[0].wafer_sig = file_cal_par_t[0].wafer_sig ;
236 m_cal_par_t[0].alice_sig = file_cal_par_t[0].alice_sig ;
237 m_cal_par_t[0].strip_P_sig = file_cal_par_t[0].strip_P_sig ;
238 m_cal_par_t[0].strip_N_sig = file_cal_par_t[0].strip_N_sig ;
239 m_cal_par_t[0].strip_P_noise = file_cal_par_t[0].strip_P_noise ;
240 m_cal_par_t[0].strip_N_noise = file_cal_par_t[0].strip_N_noise ;
241 m_cal_par_t[0].strip_P_noise_sig = file_cal_par_t[0].strip_P_noise_sig ;
242 m_cal_par_t[0].strip_N_noise_sig = file_cal_par_t[0].strip_N_noise_sig ;
243 m_cal_par_t[0].n_strip_P_factor = file_cal_par_t[0].n_strip_P_factor ;
244 m_cal_par_t[0].n_strip_N_factor = file_cal_par_t[0].n_strip_N_factor ;
245 m_cal_par_t[0].n_noisy_strip = file_cal_par_t[0].n_noisy_strip ;
250 if (!m_cal_par)
return kFALSE;
254 void St_sdm_Maker::InitConditionPar()
256 m_cond_par =
new St_sdm_condition_par(
"sdm_condition_par",1);
257 m_cond_par->SetNRows(1);
258 sdm_condition_par_st *m_cond_par_t = m_cond_par->GetTable();
260 m_cond_par_t[0].i_seed = 111111;
261 m_cond_par_t[0].N_active_ladder[0] = 1 ;
262 m_cond_par_t[0].N_active_ladder[1] = 1 ;
263 m_cond_par_t[0].N_active_ladder[2] = 1 ;
264 m_cond_par_t[0].N_active_ladder[3] = 1 ;
265 m_cond_par_t[0].N_active_ladder[4] = 1 ;
266 m_cond_par_t[0].N_active_ladder[5] = 1 ;
267 m_cond_par_t[0].N_active_ladder[6] = 1 ;
268 m_cond_par_t[0].N_active_ladder[7] = 1 ;
269 m_cond_par_t[0].N_active_ladder[8] = 1 ;
270 m_cond_par_t[0].N_active_ladder[9] = 1 ;
271 m_cond_par_t[0].N_active_ladder[10] = 1 ;
272 m_cond_par_t[0].N_active_ladder[11] = 1 ;
273 m_cond_par_t[0].N_active_ladder[12] = 1 ;
274 m_cond_par_t[0].N_active_ladder[13] = 1 ;
275 m_cond_par_t[0].N_active_ladder[14] = 1 ;
276 m_cond_par_t[0].N_active_ladder[15] = 1 ;
277 m_cond_par_t[0].N_active_ladder[16] = 1 ;
278 m_cond_par_t[0].N_active_ladder[17] = 1 ;
279 m_cond_par_t[0].N_active_ladder[18] = 1 ;
280 m_cond_par_t[0].N_active_ladder[19] = 1 ;
281 m_cond_par_t[0].p_bad_wafer = 0.0;
282 m_cond_par_t[0].p_bad_alice = 0.0;
283 m_cond_par_t[0].p_bad_strip = 0.00;
286 void St_sdm_Maker::InitGeomPar()
288 m_geom_par =
new St_sdm_geom_par(
"sdm_geom_par",1);
289 m_geom_par->SetNRows(1);
290 sdm_geom_par_st *m_geom_par_t = m_geom_par->GetTable();
292 m_geom_par_t[0].N_layer = 7 ;
293 m_geom_par_t[0].N_ladder = 20 ;
294 m_geom_par_t[0].N_waf_per_ladder = 16 ;
295 m_geom_par_t[0].N_alice_per_side = 6 ;
296 m_geom_par_t[0].N_strip_per_side = 768 ;
297 m_geom_par_t[0].L_strip_pitch = 0.0095;
298 m_geom_par_t[0].L_stereo_angle = 0.0175;
299 m_geom_par_t[0].L_wafer_tot_l = 3.75 ;
300 m_geom_par_t[0].L_wafer_tot_w = 2.1 ;
301 m_geom_par_t[0].L_wafer_tot_t = 0.015 ;
302 m_geom_par_t[0].L_wafer_act_l = 3.65 ;
303 m_geom_par_t[0].L_wafer_act_w = 2.0 ;
306 void St_sdm_Maker::InitCalibPar()
308 m_cal_par =
new St_sdm_calib_par(
"sdm_calib_par",1);
309 m_cal_par->SetNRows(1);
310 sdm_calib_par_st *m_cal_par_t = m_cal_par->GetTable();
312 m_cal_par_t[0].i_seed = 111111;
313 m_cal_par_t[0].barrel_ped = 100000;
314 m_cal_par_t[0].wafer_sig = 10000 ;
315 m_cal_par_t[0].alice_sig = 5000 ;
316 m_cal_par_t[0].strip_P_sig = 50 ;
317 m_cal_par_t[0].strip_N_sig = 50 ;
318 m_cal_par_t[0].strip_P_noise = 1400 ;
319 m_cal_par_t[0].strip_N_noise = 2200 ;
320 m_cal_par_t[0].strip_P_noise_sig = 50 ;
321 m_cal_par_t[0].strip_N_noise_sig = 70 ;
322 m_cal_par_t[0].n_strip_P_factor = 10. ;
323 m_cal_par_t[0].n_strip_N_factor = 10. ;
324 m_cal_par_t[0].n_noisy_strip = 0. ;
327 void St_sdm_Maker::BuildCalibDB()
330 Int_t lSsdPedestal = 0 ;
331 Int_t lWaferPedestal = 0 ;
332 Int_t lStripNoise = 0 ;
333 Int_t lStripPedestal = 0 ;
336 const Int_t nA128PerSide = mSsdTotA128/mSsdTotPlane;
337 const Int_t nStripPerA128 = mSsdTotStrip/mSsdTotA128;
338 const Int_t nStripPerSide = mSsdTotStrip/mSsdTotPlane;
340 sdm_calib_par_st *m_cal_par_t = m_cal_par->GetTable();
342 Int_t *mSignalPar =
new Int_t[9];
343 Float_t *mNoisyPar =
new Float_t[3];
344 Int_t *mPedestalArray =
new Int_t[mSsdTotStrip];
345 Int_t *mNoiseArray =
new Int_t[mSsdTotStrip];
347 mSignalPar[0] = m_cal_par_t[0].barrel_ped;
348 mSignalPar[1] = m_cal_par_t[0].wafer_sig;
349 mSignalPar[2] = m_cal_par_t[0].alice_sig;
350 mSignalPar[3] = m_cal_par_t[0].strip_P_sig;
351 mSignalPar[4] = m_cal_par_t[0].strip_N_sig;
352 mSignalPar[5] = m_cal_par_t[0].strip_P_noise;
353 mSignalPar[6] = m_cal_par_t[0].strip_N_noise;
354 mSignalPar[7] = m_cal_par_t[0].strip_P_noise_sig;
355 mSignalPar[8] = m_cal_par_t[0].strip_N_noise_sig;
357 mNoisyPar[0] = m_cal_par_t[0].n_strip_P_factor;
358 mNoisyPar[1] = m_cal_par_t[0].n_strip_N_factor;
359 mNoisyPar[2] = m_cal_par_t[0].n_noisy_strip;
366 for(i = 0 ; i < mSsdTotPlane ; i++)
368 iSide = (i%2 == 0) ? 0 : 1 ;
369 lSsdPedestal = Int_t((mSignalPar[0])+m_DBRandom->Gaus(0.,Double_t(mSignalPar[1])));
371 for(j = 0 ; j < nA128PerSide ; j++)
373 lWaferPedestal = lSsdPedestal + Int_t(m_DBRandom->Gaus(0.,mSignalPar[2]));
374 for(k = 0 ; k < nStripPerA128 ; k++ )
379 lStripNoise = Int_t(mSignalPar[5]+(m_DBRandom->Gaus(0.,mSignalPar[7])));
380 lStripPedestal = lWaferPedestal + Int_t(m_DBRandom->Gaus(0.,mSignalPar[3]));
383 lStripNoise = Int_t(mSignalPar[6]+(m_DBRandom->Gaus(0.,mSignalPar[8])));
384 lStripPedestal = lWaferPedestal + Int_t(m_DBRandom->Gaus(0.,mSignalPar[4]));
387 iBin = i*nStripPerSide + j*nStripPerA128 + k ;
388 mPedestalArray[iBin] = lStripPedestal;
389 mNoiseArray[iBin] = lStripNoise;
394 Int_t nNoisyStrip = Int_t(mSsdTotStrip*m_cal_par_t[0].n_noisy_strip);
395 Float_t factorP = (m_cal_par_t[0].n_strip_P_factor)-1.;
396 Float_t factorN = (m_cal_par_t[0].n_strip_N_factor)-1.;
397 Int_t *noisyTmp =
new Int_t[mSsdTotStrip];
399 for ( i = 0 ; i < mSsdTotStrip ; i++)
403 Int_t localSize = mSsdTotStrip;
408 while (i < nNoisyStrip)
410 st = Int_t(m_DBRandom->Rndm()*localSize);
411 iSide = (Int_t(st/768))%2;
415 fact = 1.+Float_t(m_DBRandom->Rndm()*factorP);
416 mNoiseArray[noisyTmp[st]] = Int_t(mNoiseArray[noisyTmp[st]]*fact);
419 fact = 1+Float_t(m_DBRandom->Rndm()*factorN);
420 mNoiseArray[noisyTmp[st]] = Int_t(mNoiseArray[noisyTmp[st]]*fact);
423 noisyTmp[st] = noisyTmp[localSize-1];
430 St_sdm_calib_db *m_noise =
new St_sdm_calib_db(
"sdm_calib_db",500000);
431 m_noise->SetNRows(0);
432 sdm_calib_db_st *m_noise_t = m_noise->GetTable();
433 cout<<
" noise Used Rows = "<<m_noise->GetNRows()<<endl;
434 cout<<
" noise Allocated Rows = "<<m_noise->GetTableSize()<<endl;
436 for(i = 0 ; i < mSsdTotStrip ; i++ ){
438 iStrip = ConvertStripId(i+1);
440 m_noise_t[i].id_strip = iStrip;
441 m_noise_t[i].n_pedestal = mPedestalArray[i];
442 m_noise_t[i].n_sigma = mNoiseArray[i];
443 m_noise->SetNRows(i+1);
446 TString *fCalibDBName =
new TString(
"sdm_calib_db.root");
447 TFile *m_CalibDBFile =
new TFile(((*m_DBPath)+(*fCalibDBName)).Data(),
"RECREATE");
449 m_CalibDBFile->Close();
454 delete[] mPedestalArray;
455 delete[] mNoiseArray;
458 delete m_CalibDBFile;
461 void St_sdm_Maker::BuildConditionDB()
463 sdm_condition_par_st *m_cond_par_t = m_cond_par->GetTable();
465 Int_t *mSsdActiveLadder =
new Int_t[mSsdTotLadder];
466 Int_t *mSsdActivePlane =
new Int_t[mSsdTotPlane];
467 Int_t *mSsdActiveA128 =
new Int_t[mSsdTotA128];
468 Int_t *mSsdActiveStrip =
new Int_t[mSsdTotStrip];
472 for (i = 0 ; i < mSsdTotLadder ; i++)
475 mSsdActiveLadder[i] = Int_t(m_cond_par_t[0].N_active_ladder[i]);
478 for (i = 0 ; i < mSsdTotLadder ; i++ )
481 if (mSsdActiveLadder[i])
483 tmp_loc = mSsdTotPlane/mSsdTotLadder;
484 for (j = 0 ; j < tmp_loc ; j++) mSsdActivePlane[j+tmp_loc*i] = 1;
485 tmp_loc = mSsdTotA128/mSsdTotLadder;
486 for (j = 0 ; j < tmp_loc ; j++) mSsdActiveA128[j+tmp_loc*i] = 1;
487 tmp_loc = mSsdTotStrip/mSsdTotLadder;
488 for (j = 0 ; j < tmp_loc ; j++) mSsdActiveStrip[j+tmp_loc*i] = 1;
492 tmp_loc = mSsdTotPlane/mSsdTotLadder;
493 for (j = 0 ; j < tmp_loc ; j++) mSsdActivePlane[j+tmp_loc*i] = 0;
494 tmp_loc = mSsdTotA128/mSsdTotLadder;
495 for (j = 0 ; j < tmp_loc ; j++) mSsdActiveA128[j+tmp_loc*i] = 0;
496 tmp_loc = mSsdTotStrip/mSsdTotLadder;
497 for (j = 0 ; j < tmp_loc ; j++) mSsdActiveStrip[j+tmp_loc*i] = 0;
501 Int_t nDeadWafer = Int_t(mSsdTotWafer*m_cond_par_t[0].p_bad_wafer);
502 Int_t nDeadA128 = Int_t(mSsdTotA128*m_cond_par_t[0].p_bad_alice);
503 Int_t nDeadStrip = Int_t(mSsdTotStrip*m_cond_par_t[0].p_bad_strip);
505 Int_t *nTmpDeadStrip =
new Int_t[mSsdTotStrip];
508 Int_t nStripPerA128 = mSsdTotStrip/mSsdTotA128;
509 Int_t nStripPerWafer = mSsdTotStrip/mSsdTotWafer;
516 for (ii =0 ; ii < mSsdTotStrip ; ii++)
518 if (mSsdActiveStrip[ii])
520 nTmpDeadStrip[LocalSize] = ii;
525 while (ii < nDeadStrip)
527 st = Int_t (m_DBRandom->Rndm()*LocalSize);
528 mSsdActiveStrip[nTmpDeadStrip[st]] = 0 ;
529 nTmpDeadStrip[st] = nTmpDeadStrip[LocalSize - 1];
530 nTmpDeadStrip[LocalSize - 1] = 0;
535 while (ii < nDeadA128)
537 ch = Int_t(m_DBRandom->Rndm()*mSsdTotA128);
538 if ( mSsdActiveA128[ch])
540 for(jj = 0 ; jj <nStripPerA128 ; jj++)
542 iBin = jj + ch*nStripPerA128;
543 mSsdActiveStrip[iBin] = 0 ;
545 mSsdActiveA128[ch] = 0 ;
551 while (ii < nDeadWafer)
553 ss = Int_t(m_DBRandom->Rndm()*mSsdTotWafer);
554 if ((mSsdActivePlane[2*ss])||(mSsdActivePlane[2*ss+1]))
556 for(jj = 0 ; jj < nStripPerWafer ; jj++)
558 iBin = jj + ss*nStripPerWafer ;
559 mSsdActiveStrip[iBin] = 0 ;
562 mSsdActivePlane[2*ss] = 0 ;
563 mSsdActivePlane[2*ss+1] = 0 ;
570 St_sdm_condition_db *m_condition =
new St_sdm_condition_db(
"sdm_condition_db",500000);
571 m_condition->SetNRows(0);
572 sdm_condition_db_st *m_condition_t = m_condition->GetTable();
574 for(jj = 0 ; jj < mSsdTotStrip ; jj++ ){
576 iStrip = ConvertStripId(jj+1);
578 m_condition_t[jj].id_strip = iStrip;
579 m_condition_t[jj].is_active = mSsdActiveStrip[jj];
580 m_condition->SetNRows(jj+1);
583 TString *fCondDBName =
new TString(
"sdm_condition_db.root");
584 TFile *m_CondDBFile =
new TFile (((*m_DBPath)+(*fCondDBName)).Data(),
"RECREATE");
585 m_condition->Write();
586 m_CondDBFile->Close();
588 delete[] nTmpDeadStrip;
589 delete[] mSsdActiveLadder;
590 delete[] mSsdActivePlane;
591 delete[] mSsdActiveA128;
592 delete[] mSsdActiveStrip;
598 Int_t St_sdm_Maker::WaferNumbToIdWafer(Int_t wafer_numb)
600 Int_t nWaferPerLadder = mSsdTotWafer/mSsdTotLadder;
601 Int_t iLadder = 1+Int_t(wafer_numb/nWaferPerLadder);
602 Int_t iWafer = wafer_numb-((iLadder-1)*nWaferPerLadder)+1;
603 return mSsdLayer*1000 + iWafer*100 + iLadder;
606 Int_t St_sdm_Maker::ConvertStripId(Int_t st)
611 Int_t nStripPerWafer = Int_t(mSsdTotStrip/mSsdTotWafer);
613 iWafer = Int_t((st-1)/nStripPerWafer);
614 idStrip = st - iWafer*nStripPerWafer;
615 iWafer = WaferNumbToIdWafer(iWafer);
616 iSide = (idStrip <= (nStripPerWafer/2)) ? 0 : 1 ;
618 if(iSide) idStrip -= (nStripPerWafer/2);
619 idStrip = 10000*(10*idStrip+iSide)+iWafer ;