G4double maxLength = 2*trackerLength, maxTime = 0.1*ns, minEkin = 10*MeV; trackerLV->SetUserLimits(new G4UserLimits(maxStep,
maxLength,
maxTime,
minEkin));
115{
116 G4Material* air = G4Material::GetMaterial(
"G4_AIR");
117
118
119
120 G4int NbOfChambers = 5;
121 G4double chamberSpacing = 80*cm;
122
123 G4double chamberWidth = 20.0*cm;
124 G4double targetLength = 5.0*cm;
125
126 G4double trackerLength = (NbOfChambers+1)*chamberSpacing;
127
128 G4double worldLength = 1.2 * (2*targetLength + trackerLength);
129
130 G4double targetRadius = 0.5*targetLength;
131 targetLength = 0.5*targetLength;
132 G4double trackerSize = 0.5*trackerLength;
133
134
135
136
137
138 G4GeometryManager::GetInstance()->SetWorldMaximumExtent(worldLength);
139
140 G4cout << "Computed tolerance = "
141 << G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/mm
142 << " mm" << G4endl;
143
144 auto worldS =
new G4Box(
"world",
145 worldLength / 2, worldLength / 2, worldLength / 2);
147 air,
148 "World");
149
150
151
153 G4ThreeVector(),
154 worldLV,
155 "World",
156 nullptr,
157 false,
158 0,
160
161
162
163 G4ThreeVector positionTarget = G4ThreeVector(0,0,-(targetLength+trackerSize));
164
165 auto targetS =
new G4Tubs(
"target", 0., targetRadius, targetLength, 0. * deg, 360. * deg);
168 positionTarget,
170 "Target",
171 worldLV,
172 false,
173 0,
175
176 G4cout << "Target is " << 2*targetLength/cm << " cm of "
178
179
180
181 G4ThreeVector positionTracker = G4ThreeVector(0,0,0);
182
183 auto trackerS =
new G4Tubs(
"tracker", 0, trackerSize, trackerSize, 0. * deg, 360. * deg);
184 auto trackerLV =
new G4LogicalVolume(trackerS, air,
"Tracker",
nullptr,
nullptr,
nullptr);
186 positionTracker,
187 trackerLV,
188 "Tracker",
189 worldLV,
190 false,
191 0,
193
194
195
196
197
198
199 auto chamberS =
new G4Tubs(
"tracker", 0, 100 * cm, 100 * cm, 0. * deg, 360. * deg);
202
203 G4double firstPosition = -trackerSize + chamberSpacing;
204 G4double firstLength = trackerLength/10;
205 G4double lastLength = trackerLength;
206
208 new ChamberParameterisation(
209 NbOfChambers,
210 firstPosition,
211 chamberSpacing,
212 chamberWidth,
213 firstLength,
214 lastLength);
215
216
217
220 trackerLV,
221 kZAxis,
222 NbOfChambers,
223 chamberParam,
225
226 G4cout << "There are " << NbOfChambers << " chambers in the tracker region. "
227 << G4endl
228 << "The chambers are " << chamberWidth/cm << " cm of "
230 << "The distance between chamber is " << chamberSpacing/cm << " cm"
231 << G4endl;
232
233
234
236
237 worldLV ->SetVisAttributes(boxVisAtt);
239 trackerLV ->SetVisAttributes(boxVisAtt);
240
243
244
245
246
247
248
249
250
251 G4double maxStep = 0.5*chamberWidth;
254
255
256
257
258
259
260
261
262
263
264
265 return worldPV;
266}