CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
IonizationGar Class Reference

#include <IonizationGar.h>

+ Inheritance diagram for IonizationGar:

Public Member Functions

 IonizationGar ()
 
 ~IonizationGar ()
 
void init (unsigned int random, ICgemGeomSvc *geomSvc, double magConfig)
 
void setDebugging (bool debugging)
 
void setTrack (int particle, int charge, double p, double trkPosIn[], double trkPosOut[])
 
int getNumberIonE ()
 
double getEx (int nElec)
 
double getEy (int nElec)
 
double getEz (int nElec)
 
double getEt (int nElec)
 
 IonizationGar ()
 
 ~IonizationGar ()
 
void init (unsigned int random, ICgemGeomSvc *geomSvc, double magConfig)
 
void setDebugging (bool debugging)
 
void setTrack (int particle, int charge, double p, double trkPosIn[], double trkPosOut[])
 
int getNumberIonE ()
 
double getEx (int nElec)
 
double getEy (int nElec)
 
double getEz (int nElec)
 
double getEt (int nElec)
 
- Public Member Functions inherited from Ionization
 Ionization ()
 
virtual ~Ionization ()
 
virtual void init (unsigned int random, ICgemGeomSvc *geomSvc, double magConfig)=0
 
virtual void setDebugging (bool debugging)=0
 
virtual void setTrack (int particle, int charge, double p, double trkPosIn[], double trkPosOut[])=0
 
virtual int getNumberIonE ()=0
 
virtual double getEx (int nElec)=0
 
virtual double getEy (int nElec)=0
 
virtual double getEz (int nElec)=0
 
virtual double getEt (int nElec)=0
 
 Ionization ()
 
virtual ~Ionization ()
 
virtual void init (unsigned int random, ICgemGeomSvc *geomSvc, double magConfig)=0
 
virtual void setDebugging (bool debugging)=0
 
virtual void setTrack (int particle, int charge, double p, double trkPosIn[], double trkPosOut[])=0
 
virtual int getNumberIonE ()=0
 
virtual double getEx (int nElec)=0
 
virtual double getEy (int nElec)=0
 
virtual double getEz (int nElec)=0
 
virtual double getEt (int nElec)=0
 

Detailed Description

Constructor & Destructor Documentation

◆ IonizationGar() [1/2]

IonizationGar::IonizationGar ( )

Definition at line 19 of file IonizationGar.cxx.

19 {
20}

◆ ~IonizationGar() [1/2]

IonizationGar::~IonizationGar ( )

Definition at line 22 of file IonizationGar.cxx.

22 {
23 delete m_gas;
24 delete m_geo;
25 delete m_comp;
26 delete m_box;
27 delete m_sensor;
28}

◆ IonizationGar() [2/2]

IonizationGar::IonizationGar ( )

◆ ~IonizationGar() [2/2]

IonizationGar::~IonizationGar ( )

Member Function Documentation

◆ getEt() [1/2]

double IonizationGar::getEt ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 40 of file Cgem/CgemDigitizerSvc/CgemDigitizerSvc-00-00-24/CgemDigitizerSvc/IonizationGar.h.

40{return m_et[nElec];}

◆ getEt() [2/2]

double IonizationGar::getEt ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 40 of file InstallArea/include/CgemDigitizerSvc/CgemDigitizerSvc/IonizationGar.h.

40{return m_et[nElec];}

◆ getEx() [1/2]

double IonizationGar::getEx ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 37 of file Cgem/CgemDigitizerSvc/CgemDigitizerSvc-00-00-24/CgemDigitizerSvc/IonizationGar.h.

37{return m_ex[nElec];}

◆ getEx() [2/2]

double IonizationGar::getEx ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 37 of file InstallArea/include/CgemDigitizerSvc/CgemDigitizerSvc/IonizationGar.h.

37{return m_ex[nElec];}

◆ getEy() [1/2]

double IonizationGar::getEy ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 38 of file Cgem/CgemDigitizerSvc/CgemDigitizerSvc-00-00-24/CgemDigitizerSvc/IonizationGar.h.

38{return m_ey[nElec];}

◆ getEy() [2/2]

double IonizationGar::getEy ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 38 of file InstallArea/include/CgemDigitizerSvc/CgemDigitizerSvc/IonizationGar.h.

