Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
B2bDetectorConstruction Class Reference

#include <B2bDetectorConstruction.hh>

Inheritance diagram for B2bDetectorConstruction:
G4VUserDetectorConstruction G4VUserDetectorConstruction

Public Member Functions

 B2bDetectorConstruction ()
 
virtual ~B2bDetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
void SetTargetMaterial (G4String)
 
void SetChamberMaterial (G4String)
 
void SetMaxStep (G4double)
 
void SetCheckOverlaps (G4bool)
 
 B2bDetectorConstruction ()
 
virtual ~B2bDetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
void SetTargetMaterial (G4String)
 
void SetChamberMaterial (G4String)
 
void SetMaxStep (G4double)
 
void SetCheckOverlaps (G4bool)
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Detector construction class to define materials, geometry and global uniform magnetic field.

Definition at line 49 of file basic/B2/B2b/include/B2bDetectorConstruction.hh.

Constructor & Destructor Documentation

B2bDetectorConstruction::B2bDetectorConstruction ( )

Definition at line 62 of file basic/B2/B2b/src/B2bDetectorConstruction.cc.

64  fLogicTarget(NULL), fLogicChamber(NULL),
65  fTargetMaterial(NULL), fChamberMaterial(NULL),
66  fStepLimit(NULL),
67  fCheckOverlaps(true)
68 {
69  fMessenger = new B2bDetectorMessenger(this);
70 }
B2bDetectorConstruction::~B2bDetectorConstruction ( )
virtual

Definition at line 74 of file basic/B2/B2b/src/B2bDetectorConstruction.cc.

75 {
76  delete fStepLimit;
77  delete fMessenger;
78 }
B2bDetectorConstruction::B2bDetectorConstruction ( )
virtual B2bDetectorConstruction::~B2bDetectorConstruction ( )
virtual

Member Function Documentation

G4VPhysicalVolume * B2bDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 82 of file basic/B2/B2b/src/B2bDetectorConstruction.cc.

83 {
84  // Define materials
85  DefineMaterials();
86 
87  // Define volumes
88  return DefineVolumes();
89 }
virtual G4VPhysicalVolume* B2bDetectorConstruction::Construct ( )
virtual
void B2bDetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 277 of file basic/B2/B2b/src/B2bDetectorConstruction.cc.

References G4AutoDelete::Register(), G4VUserDetectorConstruction::SetSensitiveDetector(), and G4GlobalMagFieldMessenger::SetVerboseLevel().

278 {
279  // Sensitive detectors
280 
281  G4String trackerChamberSDname = "B2/TrackerChamberSD";
282  B2TrackerSD* aTrackerSD = new B2TrackerSD(trackerChamberSDname,
283  "TrackerHitsCollection");
284  SetSensitiveDetector( fLogicChamber, aTrackerSD );
285 
286  // Create global magnetic field messenger.
287  // Uniform magnetic field is then created automatically if
288  // the field value is not zero.
289  G4ThreeVector fieldValue = G4ThreeVector();
290  fMagFieldMessenger = new G4GlobalMagFieldMessenger(fieldValue);
291  fMagFieldMessenger->SetVerboseLevel(1);
292 
293  // Register the field messenger for deleting
294  G4AutoDelete::Register(fMagFieldMessenger);
295 }
void SetVerboseLevel(G4int verboseLevel)
CLHEP::Hep3Vector G4ThreeVector
void Register(T *inst)
Definition: G4AutoDelete.hh:65
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
virtual void B2bDetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

void B2bDetectorConstruction::SetChamberMaterial ( G4String  materialName)

Definition at line 320 of file basic/B2/B2b/src/B2bDetectorConstruction.cc.

References G4NistManager::FindOrBuildMaterial(), G4cout, G4endl, G4NistManager::Instance(), and G4LogicalVolume::SetMaterial().

Referenced by B2bDetectorMessenger::SetNewValue().

321 {
322  G4NistManager* nistManager = G4NistManager::Instance();
323 
324  G4Material* pttoMaterial =
325  nistManager->FindOrBuildMaterial(materialName);
326 
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;
332  } else {
333  G4cout << "\n--> WARNING from SetChamberMaterial : "
334  << materialName << " not found" << G4endl;
335  }
336  }
337 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void SetMaterial(G4Material *pMaterial)
void B2bDetectorConstruction::SetChamberMaterial ( G4String  )
void B2bDetectorConstruction::SetCheckOverlaps ( G4bool  )
void B2bDetectorConstruction::SetCheckOverlaps ( G4bool  )
void B2bDetectorConstruction::SetMaxStep ( G4double  )
void B2bDetectorConstruction::SetMaxStep ( G4double  maxStep)

Definition at line 341 of file basic/B2/B2b/src/B2bDetectorConstruction.cc.

References G4UserLimits::SetMaxAllowedStep().

Referenced by B2bDetectorMessenger::SetNewValue().

342 {
343  if ((fStepLimit)&&(maxStep>0.)) fStepLimit->SetMaxAllowedStep(maxStep);
344 }
virtual void SetMaxAllowedStep(G4double ustepMax)
void B2bDetectorConstruction::SetTargetMaterial ( G4String  materialName)

Definition at line 299 of file basic/B2/B2b/src/B2bDetectorConstruction.cc.

References G4NistManager::FindOrBuildMaterial(), G4cout, G4endl, G4NistManager::Instance(), and G4LogicalVolume::SetMaterial().

Referenced by B2bDetectorMessenger::SetNewValue().

300 {
301  G4NistManager* nistManager = G4NistManager::Instance();
302 
303  G4Material* pttoMaterial =
304  nistManager->FindOrBuildMaterial(materialName);
305 
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;
311  } else {
312  G4cout << "\n--> WARNING from SetTargetMaterial : "
313  << materialName << " not found" << G4endl;
314  }
315  }
316 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void SetMaterial(G4Material *pMaterial)
void B2bDetectorConstruction::SetTargetMaterial ( G4String  )

The documentation for this class was generated from the following files: