33 #include "B2MagneticField.hh"
34 #include "B2TrackerSD.hh"
63 fLogicTarget(NULL), fLogicChamber(NULL),
64 fTargetMaterial(NULL), fChamberMaterial(NULL),
79 delete [] fLogicChamber;
93 return DefineVolumes();
98 void B2aDetectorConstruction::DefineMaterials()
104 G4bool fromIsotopes =
false;
132 G4double trackerLength = (fNbOfChambers+1)*chamberSpacing;
134 G4double worldLength = 1.2 * (2*targetLength + trackerLength);
136 G4double targetRadius = 0.5*targetLength;
137 targetLength = 0.5*targetLength;
138 G4double trackerSize = 0.5*trackerLength;
146 G4cout <<
"Computed tolerance = "
152 worldLength/2,worldLength/2,worldLength/2);
177 =
new G4Tubs(
"target",0.,targetRadius,targetLength,0.*
deg,360.*
deg);
189 G4cout <<
"Target is " << 2*targetLength/
cm <<
" cm of "
197 =
new G4Tubs(
"tracker",0,trackerSize,trackerSize, 0.*
deg, 360.*
deg);
220 G4String trackerChamberSDname =
"B2/TrackerChamberSD";
222 "TrackerHitsCollection");
227 G4cout <<
"There are " << fNbOfChambers <<
" chambers in the tracker region. "
228 <<
"\nThe chambers are " << chamberWidth/
cm <<
" cm of "
229 << fChamberMaterial->
GetName() <<
"\nThe distance between chamber is "
230 << chamberSpacing/
cm <<
" cm" <<
G4endl;
232 G4double firstPosition = -trackerSize + chamberSpacing;
233 G4double firstLength = trackerLength/10;
234 G4double lastLength = trackerLength;
236 G4double halfWidth = 0.5*chamberWidth;
237 G4double rmaxFirst = 0.5 * firstLength;
240 if( fNbOfChambers > 0 ){
241 rmaxIncr = 0.5 * (lastLength-firstLength)/(fNbOfChambers-1);
242 if (chamberSpacing < chamberWidth) {
243 G4Exception(
"B2aDetectorConstruction::DefineVolumes()",
249 for (
G4int copyNo=0; copyNo<fNbOfChambers; copyNo++) {
251 G4double Zposition = firstPosition + copyNo * chamberSpacing;
252 G4double rmax = rmaxFirst + copyNo * rmaxIncr;
255 =
new G4Tubs(
"chamber", 0, rmax, halfWidth, 0.*
deg, 360.*
deg);
257 fLogicChamber[copyNo] =
265 fLogicChamber[copyNo],
281 G4double maxStep = 0.5*chamberWidth;
303 G4bool fromIsotopes =
false;
308 if (fTargetMaterial != pttoMaterial) {
309 if ( pttoMaterial ) {
310 fTargetMaterial = pttoMaterial;
311 if (fLogicTarget) fLogicTarget->
SetMaterial(fTargetMaterial);
312 G4cout <<
"\n----> The target is made of " << materialName <<
G4endl;
314 G4cout <<
"\n--> WARNING from SetTargetMaterial : "
315 << materialName <<
" not found" <<
G4endl;
325 G4bool fromIsotopes =
false;
330 if (fChamberMaterial != pttoMaterial) {
331 if ( pttoMaterial ) {
332 fChamberMaterial = pttoMaterial;
333 for (
G4int copyNo=0; copyNo<fNbOfChambers; copyNo++) {
334 if (fLogicChamber[copyNo]) fLogicChamber[copyNo]->
337 G4cout <<
"\n----> The chambers are made of " << materialName <<
G4endl;
339 G4cout <<
"\n--> WARNING from SetChamberMaterial : "
340 << materialName <<
" not found" <<
G4endl;
363 fCheckOverlaps = checkOverlaps;