38{return m_ey[nElec];}

◆ getEz() [1/2]

double IonizationGar::getEz ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 39 of file Cgem/CgemDigitizerSvc/CgemDigitizerSvc-00-00-24/CgemDigitizerSvc/IonizationGar.h.

39{return m_ez[nElec];}

◆ getEz() [2/2]

double IonizationGar::getEz ( int  nElec)
inlinevirtual

Implements Ionization.

Definition at line 39 of file InstallArea/include/CgemDigitizerSvc/CgemDigitizerSvc/IonizationGar.h.

39{return m_ez[nElec];}

◆ getNumberIonE() [1/2]

int IonizationGar::getNumberIonE ( )
inlinevirtual

Implements Ionization.

Definition at line 36 of file Cgem/CgemDigitizerSvc/CgemDigitizerSvc-00-00-24/CgemDigitizerSvc/IonizationGar.h.

36{return m_nIonE;}

◆ getNumberIonE() [2/2]

int IonizationGar::getNumberIonE ( )
inlinevirtual

Implements Ionization.

Definition at line 36 of file InstallArea/include/CgemDigitizerSvc/CgemDigitizerSvc/IonizationGar.h.

36{return m_nIonE;}

◆ init() [1/2]

void IonizationGar::init ( unsigned int  random,
ICgemGeomSvc geomSvc,
double  magConfig 
)
virtual

Implements Ionization.

Definition at line 30 of file IonizationGar.cxx.

30 {
31 m_random = random;
32 m_geomSvc = geomSvc;
33 m_magConfig = magConfig;
34
35 initGeoGas();
36}

◆ init() [2/2]

void IonizationGar::init ( unsigned int  random,
ICgemGeomSvc geomSvc,
double  magConfig 
)
virtual

Implements Ionization.

◆ setDebugging() [1/2]

void IonizationGar::setDebugging ( bool  debugging)
inlinevirtual

Implements Ionization.

Definition at line 27 of file Cgem/CgemDigitizerSvc/CgemDigitizerSvc-00-00-24/CgemDigitizerSvc/IonizationGar.h.

27{m_debugging = debugging;}

◆ setDebugging() [2/2]

void IonizationGar::setDebugging ( bool  debugging)
inlinevirtual

Implements Ionization.

Definition at line 27 of file InstallArea/include/CgemDigitizerSvc/CgemDigitizerSvc/IonizationGar.h.

27{m_debugging = debugging;}

◆ setTrack() [1/2]

void IonizationGar::setTrack ( int  particle,
int  charge,
double  p,
double  trkPosIn[],
double  trkPosOut[] 
)
virtual

Implements Ionization.

Definition at line 38 of file IonizationGar.cxx.

