BOSS 7.0.2
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 V, double threshold, bool saturationFlag=true)
 
double getAlpha (double E)
 
double getEta (double E)
 
double getV (double E)
 
 StripStruct ()
 
void initial ()
 
void print ()
 
void avalanche ()
 
void calFirstHit ()
 
long int calNextN (int num)
 
long int multiply (double rdm)
 
double calSigma ()
 
void setPar (double V, double threshold, bool saturationFlag=true)
 
double getAlpha (double E)
 
double getEta (double E)
 
double getV (double E)
 

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 657 of file BesTofDigitizerEcV4.cc.

◆ StripStruct() [2/2]

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

Member Function Documentation

◆ avalanche() [1/2]

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

Definition at line 458 of file BesTofDigitizerEcV4.cc.

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

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 512 of file BesTofDigitizerEcV4.cc.

513{
514 if(num<150)
515 {
516 long int nextN = 0;
517 double rdm;
518 for(int i=0; i<num; i++)
519 {
520 rdm = G4UniformRand();
521 nextN += multiply(rdm);
522 }
523 return nextN;
524 }
525 else
526 {
527 double nbar = exp((alpha-eta)*m_param.stepWidth);
528 double sigma = calSigma();
529 double mean = num*nbar;
530 double resolution = G4RandGauss::shoot(0,(sqrt(num)*sigma));
531 long int nextN = mean+resolution;
532 return nextN;
533 }
534}
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 552 of file BesTofDigitizerEcV4.cc.

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

◆ calSigma() [2/2]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

◆ getAlpha() [1/2]

double BesTofDigitizerEcV4::StripStruct::getAlpha ( double  E)

Definition at line 727 of file BesTofDigitizerEcV4.cc.

728{
729 //electric field: kV/cm; alpha: mm-1
730 //kV/cm
731 double e[22] =
732 {
733 65,
734 70 ,
735 75 ,
736 80 ,
737 85 ,
738 90 ,
739 95 ,
740 100 ,
741 102 ,
742 104 ,
743 106 ,
744 108 ,
745 110 ,
746 112 ,
747 114 ,
748 116 ,
749 118 ,
750 120 ,
751 125 ,
752 130 ,
753 135 ,
754 140
755 };
756
757 //mm-1
758 double alpha[22]=
759 {
760 383.5/10 ,
761 471 /10 ,
762 564.5/10 ,
763 663.6/10 ,
764 777.1/10 ,
765 877 /10 ,
766 990.8/10 ,
767 1106 /10 ,
768 1154 /10 ,
769 1199 /10 ,
770 1253 /10 ,
771 1296 /10 ,
772 1344 /10 ,
773 1396 /10 ,
774 1448 /10 ,
775 1502 /10 ,
776 1545 /10 ,
777 1597 /10 ,
778 1726 /10 ,
779 1858 /10 ,
780 1992 /10 ,
781 2124 /10 ,
782 };
783
784 TSpline3* sp_alpha = new TSpline3("sp_alpha", e, alpha, 22);
785 double alphaVal = sp_alpha->Eval(E);
786 return alphaVal;
787}

◆ getAlpha() [2/2]

double BesTofDigitizerEcV4::StripStruct::getAlpha ( double  E)

◆ getEta() [1/2]

double BesTofDigitizerEcV4::StripStruct::getEta ( double  E)

Definition at line 789 of file BesTofDigitizerEcV4.cc.

790{
791 //electric field: kV/cm; eta: mm-1
792 //kV/cm
793 double e[22] =
794 {
795 65,
796 70 ,
797 75 ,
798 80 ,
799 85 ,
800 90 ,
801 95 ,
802 100 ,
803 102 ,
804 104 ,
805 106 ,
806 108 ,
807 110 ,
808 112 ,
809 114 ,
810 116 ,
811 118 ,
812 120 ,
813 125 ,
814 130 ,
815 135 ,
816 140
817 };
818
819 //mm-1
820 double eta[22]=
821 {
822 132.6/10 ,
823 117.2/10 ,
824 102.6/10 ,
825 88.26/10 ,
826 79.81/10 ,
827 74.0 /10 ,
828 66.7 /10 ,
829 62.7 /10 ,
830 61.4 /10 ,
831 57.4 /10 ,
832 55.45/10 ,
833 54.35/10 ,
834 52.48/10 ,
835 51.3 /10 ,
836 50.1 /10 ,
837 48.3 /10 ,
838 48.28/10 ,
839 46.00/10 ,
840 44.08/10 ,
841 41.67/10 ,
842 39.97/10 ,
843 38.04/10
844 };
845
846 TSpline3* sp_eta = new TSpline3("sp_eta", e, eta, 22);
847 double etaVal = sp_eta->Eval(E);
848 return etaVal;
849}

◆ getEta() [2/2]

double BesTofDigitizerEcV4::StripStruct::getEta ( double  E)

◆ getV() [1/2]

double BesTofDigitizerEcV4::StripStruct::getV ( double  E)

Definition at line 851 of file BesTofDigitizerEcV4.cc.

852{
853 //electric field: kV/cm; velocity: mm/ns
854 //kV/cm
855 double e[22] =
856 {
857 65,
858 70 ,
859 75 ,
860 80 ,
861 85 ,
862 90 ,
863 95 ,
864 100 ,
865 102 ,
866 104 ,
867 106 ,
868 108 ,
869 110 ,
870 112 ,
871 114 ,
872 116 ,
873 118 ,
874 120 ,
875 125 ,
876 130 ,
877 135 ,
878 140
879 };
880
881 //mm/ns
882 double v[22]=
883 {
884 130.2/1000 ,
885 138.5/1000 ,
886 146.7/1000 ,
887 155.0/1000 ,
888 163.3/1000 ,
889 171.4/1000 ,
890 179.7/1000 ,
891 187.7/1000 ,
892 191.2/1000 ,
893 194.5/1000 ,
894 197.9/1000 ,
895 201.2/1000 ,
896 204.5/1000 ,
897 207.6/1000 ,
898 210.9/1000 ,
899 214.4/1000 ,
900 217.5/1000 ,
901 220.9/1000 ,
902 228.8/1000 ,
903 237.0/1000 ,
904 244.7/1000 ,
905 252.9/1000
906 };
907
908 TSpline3* sp_v = new TSpline3("sp_v", e, v, 22);
909 double vVal = sp_v->Eval(E);
910 return vVal;
911}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35

◆ getV() [2/2]

double BesTofDigitizerEcV4::StripStruct::getV ( double  E)

◆ initial() [1/2]

void BesTofDigitizerEcV4::StripStruct::initial ( )

Definition at line 662 of file BesTofDigitizerEcV4.cc.

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

◆ initial() [2/2]

void BesTofDigitizerEcV4::StripStruct::initial ( )

◆ multiply() [1/2]

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

Definition at line 536 of file BesTofDigitizerEcV4.cc.

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

◆ multiply() [2/2]

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

◆ print() [1/2]

void BesTofDigitizerEcV4::StripStruct::print ( )

Definition at line 963 of file BesTofDigitizerEcV4.cc.

964{
965 cout<<"Strip information: "<<endl;
966 cout<<" strip= "<<strip
967 <<" trkIndex= "<<trkIndex
968 <<" tStart= "<<tStart
969 <<" tPropagate_sphi= "<<tPropagate_sphi
970 <<" tPropagate_xphi= "<<tPropagate_xphi
971 <<" tThreshold "<<tThreshold
972 <<" charge= "<<charge
973 <<" E= "<<E
974 <<" alpha= "<<alpha
975 <<" eta= "<<eta
976 <<" threshold= "<<threshold
977 <<" v_drift= "<<v_drift
978 <<endl;
979}

◆ print() [2/2]

void BesTofDigitizerEcV4::StripStruct::print ( )

◆ setPar() [1/2]

void BesTofDigitizerEcV4::StripStruct::setPar ( double  V,
double  threshold,
bool  saturationFlag = true 
)

Definition at line 683 of file BesTofDigitizerEcV4.cc.

684{
685 threshold = threshold_n;
686 E = E_V/1000*2/6/(m_param.gapWidth/10); //kV/cm
687 alpha = getAlpha(E); //mm^-1
688 eta = getEta(E); //mm^-1
689 v_drift = getV(E); // mm/ns
690
691 saturationFlag = saturationFlag_n;
692}

Referenced by BesTofDigitizerEcV4::Digitize().

◆ setPar() [2/2]

void BesTofDigitizerEcV4::StripStruct::setPar ( double  V,
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: