BOSS 7.0.9
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 659 of file BesTofDigitizerEcV4.cc.

Member Function Documentation

◆ avalanche()

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().

◆ calFirstHit()

void BesTofDigitizerEcV4::StripStruct::calFirstHit ( )

Definition at line 412 of file BesTofDigitizerEcV4.cc.

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

Referenced by BesTofDigitizerEcV4::Digitize().

◆ calNextN()

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}
TTree * sigma
EvtComplex exp(const EvtComplex &c)

◆ calSigma()

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}

◆ initial()

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}

◆ multiply()

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}

◆ print()

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}

◆ setPar()

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().

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: