BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTofDigitizerEcV4 Class Reference

#include <BesTofDigitizerEcV4.hh>

+ Inheritance diagram for BesTofDigitizerEcV4:

Classes

struct  HitStruct
 
struct  Param
 
struct  StripStruct
 

Public Member Functions

 BesTofDigitizerEcV4 ()
 
 ~BesTofDigitizerEcV4 ()
 
void initial ()
 
virtual void Digitize (ScintSingle *, BesTofDigitsCollection *)
 
int calStrip (double locZ)
 
bool underStrip (double locX, double locZ)
 
double calTdcRes_charge (double charge_fC)
 
double charge2Time (double charge_fC)
 
double calAdcRes_charge (double charge_fC)
 
double calTdcRes_charge1 (double charge_fC)
 
double charge2Time1 (double charge_fC)
 
double calAdcRes_charge1 (double charge_fC)
 
 BesTofDigitizerEcV4 ()
 
 ~BesTofDigitizerEcV4 ()
 
void initial ()
 
virtual void Digitize (ScintSingle *, BesTofDigitsCollection *)
 
int calStrip (double locZ)
 
bool underStrip (double locX, double locZ)
 
double calTdcRes_charge (double charge_fC)
 
double charge2Time (double charge_fC)
 
double calAdcRes_charge (double charge_fC)
 
double calTdcRes_charge1 (double charge_fC)
 
double charge2Time1 (double charge_fC)
 
double calAdcRes_charge1 (double charge_fC)
 
- Public Member Functions inherited from BesTofDigitizerV
 BesTofDigitizerV ()
 
 ~BesTofDigitizerV ()
 
void Initialize ()
 
virtual void Digitize (ScintSingle *, BesTofDigitsCollection *)
 
 BesTofDigitizerV ()
 
 ~BesTofDigitizerV ()
 
void Initialize ()
 
virtual void Digitize (ScintSingle *, BesTofDigitsCollection *)
 

Additional Inherited Members

- Protected Attributes inherited from BesTofDigitizerV
BesTofDigitsCollectionm_besTofDigitsCollection
 
BesTofHitsCollectionm_THC
 
ITofCaliSvcm_tofCaliSvc
 
ITofSimSvcm_tofSimSvc
 
ITofQElecSvcm_tofQElecSvc
 
G4double m_ADC [2]
 
G4double m_TDC [2]
 
G4int m_trackIndex
 
G4double m_globalTime
 
- Static Protected Attributes inherited from BesTofDigitizerV
static bool m_booked = false
 
static NTuple::Tuple * m_tupleTof1 = 0
 
static NTuple::Item< double > m_partId
 
static NTuple::Item< double > m_scinNb
 
static NTuple::Item< double > m_edep
 
static NTuple::Item< double > m_nHits
 
static NTuple::Item< double > m_time1st0
 
static NTuple::Item< double > m_time1st1
 
static NTuple::Item< double > m_timelast0
 
static NTuple::Item< double > m_timelast1
 
static NTuple::Item< double > m_totalPhot0
 
static NTuple::Item< double > m_totalPhot1
 
static NTuple::Item< double > m_NphAllSteps
 
static NTuple::Item< double > m_max0
 
static NTuple::Item< double > m_max1
 
static NTuple::Item< double > m_tdc0
 
static NTuple::Item< double > m_adc0
 
static NTuple::Item< double > m_tdc1
 
static NTuple::Item< double > m_adc1
 
static NTuple::Tuple * m_tupleTof2 = 0
 
static NTuple::Item< double > m_eTotal
 
static NTuple::Item< double > m_nDigi
 
static NTuple::Item< double > m_partIdMPV
 
static NTuple::Item< double > m_scinNbMPV
 
static NTuple::Item< double > m_edepMPV
 
static NTuple::Item< double > m_nDigiOut
 
static NTuple::Tuple * m_tupleTof3 = 0
 
static NTuple::Item< double > m_forb
 
static NTuple::Item< double > m_timeFlight
 
static NTuple::Item< double > m_ddT
 
static NTuple::Item< double > m_scinSwim
 
static NTuple::Item< double > m_scinTime
 
static NTuple::Item< double > m_transitTime
 
static NTuple::Item< double > m_endTime
 
static NTuple::Item< double > m_edepHit
 

Detailed Description

Constructor & Destructor Documentation

◆ BesTofDigitizerEcV4() [1/2]

BesTofDigitizerEcV4::BesTofDigitizerEcV4 ( )

Definition at line 32 of file BesTofDigitizerEcV4.cc.

33{
34 PropertyMgr m_propMgr;
35 m_propMgr.declareProperty("FileName", m_fileName = "mrpc.root");
36 m_propMgr.declareProperty("RootFlag", m_rootFlag = false);
37 m_propMgr.declareProperty("E", m_V = 7000);
38 m_propMgr.declareProperty("Threshold", m_threshold = 5.5e+08);
39
40 m_propMgr.declareProperty("nstep", m_nstep = -1);
41 m_propMgr.declareProperty("E_weight", m_E_weight = -1);
42 m_propMgr.declareProperty("saturationFlag", m_saturationFlag = true);
43 m_propMgr.declareProperty("tdcRes_const", tdcRes_const = -1);
44 m_propMgr.declareProperty("adcRes_const", adcRes_const = -1);
45 m_propMgr.declareProperty("calTdcRes_charge_flag", m_calTdcRes_charge_flag=0);
46 m_propMgr.declareProperty("charge2Time_flag", m_charge2Time_flag=0);
47 m_propMgr.declareProperty("calAdcRes_charge_flag", m_calAdcRes_charge_flag=0);
48 cout<<"Property:"<<endl
49 <<" FileName= "<<m_fileName
50 <<" E= "<<m_V
51 <<" Threshold= "<<m_threshold
52 <<" nstep= "<<m_nstep
53 <<" E_weight= "<<m_E_weight
54 <<" saturationFlag= "<<m_saturationFlag
55 <<" tdcRes_const= "<<tdcRes_const
56 <<" adcRes_const= "<<adcRes_const
57 <<" calTdcRes_charge_flag= "<<m_calTdcRes_charge_flag
58 <<" charge2Time_flag= "<<m_charge2Time_flag
59 <<" calAdcRes_charge_flag= "<<m_calAdcRes_charge_flag
60 <<endl;
61
62
63 IJobOptionsSvc* jobSvc;
64 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
65 jobSvc->setMyProperties("BesTofDigitizerEcV4", &m_propMgr);
66
67 initial();
68
69 if(m_rootFlag)
70 {
71 m_file = new TFile(m_fileName.c_str(), "RECREATE");
72 m_tree = new TTree("mrpc", "mrpc");
73
74 m_tree->Branch("event", &m_event, "event/D");
75 m_tree->Branch("partId", &m_partId, "partId/D");
76 m_tree->Branch("module", &m_module, "module/D");
77 m_tree->Branch("time_leading_sphi", &m_time_leading_sphi, "time_leading_sphi/D");
78 m_tree->Branch("time_leading_xphi", &m_time_leading_xphi, "time_leading_xphi/D");
79 m_tree->Branch("time_trailing_sphi", &m_time_trailing_sphi, "time_trailing_sphi/D");
80 m_tree->Branch("time_trailing_xphi", &m_time_trailing_xphi, "time_trailing_xphi/D");
81 m_tree->Branch("tdcRes", &m_tdcRes, "tdcRes/D");
82 m_tree->Branch("tdcRes_charge", &m_tdcRes_charge, "tdcRes_charge/D");
83 m_tree->Branch("adc", &m_adc, "adc/D");
84 m_tree->Branch("adcRes", &m_adcRes, "adcRes/D");
85 m_tree->Branch("adcRes_charge", &m_adcRes_charge, "adcRes_charge/D");
86 m_tree->Branch("strip", &m_strip, "strip/D");
87 m_tree->Branch("trkIndex", &m_trkIndex, "trkIndex/D");
88 m_tree->Branch("tStart", &m_tStart, "tStart/D");
89 m_tree->Branch("tPropagate_sphi", &m_tPropagate_sphi, "tPropagate_sphi/D");
90 m_tree->Branch("tPropagate_xphi", &m_tPropagate_xphi, "tPropagate_xphi/D");
91 m_tree->Branch("tThreshold", &m_tThreshold, "tThreshold/D");
92 m_tree->Branch("charge", &m_charge, "charge/D");
93 m_tree->Branch("nhit", &m_nhit, "nhit/I");
94 m_tree->Branch("ions_hit", m_ions_hit, "ions_hit[nhit]/D");
95 m_tree->Branch("trkIndex_hit", m_trkIndex_hit, "trkIndex_hit[nhit]/D");
96 m_tree->Branch("pdgCode_hit", m_pdgCode_hit, "pdgCode_hit[nhit]/D");
97 m_tree->Branch("gap_hit", m_gap_hit, "gap_hit[nhit]/D");
98 m_tree->Branch("underStrip_hit", m_underStrip_hit, "underStrip_hit[nhit]/D");
99 m_tree->Branch("locx_hit", m_locx_hit, "locx_hit[nhit]/D");
100 m_tree->Branch("locy_hit", m_locy_hit, "locy_hit[nhit]/D");
101 m_tree->Branch("locz_hit", m_locz_hit, "locz_hit[nhit]/D");
102 m_tree->Branch("x_hit", m_x_hit, "x_hit[nhit]/D");
103 m_tree->Branch("y_hit", m_y_hit, "y_hit[nhit]/D");
104 m_tree->Branch("z_hit", m_z_hit, "z_hit[nhit]/D");
105 m_tree->Branch("px_hit", m_px_hit, "px_hit[nhit]/D");
106 m_tree->Branch("py_hit", m_py_hit, "py_hit[nhit]/D");
107 m_tree->Branch("pz_hit", m_pz_hit, "pz_hit[nhit]/D");
108 }
109}

◆ ~BesTofDigitizerEcV4() [1/2]

BesTofDigitizerEcV4::~BesTofDigitizerEcV4 ( )

Definition at line 112 of file BesTofDigitizerEcV4.cc.

113{
114 if(m_rootFlag)
115 {
116 m_file->Write();
117 m_file->Close();
118 }
119}

◆ BesTofDigitizerEcV4() [2/2]

BesTofDigitizerEcV4::BesTofDigitizerEcV4 ( )

◆ ~BesTofDigitizerEcV4() [2/2]

BesTofDigitizerEcV4::~BesTofDigitizerEcV4 ( )

Member Function Documentation

◆ calAdcRes_charge() [1/2]

double BesTofDigitizerEcV4::calAdcRes_charge ( double  charge_fC)

Definition at line 583 of file BesTofDigitizerEcV4.cc.

584{
585 double time=0;
586 if(charge_fC<250)
587 {
588 time = 72.6005*exp(-charge_fC*0.0302626 + 1.49059) + 40.8627;
589 }
590 else
591 {
592 time = 32.6233+0.00404149*charge_fC;
593 }
594 if(time<0) time=0;
595 return time; //ps
596}
Double_t time
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252

Referenced by Digitize().

◆ calAdcRes_charge() [2/2]

double BesTofDigitizerEcV4::calAdcRes_charge ( double  charge_fC)

◆ calAdcRes_charge1() [1/2]

double BesTofDigitizerEcV4::calAdcRes_charge1 ( double  charge_fC)

Definition at line 621 of file BesTofDigitizerEcV4.cc.

622{
623 double time = 64.3326*exp(-charge_fC/25.4638 + 0.944184)+19.4846;
624 if(time<0) time=0;
625 return time; //ps
626}

Referenced by Digitize().

◆ calAdcRes_charge1() [2/2]

double BesTofDigitizerEcV4::calAdcRes_charge1 ( double  charge_fC)

◆ calStrip() [1/2]

int BesTofDigitizerEcV4::calStrip ( double  locZ)

Definition at line 352 of file BesTofDigitizerEcV4.cc.

353{
354 int strip=-1;
355 double stripWidth = m_param.strip_z+m_param.strip_gap; //Strip spread: (24+3)mm
356 int nstrip = m_param.nstrip;
357 //the offset between strip coordinate and gas SD: 0.5
358 double length = locZ+stripWidth*nstrip/2-0.5;
359 if(length<=0)
360 {
361 strip=0;
362 }
363 else if(length<stripWidth*nstrip)
364 {
365 for(int i=0; i<nstrip; i++)
366 {
367 if(length>i*stripWidth && length<(i+1)*stripWidth)
368 {
369 strip = i;
370 break;
371 }
372 }
373 }
374 else
375 {
376 strip=nstrip-1;
377 }
378 if(strip<0) strip=0;
379 if(strip>nstrip-1) strip=nstrip-1;
380
381 return strip;
382}

Referenced by Digitize().

◆ calStrip() [2/2]

int BesTofDigitizerEcV4::calStrip ( double  locZ)

◆ calTdcRes_charge() [1/2]

double BesTofDigitizerEcV4::calTdcRes_charge ( double  charge_fC)

Definition at line 560 of file BesTofDigitizerEcV4.cc.

561{
562 double time=0;
563 if( charge_fC<250)
564 {
565 time = 100.764*exp(-charge_fC*0.0413966+0.377154)+ 13.814;
566 }
567 else
568 {
569 time = 12.8562+0.000507299*charge_fC;
570 }
571 if(time<0) time=0;
572 return time; //ps
573}

Referenced by Digitize().

◆ calTdcRes_charge() [2/2]

double BesTofDigitizerEcV4::calTdcRes_charge ( double  charge_fC)

◆ calTdcRes_charge1() [1/2]

double BesTofDigitizerEcV4::calTdcRes_charge1 ( double  charge_fC)

Definition at line 598 of file BesTofDigitizerEcV4.cc.

599{
600 double result =0;
601 if( charge_fC > 50.)
602 {
603 result = 67.6737*exp(-charge_fC/50.9995-0.27755)+9.06223;
604 }
605 else
606 {
607 result = 176.322-2.98345*charge_fC;
608 }
609 if(result<0) result=0;
610 return result; //ps
611}

Referenced by Digitize().

◆ calTdcRes_charge1() [2/2]

double BesTofDigitizerEcV4::calTdcRes_charge1 ( double  charge_fC)

◆ charge2Time() [1/2]

double BesTofDigitizerEcV4::charge2Time ( double  charge_fC)

Definition at line 575 of file BesTofDigitizerEcV4.cc.

576{
577 double time=0;
578 time=-120.808/log(charge_fC*30.1306)+26.6024; //ns
579 if(time<0) time=0;
580 return time;
581}

Referenced by Digitize().

◆ charge2Time() [2/2]

double BesTofDigitizerEcV4::charge2Time ( double  charge_fC)

◆ charge2Time1() [1/2]

double BesTofDigitizerEcV4::charge2Time1 ( double  charge_fC)

Definition at line 613 of file BesTofDigitizerEcV4.cc.

614{
615 double time=0;
616 time=-4.50565/log(charge_fC*0.0812208)+16.6653; //ns
617 if(time<0) time=0;
618 return time;
619}

Referenced by Digitize().

◆ charge2Time1() [2/2]

double BesTofDigitizerEcV4::charge2Time1 ( double  charge_fC)

◆ Digitize() [1/2]

void BesTofDigitizerEcV4::Digitize ( ScintSingle single_module,
BesTofDigitsCollection DC 
)
virtual

Reimplemented from BesTofDigitizerV.

Definition at line 143 of file BesTofDigitizerEcV4.cc.

144{
146 G4DigiManager* digiManager = G4DigiManager::GetDMpointer();
147 G4int THCID = digiManager->GetHitsCollectionID("BesTofHitsCollection");
148 m_THC = (BesTofHitsCollection*) (digiManager->GetHitsCollection(THCID));
149 if( !m_THC ) return;
150
151 partId = single_module->GetPartId();
152 module = single_module->GetModule_mrpc();
153 //cout<<"partId= "<<partId<<" module= "<<module<<endl;
154
155 //Process the hits
156 int nstrip = m_param.nstrip;
157 StripStruct stripStruct[12];
158 for(int i=0; i<nstrip; i++)
159 {
160 stripStruct[i].m_param = m_param;
161 stripStruct[i].setPar(m_V, m_threshold, m_saturationFlag);
162 }
163
164 BesTofHit* hit;
165 for(unsigned int i=0; i<single_module->GetHitIndexes_mrpc()->size(); i++)
166 {
167 hit = (*m_THC)[ (*(single_module->GetHitIndexes_mrpc()))[i] ];
168 m_event = hit->GetEvent();
169
170 HitStruct hitStruct;
171 hitStruct.m_param = m_param;
172 hitStruct.trkIndex = hit->GetG4Index();
173 hitStruct.pdgCode = hit->GetPDGcode();
174 hitStruct.ions = hit->GetIons();
175 hitStruct.strip = calStrip(hit->GetLocPos().z()/mm);
176 hitStruct.underStrip = underStrip(hit->GetLocPos().x()/mm, hit->GetLocPos().z()/mm);
177 hitStruct.gap = hit->GetGapNb();
178 hitStruct.glbTime = hit->GetTime()/ns;
179 hitStruct.locx = hit->GetLocPos().x()/mm;
180 hitStruct.locy = hit->GetLocPos().y()/mm;
181 hitStruct.locz = hit->GetLocPos().z()/mm;
182 hitStruct.x = hit->GetPos().x()/mm;
183 hitStruct.y = hit->GetPos().y()/mm;
184 hitStruct.z = hit->GetPos().z()/mm;
185 hitStruct.px = hit->GetMomentum().x()/(GeV/(3e+08*m/s));
186 hitStruct.py = hit->GetMomentum().y()/(GeV/(3e+08*m/s));
187 hitStruct.pz = hit->GetMomentum().z()/(GeV/(3e+08*m/s));
188 //hitStruct.print();
189
190 if(hitStruct.ions>0 && hitStruct.glbTime>0)
191 {
192 stripStruct[hitStruct.strip].hitStructCol.push_back(hitStruct);
193 }
194 }
195
196 //test multihit, study the lower peak in charge
197 int hitSize=0;
198
199 for(int i=0; i<nstrip; i++)
200 {
201 if(stripStruct[i].hitStructCol.size()==0) continue;
202 stripStruct[i].strip = i;
203 stripStruct[i].calFirstHit();
204 stripStruct[i].avalanche();
205 //stripStruct[i].print();
206
207 if(stripStruct[i].tThreshold<=0) continue;
208
209 tdc_sphi = stripStruct[i].tStart + stripStruct[i].tThreshold + stripStruct[i].tPropagate_sphi;
210 tdc_xphi = stripStruct[i].tStart + stripStruct[i].tThreshold + stripStruct[i].tPropagate_xphi;
211
212 double tdcRes_charge;
213 if(m_calTdcRes_charge_flag==0)
214 {
215 tdcRes_charge = calTdcRes_charge(stripStruct[i].charge*1000); //ps, charge in fC
216 }
217 else if(m_calTdcRes_charge_flag==1)
218 {
219 tdcRes_charge = calTdcRes_charge1(stripStruct[i].charge*1000);
220 }
221 else if(m_calTdcRes_charge_flag==2)
222 {
223 tdcRes_charge = 0;
224 }
225
226 tdcRes = sqrt(tdcRes_charge*tdcRes_charge+tdcRes_const*tdcRes_const)/1000; //ns
227
228 tdc_sphi = G4RandGauss::shoot(tdc_sphi, tdcRes);
229 tdc_xphi = G4RandGauss::shoot(tdc_xphi, tdcRes);
230
231 if(m_charge2Time_flag==0)
232 {
233 adc = charge2Time(stripStruct[i].charge*1000); //ns, charge in fC
234 }
235 else if(m_charge2Time_flag==1)
236 {
237 adc = charge2Time1(stripStruct[i].charge*1000);
238 }
239
240 double adcRes_charge;
241 if(m_calAdcRes_charge_flag==0)
242 {
243 adcRes_charge = calAdcRes_charge(stripStruct[i].charge*1000); //ps, charge in fC
244 }
245 else if(m_calAdcRes_charge_flag==1)
246 {
247 adcRes_charge = calAdcRes_charge1(stripStruct[i].charge*1000);
248 }
249 else if(m_calAdcRes_charge_flag==2)
250 {
251 adcRes_charge = 0;
252 }
253
254 adcRes = sqrt(adcRes_charge*adcRes_charge+adcRes_const*adcRes_const)/1000;
255 adc = G4RandGauss::shoot(adc, adcRes);
256 if(adc<0) adc=0;
257
258 time_leading_sphi = tdc_sphi;
259 time_leading_xphi = tdc_xphi;
260 time_trailing_sphi = tdc_sphi+adc;
261 time_trailing_xphi = tdc_xphi+adc;
262
263
264 //save digi information
265 BesTofDigi *digi = new BesTofDigi;
266 digi->SetTrackIndex(stripStruct[i].trkIndex);
267 digi->SetPartId(partId);
268 digi->SetModule(module);
269 digi->SetStrip(stripStruct[i].strip);
270 int mo = (partId-3)*36+module;
271 int st = stripStruct[i].strip;
272 if(m_param.deadChannel[mo][st]==0 || m_param.deadChannel[mo][st]==2)
273 {
274 //Set dead channel
275 digi->SetForwT1(-999);
276 digi->SetForwT2(-999);
277 }
278 else
279 {
280 digi->SetForwT1(time_leading_sphi);
281 digi->SetForwT2(time_trailing_sphi);
282 }
283 if(m_param.deadChannel[mo][st]==1 || m_param.deadChannel[mo][st]==2)
284 {
285 digi->SetBackT1(-999);
286 digi->SetBackT2(-999);
287 }
288 else
289 {
290 digi->SetBackT1(time_leading_xphi);
291 digi->SetBackT2(time_trailing_xphi);
292 }
293 m_besTofDigitsCollection->insert(digi);
294 //cout<<"Print digi info: "
295 // <<" partId= "<<partId
296 // <<" module= "<<module
297 // <<" strip= "<<stripStruct[i].strip
298 // <<" time_leading_sphi= "<<time_leading_sphi
299 // <<" time_leading_xphi= "<<time_leading_xphi
300 // <<" time_trailing_sphi= "<<time_trailing_sphi
301 // <<" time_trailing_xphi= "<<time_trailing_xphi
302 // <<endl;
303
304
305 //save digi information
306 if(m_rootFlag)
307 {
308 m_partId = partId;
309 m_module = module;
310 m_time_leading_sphi = time_leading_sphi;
311 m_time_leading_xphi = time_leading_xphi;
312 m_time_trailing_sphi = time_trailing_sphi;
313 m_time_trailing_xphi = time_trailing_xphi;
314 m_tdcRes = tdcRes;
315 m_tdcRes_charge = tdcRes_charge;
316 m_adc = adc;
317 m_adcRes = adcRes;
318 m_adcRes_charge = adcRes_charge;
319
320 m_strip = stripStruct[i].strip;
321 m_trkIndex = stripStruct[i].trkIndex;
322 m_tStart = stripStruct[i].tStart;
323 m_tPropagate_sphi = stripStruct[i].tPropagate_sphi;
324 m_tPropagate_xphi = stripStruct[i].tPropagate_xphi;
325 m_tThreshold = stripStruct[i].tThreshold;
326 m_charge = stripStruct[i].charge;
327
328 m_nhit = stripStruct[i].hitStructCol.size();
329 //cout<<"m_nhit= "<<m_nhit<<endl;
330 for(int j=0; j<m_nhit; j++)
331 {
332 m_ions_hit[j] = stripStruct[i].hitStructCol[j].ions;
333 m_trkIndex_hit[j] = stripStruct[i].hitStructCol[j].trkIndex;
334 m_pdgCode_hit[j] = stripStruct[i].hitStructCol[j].pdgCode;
335 m_gap_hit[j] = stripStruct[i].hitStructCol[j].gap;
336 m_underStrip_hit[j] = stripStruct[i].hitStructCol[j].underStrip;
337 m_locx_hit[j] = stripStruct[i].hitStructCol[j].locx;
338 m_locy_hit[j] = stripStruct[i].hitStructCol[j].locy;
339 m_locz_hit[j] = stripStruct[i].hitStructCol[j].locz;
340 m_x_hit[j] = stripStruct[i].hitStructCol[j].x;
341 m_y_hit[j] = stripStruct[i].hitStructCol[j].y;
342 m_z_hit[j] = stripStruct[i].hitStructCol[j].z;
343 m_px_hit[j] = stripStruct[i].hitStructCol[j].px;
344 m_py_hit[j] = stripStruct[i].hitStructCol[j].py;
345 m_pz_hit[j] = stripStruct[i].hitStructCol[j].pz;
346 }
347 m_tree->Fill();
348 }
349 }
350}
XmlRpcServer s
Definition: HelloServer.cpp:11
G4THitsCollection< BesTofHit > BesTofHitsCollection
double calTdcRes_charge1(double charge_fC)
double calAdcRes_charge(double charge_fC)
double calAdcRes_charge1(double charge_fC)
bool underStrip(double locX, double locZ)
int calStrip(double locZ)
double charge2Time1(double charge_fC)
double charge2Time(double charge_fC)
double calTdcRes_charge(double charge_fC)
void setPar(int nstep, double E_weight)
#define ns(x)
Definition: xmltok.c:1504

Referenced by BesTofDigitizer::Digitize().

◆ Digitize() [2/2]

virtual void BesTofDigitizerEcV4::Digitize ( ScintSingle ,
BesTofDigitsCollection  
)
virtual

Reimplemented from BesTofDigitizerV.

◆ initial() [1/2]

void BesTofDigitizerEcV4::initial ( )

Definition at line 121 of file BesTofDigitizerEcV4.cc.

122{
123 m_param = Param();
124 m_param.setPar(m_nstep, m_E_weight);
125 m_event=-1;
126 partId = -999;
127 module = -999;
128 tdc_sphi = -999;
129 tdc_xphi = -999;
130 if(tdcRes_const<0) tdcRes_const = 38; //sqrt(27*27.+10.*10+20.*20)+3.; //ps, 27:TDC; 10:gapNb; 20:cables..
131 tdcRes = -999;
132
133 adc = -999;
134 if(adcRes_const<0) adcRes_const = 27; //ps TDC
135 adcRes = -999;
136
137 time_leading_sphi = -999;
138 time_leading_xphi = -999;
139 time_trailing_sphi = -999;
140 time_trailing_xphi = -999;
141}

Referenced by BesTofDigitizerEcV4(), BesTofDigitizerEcV4::HitStruct::HitStruct(), and BesTofDigitizerEcV4::StripStruct::StripStruct().

