CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
SamplingGar2 Class Reference

#include <SamplingGar2.h>

+ Inheritance diagram for SamplingGar2:

Public Member Functions

 SamplingGar2 ()
 
 ~SamplingGar2 ()
 
void init (ICgemGeomSvc *geomSvc, double magConfig)
 
void setIonElectrons (int layer, int nElectrons, std::vector< double > x, std::vector< double > y, std::vector< double > z, std::vector< double > t)
 
int getNelectrons () const
 
Float_t getX (int n) const
 
Float_t getY (int n) const
 
Float_t getZ (int n) const
 
Float_t getT (int n) const
 
const std::vector< Float_t > & getXContainer () const
 
const std::vector< Float_t > & getYContainer () const
 
const std::vector< Float_t > & getZContainer () const
 
const std::vector< Float_t > & getTContainer () const
 
void setDebugging (bool debugging)
 
void setGainMultiplier (vector< double > GainMultiplier)
 
void setTransMultiplier (double TransMultiplier)
 
void setDiffuMultiplier (double DiffuMultiplier)
 
void setMultiElectronMapAddr (HitHistMap *address)
 
void setNgapsSect (int n)
 
void setGapSizeSect (double size)
 
void setGapShiftSect (vector< double > shift)
 
void setMicroSectorWidthRad (vector< double > width)
 
- Public Member Functions inherited from DriftAndAvalanche
 DriftAndAvalanche ()
 
virtual ~DriftAndAvalanche ()
 
virtual void init (ICgemGeomSvc *geomSvc, double magConfig)=0
 
virtual void setIonElectrons (int layer, int nElectrons, std::vector< double > x, std::vector< double > y, std::vector< double > z, std::vector< double > t)=0
 
virtual void setDebugging (bool debugging)=0
 
virtual int getNelectrons () const =0
 
virtual Float_t getX (int n) const =0
 
virtual Float_t getY (int n) const =0
 
virtual Float_t getZ (int n) const =0
 
virtual Float_t getT (int n) const =0
 
virtual const std::vector< Float_t > & getXContainer () const =0
 
virtual const std::vector< Float_t > & getYContainer () const =0
 
virtual const std::vector< Float_t > & getZContainer () const =0
 
virtual const std::vector< Float_t > & getTContainer () const =0
 

Detailed Description

Definition at line 17 of file SamplingGar2.h.

Constructor & Destructor Documentation

◆ SamplingGar2()

SamplingGar2::SamplingGar2 ( )

Definition at line 30 of file SamplingGar2.cxx.

30 {
31 m_pMultiElectronMap = nullptr;
32 m_layer = -1;
33
34 m_GainMultiplier[0]=1.60;
35 m_GainMultiplier[1]=1.60;
36 m_GainMultiplier[2]=1.60;
37}

◆ ~SamplingGar2()

SamplingGar2::~SamplingGar2 ( )

Definition at line 39 of file SamplingGar2.cxx.

39 {
40}

Member Function Documentation

◆ getNelectrons()

int SamplingGar2::getNelectrons ( ) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 28 of file SamplingGar2.h.

28{ return m_nMulElec; }

◆ getT()

Float_t SamplingGar2::getT ( int  n) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 32 of file SamplingGar2.h.

32{ return m_eT[n]; }
const Int_t n

◆ getTContainer()

const std::vector< Float_t > & SamplingGar2::getTContainer ( ) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 36 of file SamplingGar2.h.

36{ return m_eT; }

◆ getX()

Float_t SamplingGar2::getX ( int  n) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 29 of file SamplingGar2.h.

29{ return m_eX[n]; }

◆ getXContainer()

const std::vector< Float_t > & SamplingGar2::getXContainer ( ) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 33 of file SamplingGar2.h.

33{ return m_eX; }

◆ getY()

Float_t SamplingGar2::getY ( int  n) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 30 of file SamplingGar2.h.

30{ return m_eY[n]; }

◆ getYContainer()

const std::vector< Float_t > & SamplingGar2::getYContainer ( ) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 34 of file SamplingGar2.h.

34{ return m_eY; }

◆ getZ()

Float_t SamplingGar2::getZ ( int  n) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 31 of file SamplingGar2.h.

31{ return m_eZ[n]; }

◆ getZContainer()

const std::vector< Float_t > & SamplingGar2::getZContainer ( ) const
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 35 of file SamplingGar2.h.

35{ return m_eZ; }

◆ init()

void SamplingGar2::init ( ICgemGeomSvc geomSvc,
double  magConfig 
)
virtual

Implements DriftAndAvalanche.

Definition at line 47 of file SamplingGar2.cxx.

47 {
48 m_geomSvc = geomSvc;
49 m_magConfig = magConfig;
50
51 readSmearPar();
52
53 // initialize polya functions
54 char funname[10];
55 for(int l=0; l<3;l++){
56 for(int i=0; i<3; i++){
57 sprintf(funname, "funPolya%d%d", l, i);
58 m_funPolya[l][i] = new TF1(funname, "[0]*pow(1+[2],1+[2])*pow(x/[1],[2])*exp(-(1+[2])*x/[1])/TMath::Gamma(1+[2])", 1, 500);
59 m_funPolya[l][i]->SetParameter(0, m_gain_gem[i][0]);
60 m_funPolya[l][i]->SetParameter(1, m_gain_gem[i][1]*m_GainMultiplier[l]);
61 m_funPolya[l][i]->SetParameter(2, m_gain_gem[i][2]);
62 }
63 }
64
65 m_Ngaps_microSector=40;
66 m_gapShift_microSector[0][0]=0.;
67 m_gapShift_microSector[0][1]=0.;
68 m_gapShift_microSector[1][0]=0.;
69 m_gapShift_microSector[1][1]=0.;
70 m_gapShift_microSector[2][0]=0.;
71 m_gapShift_microSector[2][1]=0.;
72 m_microSector_width[0][0]=2*M_PI/m_Ngaps_microSector;
73 m_microSector_width[0][1]=2*M_PI/m_Ngaps_microSector;
74 m_microSector_width[1][0]=2*M_PI/m_Ngaps_microSector/2;
75 m_microSector_width[1][1]=2*M_PI/m_Ngaps_microSector/2;
76 m_microSector_width[2][0]=2*M_PI/m_Ngaps_microSector/2;
77 m_microSector_width[2][1]=2*M_PI/m_Ngaps_microSector/2;
78 m_gap_microSector=1.1;//in mm
79}
#define M_PI
Definition: TConstant.h:4

◆ setDebugging()

void SamplingGar2::setDebugging ( bool  debugging)
inlinevirtual

Implements DriftAndAvalanche.

Definition at line 37 of file SamplingGar2.h.

37{m_debugging = debugging;}

◆ setDiffuMultiplier()

void SamplingGar2::setDiffuMultiplier ( double  DiffuMultiplier)
inline

Definition at line 46 of file SamplingGar2.h.

46{m_DiffuMultiplier = DiffuMultiplier;}

Referenced by CgemDigitizerSvc::initialize().

◆ setGainMultiplier()

void SamplingGar2::setGainMultiplier ( vector< double >  GainMultiplier)
inline

Definition at line 39 of file SamplingGar2.h.

40 {
41 m_GainMultiplier[0] = GainMultiplier[0];
42 m_GainMultiplier[1] = GainMultiplier[1];
43 m_GainMultiplier[2] = GainMultiplier[2];
44 }

Referenced by CgemDigitizerSvc::initialize().

◆ setGapShiftSect()

void SamplingGar2::setGapShiftSect ( vector< double >  shift)
inline

Definition at line 55 of file SamplingGar2.h.

56 {
57 m_gapShift_microSector[0][0]=shift[0];
58 m_gapShift_microSector[0][1]=shift[1];
59 m_gapShift_microSector[1][0]=shift[2];
60 m_gapShift_microSector[1][1]=shift[3];
61 m_gapShift_microSector[2][0]=shift[4];
62 m_gapShift_microSector[2][1]=shift[5];
63 }

Referenced by CgemDigitizerSvc::initialize().

◆ setGapSizeSect()

void SamplingGar2::setGapSizeSect ( double  size)
inline

Definition at line 54 of file SamplingGar2.h.

54{m_gap_microSector=size;}

Referenced by CgemDigitizerSvc::initialize().

◆ setIonElectrons()

void SamplingGar2::setIonElectrons ( int  layer,
int  nElectrons,
std::vector< double >  x,
std::vector< double >  y,
std::vector< double >  z,
std::vector< double >  t 
)
virtual

Implements DriftAndAvalanche.

Definition at line 81 of file SamplingGar2.cxx.

81 {
82 clear();
83 m_layer = layer;
84 if (m_pMultiElectronMap == nullptr) {
85 cout << "Error: SamplingGar2::m_pMultiElectronMap is nullptr and has aborted running." << endl;
86 throw std::runtime_error("Error: SamplingGar2::m_pMultiElectronMap is nullptr and has aborted running.");
87 }
88 m_pMultiElectronMap->clear();
89 m_nIonE = nElectrons;
90 // cout << "nIonE = " << m_nIonE << endl;
91 for (int i = 0; i < nElectrons; i++) {
92 double r = sqrt(x[i] * x[i] + y[i] * y[i]);
93 double phi;
94 if (y[i] >= 0)
95 phi = acos(x[i] / r);
96 else
97 phi = CLHEP::twopi - acos(x[i] / r);
98 m_vecIonR.push_back(r);
99 m_vecIonPhi.push_back(phi);
100 m_vecIonZ.push_back(z[i]);
101 m_vecIonT.push_back(t[i]);
102
103 // cout << "check geom layer" << setw(15) << layer << setw(15) << m_geomSvc->getCgemLayer(layer)->getInnerROfGapD()
104 // << setw(15) << m_geomSvc->getCgemLayer(layer)->getOuterROfGapD()
105 // << setw(15) << m_geomSvc->getCgemLayer(layer)->getCgemFoil(0)->getInnerROfCgemFoil() << endl;
106
107 double radii_gem1 = m_geomSvc->getCgemLayer(layer)->getCgemFoil(0)->getInnerROfCgemFoil();
108 double driftD = radii_gem1 - r;
109 // cout << "driftD = " << setw(15) << driftD << setw(15) << radii_gem1 << setw(15) << r << endl;
110 samplingDrift(layer, driftD, i);
111 }
112 // cout << "nMultiGem1 = " << m_nEgem1 << endl;
113 for (int i = 0; i < m_nEgem1; i++) samplingTransfer(layer,1, i);
114 // cout << "nMultiGem2 = " << m_nEgem2 << endl;
115 for (int i = 0; i < m_nEgem2; i++) samplingTransfer(layer,2, i);
116 // cout << "nMultiGem3 = " << m_nEgem3 << endl;
117 //calMultiE(layer);
118
119 m_layer = -1;
120}
double getInnerROfCgemFoil() const
Definition: CgemGeoFoil.h:33
CgemGeoFoil * getCgemFoil(int i) const
Definition: CgemGeoLayer.h:115
virtual CgemGeoLayer * getCgemLayer(int i) const =0
int t()
Definition: t.c:1

◆ setMicroSectorWidthRad()

void SamplingGar2::setMicroSectorWidthRad ( vector< double >  width)
inline

Definition at line 64 of file SamplingGar2.h.

65 {
66 m_microSector_width[0][0]=width[0];
67 m_microSector_width[0][1]=width[1];
68 m_microSector_width[1][0]=width[2];
69 m_microSector_width[1][1]=width[3];
70 m_microSector_width[2][0]=width[4];
71 m_microSector_width[2][1]=width[5];
72 }

Referenced by CgemDigitizerSvc::initialize().

◆ setMultiElectronMapAddr()

void SamplingGar2::setMultiElectronMapAddr ( HitHistMap address)
inline

Definition at line 49 of file SamplingGar2.h.

49{ m_pMultiElectronMap = address; } // OK since Wangll said this type feels better.

Referenced by CgemDigitizerSvc::initialize().

◆ setNgapsSect()

void SamplingGar2::setNgapsSect ( int  n)
inline

Definition at line 53 of file SamplingGar2.h.

53{m_Ngaps_microSector=n;}

Referenced by CgemDigitizerSvc::initialize().

◆ setTransMultiplier()

void SamplingGar2::setTransMultiplier ( double  TransMultiplier)
inline

Definition at line 45 of file SamplingGar2.h.

45{m_TransMultiplier = TransMultiplier;}

Referenced by CgemDigitizerSvc::initialize().


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