BOSS 7.0.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 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 612 of file BesTofDigitizerEcV4.cc.

◆ StripStruct() [2/2]

BesTofDigitizerEcV4::StripStruct::StripStruct ( )

Member Function Documentation

◆ avalanche() [1/2]

void BesTofDigitizerEcV4::StripStruct::avalanche ( )

Definition at line 419 of file BesTofDigitizerEcV4.cc.

420{
421 //process each hit
422 for(unsigned int i=0; i<hitStructCol.size(); i++)
423 {
424 hitStructCol[i].ava_pos.clear();
425 hitStructCol[i].ava_num.clear();
426
427 hitStructCol[i].ava_pos[0] = hitStructCol[i].calAvaLength();
428 hitStructCol[i].ava_num[0] = hitStructCol[i].ions;
429 //cout<<"i= "<<i<<" gap= "<<hitStructCol[i].gap<<" initial pos= "<<hitStructCol[i].ava_pos[0]<<endl;
430 for(int j=1; j<m_param.nstep; j++)
431 {
432 hitStructCol[i].ava_pos[j] = hitStructCol[i].ava_pos[j-1] + m_param.stepWidth;
433 if(saturationFlag==true && hitStructCol[i].ava_num[j-1]>1.5e+07) //saturation e+07~e+08, ~2pC, Reather limit
434 {
435 hitStructCol[i].ava_num[j] = hitStructCol[i].ava_num[j-1];
436 }
437 else
438 {
439 hitStructCol[i].ava_num[j] = calNextN(hitStructCol[i].ava_num[j-1]);
440 }
441 if(hitStructCol[i].ava_pos[j]>m_param.gapWidth) break;
442 }
443 }
444
445 //decide threshold and charge
446 bool over_threshold = false;
447 long int sum = 0;
448 for(int i=0; i<m_param.nstep; i++)
449 {
450 for(unsigned int j=0; j<hitStructCol.size(); j++)
451 {
452 if(i<hitStructCol[j].ava_pos.size() && hitStructCol[j].ava_pos[i]<m_param.gapWidth)
453 {
454 sum += hitStructCol[j].ava_num[i];
455 }
456 }
457 //cout<<"sum= "<<sum<<" avaSize= "<<hitStructCol.size()<<endl;
458
459 if(over_threshold==false)
460 {
461 if(sum>threshold)
462 {
463 over_threshold = true;
465 }
466 }
467 }
468
470}

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

474{
475 if(num<150)
476 {
477 long int nextN = 0;
478 double rdm;
479 for(int i=0; i<num; i++)
480 {
481 rdm = G4UniformRand();
482 nextN += multiply(rdm);
483 }
484 return nextN;
485 }
486 else
487 {
488 double nbar = exp((alpha-eta)*m_param.stepWidth);
489 double sigma = calSigma();
490 double mean = num*nbar;
491 double resolution = G4RandGauss::shoot(0,(sqrt(num)*sigma));
492 long int nextN = mean+resolution;
493 return nextN;
494 }
495}
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
int num[96]
Definition: ranlxd.c:373

◆ calNextN() [2/2]

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

◆ calSigma() [1/2]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

Definition at line 513 of file BesTofDigitizerEcV4.cc.

514{
515 double nbar = exp((alpha-eta)*m_param.stepWidth);
516 double k = eta/alpha;
517 double sigma = sqrt((1+k)/(1-k)*nbar*(nbar-1));
518 return sigma;
519}

◆ calSigma() [2/2]

double BesTofDigitizerEcV4::StripStruct::calSigma ( )

◆ getAlpha() [1/2]

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

Definition at line 680 of file BesTofDigitizerEcV4.cc.

681{
682 //electric field: kV/cm; alpha: mm-1
683 //kV/cm
684 double e[22] =
685 {
686 65,
687 70 ,
688 75 ,
689 80 ,
690 85 ,
691 90 ,
692 95 ,
693 100 ,
694 102 ,
695 104 ,
696 106 ,
697 108 ,
698 110 ,
699 112 ,
700 114 ,
701 116 ,
702 118 ,
703 120 ,
704 125 ,
705 130 ,
706 135 ,
707 140
708 };
709
710 //mm-1
711 double alpha[22]=
712 {
713 383.5/10 ,
714 471 /10 ,
715 564.5/10 ,
716 663.6/10 ,
717 777.1/10 ,
718 877 /10 ,
719 990.8/10 ,
720 1106 /10 ,
721 1154 /10 ,
722 1199 /10 ,
723 1253 /10 ,
724 1296 /10 ,
725 1344 /10 ,
726 1396 /10 ,
727 1448 /10 ,
728 1502 /10 ,
729 1545 /10 ,
730 1597 /10 ,
731 1726 /10 ,
732 1858 /10 ,
733 1992 /10 ,
734 2124 /10 ,
735 };
736
737 TSpline3* sp_alpha = new TSpline3("sp_alpha", e, alpha, 22);
738 double alphaVal = sp_alpha->Eval(E);
739 return alphaVal;
740}

◆ getAlpha() [2/2]

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

◆ getEta() [1/2]

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

Definition at line 742 of file BesTofDigitizerEcV4.cc.