◆ initial() [2/2]

void BesTofDigitizerEcV4::initial ( )

◆ underStrip() [1/2]

bool BesTofDigitizerEcV4::underStrip ( double  locX,
double  locZ 
)

Definition at line 384 of file BesTofDigitizerEcV4.cc.

385{
386 bool flag = 0;
387 int strip=-1;
388 double stripWidth = m_param.strip_z+m_param.strip_gap; //Strip spread: (24+3)mm
389 int nstrip = m_param.nstrip;
390 //the offset between strip coordinate and gas SD: 0.5
391 double length = locZ+stripWidth*nstrip/2-0.5;
392 if(length<stripWidth*nstrip)
393 {
394 for(int i=0; i<nstrip; i++)
395 {
396 if(length>i*stripWidth && length<(i+1)*stripWidth)
397 {
398 strip = i;
399 if(length>i*stripWidth+m_param.strip_gap/2 && length<(i+1)*stripWidth-m_param.strip_gap/2
400 && locX>-m_param.strip_x[strip]/2 && locX<m_param.strip_x[strip]/2) flag=1;
401 break;
402 }
403 }
404 }
405
406 return flag;
407}

Referenced by Digitize().

◆ underStrip() [2/2]

bool BesTofDigitizerEcV4::underStrip ( double  locX,
double  locZ 
)

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