BOSS 7.0.3
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)
 

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

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

Definition at line 659 of file BesTofDigitizerEcV4.cc.

◆ StripStruct() [2/2]

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

Member Function Documentation

◆ avalanche() [1/2]

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

Definition at line 460 of file BesTofDigitizerEcV4.cc.

461{
462 //process each hit
463 for(unsigned int i=0; i<hitStructCol.size(); i++)
464 {
465 hitStructCol[i].ava_pos.clear();
466 hitStructCol[i].ava_num.clear();
467
468 hitStructCol[i].ava_pos[0] = hitStructCol[i].calAvaLength();
469 hitStructCol[i].ava_num[0] = hitStructCol[i].ions;
470 //cout<<"i= "<<i<<" gap= "<<hitStructCol[i].gap<<" initial pos= "<<hitStructCol[i].ava_pos[0]<<endl;
471 for(int j=1; j<m_param.nstep; j++)
472 {
473 hitStructCol[i].ava_pos[j] = hitStructCol[i].ava_pos[j-1] + m_param.stepWidth;
474 if(saturationFlag==true && hitStructCol[i].ava_num[j-1]>1.5e+07) //saturation e+07~e+08, ~2pC, Reather limit
475 {
476 hitStructCol[i].ava_num[j] = hitStructCol[i].ava_num[j-1];
477 }
478 else
479 {
480 hitStructCol[i].ava_num[j] = calNextN(hitStructCol[i].ava_num[j-1]);
481 }
482 if(hitStructCol[i].ava_pos[j]>m_param.gapWidth) break;
483 }
484 }
485
486 //decide threshold and charge
487 bool over_threshold = false;
488 long int sum = 0;
489 for(int i=0; i<m_param.nstep; i++)
490 {
491 for(unsigned int j=0; j<hitStructCol.size(); j++)
492 {
493 if(i<hitStructCol[j].ava_pos.size() && hitStructCol[j].ava_pos[i]<m_param.gapWidth)
494 {
495 sum += hitStructCol[j].ava_num[i];
496 }
497 }
498 //cout<<"sum= "<<sum<<" avaSize= "<<hitStructCol.size()<<endl;
499
500 if(over_threshold==false)
501 {
502 if(sum>threshold)
503 {
504 over_threshold = true;
506 }
507 }
508 }
509
511}

Referenced by BesTofDigitizerEcV4::Digitize().

◆ avalanche() [2/2]

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

◆ calFirstHit() [1/2]

void BesTofDigitizerEcV4::StripStruct::calFirstHit ( )

◆ calFirstHit() [2/2]

void BesTofDigitizerEcV4::StripStruct::calFirstHit ( )

◆ calNextN() [1/2]

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

Definition at line 514 of file BesTofDigitizerEcV4.cc.

515{
516 if(num<150)
517 {
518 long int nextN = 0;
519 double rdm;
520 for(int i=0; i<num; i++)
521 {
522 rdm = G4UniformRand();
523 nextN += multiply(rdm);
524 }
525 return nextN;
526 }
527 else
528 {
529 double nbar = exp((alpha-eta)*m_param.stepWidth);
530 double sigma = calSigma();
531 double mean = num*nbar;
532 double resolution = G4RandGauss::shoot(0,(sqrt(num)*sigma));
533 long int nextN = mean+resolution;
534 return nextN;
535 }
536}
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252

◆ calNextN() [2/2]

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

◆ calSigma() [1/2]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

Definition at line 554 of file BesTofDigitizerEcV4.cc.

555{
556 double nbar = exp((alpha-eta)*m_param.stepWidth);
557 double k = eta/alpha;
558 double sigma = sqrt((1+k)/(1-k)*nbar*(nbar-1));
559 return sigma;
560}

◆ calSigma() [2/2]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

◆ initial() [1/2]

void BesTofDigitizerEcV4::StripStruct::initial ( )

Definition at line 664 of file BesTofDigitizerEcV4.cc.

665{
666 //properties to get
667 strip = -999.0;
668 trkIndex = -999.0;
669 tStart = 99999.0;
670 tPropagate_sphi = -999.0;
671 tPropagate_xphi = -999.0;
672 tThreshold = -999.0;
673 charge = -999.0;
674
675 //parameters to tune
676 E = 106;
677 alpha = 144800./1000; //-999.0; /mm^-1
678 eta = 5013./1000; //-999.0; /mm^-1
679 threshold = 1.5e+08; //Correspond to induced charge of 15 fC
680 v_drift = 210.9e-3; // mm/ns
681
682 hitStructCol.clear();
683}

◆ initial() [2/2]

void BesTofDigitizerEcV4::StripStruct::initial ( )

◆ multiply() [1/2]

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

Definition at line 538 of file BesTofDigitizerEcV4.cc.

539{
540 double nbar = exp((alpha-eta)*m_param.stepWidth);
541 double k = eta/alpha;
542 double rdm_border = k*(nbar-1)/(nbar-k);
543 if(rdm<rdm_border)
544 {
545 return 0;
546 }
547 else
548 {
549 long int number = 1.+1./log((nbar-1.)/(nbar-k))*log((nbar-k)*(rdm-1)/(k-1)/nbar);
550 return number;
551 }
552}

◆ multiply() [2/2]

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

◆ print() [1/2]

void BesTofDigitizerEcV4::StripStruct::print ( )

Definition at line 980 of file BesTofDigitizerEcV4.cc.

981{
982 cout<<"Strip information: "<<endl;
983 cout<<" strip= "<<strip
984 <<" trkIndex= "<<trkIndex
985 <<" tStart= "<<tStart
986 <<" tPropagate_sphi= "<<tPropagate_sphi
987 <<" tPropagate_xphi= "<<tPropagate_xphi
988 <<" tThreshold "<<tThreshold
989 <<" charge= "<<charge
990 <<" alpha= "<<alpha
991 <<" eta= "<<eta
992 <<" threshold= "<<threshold
993 <<" v_drift= "<<v_drift
994 <<endl;
995}

◆ print() [2/2]

void BesTofDigitizerEcV4::StripStruct::print ( )

◆ setPar() [1/2]

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

Definition at line 685 of file BesTofDigitizerEcV4.cc.

686{
687 alpha = alpha_n;
688 eta = eta_n;
689 v_drift = drift_n;
690 threshold = threshold_n;
691
692 saturationFlag = saturationFlag_n;
693}

Referenced by BesTofDigitizerEcV4::Digitize().

◆ setPar() [2/2]

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

Param BesTofDigitizerEcV4::StripStruct::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: