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

#include <BesTofDigitizerEcV4.hh>

Inheritance diagram for BesTofDigitizerEcV4:

Classes

struct  Param
struct  HitStruct
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)
 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 ()
 BesTofDigitizerV ()
 ~BesTofDigitizerV ()
void Initialize ()
 BesTofDigitizerV ()
 ~BesTofDigitizerV ()
void Initialize ()

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/3]

BesTofDigitizerEcV4::BesTofDigitizerEcV4 ( )

Definition at line 36 of file BesTofDigitizerEcV4.cc.

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

◆ ~BesTofDigitizerEcV4() [1/3]

BesTofDigitizerEcV4::~BesTofDigitizerEcV4 ( )

Definition at line 109 of file BesTofDigitizerEcV4.cc.

109 {
110 if ( m_rootFlag )
111 {
112 m_file->Write();
113 m_file->Close();
114 }
115}

◆ BesTofDigitizerEcV4() [2/3]

BesTofDigitizerEcV4::BesTofDigitizerEcV4 ( )

◆ ~BesTofDigitizerEcV4() [2/3]

BesTofDigitizerEcV4::~BesTofDigitizerEcV4 ( )

◆ BesTofDigitizerEcV4() [3/3]

BesTofDigitizerEcV4::BesTofDigitizerEcV4 ( )

◆ ~BesTofDigitizerEcV4() [3/3]

BesTofDigitizerEcV4::~BesTofDigitizerEcV4 ( )

Member Function Documentation

◆ calAdcRes_charge() [1/3]

double BesTofDigitizerEcV4::calAdcRes_charge ( double charge_fC)

Definition at line 547 of file BesTofDigitizerEcV4.cc.

547 {
548 double time = 0;
549 if ( charge_fC < 250 )
550 { time = 72.6005 * exp( -charge_fC * 0.0302626 + 1.49059 ) + 40.8627; }
551 else { time = 32.6233 + 0.00404149 * charge_fC; }
552 if ( time < 0 ) time = 0;
553 return time; // ps
554}
Double_t time
EvtComplex exp(const EvtComplex &c)

Referenced by Digitize().

◆ calAdcRes_charge() [2/3]

double BesTofDigitizerEcV4::calAdcRes_charge ( double charge_fC)

◆ calAdcRes_charge() [3/3]

double BesTofDigitizerEcV4::calAdcRes_charge ( double charge_fC)

◆ calAdcRes_charge1() [1/3]

double BesTofDigitizerEcV4::calAdcRes_charge1 ( double charge_fC)

Definition at line 572 of file BesTofDigitizerEcV4.cc.

572 {
573 double time = 64.3326 * exp( -charge_fC / 25.4638 + 0.944184 ) + 19.4846;
574 if ( time < 0 ) time = 0;
575 return time; // ps
576}

Referenced by Digitize().

◆ calAdcRes_charge1() [2/3]

double BesTofDigitizerEcV4::calAdcRes_charge1 ( double charge_fC)

◆ calAdcRes_charge1() [3/3]

double BesTofDigitizerEcV4::calAdcRes_charge1 ( double charge_fC)

◆ calStrip() [1/3]

int BesTofDigitizerEcV4::calStrip ( double locZ)

Definition at line 343 of file BesTofDigitizerEcV4.cc.

343 {
344 int strip = -1;
345 double stripWidth = m_param.strip_z + m_param.strip_gap; // Strip spread: (24+3)mm
346 int nstrip = m_param.nstrip;
347 // the offset between strip coordinate and gas SD: 0.5
348 double length = locZ + stripWidth * nstrip / 2 - 0.5;
349 if ( length <= 0 ) { strip = 0; }
350 else if ( length < stripWidth * nstrip )
351 {
352 for ( int i = 0; i < nstrip; i++ )
353 {
354 if ( length > i * stripWidth && length < ( i + 1 ) * stripWidth )
355 {
356 strip = i;
357 break;
358 }
359 }
360 }
361 else { strip = nstrip - 1; }
362 if ( strip < 0 ) strip = 0;
363 if ( strip > nstrip - 1 ) strip = nstrip - 1;
364
365 return strip;
366}

Referenced by Digitize().

◆ calStrip() [2/3]

int BesTofDigitizerEcV4::calStrip ( double locZ)

◆ calStrip() [3/3]

int BesTofDigitizerEcV4::calStrip ( double locZ)

◆ calTdcRes_charge() [1/3]

double BesTofDigitizerEcV4::calTdcRes_charge ( double charge_fC)

Definition at line 531 of file BesTofDigitizerEcV4.cc.

531 {
532 double time = 0;
533 if ( charge_fC < 250 )
534 { time = 100.764 * exp( -charge_fC * 0.0413966 + 0.377154 ) + 13.814; }
535 else { time = 12.8562 + 0.000507299 * charge_fC; }
536 if ( time < 0 ) time = 0;
537 return time; // ps
538}

Referenced by Digitize().

◆ calTdcRes_charge() [2/3]

double BesTofDigitizerEcV4::calTdcRes_charge ( double charge_fC)

◆ calTdcRes_charge() [3/3]

double BesTofDigitizerEcV4::calTdcRes_charge ( double charge_fC)

◆ calTdcRes_charge1() [1/3]

double BesTofDigitizerEcV4::calTdcRes_charge1 ( double charge_fC)

