87 {
88
89 G4double chg=aStep->GetTrack()->GetDefinition()->GetPDGCharge();
90 G4double edep = aStep->GetTotalEnergyDeposit();
91 G4double stepL=aStep->GetStepLength();
92 G4double deltaT=aStep->GetDeltaTime();
93 G4StepPoint* preStep = aStep->GetPreStepPoint();
94 G4ThreeVector pDirection=preStep->GetMomentumDirection();
95 G4String particleName = aStep->GetTrack()->GetDefinition()->GetParticleName();
96 G4Material* scinMaterial = aStep->GetTrack()->GetMaterial();
97 G4double
charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
98 G4int pdgcode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
99
100 if( chg==0 && edep==0 && stepL==0 ) { return false; }
101
103 G4int trackId = aStep->GetTrack()->GetTrackID();
104
107 newHit->
SetG4Index(aStep->GetTrack()->GetTrackID());
110
111 newHit->
SetTrackL(aStep->GetTrack()->GetTrackLength());
112 G4ThreeVector pos=preStep->GetPosition();
114 G4double globalTime=preStep->GetGlobalTime();
119
122
123
124 G4ThreeVector locPos(0,0,0);
125 G4TouchableHistory* theTouchable = (G4TouchableHistory*)( preStep->GetTouchable() );
126
127
128
129
130 G4String name;
131
132
133
134
135
136 name = theTouchable->GetVolume(0)->GetName();
137
138 G4int partId=-1, scinNb=-1, gapNb=-1, number=-1;
139 G4int strip = -1;
140 gapNb = theTouchable->GetReplicaNumber(0);
141 number = theTouchable->GetReplicaNumber(2);
142
143
144 if(name.contains("physical_gasLayer"))
145 {
146 locPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
147 number = theTouchable->GetReplicaNumber(3);
148 scinNb = number;
149
150 G4String name1 = theTouchable->GetVolume(4)->GetName();
151 if(name1 == "physicalEcTofEast") partId=3;
152 else if(name1 == "physicalEcTofWest") partId=4;
153
154 }
155
156 else if(name=="logical_gasLayer")
157 {
158 locPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
159 number = theTouchable->GetReplicaNumber(3);
160 scinNb = 35-number;
161
162 G4String name1 = theTouchable->GetVolume(4)->GetName();
163 if(name1 == "logicalEcTofEast") partId=3;
164 else if(name1 == "logicalEcTofWest") partId=4;
165
166 }
167
168
169
170 else if( name=="physicalScinBr1" ) {
171 partId = 1;
172 scinNb = number;
173
174 }
175 else if( name=="physicalScinBr2" ) {
176 partId = 1;
177 scinNb = number+88;
178
179 }
180 else if( name=="physicalScinEcWest" ) {
181 partId = 2;
182 scinNb = number;
183
184 }
185 else if( name=="physicalScinEcEast" ) {
186 partId = 0;
187 scinNb = number;
188
189 }
190
191
192
193 else if( name=="logicalScinBr1" || name=="logicalScinBr2" ) {
194 partId = 1;
195 scinNb = (527-number)/3;
196 }
197
198 else if( name=="logicalScinEcEast" ) {
199 partId = 0;
200 scinNb = (95-number)/2;
201 }
202 else if( name=="logicalScinEcWest" ) {
203 partId = 2;
204 scinNb = (95-number)/2;
205 }
206 else { return false; }
207
208
209 if(name.contains("physical_gasLayer") || name.contains("logical_gasLayer"))
210 {
211 G4double zz = locPos.z()-0.5*mm+(24+3)*mm*6;
212 if(zz<=0)
213 {
214 strip=0;
215 }
216 else if(zz>0 && zz<12*27*mm)
217 {
218 for(G4int i=0; i<12; i++)
219 {
220 if(zz>i*27*mm && zz<=(i+1)*27*mm)
221 {
222 strip = i;
223
224 break;
225 }
226 }
227 }
228 else
229 {
230 strip=11;
231 }
232 if(strip<0) strip=0;
233 if(strip>11) strip=11;
234 }
235
236
243
245
246
247 G4int trackIndex, g4TrackId;
250
251 if( edep>0 ) {
252 m_besTofCollection->insert( newHit );
253 }
254
255
256 if( m_besTofList ) {
257 G4int trackIndex, g4TrackId;
260 if( m_trackIndex != trackIndex ) {
261 m_trackIndex = trackIndex;
262
263
264
265
266
267
268
269
270
272 G4int pdg =
abs(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
273 if( pdg==12 || pdg==14 || pdg==16 ) {
flag=0; }
274 if(
flag && aStep->GetTrack()->GetTrackID()==g4TrackId ) {
275 m_trackIndexes.push_back(trackIndex);
277 *truHit = *newHit;
278 m_besTofList->insert(truHit);
279 }
280 }
281 }
282 if( edep<=0 ) { delete newHit; }
283
284 return true;
285
286}
void GetCurrentTrackIndex(G4int &trackIndex, G4int &g4TrackId) const
void SetEvent(G4double event)
void SetModule(G4int module)
void SetPos(G4ThreeVector pos)
void SetDeltaT(G4double deltaT)
void SetCharge(G4double charge)
void SetPDGcode(G4int pdgcode)
void SetTrackIndex(G4int trackIndex)
void SetPDirection(G4ThreeVector pDirection)
void SetPartId(G4int partId)
void SetLocPos(G4ThreeVector locPos)
void SetScinNb(G4int scinNb)
void SetGapNb(G4int gapNb)
void SetStrip(G4int strip)
void SetStepL(G4double stepL)
void SetTrackL(G4double length)
void SetTime(G4double time)
void SetEdep(G4double edep)
void SetMomentum(G4ThreeVector momentum)
void SetG4Index(G4int index)
G4int SampleNumberOfIonsAlongStep(const G4Step *, G4ElectronIonPair *)