86{
87
88 G4double chg=aStep->GetTrack()->GetDefinition()->GetPDGCharge();
89 G4double edep = aStep->GetTotalEnergyDeposit();
90 G4double stepL=aStep->GetStepLength();
91 G4double deltaT=aStep->GetDeltaTime();
92 G4StepPoint* preStep = aStep->GetPreStepPoint();
93 G4ThreeVector pDirection=preStep->GetMomentumDirection();
94 G4String particleName = aStep->GetTrack()->GetDefinition()->GetParticleName();
95 G4Material* scinMaterial = aStep->GetTrack()->GetMaterial();
96 G4double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
97 G4int pdgcode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
98
99 if (chg==0&&edep==0&&stepL==0)
100 return false;
102
103
104 G4int trackId = aStep->GetTrack()->GetTrackID();
105
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
125
126 G4TouchableHistory* theTouchable
127 = (G4TouchableHistory*)(preStep->GetTouchable());
128
129
130
131
132 G4String name = theTouchable->GetVolume(0)->GetName();
133
134 G4int partId, scinNb, number,help_mrpc,module_mrpc ;
135
136 number = theTouchable->GetReplicaNumber(2);
137 help_mrpc = theTouchable->GetReplicaNumber(3);
138
139
140
141 if(name=="physical_sensitive_detector_west_1")
142 {
143 partId =5;
144 scinNb = help_mrpc;
145 }
146 else if(name=="physical_sensitive_detector_west_2")
147 {
148 partId =6;
149 scinNb = help_mrpc;
150 }
151 else if(name=="physical_sensitive_detector_east_1")
152 {
153 partId =4;
154 scinNb = help_mrpc;
155 }
156 else if(name=="physical_sensitive_detector_east_2")
157 {
158 partId =3;
159 scinNb = help_mrpc;
160 }
161
162 else if(name=="logical_sensitive_detector_west_1")
163 {
164 partId =5;
165 scinNb = (help_mrpc)*(-0.5)+18.5;
166 }
167 else if(name=="logical_sensitive_detector_west_2")
168 {
169 partId =6;
170 scinNb = (help_mrpc)*(-0.5)+18;
171 }
172 else if(name=="logical_sensitive_detector_east_1")
173 {
174 partId =4;
175 scinNb = (help_mrpc)*(0.5)+0.5;
176 }
177
178 else if(name=="logical_sensitive_detector_east_2")
179 {
180 partId =3;
181 scinNb =( help_mrpc)*(0.5)+1;
182 }
183
184 else if (name=="physicalScinBr1")
185 {
186 partId = 1;
187 scinNb = number;
188 }
189 else if (name=="physicalScinBr2")
190 {
191 partId = 1;
192 scinNb = number+88;
193 }
194 else if (name=="physicalScinEcWest")
195 {
196 partId = 2;
197 scinNb = number;
198 }
199 else if (name=="physicalScinEcEast")
200 {
201 partId = 0;
202 scinNb = number;
203 }
204
205
206 else if (name=="logicalScinBr1" ||name=="logicalScinBr2")
207 {
208 partId = 1;
209 scinNb = (527-number)/3;
210 }
211 else if (name=="logicalScinEcEast")
212 {
213
214 partId = 0;
215 scinNb = (95-number)/2;
216 }
217 else if (name=="logicalScinEcWest")
218 {
219 partId = 2;
220 scinNb = (95-number)/2;
221 }
222 else
223 return false;
224
225
226
227
228
229
230
231
235
237
238
239
240
241
242 G4int trackIndex, g4TrackId;
245
246 if (edep>0)
247 {
248 m_besTofCollection->insert(newHit);
249
250 }
251
252
253 if (m_besTofList)
254 {
255 G4int trackIndex, g4TrackId;
258 if (m_trackIndex != trackIndex)
259 {
260 m_trackIndex = trackIndex;
261
262
263
264
265
266
267
268
269
270 G4int flag=1;
271 G4int pdg =
abs(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
272 if (pdg==12 || pdg==14 || pdg==16)
273 flag=0;
274 if (flag && aStep->GetTrack()->GetTrackID()==g4TrackId)
275 {
276 m_trackIndexes.push_back(trackIndex);
278 *truHit = *newHit;
279 m_besTofList->insert(truHit);
280 }
281 }
282 }
283 if (edep<=0) delete newHit;
284
285
286
287return true;
288
289}
double abs(const EvtComplex &c)
void GetCurrentTrackIndex(G4int &trackIndex, G4int &g4TrackId) const
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 SetModule_mrpc(G4int module_mrpc)
void SetScinNb(G4int scinNb)
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 *)