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

#include <B2aDetectorConstruction.hh>

Inheritance diagram for B2aDetectorConstruction:
Collaboration diagram for B2aDetectorConstruction:

Public Member Functions

 B2aDetectorConstruction ()
 
virtual ~B2aDetectorConstruction ()
 
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 B2aDetectorConstruction.hh.

Constructor & Destructor Documentation

B2aDetectorConstruction::B2aDetectorConstruction ( )

Definition at line 61 of file B2aDetectorConstruction.cc.

63  fNbOfChambers(0),
64  fLogicTarget(NULL), fLogicChamber(NULL),
65  fTargetMaterial(NULL), fChamberMaterial(NULL),
66  fStepLimit(NULL),
67  fCheckOverlaps(true)
68 {
69  fMessenger = new B2aDetectorMessenger(this);
70 
71  fNbOfChambers = 5;
72  fLogicChamber = new G4LogicalVolume*[fNbOfChambers];
73 }
B2aDetectorConstruction::~B2aDetectorConstruction ( )
virtual

Definition at line 77 of file B2aDetectorConstruction.cc.

78 {
79  delete [] fLogicChamber;
80  delete fStepLimit;
81  delete fMessenger;
82 }

Member Function Documentation

G4VPhysicalVolume * B2aDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 86 of file B2aDetectorConstruction.cc.

87 {
88  // Define materials
89  DefineMaterials();
90 
91  // Define volumes
92  return DefineVolumes();
93 }
void B2aDetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 291 of file B2aDetectorConstruction.cc.

292 {
293  // Sensitive detectors
294 
295  G4String trackerChamberSDname = "B2/TrackerChamberSD";
296  B2TrackerSD* aTrackerSD = new B2TrackerSD(trackerChamberSDname,
297  "TrackerHitsCollection");
299  // Setting aTrackerSD to all logical volumes with the same name
300  // of "Chamber_LV".
301  SetSensitiveDetector("Chamber_LV", aTrackerSD, true);
302 
303  // Create global magnetic field messenger.
304  // Uniform magnetic field is then created automatically if
305  // the field value is not zero.
306  G4ThreeVector fieldValue = G4ThreeVector();
307  fMagFieldMessenger = new G4GlobalMagFieldMessenger(fieldValue);
308  fMagFieldMessenger->SetVerboseLevel(1);
309 
310  // Register the field messenger for deleting
311  G4AutoDelete::Register(fMagFieldMessenger);
312 }
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:

void B2aDetectorConstruction::SetChamberMaterial ( G4String  materialName)

Definition at line 341 of file B2aDetectorConstruction.cc.

342 {
343  G4NistManager* nistManager = G4NistManager::Instance();
344 
345  G4Material* pttoMaterial =
346  nistManager->FindOrBuildMaterial(materialName);
347 
348  if (fChamberMaterial != pttoMaterial) {
349  if ( pttoMaterial ) {
350  fChamberMaterial = pttoMaterial;
351  for (G4int copyNo=0; copyNo<fNbOfChambers; copyNo++) {
352  if (fLogicChamber[copyNo]) fLogicChamber[copyNo]->
353  SetMaterial(fChamberMaterial);
354  }
355  G4cout
356  << G4endl
357  << "----> The chambers are made of " << materialName << G4endl;
358  } else {
359  G4cout
360  << G4endl
361  << "--> WARNING from SetChamberMaterial : "
362  << materialName << " not found" << G4endl;
363  }
364  }
365 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
def SetMaterial
Definition: EmPlot.py:25
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void B2aDetectorConstruction::SetCheckOverlaps ( G4bool  checkOverlaps)

Definition at line 376 of file B2aDetectorConstruction.cc.

377 {
378  fCheckOverlaps = checkOverlaps;
379 }
void B2aDetectorConstruction::SetMaxStep ( G4double  maxStep)

Definition at line 369 of file B2aDetectorConstruction.cc.

370 {
371  if ((fStepLimit)&&(maxStep>0.)) fStepLimit->SetMaxAllowedStep(maxStep);
372 }
virtual void SetMaxAllowedStep(G4double ustepMax)

Here is the call graph for this function:

Here is the caller graph for this function:

void B2aDetectorConstruction::SetTargetMaterial ( G4String  materialName)

Definition at line 316 of file B2aDetectorConstruction.cc.

317 {
318  G4NistManager* nistManager = G4NistManager::Instance();
319 
320  G4Material* pttoMaterial =
321  nistManager->FindOrBuildMaterial(materialName);
322 
323  if (fTargetMaterial != pttoMaterial) {
324  if ( pttoMaterial ) {
325  fTargetMaterial = pttoMaterial;
326  if (fLogicTarget) fLogicTarget->SetMaterial(fTargetMaterial);
327  G4cout
328  << G4endl
329  << "----> The target is made of " << materialName << G4endl;
330  } else {
331  G4cout
332  << G4endl
333  << "--> WARNING from SetTargetMaterial : "
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)

Here is the call graph for this function:

Here is the caller graph for this function:


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