118 G4Material* air = G4Material::GetMaterial(
"G4_AIR");
122 G4double chamberSpacing = 80*cm;
124 G4double chamberWidth = 20.0*cm;
125 G4double targetLength = 5.0*cm;
129 G4double worldLength = 1.2 * (2*targetLength + trackerLength);
131 G4double targetRadius = 0.5*targetLength;
132 targetLength = 0.5*targetLength;
133 G4double trackerSize = 0.5*trackerLength;
139 G4GeometryManager::GetInstance()->SetWorldMaximumExtent(worldLength);
141 G4cout <<
"Computed tolerance = "
142 << G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/mm
145 auto worldS =
new G4Box(
"world",
146 worldLength / 2, worldLength / 2, worldLength / 2);
164 G4ThreeVector positionTarget = G4ThreeVector(0,0,-(targetLength+trackerSize));
166 auto targetS =
new G4Tubs(
"target", 0., targetRadius, targetLength, 0. * deg, 360. * deg);
177 G4cout <<
"Target is " << 2*targetLength/cm <<
" cm of "
182 G4ThreeVector positionTracker = G4ThreeVector(0,0,0);
184 auto trackerS =
new G4Tubs(
"tracker", 0, trackerSize, trackerSize, 0. * deg, 360. * deg);
185 auto trackerLV =
new G4LogicalVolume(trackerS, air,
"Tracker",
nullptr,
nullptr,
nullptr);
200 worldLV ->SetVisAttributes(boxVisAtt);
202 trackerLV ->SetVisAttributes(boxVisAtt);
206 G4cout <<
"There are " <<
fNbOfChambers <<
" chambers in the tracker region. "
208 <<
"The chambers are " << chamberWidth/cm <<
" cm of "
210 <<
"The distance between chamber is " << chamberSpacing/cm <<
" cm"
213 G4double firstPosition = -trackerSize + chamberSpacing;
214 G4double firstLength = trackerLength/10;
215 G4double lastLength = trackerLength;
217 G4double halfWidth = 0.5*chamberWidth;
218 G4double rmaxFirst = 0.5 * firstLength;
220 G4double rmaxIncr = 0.0;
223 if (chamberSpacing < chamberWidth) {
224 G4Exception(
"DetectorConstruction::DefineVolumes()",
225 "InvalidSetup", FatalException,
232 G4double Zposition = firstPosition + copyNo * chamberSpacing;
233 G4double rmax = rmaxFirst + copyNo * rmaxIncr;
235 auto chamberS =
new G4Tubs(
"Chamber_solid", 0, rmax, halfWidth, 0. * deg, 360. * deg);
243 G4ThreeVector(0, 0, Zposition),
259 G4double maxStep = 0.5*chamberWidth;