743{
744 //electric field: kV/cm; eta: mm-1
745 //kV/cm
746 double e[22] =
747 {
748 65,
749 70 ,
750 75 ,
751 80 ,
752 85 ,
753 90 ,
754 95 ,
755 100 ,
756 102 ,
757 104 ,
758 106 ,
759 108 ,
760 110 ,
761 112 ,
762 114 ,
763 116 ,
764 118 ,
765 120 ,
766 125 ,
767 130 ,
768 135 ,
769 140
770 };
771
772 //mm-1
773 double eta[22]=
774 {
775 132.6/10 ,
776 117.2/10 ,
777 102.6/10 ,
778 88.26/10 ,
779 79.81/10 ,
780 74.0 /10 ,
781 66.7 /10 ,
782 62.7 /10 ,
783 61.4 /10 ,
784 57.4 /10 ,
785 55.45/10 ,
786 54.35/10 ,
787 52.48/10 ,
788 51.3 /10 ,
789 50.1 /10 ,
790 48.3 /10 ,
791 48.28/10 ,
792 46.00/10 ,
793 44.08/10 ,
794 41.67/10 ,
795 39.97/10 ,
796 38.04/10
797 };
798
799 TSpline3* sp_eta = new TSpline3("sp_eta", e, eta, 22);
800 double etaVal = sp_eta->Eval(E);
801 return etaVal;
802}

◆ getEta() [2/2]

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

◆ getV() [1/2]

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

Definition at line 804 of file BesTofDigitizerEcV4.cc.

805{
806 //electric field: kV/cm; velocity: mm/ns
807 //kV/cm
808 double e[22] =
809 {
810 65,
811 70 ,
812 75 ,
813 80 ,
814 85 ,
815 90 ,
816 95 ,
817 100 ,
818 102 ,
819 104 ,
820 106 ,
821 108 ,
822 110 ,
823 112 ,
824 114 ,
825 116 ,
826 118 ,
827 120 ,
828 125 ,
829 130 ,
830 135 ,
831 140
832 };
833
834 //mm/ns
835 double v[22]=
836 {
837 130.2/1000 ,
838 138.5/1000 ,
839 146.7/1000 ,
840 155.0/1000 ,
841 163.3/1000 ,
842 171.4/1000 ,
843 179.7/1000 ,
844 187.7/1000 ,
845 191.2/1000 ,
846 194.5/1000 ,
847 197.9/1000 ,
848 201.2/1000 ,
849 204.5/1000 ,
850 207.6/1000 ,
851 210.9/1000 ,
852 214.4/1000 ,
853 217.5/1000 ,
854 220.9/1000 ,
855 228.8/1000 ,
856 237.0/1000 ,
857 244.7/1000 ,
858 252.9/1000
859 };
860
861 TSpline3* sp_v = new TSpline3("sp_v", e, v, 22);
862 double vVal = sp_v->Eval(E);
863 return vVal;
864}
**********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 617 of file BesTofDigitizerEcV4.cc.

618{
619 //properties to get
620 strip = -999.0;
621 trkIndex = -999.0;
622 tStart = 99999.0;
623 tPropagate_sphi = -999.0;
624 tPropagate_xphi = -999.0;
625 tThreshold = -999.0;
626 charge = -999.0;
627
628 //parameters to tune
629 E = 106;
630 alpha = 144800./1000; //-999.0; /mm^-1
631 eta = 5013./1000; //-999.0; /mm^-1
632 threshold = 1.5e+08; //Correspond to induced charge of 15 fC
633 v_drift = 210.9e-3; // mm/ns
634
635 hitStructCol.clear();
636}

◆ initial() [2/2]

void BesTofDigitizerEcV4::StripStruct::initial ( )

◆ multiply() [1/2]

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

Definition at line 497 of file BesTofDigitizerEcV4.cc.

498{
499 double nbar = exp((alpha-eta)*m_param.stepWidth);
500 double k = eta/alpha;
501 double rdm_border = k*(nbar-1)/(nbar-k);
502 if(rdm<rdm_border)
503 {
504 return 0;
505 }
506 else
507 {
508 long int number = 1.+1./log((nbar-1.)/(nbar-k))*log((nbar-k)*(rdm-1)/(k-1)/nbar);
509 return number;
510 }
511}

◆ multiply() [2/2]

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

◆ print() [1/2]

void BesTofDigitizerEcV4::StripStruct::print ( )

Definition at line 908 of file BesTofDigitizerEcV4.cc.

909{
910 cout<<"Strip information: "<<endl;
911 cout<<" strip= "<<strip
912 <<" trkIndex= "<<trkIndex
913 <<" tStart= "<<tStart
914 <<" tPropagate_sphi= "<<tPropagate_sphi
915 <<" tPropagate_xphi= "<<tPropagate_xphi
916 <<" tThreshold "<<tThreshold
917 <<" charge= "<<charge
918 <<" E= "<<E
919 <<" alpha= "<<alpha
920 <<" eta= "<<eta
921 <<" threshold= "<<threshold
922 <<" v_drift= "<<v_drift
923 <<endl;
924}

◆ print() [2/2]

void BesTofDigitizerEcV4::StripStruct::print ( )

◆ setPar() [1/2]

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

Definition at line 638 of file BesTofDigitizerEcV4.cc.

639{
640 threshold = threshold_n;
641 E = E_V/1000*2/6/(m_param.gapWidth/10); //kV/cm
642 alpha = getAlpha(E); //mm^-1
643 eta = getEta(E); //mm^-1
644 v_drift = getV(E); // mm/ns
645
646 saturationFlag = saturationFlag_n;
647}

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: