33 #include "B2TrackerSD.hh"
64 fLogicTarget(NULL), fLogicChamber(NULL),
65 fTargetMaterial(NULL), fChamberMaterial(NULL),
131 G4double worldLength = 1.2 * (2*targetLength + trackerLength);
133 G4double targetRadius = 0.5*targetLength;
134 targetLength = 0.5*targetLength;
135 G4double trackerSize = 0.5*trackerLength;
143 G4cout <<
"Computed tolerance = "
149 worldLength/2,worldLength/2,worldLength/2);
174 =
new G4Tubs(
"target",0.,targetRadius,targetLength,0.*
deg,360.*
deg);
186 G4cout <<
"Target is " << 2*targetLength/
cm <<
" cm of "
194 =
new G4Tubs(
"tracker",0,trackerSize,trackerSize, 0.*
deg, 360.*
deg);
219 <<
"The chambers are " << chamberWidth/
cm <<
" cm of "
221 <<
"The distance between chamber is " << chamberSpacing/
cm <<
" cm"
224 G4double firstPosition = -trackerSize + chamberSpacing;
225 G4double firstLength = trackerLength/10;
226 G4double lastLength = trackerLength;
228 G4double halfWidth = 0.5*chamberWidth;
229 G4double rmaxFirst = 0.5 * firstLength;
234 if (chamberSpacing < chamberWidth) {
235 G4Exception(
"B2aDetectorConstruction::DefineVolumes()",
243 G4double Zposition = firstPosition + copyNo * chamberSpacing;
244 G4double rmax = rmaxFirst + copyNo * rmaxIncr;
247 =
new G4Tubs(
"Chamber_solid", 0, rmax, halfWidth, 0.*
deg, 360.*
deg);
272 G4double maxStep = 0.5*chamberWidth;
295 G4String trackerChamberSDname =
"B2/TrackerChamberSD";
297 "TrackerHitsCollection");
324 if ( pttoMaterial ) {
329 <<
"----> The target is made of " << materialName <<
G4endl;
333 <<
"--> WARNING from SetTargetMaterial : "
334 << materialName <<
" not found" <<
G4endl;
349 if ( pttoMaterial ) {
357 <<
"----> The chambers are made of " << materialName <<
G4endl;
361 <<
"--> WARNING from SetChamberMaterial : "
362 << materialName <<
" not found" <<
G4endl;
B2aDetectorConstruction()
void SetMaxStep(G4double)
G4Material * fTargetMaterial
CLHEP::Hep3Vector G4ThreeVector
B2aDetectorMessenger * fMessenger
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
static G4MaterialTable * GetMaterialTable()
static constexpr double mm
void AddNewDetector(G4VSensitiveDetector *aSD)
G4LogicalVolume ** fLogicChamber
void SetVerboseLevel(G4int verboseLevel)
G4VPhysicalVolume * DefineVolumes()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetChamberMaterial(G4String)
void SetCheckOverlaps(G4bool)
G4Material * fChamberMaterial
const G4String & GetName() const
virtual ~B2aDetectorConstruction()
static constexpr double deg
static G4GeometryManager * GetInstance()
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static G4ThreadLocal G4GlobalMagFieldMessenger * fMagFieldMessenger
void SetVisAttributes(const G4VisAttributes *pVA)
void SetWorldMaximumExtent(G4double worldExtent)
Definition of the B2aDetectorMessenger class.
void SetUserLimits(G4UserLimits *pULimits)
G4LogicalVolume * fLogicTarget
G4UserLimits * fStepLimit
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual void ConstructSDandField()
static G4SDManager * GetSDMpointer()
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
void SetMaterial(G4Material *pMaterial)
static G4GeometryTolerance * GetInstance()
Definition of the B2aDetectorConstruction class.
virtual void SetMaxAllowedStep(G4double ustepMax)
void SetTargetMaterial(G4String)
virtual G4VPhysicalVolume * Construct()
G4double GetSurfaceTolerance() const
static G4NistManager * Instance()