66 {
67
68 G4double chg=aStep->GetTrack()->GetDefinition()->GetPDGCharge();
69 G4double edep = aStep->GetTotalEnergyDeposit();
70 G4double stepL=aStep->GetStepLength();
71 G4double deltaT=aStep->GetDeltaTime();
72 G4StepPoint* preStep = aStep->GetPreStepPoint();
73 G4ThreeVector pDirection=preStep->GetMomentumDirection();
74 G4String particleName = aStep->GetTrack()->GetDefinition()->GetParticleName();
75 G4Material* scinMaterial = aStep->GetTrack()->GetMaterial();
76 G4double charge = aStep->GetTrack()->GetDefinition()->GetPDGCharge();
77 G4int pdgcode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
78
79 if( chg==0 && edep==0 && stepL==0 ) { return false; }
80
82 G4int trackId = aStep->GetTrack()->GetTrackID();
83
86 newHit->
SetG4Index(aStep->GetTrack()->GetTrackID());
89
90 newHit->
SetTrackL(aStep->GetTrack()->GetTrackLength());
91 G4ThreeVector pos=preStep->GetPosition();
93 G4double globalTime=preStep->GetGlobalTime();
98
101
102
103 G4ThreeVector locPos(0,0,0);
104 G4TouchableHistory* theTouchable = (G4TouchableHistory*)( preStep->GetTouchable() );
105
106
107
108
109 G4String name;
110
111
112
113
114
115 name = theTouchable->GetVolume(0)->GetName();
116
117 G4int partId=-1, scinNb=-1, gapNb=-1, number=-1;
118 G4int strip = -1;
119 gapNb = theTouchable->GetReplicaNumber(0);
120 number = theTouchable->GetReplicaNumber(2);
121
122
123 if(name.contains("physical_gasLayer"))
124 {
125 locPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
126 number = theTouchable->GetReplicaNumber(3);
127 scinNb = number;
128
129 G4String name1 = theTouchable->GetVolume(4)->GetName();
130 if(name1 == "physicalEcTofEast") partId=3;
131 else if(name1 == "physicalEcTofWest") partId=4;
132
133 }
134
135 else if(name=="logical_gasLayer")
136 {
137 locPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(pos);
138 number = theTouchable->GetReplicaNumber(3);
139 scinNb = 35-number;
140
141 G4String name1 = theTouchable->GetVolume(4)->GetName();
142 if(name1 == "logicalEcTofEast") partId=3;
143 else if(name1 == "logicalEcTofWest") partId=4;
144
145 }
146
147
148
149 else if( name=="physicalScinBr1" ) {
150 partId = 1;
151 scinNb = number;
152
153 }
154 else if( name=="physicalScinBr2" ) {
155 partId = 1;
156 scinNb = number+88;
157
158 }
159 else if( name=="physicalScinEcWest" ) {
160 partId = 2;
161 scinNb = number;
162
163 }
164 else if( name=="physicalScinEcEast" ) {
165 partId = 0;
166 scinNb = number;
167
168 }
169
170
171
172 else if( name=="logicalScinBr1" || name=="logicalScinBr2" ) {
173 partId = 1;
174 scinNb = (527-number)/3;
175 }
176
177 else if( name=="logicalScinEcEast" ) {
178 partId = 0;
179 scinNb = (95-number)/2;
180 }
181 else if( name=="logicalScinEcWest" ) {
182 partId = 2;
183 scinNb = (95-number)/2;
184 }
185 else { return false; }
186
187
188 if(name.contains("physical_gasLayer") || name.contains("logical_gasLayer"))
189 {
190 G4double zz = locPos.z()-0.5*mm+(24+3)*mm*6;
191 if(zz<=0)
192 {
193 strip=0;
194 }
195 else if(zz>0 && zz<12*27*mm)
196 {
197 for(G4int i=0; i<12; i++)
198 {
199 if(zz>i*27*mm && zz<=(i+1)*27*mm)
200 {
201 strip = i;
202
203 break;
204 }
205 }
206 }
207 else
208 {
209 strip=11;
210 }
211 if(strip<0) strip=0;
212 if(strip>11) strip=11;
213 }
214
215
222
224
225
226 G4int trackIndex, g4TrackId;
229
230 if( edep>0 ) {
231 m_besTofCollection->insert( newHit );
232 }
233
234
235 if( m_besTofList ) {
236 G4int trackIndex, g4TrackId;
239 if( m_trackIndex != trackIndex ) {
240 m_trackIndex = trackIndex;
241
242
243
244
245
246
247
248
249
251 G4int pdg =
abs(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
252 if( pdg==12 || pdg==14 || pdg==16 ) {
flag=0; }
253 if(
flag && aStep->GetTrack()->GetTrackID()==g4TrackId ) {
254 m_trackIndexes.push_back(trackIndex);
256 *truHit = *newHit;
257 m_besTofList->insert(truHit);
258 }
259 }
260 }
261 if( edep<=0 ) { delete newHit; }
262
263 return true;
264
265}
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 *)