46 {
47 clear();
48 int nE = 0;
49
50 double x0 = 0., y0 = 0., z0 = 0., t0 = 0.;
51
52
53
54
55
56
57
58
59
60
61
62
63
64 double dx0 = (trkPosOut[0] - trkPosIn[0])/10.0;
65 double dy0 = (trkPosOut[1] - trkPosIn[1])/10.0;
66 double dz0 = (trkPosOut[2] - trkPosIn[2])/10.0;
67 double trkL = sqrt(dx0*dx0 + dy0*dy0 + dz0*dz0);
68
69
70
71
72
73 double minX = 0. < dx0 ? 0. : dx0;
74 double maxX = 0. < dx0 ? dx0 : 0.;
75 double minY = 0. < dy0 ? 0. : dy0;
76 double maxY = 0. < dy0 ? dy0 : 0.;
77 double minZ = 0. < dz0 ? 0. : dz0;
78 double maxZ = 0. < dz0 ? dz0 : 0.;
79 if(maxX<=minX){
80 minX += -0.1;
81 maxX += 0.1;
82 }
83 if(maxY<=minY){
84 minY += -0.1;
85 maxY += 0.1;
86 }
87 if(maxZ<=minZ){
88 minZ += -0.1;
89 maxZ += 0.1;
90 }
91
92 string particleType = getParticle(particle, charge);
93
94 m_track->SetParticle(particleType);
95 m_track->SetMomentum(p*1.e9);
96
97 m_sensor->SetArea(minX, minY, minZ, maxX, maxY, maxZ);
98
99
100
101
102
103
104
105
106 m_track->NewTrack(x0, y0, z0, t0, dx0, dy0, dz0);
107
108
109
110
111
112
113 double xc = 0., yc = 0., zc = 0., tc = 0.;
114 int nc = 0;
115 double ec = 0.;
116 double extra = 0.;
117 int nCluster = 0;
118
119 while(m_track->GetCluster(xc, yc, zc, tc, nc, ec, extra)){
120
121 double length = sqrt(pow(xc,2)+pow(yc,2)+pow(zc,2));
122
124 cout << "overflow -------------------------" << endl;
125 continue;
126 }
127
128 nCluster++;
129 for(int j = 0; j<nc; ++j) {
130 double xe, ye, ze, te;
131 double ee, dxe, dye, dze;
132
133 m_track->GetElectron(j, xe, ye, ze, te, ee, dxe, dye, dze);
134
135
136 m_ex.push_back(trkPosIn[0] + xe*10.0);
137 m_ey.push_back(trkPosIn[1] + ye*10.0);
138 m_ez.push_back(trkPosIn[2] + ze*10.0);
139 m_et.push_back(te);
140 nE++;
141 }
142 }
143 m_nIonE = nE;
144
145}