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

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

Definition at line 107 of file BesTofDigitizerEcV4.hh.

Constructor & Destructor Documentation

◆ StripStruct()

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

Definition at line 660 of file BesTofDigitizerEcV4.cc.

Member Function Documentation

◆ avalanche()

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

Definition at line 461 of file BesTofDigitizerEcV4.cc.

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

Referenced by BesTofDigitizerEcV4::Digitize().

◆ calFirstHit()

void BesTofDigitizerEcV4::StripStruct::calFirstHit ( )

Definition at line 413 of file BesTofDigitizerEcV4.cc.

414{
415 for(unsigned int i=0; i<hitStructCol.size(); i++)
416 {
417 if(hitStructCol[i].glbTime<tStart)
418 {
419 tStart = hitStructCol[i].glbTime;
420 trkIndex = hitStructCol[i].trkIndex;
421 hitStructCol[i].calTPropagate();
422 tPropagate_sphi = hitStructCol[i].tPropagate_sphi;
423 tPropagate_xphi = hitStructCol[i].tPropagate_xphi;
424 }
425 }
426}

Referenced by BesTofDigitizerEcV4::Digitize().

◆ calNextN()

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

Definition at line 515 of file BesTofDigitizerEcV4.cc.

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

◆ calSigma()

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

Definition at line 555 of file BesTofDigitizerEcV4.cc.

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

◆ initial()

void BesTofDigitizerEcV4::StripStruct::initial ( )

Definition at line 665 of file BesTofDigitizerEcV4.cc.

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

◆ multiply()

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

Definition at line 539 of file BesTofDigitizerEcV4.cc.

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

◆ print()

void BesTofDigitizerEcV4::StripStruct::print ( )

Definition at line 981 of file BesTofDigitizerEcV4.cc.

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

◆ setPar()

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

Definition at line 686 of file BesTofDigitizerEcV4.cc.

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

Referenced by BesTofDigitizerEcV4::Digitize().

Member Data Documentation

◆ alpha

double BesTofDigitizerEcV4::StripStruct::alpha

Definition at line 133 of file BesTofDigitizerEcV4.hh.

◆ charge

double BesTofDigitizerEcV4::StripStruct::charge

Definition at line 129 of file BesTofDigitizerEcV4.hh.

Referenced by BesTofDigitizerEcV4::Digitize().

◆ E

double BesTofDigitizerEcV4::StripStruct::E

Definition at line 132 of file BesTofDigitizerEcV4.hh.

◆ eta

double BesTofDigitizerEcV4::StripStruct::eta

Definition at line 134 of file BesTofDigitizerEcV4.hh.

◆ hitStructCol

vector<HitStruct> BesTofDigitizerEcV4::StripStruct::hitStructCol

Definition at line 120 of file BesTofDigitizerEcV4.hh.

Referenced by calFirstHit(), and BesTofDigitizerEcV4::Digitize().

◆ m_param

Param BesTofDigitizerEcV4::StripStruct::m_param

Definition at line 119 of file BesTofDigitizerEcV4.hh.

Referenced by BesTofDigitizerEcV4::Digitize().

◆ saturationFlag

bool BesTofDigitizerEcV4::StripStruct::saturationFlag

Definition at line 137 of file BesTofDigitizerEcV4.hh.

◆ strip

int BesTofDigitizerEcV4::StripStruct::strip

Definition at line 123 of file BesTofDigitizerEcV4.hh.

Referenced by BesTofDigitizerEcV4::Digitize().

◆ threshold

long int BesTofDigitizerEcV4::StripStruct::threshold

Definition at line 135 of file BesTofDigitizerEcV4.hh.

◆ tPropagate_sphi

double BesTofDigitizerEcV4::StripStruct::tPropagate_sphi

Definition at line 126 of file BesTofDigitizerEcV4.hh.

Referenced by calFirstHit(), and BesTofDigitizerEcV4::Digitize().

◆ tPropagate_xphi

double BesTofDigitizerEcV4::StripStruct::tPropagate_xphi

Definition at line 127 of file BesTofDigitizerEcV4.hh.

Referenced by calFirstHit(), and BesTofDigitizerEcV4::Digitize().

◆ trkIndex

int BesTofDigitizerEcV4::StripStruct::trkIndex

Definition at line 124 of file BesTofDigitizerEcV4.hh.

Referenced by calFirstHit(), and BesTofDigitizerEcV4::Digitize().

◆ tStart

double BesTofDigitizerEcV4::StripStruct::tStart

Definition at line 125 of file BesTofDigitizerEcV4.hh.

Referenced by calFirstHit(), and BesTofDigitizerEcV4::Digitize().

◆ tThreshold

double BesTofDigitizerEcV4::StripStruct::tThreshold

Definition at line 128 of file BesTofDigitizerEcV4.hh.

Referenced by BesTofDigitizerEcV4::Digitize().

◆ v_drift

double BesTofDigitizerEcV4::StripStruct::v_drift

Definition at line 136 of file BesTofDigitizerEcV4.hh.


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