Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
B2bDetectorConstruction Class Reference

#include <B2bDetectorConstruction.hh>

Inheritance diagram for B2bDetectorConstruction:
Collaboration diagram for B2bDetectorConstruction:

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 B2bDetectorConstruction.hh.

Constructor & Destructor Documentation

B2bDetectorConstruction::B2bDetectorConstruction ( )

Definition at line 63 of file B2bDetectorConstruction.cc.

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

Definition at line 75 of file B2bDetectorConstruction.cc.

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

Member Function Documentation

G4VPhysicalVolume * B2bDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 83 of file B2bDetectorConstruction.cc.

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

Reimplemented from G4VUserDetectorConstruction.

Definition at line 280 of file B2bDetectorConstruction.cc.

281 {
282  // Sensitive detectors
283 
284  G4String trackerChamberSDname = "B2/TrackerChamberSD";
285  B2TrackerSD* aTrackerSD = new B2TrackerSD(trackerChamberSDname,
286  "TrackerHitsCollection");
288  SetSensitiveDetector( fLogicChamber, aTrackerSD );
289 
290  // Create global magnetic field messenger.
291  // Uniform magnetic field is then created automatically if
292  // the field value is not zero.
293  G4ThreeVector fieldValue = G4ThreeVector();
294  fMagFieldMessenger = new G4GlobalMagFieldMessenger(fieldValue);
295  fMagFieldMessenger->SetVerboseLevel(1);
296 
297  // Register the field messenger for deleting
298  G4AutoDelete::Register(fMagFieldMessenger);
299 }
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)
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40

Here is the call graph for this function:

virtual void B2bDetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

void B2bDetectorConstruction::SetChamberMaterial ( G4String  materialName)

Definition at line 328 of file B2bDetectorConstruction.cc.

329 {
330  G4NistManager* nistManager = G4NistManager::Instance();
331 
332  G4Material* pttoMaterial =
333  nistManager->FindOrBuildMaterial(materialName);
334 
335  if (fChamberMaterial != pttoMaterial) {
336  if ( pttoMaterial ) {
337  fChamberMaterial = pttoMaterial;
338  if (fLogicChamber) fLogicChamber->SetMaterial(fChamberMaterial);
339  G4cout
340  << G4endl
341  << "----> The chambers are made of " << materialName << G4endl;
342  } else {
343  G4cout
344  << G4endl
345  << "--> WARNING from SetChamberMaterial : "
346  << materialName << " not found" << G4endl;
347  }
348  }
349 }
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)

Here is the call graph for this function:

Here is the caller graph for this function:

void B2bDetectorConstruction::SetChamberMaterial ( G4String  )
void B2bDetectorConstruction::SetCheckOverlaps ( G4bool  )
void B2bDetectorConstruction::SetCheckOverlaps ( G4bool  )
void B2bDetectorConstruction::SetMaxStep ( G4double  )
void B2bDetectorConstruction::SetMaxStep ( G4double  maxStep)

Definition at line 353 of file B2bDetectorConstruction.cc.

354 {
355  if ((fStepLimit)&&(maxStep>0.)) fStepLimit->SetMaxAllowedStep(maxStep);
356 }
virtual void SetMaxAllowedStep(G4double ustepMax)

Here is the call graph for this function:

Here is the caller graph for this function:

void B2bDetectorConstruction::SetTargetMaterial ( G4String  materialName)

Definition at line 303 of file B2bDetectorConstruction.cc.

304 {
305  G4NistManager* nistManager = G4NistManager::Instance();
306 
307  G4Material* pttoMaterial =
308  nistManager->FindOrBuildMaterial(materialName);
309 
310  if (fTargetMaterial != pttoMaterial) {
311  if ( pttoMaterial ) {
312  fTargetMaterial = pttoMaterial;
313  if (fLogicTarget) fLogicTarget->SetMaterial(fTargetMaterial);
314  G4cout
315  << G4endl
316  << "----> The target is made of " << materialName << G4endl;
317  } else {
318  G4cout
319  << G4endl
320  << "--> WARNING from SetTargetMaterial : "
321  << materialName << " not found" << G4endl;
322  }
323  }
324 }
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)

Here is the call graph for this function:

Here is the caller graph for this function:

void B2bDetectorConstruction::SetTargetMaterial ( G4String  )

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