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 ) { return false; }
100
102 G4int trackId = aStep->GetTrack()->GetTrackID();
103
106 newHit->
SetG4Index(aStep->GetTrack()->GetTrackID());
109
110 newHit->
SetTrackL(aStep->GetTrack()->GetTrackLength());
111 G4ThreeVector pos=preStep->GetPosition();
113 G4double globalTime=preStep->GetGlobalTime();
118
121
122
123 G4ThreeVector locPos(0,0,0);
124 G4TouchableHistory* theTouchable = (G4TouchableHistory*)( preStep->GetTouchable() );
125
126
127
128
129 G4String name;
130
131
132
133
134
135 name = theTouchable->GetVolume(0)->GetName();
136
137 G4int partId=-1, scinNb=-1, gapNb=-1, number=-1;
138 G4int strip = -1;
139 gapNb = theTouchable->GetReplicaNumber(0);
140 number = theTouchable->GetReplicaNumber(2);
141
142
143 if(name.contains("physical_gasLayer"))
144 {
145 locPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
146 number = theTouchable->GetReplicaNumber(3);
147 scinNb = number;
148
149 G4String name1 = theTouchable->GetVolume(4)->GetName();
150 if(name1 == "physicalEcTofEast") partId=3;
151 else if(name1 == "physicalEcTofWest") partId=4;
152
153 }
154
155 else if(name=="logical_gasLayer")
156 {
157 locPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
158 number = theTouchable->GetReplicaNumber(3);
159 scinNb = 35-number;
160
161 G4String name1 = theTouchable->GetVolume(4)->GetName();
162 if(name1 == "logicalEcTofEast") partId=3;
163 else if(name1 == "logicalEcTofWest") partId=4;
164
165 }
166
167
168
169 else if( name=="physicalScinBr1" ) {
170 partId = 1;
171 scinNb = number;
172
173 }
174 else if( name=="physicalScinBr2" ) {
175 partId = 1;
176 scinNb = number+88;
177
178 }
179 else if( name=="physicalScinEcWest" ) {
180 partId = 2;
181 scinNb = number;
182
183 }
184 else if( name=="physicalScinEcEast" ) {
185 partId = 0;
186 scinNb = number;
187
188 }
189
190
191
192 else if( name=="logicalScinBr1" || name=="logicalScinBr2" ) {
193 partId = 1;
194 scinNb = (527-number)/3;
195 }
196
197 else if( name=="logicalScinEcEast" ) {
198 partId = 0;
199 scinNb = (95-number)/2;
200 }
201 else if( name=="logicalScinEcWest" ) {
202 partId = 2;
203 scinNb = (95-number)/2;
204 }
205 else { return false; }
206
207
208 if(name.contains("physical_gasLayer") || name.contains("logical_gasLayer"))
209 {
210 G4double zz = locPos.z()-0.5*mm+(24+3)*mm*6;
211 if(zz<=0)
212 {
213 strip=0;
214 }
215 else if(zz>0 && zz<12*27*mm)
216 {
217 for(G4int i=0; i<12; i++)
218 {
219 if(zz>i*27*mm && zz<=(i+1)*27*mm)
220 {
221 strip = i;
222
223 break;
224 }
225 }
226 }
227 else
228 {
229 strip=11;
230 }
231 if(strip<0) strip=0;
232 if(strip>11) strip=11;
233 }
234
235
242
244
245
246 G4int trackIndex, g4TrackId;
249
250 if( edep>0 ) {
251 m_besTofCollection->insert( newHit );
252 }
253
254
255 if( m_besTofList ) {
256 G4int trackIndex, g4TrackId;
259 if( m_trackIndex != trackIndex ) {
260 m_trackIndex = trackIndex;
261
262
263
264
265
266
267
268
269
271 G4int pdg =
abs(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
272 if( pdg==12 || pdg==14 || pdg==16 ) {
flag=0; }
273 if(
flag && aStep->GetTrack()->GetTrackID()==g4TrackId ) {
274 m_trackIndexes.push_back(trackIndex);
276 *truHit = *newHit;
277 m_besTofList->insert(truHit);
278 }
279 }
280 }
281 if( edep<=0 ) { delete newHit; }
282
283 return true;
284
285}
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 *)