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