31 #include "B2bDetectorConstruction.hh"
32 #include "B2bDetectorMessenger.hh"
33 #include "B2bChamberParameterisation.hh"
34 #include "B2TrackerSD.hh"
64 fLogicTarget(NULL), fLogicChamber(NULL),
65 fTargetMaterial(NULL), fChamberMaterial(NULL),
88 return DefineVolumes();
93 void B2bDetectorConstruction::DefineMaterials()
120 G4int NbOfChambers = 5;
126 G4double trackerLength = (NbOfChambers+1)*chamberSpacing;
128 G4double worldLength = 1.2 * (2*targetLength + trackerLength);
130 G4double targetRadius = 0.5*targetLength;
131 targetLength = 0.5*targetLength;
132 G4double trackerSize = 0.5*trackerLength;
140 G4cout <<
"Computed tolerance = "
146 worldLength/2,worldLength/2,worldLength/2);
171 =
new G4Tubs(
"target",0.,targetRadius,targetLength,0.*
deg,360.*
deg);
183 G4cout <<
"Target is " << 2*targetLength/
cm <<
" cm of "
191 =
new G4Tubs(
"tracker",0,trackerSize,trackerSize, 0.*
deg, 360.*
deg);
213 G4double firstPosition = -trackerSize + chamberSpacing;
214 G4double firstLength = trackerLength/10;
215 G4double lastLength = trackerLength;
236 G4cout <<
"There are " << NbOfChambers <<
" chambers in the tracker region. "
237 <<
"\nThe chambers are " << chamberWidth/
cm <<
" cm of "
238 << fChamberMaterial->
GetName() <<
"\nThe distance between chamber is "
239 << chamberSpacing/
cm <<
" cm" <<
G4endl;
258 G4double maxStep = 0.5*chamberWidth;
281 G4String trackerChamberSDname =
"B2/TrackerChamberSD";
283 "TrackerHitsCollection");
306 if (fTargetMaterial != pttoMaterial) {
307 if ( pttoMaterial ) {
308 fTargetMaterial = pttoMaterial;
309 if (fLogicTarget) fLogicTarget->
SetMaterial(fTargetMaterial);
310 G4cout <<
"\n----> The target is made of " << materialName <<
G4endl;
312 G4cout <<
"\n--> WARNING from SetTargetMaterial : "
313 << materialName <<
" not found" <<
G4endl;
327 if (fChamberMaterial != pttoMaterial) {
328 if ( pttoMaterial ) {
329 fChamberMaterial = pttoMaterial;
330 if (fLogicChamber) fLogicChamber->
SetMaterial(fChamberMaterial);
331 G4cout <<
"\n----> The chambers are made of " << materialName <<
G4endl;
333 G4cout <<
"\n--> WARNING from SetChamberMaterial : "
334 << materialName <<
" not found" <<
G4endl;
void SetVerboseLevel(G4int verboseLevel)
void SetTargetMaterial(G4String)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
virtual void SetMaxAllowedStep(G4double ustepMax)
virtual G4VPhysicalVolume * Construct()
CLHEP::Hep3Vector G4ThreeVector
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
const G4String & GetName() const
void SetUserLimits(G4UserLimits *pULimits)
G4double GetSurfaceTolerance() const
B2bDetectorConstruction()
static G4MaterialTable * GetMaterialTable()
void SetWorldMaximumExtent(G4double worldExtent)
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
virtual void ConstructSDandField()
virtual ~B2bDetectorConstruction()
static G4GeometryManager * GetInstance()
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void SetMaxStep(G4double)
void SetChamberMaterial(G4String)
void SetMaterial(G4Material *pMaterial)
void SetVisAttributes(const G4VisAttributes *pVA)
static G4GeometryTolerance * GetInstance()