Definition at line 556 of file BesTofDigitizerEcV4.cc.

556 {
557 double result = 0;
558 if ( charge_fC > 50. )
559 { result = 67.6737 * exp( -charge_fC / 50.9995 - 0.27755 ) + 9.06223; }
560 else { result = 176.322 - 2.98345 * charge_fC; }
561 if ( result < 0 ) result = 0;
562 return result; // ps
563}

Referenced by Digitize().

◆ calTdcRes_charge1() [2/3]

double BesTofDigitizerEcV4::calTdcRes_charge1 ( double charge_fC)

◆ calTdcRes_charge1() [3/3]

double BesTofDigitizerEcV4::calTdcRes_charge1 ( double charge_fC)

◆ charge2Time() [1/3]

double BesTofDigitizerEcV4::charge2Time ( double charge_fC)

Definition at line 540 of file BesTofDigitizerEcV4.cc.

540 {
541 double time = 0;
542 time = -120.808 / log( charge_fC * 30.1306 ) + 26.6024; // ns
543 if ( time < 0 ) time = 0;
544 return time;
545}

Referenced by Digitize().

◆ charge2Time() [2/3]

double BesTofDigitizerEcV4::charge2Time ( double charge_fC)

◆ charge2Time() [3/3]

double BesTofDigitizerEcV4::charge2Time ( double charge_fC)

◆ charge2Time1() [1/3]

double BesTofDigitizerEcV4::charge2Time1 ( double charge_fC)

Definition at line 565 of file BesTofDigitizerEcV4.cc.

565 {
566 double time = 0;
567 time = -4.50565 / log( charge_fC * 0.0812208 ) + 16.6653; // ns
568 if ( time < 0 ) time = 0;
569 return time;
570}

Referenced by Digitize().

◆ charge2Time1() [2/3]

double BesTofDigitizerEcV4::charge2Time1 ( double charge_fC)

◆ charge2Time1() [3/3]

double BesTofDigitizerEcV4::charge2Time1 ( double charge_fC)

◆ Digitize() [1/3]

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

Reimplemented from BesTofDigitizerV.

Definition at line 149 of file BesTofDigitizerEcV4.cc.

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

◆ Digitize() [2/3]

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

Reimplemented from BesTofDigitizerV.

◆ Digitize() [3/3]

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

Reimplemented from BesTofDigitizerV.

◆ initial() [1/3]

void BesTofDigitizerEcV4::initial ( )

Definition at line 117 of file BesTofDigitizerEcV4.cc.

117 {
118 m_param = Param();
119 m_param.setPar( m_nstep, m_E_weight, m_V );
120 m_param.print();
121 m_event = -1;
122 partId = -999;
123 module = -999;
124 tdc_sphi = -999;
125 tdc_xphi = -999;
126 if ( tdcRes_const < 0 ) tdcRes_const = 38;
127 // 45; //sqrt(27*27.+30.*30+20.*20); //ps, 27:TDC; 30:gapNb; 20:cables..
128 tdcRes = -999;
129
130 adc = -999;
131 if ( adcRes_const < 0 ) adcRes_const = 27; // ps TDC
132 adcRes = -999;
133
134 time_leading_sphi = -999;
135 time_leading_xphi = -999;
136 time_trailing_sphi = -999;
137 time_trailing_xphi = -999;
138
139 cout << "Property:" << endl
140 << " FileName= " << m_fileName << " E= " << m_V << " Threshold= " << m_threshold
141 << " nstep= " << m_nstep << " E_weight= " << m_E_weight
142 << " saturationFlag= " << m_saturationFlag << " tdcRes_const= " << tdcRes_const
143 << " adcRes_const= " << adcRes_const
144 << " calTdcRes_charge_flag= " << m_calTdcRes_charge_flag
145 << " charge2Time_flag= " << m_charge2Time_flag
146 << " calAdcRes_charge_flag= " << m_calAdcRes_charge_flag << endl;
147}

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

◆ initial() [2/3]

void BesTofDigitizerEcV4::initial ( )

◆ initial() [3/3]

void BesTofDigitizerEcV4::initial ( )

◆ underStrip() [1/3]

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

Definition at line 368 of file BesTofDigitizerEcV4.cc.

368 {
369 bool flag = 0;
370 int strip = -1;
371 double stripWidth = m_param.strip_z + m_param.strip_gap; // Strip spread: (24+3)mm
372 int nstrip = m_param.nstrip;
373 // the offset between strip coordinate and gas SD: 0.5
374 double length = locZ + stripWidth * nstrip / 2 - 0.5;
375 if ( length < stripWidth * nstrip )
376 {
377 for ( int i = 0; i < nstrip; i++ )
378 {
379 if ( length > i * stripWidth && length < ( i + 1 ) * stripWidth )
380 {
381 strip = i;
382 if ( length > i * stripWidth + m_param.strip_gap / 2 &&
383 length < ( i + 1 ) * stripWidth - m_param.strip_gap / 2 &&
384 locX > -m_param.strip_x[strip] / 2 && locX < m_param.strip_x[strip] / 2 )
385 flag = 1;
386 break;
387 }
388 }
389 }
390
391 return flag;
392}

Referenced by Digitize().

◆ underStrip() [2/3]

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

◆ underStrip() [3/3]

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

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