38 {
39 clear();
40 int nE = 0;
41
42 double x0 = 0., y0 = 0., z0 = 0., t0 = 0.;
43
44 // //the length of track segment.
45 // double d0 = sqrt(pow((trkPosOut[0]-trkPosIn[0]),2)+pow((trkPosOut[1]-trkPosIn[1]),2)+pow((trkPosOut[2]-trkPosIn[2]),2));
46 // double d1 = sqrt(pow((trkPosOut[0]-trkPosIn[0]),2)+pow((trkPosOut[1]-trkPosIn[1]),2));
47 // double trkL = d0;
48
49 // double lambda = acos(d1/d0);
50 // double theta = acos((trkPosOut[1]-trkPosIn[1])/d1);
51
52 // double dx0 = cos(lambda)*sin(theta)/10.0; // mm->cm
53 // double dy0 = cos(lambda)*cos(theta)/10.0; // mm->cm
54 // double dz0 = sin(lambda)/10.0; // mm->cm
55
56 double dx0 = (trkPosOut[0] - trkPosIn[0])/10.0; // cm
57 double dy0 = (trkPosOut[1] - trkPosIn[1])/10.0; // cm
58 double dz0 = (trkPosOut[2] - trkPosIn[2])/10.0; // cm
59 double trkL = sqrt(dx0*dx0 + dy0*dy0 + dz0*dz0);
60
61 // cout << "track segment: " << setw(15) << trkPosIn[0] << setw(15) << trkPosIn[1] << setw(15) << trkPosIn[2]
62 // << setw(15) << trkPosOut[0] << setw(15) << trkPosOut[1] << setw(15) << trkPosOut[2] << endl;
63 // cout << setw(15) << trkL << setw(15) << dx0 << setw(15) << dy0 << setw(15) << dz0 << endl;
64
65 double minX = 0. < dx0 ? 0. : dx0;
66 double maxX = 0. < dx0 ? dx0 : 0.;
67 double minY = 0. < dy0 ? 0. : dy0;
68 double maxY = 0. < dy0 ? dy0 : 0.;
69 double minZ = 0. < dz0 ? 0. : dz0;
70 double maxZ = 0. < dz0 ? dz0 : 0.;
71 if(maxX<=minX){
72 minX += -0.1;
73 maxX += 0.1;
74 }
75 if(maxY<=minY){
76 minY += -0.1;
77 maxY += 0.1;
78 }
79 if(maxZ<=minZ){
80 minZ += -0.1;
81 maxZ += 0.1;
82 }
83
84 string particleType = getParticle(particle, charge);
85
86 TrackHeed* track = new TrackHeed();
87 track->SetSensor(m_sensor);
88 if(m_debugging) track->EnableDebugging();
89 else track->DisableDebugging();
90 track->EnableMagneticField();
91 track->SetParticle(particleType);
92 track->SetMomentum(p*1.e9);
93 // m_sensor->SetArea(-0.5, 0, -0.5, 0.5, 0.5, 0.5);
94 m_sensor->SetArea(minX, minY, minZ, maxX, maxY, maxZ);
95 // cout << setw(15) << minX << setw(15) << maxX << setw(15) << minY << setw(15) << maxY
96 // << setw(15) << minZ << setw(15) << maxZ << endl;
97
98 // cout << "trkpos" << endl;
99 // cout << setw(15) << trkPosIn[0] << setw(15) << trkPosIn[1] << setw(15) << trkPosIn[2]
100 // << setw(15) << trkPosOut[0] << setw(15) << trkPosOut[1] << setw(15) << trkPosOut[2] << endl;
101
102 track->NewTrack(x0, y0, z0, t0, dx0, dy0, dz0);
103 // track->NewTrack(0, 0, 0, t0, 0, 1, 0);
104 // cout << "particle: " << particleType << ", P = " << p << endl;
105 // cout << setw(15) << x0 << setw(15) << y0 << setw(15) << z0 << setw(15) << t0
106 // << setw(15) << dx0 << setw(15) << dy0 << setw(15) << dz0 << endl;
107
108 double xc = 0., yc = 0., zc = 0., tc = 0.; // cluster position
109 int nc = 0; // number of electrons
110 double ec = 0.; // energy
111 double extra = 0.; // not used
112 int nCluster = 0;
113
114 while(track->GetCluster(xc, yc, zc, tc, nc, ec, extra)){
115 double length = sqrt(pow(xc,2)+pow(yc,2)+pow(zc,2));
116 // cout << "length = " << length << ", trkL = " << trkL << endl;
117 if(length>trkL){
118 cout << "overflow -------------------------" << endl;
119 continue;
120 }
121 // cout << setw(5) << nCluster << setw(15) << xc << setw(15) << yc << setw(15) << zc << setw(15) << nc << endl;
122 nCluster++;
123 for(int j = 0; j<nc; ++j) {
124 double xe, ye, ze, te;
125 double ee, dxe, dye, dze;
126 track->GetElectron(j, xe, ye, ze, te, ee, dxe, dye, dze); // unit: cm
127
128 // cout << setw(5) << nE << setw(15) << xe << setw(15) << ye << setw(15) << ze << setw(15) << te << endl;
129 m_ex.push_back(trkPosIn[0] + xe*10.0); // mm
130 m_ey.push_back(trkPosIn[1] + ye*10.0); // mm
131 m_ez.push_back(trkPosIn[2] + ze*10.0); // mm
132 m_et.push_back(te);
133 nE++;
134 }
135 }
136 m_nIonE = nE;
137 delete track;
138}

◆ setTrack() [2/2]

void IonizationGar::setTrack ( int  particle,
int  charge,
double  p,
double  trkPosIn[],
double  trkPosOut[] 
)
virtual

Implements Ionization.


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