BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesTofDigitizerEcV4::StripStruct Struct Reference

#include <BesTofDigitizerEcV4.hh>

Public Member Functions

 StripStruct ()
void initial ()
void print ()
void avalanche ()
void calFirstHit ()
long int calNextN (int num)
long int multiply (double rdm)
double calSigma ()
void setPar (double alpha_n, double eta_n, double drift_n, double threshold, bool saturationFlag=true)
 StripStruct ()
void initial ()
void print ()
void avalanche ()
void calFirstHit ()
long int calNextN (int num)
long int multiply (double rdm)
double calSigma ()
void setPar (double alpha_n, double eta_n, double drift_n, double threshold, bool saturationFlag=true)
 StripStruct ()
void initial ()
void print ()
void avalanche ()
void calFirstHit ()
long int calNextN (int num)
long int multiply (double rdm)
double calSigma ()
void setPar (double alpha_n, double eta_n, double drift_n, double threshold, bool saturationFlag=true)

Public Attributes

Param m_param
vector< HitStructhitStructCol
int strip
int trkIndex
double tStart
double tPropagate_sphi
double tPropagate_xphi
double tThreshold
double charge
double E
double alpha
double eta
long int threshold
double v_drift
bool saturationFlag

Detailed Description

Constructor & Destructor Documentation

◆ StripStruct() [1/3]

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

Definition at line 602 of file BesTofDigitizerEcV4.cc.

◆ StripStruct() [2/3]

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

◆ StripStruct() [3/3]

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

Member Function Documentation

◆ avalanche() [1/3]

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

Definition at line 439 of file BesTofDigitizerEcV4.cc.

439 {
440 // process each hit
441 for ( unsigned int i = 0; i < hitStructCol.size(); i++ )
442 {
443 hitStructCol[i].ava_pos.clear();
444 hitStructCol[i].ava_num.clear();
445
446 hitStructCol[i].ava_pos[0] = hitStructCol[i].calAvaLength();
447 hitStructCol[i].ava_num[0] = hitStructCol[i].ions;
448 // cout<<"i= "<<i<<" gap= "<<hitStructCol[i].gap<<" initial pos=
449 // "<<hitStructCol[i].ava_pos[0]<<endl;
450 for ( int j = 1; j < m_param.nstep; j++ )
451 {
452 hitStructCol[i].ava_pos[j] = hitStructCol[i].ava_pos[j - 1] + m_param.stepWidth;
453 if ( saturationFlag == true && hitStructCol[i].ava_num[j - 1] >
454 1.5e+07 ) // saturation e+07~e+08, ~2pC, Reather limit
455 { hitStructCol[i].ava_num[j] = hitStructCol[i].ava_num[j - 1]; }
456 else { hitStructCol[i].ava_num[j] = calNextN( hitStructCol[i].ava_num[j - 1] ); }
457 if ( hitStructCol[i].ava_pos[j] > m_param.gapWidth ) break;
458 }
459 }
460
461 // decide threshold and charge
462 bool over_threshold = false;
463 long int sum = 0;
464 for ( int i = 0; i < m_param.nstep; i++ )
465 {
466 for ( unsigned int j = 0; j < hitStructCol.size(); j++ )
467 {
468 if ( i < hitStructCol[j].ava_pos.size() &&
469 hitStructCol[j].ava_pos[i] < m_param.gapWidth )
470 { sum += hitStructCol[j].ava_num[i]; }
471 }
472 // cout<<"sum= "<<sum<<" avaSize= "<<hitStructCol.size()<<endl;
473
474 if ( over_threshold == false )
475 {
476 if ( sum > threshold )
477 {
478 over_threshold = true;
479 tThreshold = ( m_param.gapWidth ) / ( m_param.nstep ) / v_drift * ( i + 1 );
480 }
481 }
482 }
483
484 charge = sum * ( m_param.E_weight ) * ( v_drift ) * ( m_param.eCharge ) *
485 ( m_param.gapWidth ) / ( m_param.nstep ) / v_drift;
486}

Referenced by BesTofDigitizerEcV4::Digitize().

◆ avalanche() [2/3]

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

◆ avalanche() [3/3]

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

◆ calFirstHit() [1/3]

void BesTofDigitizerEcV4::StripStruct::calFirstHit ( )

◆ calFirstHit() [2/3]

void BesTofDigitizerEcV4::StripStruct::calFirstHit ( )

◆ calFirstHit() [3/3]

void BesTofDigitizerEcV4::StripStruct::calFirstHit ( )

◆ calNextN() [1/3]

long int BesTofDigitizerEcV4::StripStruct::calNextN ( int num)

Definition at line 488 of file BesTofDigitizerEcV4.cc.

488 {
489 if ( num < 150 )
490 {
491 long int nextN = 0;
492 double rdm;
493 for ( int i = 0; i < num; i++ )
494 {
495 rdm = G4UniformRand();
496 nextN += multiply( rdm );
497 }
498 return nextN;
499 }
500 else
501 {
502 double nbar = exp( ( alpha - eta ) * m_param.stepWidth );
503 double sigma = calSigma();
504 double mean = num * nbar;
505 double resolution = G4RandGauss::shoot( 0, ( sqrt( num ) * sigma ) );
506 long int nextN = mean + resolution;
507 return nextN;
508 }
509}
EvtComplex exp(const EvtComplex &c)

Referenced by avalanche().

◆ calNextN() [2/3]

long int BesTofDigitizerEcV4::StripStruct::calNextN ( int num)

◆ calNextN() [3/3]

long int BesTofDigitizerEcV4::StripStruct::calNextN ( int num)

◆ calSigma() [1/3]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

Definition at line 524 of file BesTofDigitizerEcV4.cc.

524 {
525 double nbar = exp( ( alpha - eta ) * m_param.stepWidth );
526 double k = eta / alpha;
527 double sigma = sqrt( ( 1 + k ) / ( 1 - k ) * nbar * ( nbar - 1 ) );
528 return sigma;
529}

Referenced by calNextN().

◆ calSigma() [2/3]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

◆ calSigma() [3/3]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

◆ initial() [1/3]

void BesTofDigitizerEcV4::StripStruct::initial ( )

Definition at line 604 of file BesTofDigitizerEcV4.cc.

604 {
605 // properties to get
606 strip = -999.0;
607 trkIndex = -999.0;
608 tStart = 99999.0;
609 tPropagate_sphi = -999.0;
610 tPropagate_xphi = -999.0;
611 tThreshold = -999.0;
612 charge = -999.0;
613
614 // parameters to tune
615 E = 106;
616 alpha = 144800. / 1000; //-999.0; /mm^-1
617 eta = 5013. / 1000; //-999.0; /mm^-1
618 threshold = 1.5e+08; // Correspond to induced charge of 15 fC
619 v_drift = 210.9e-3; // mm/ns
620
621 hitStructCol.clear();
622}

◆ initial() [2/3]

void BesTofDigitizerEcV4::StripStruct::initial ( )

◆ initial() [3/3]

void BesTofDigitizerEcV4::StripStruct::initial ( )

◆ multiply() [1/3]

long int BesTofDigitizerEcV4::StripStruct::multiply ( double rdm)

Definition at line 511 of file BesTofDigitizerEcV4.cc.

511 {
512 double nbar = exp( ( alpha - eta ) * m_param.stepWidth );
513 double k = eta / alpha;
514 double rdm_border = k * ( nbar - 1 ) / ( nbar - k );
515 if ( rdm < rdm_border ) { return 0; }
516 else
517 {
518 long int number = 1. + 1. / log( ( nbar - 1. ) / ( nbar - k ) ) *
519 log( ( nbar - k ) * ( rdm - 1 ) / ( k - 1 ) / nbar );
520 return number;
521 }
522}

Referenced by calNextN().

◆ multiply() [2/3]

long int BesTofDigitizerEcV4::StripStruct::multiply ( double rdm)

◆ multiply() [3/3]

long int BesTofDigitizerEcV4::StripStruct::multiply ( double rdm)

◆ print() [1/3]

void BesTofDigitizerEcV4::StripStruct::print ( )

Definition at line 756 of file BesTofDigitizerEcV4.cc.

756 {
757 cout << "Strip information: " << endl;
758 cout << " strip= " << strip << " trkIndex= " << trkIndex << " tStart= " << tStart
759 << " tPropagate_sphi= " << tPropagate_sphi << " tPropagate_xphi= " << tPropagate_xphi
760 << " tThreshold " << tThreshold << " charge= " << charge << " alpha= " << alpha
761 << " eta= " << eta << " threshold= " << threshold << " v_drift= " << v_drift << endl;
762}

◆ print() [2/3]

void BesTofDigitizerEcV4::StripStruct::print ( )

◆ print() [3/3]

void BesTofDigitizerEcV4::StripStruct::print ( )

◆ setPar() [1/3]

void BesTofDigitizerEcV4::StripStruct::setPar ( double alpha_n,
double eta_n,
double drift_n,
double threshold,
bool saturationFlag = true )

Definition at line 624 of file BesTofDigitizerEcV4.cc.

625 {
626 alpha = alpha_n;
627 eta = eta_n;
628 v_drift = drift_n;
629 threshold = threshold_n;
630
631 saturationFlag = saturationFlag_n;
632}

Referenced by BesTofDigitizerEcV4::Digitize().

◆ setPar() [2/3]

void BesTofDigitizerEcV4::StripStruct::setPar ( double alpha_n,
double eta_n,
double drift_n,
double threshold,
bool saturationFlag = true )

◆ setPar() [3/3]

void BesTofDigitizerEcV4::StripStruct::setPar ( double alpha_n,
double eta_n,
double drift_n,
double threshold,
bool saturationFlag = true )

Member Data Documentation

◆ alpha

double BesTofDigitizerEcV4::StripStruct::alpha

◆ charge

double BesTofDigitizerEcV4::StripStruct::charge

◆ E

double BesTofDigitizerEcV4::StripStruct::E

◆ eta

double BesTofDigitizerEcV4::StripStruct::eta

◆ hitStructCol

vector< HitStruct > BesTofDigitizerEcV4::StripStruct::hitStructCol

◆ m_param

◆ saturationFlag

bool BesTofDigitizerEcV4::StripStruct::saturationFlag

◆ strip

int BesTofDigitizerEcV4::StripStruct::strip

◆ threshold

long int BesTofDigitizerEcV4::StripStruct::threshold

◆ tPropagate_sphi

double BesTofDigitizerEcV4::StripStruct::tPropagate_sphi

◆ tPropagate_xphi

double BesTofDigitizerEcV4::StripStruct::tPropagate_xphi

◆ trkIndex

int BesTofDigitizerEcV4::StripStruct::trkIndex

◆ tStart

double BesTofDigitizerEcV4::StripStruct::tStart

◆ tThreshold

double BesTofDigitizerEcV4::StripStruct::tThreshold

◆ v_drift

double BesTofDigitizerEcV4::StripStruct::v_drift

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