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

#include <Par02DetectorConstruction.hh>

Inheritance diagram for Par02DetectorConstruction:
Collaboration diagram for Par02DetectorConstruction:

Public Member Functions

 Par02DetectorConstruction ()
 A default constructor. More...
 
virtual ~Par02DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 A method invoked by G4RunManager::Initialize() to construct thread local objects. More...
 
- 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
 

Public Attributes

std::vector< G4Region * > fTrackerList
 A vector of the tracking detector regions. More...
 
std::vector< G4Region * > fECalList
 A vector of the the electromagnetic calorimeter regions. More...
 
std::vector< G4Region * > fHCalList
 A vector of the the hadronic calorimeter regions. More...
 
std::vector< G4Region * > fMuonList
 A vector of the muon detector regions. More...
 
G4GlobalMagFieldMessengerfMagFieldMessenger
 Messenger of the magnetic field. More...
 

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

Construction of detector geometry.

A mandatory initialization class of the detector setup. Detector construction allows to use the geometry read from a GDML file. Based on G4 examples/persistency/gdml/G01/include/G01DetectorConstruction.hh .

Author
Anna Zaborowska

Definition at line 51 of file Par02DetectorConstruction.hh.

Constructor & Destructor Documentation

Par02DetectorConstruction::Par02DetectorConstruction ( )

A default constructor.

Definition at line 42 of file Par02DetectorConstruction.cc.

42 {}
Par02DetectorConstruction::~Par02DetectorConstruction ( )
virtual

Definition at line 46 of file Par02DetectorConstruction.cc.

46 {}

Member Function Documentation

G4VPhysicalVolume * Par02DetectorConstruction::Construct ( void  )
virtual

A method invoked by G4RunManager::Initialize()

Returns
A pointer to the world volume.

Implements G4VUserDetectorConstruction.

Definition at line 50 of file Par02DetectorConstruction.cc.

50  {
52  parser.Read( "Par02FullDetector.gdml" );
53  G4cout << "Geometry loaded from file .......Par02FullDetector.gdml " << G4endl;
54 
55  // This GDML detector description uses the auxiliary information part to store
56  // information regarding which Geant4 volumes have a fast simulation model.
57 
58  const G4GDMLAuxMapType* aAuxMap = parser.GetAuxMap();
59  for ( G4GDMLAuxMapType::const_iterator iter = aAuxMap->begin();
60  iter != aAuxMap->end(); ++iter ) {
61  for ( G4GDMLAuxListType::const_iterator vit = (*iter).second.begin();
62  vit != (*iter).second.end(); ++vit ) {
63  if ( (*vit).type == "FastSimModel" ) {
64  G4LogicalVolume* myvol = (*iter).first;
65  if ( ( myvol->GetName() ).find( "Tracker" ) != std::string::npos ) {
66  fTrackerList.push_back( new G4Region( myvol->GetName() ) );
67  fTrackerList.back()->AddRootLogicalVolume( myvol );
68  G4cout << G4endl << "tracker !!!" << G4endl;
69  } else if ( ( myvol->GetName() ).find( "HCal" ) != std::string::npos ) {
70  fHCalList.push_back( new G4Region( myvol->GetName() ) );
71  fHCalList.back()->AddRootLogicalVolume( myvol );
72  G4cout << G4endl << "hcal !!!" << G4endl;
73  } else if ( ( myvol->GetName() ).find( "ECal" ) != std::string::npos ) {
74  fECalList.push_back( new G4Region( myvol->GetName() ) );
75  fECalList.back()->AddRootLogicalVolume( myvol );
76  G4cout << G4endl << "ecal !!!" << G4endl;
77  } else if ( ( myvol->GetName() ).find( "Muon" ) != std::string::npos ) {
78  fMuonList.push_back( new G4Region( myvol->GetName() ) );
79  fMuonList.back()->AddRootLogicalVolume( myvol );
80  } else {
81  G4cout << G4endl << "NOT A KNOWN DETECTOR !!!" << G4endl;
82  }
83  }
84  }
85  }
86  for ( G4int iterTracker = 0; iterTracker < G4int( fTrackerList.size() );
87  iterTracker++ ) {
88  fTrackerList[ iterTracker ]->SetProductionCuts( new G4ProductionCuts() );
89  fTrackerList[ iterTracker ]->GetProductionCuts()->SetProductionCut
90  ( 1.0* ( ( *fTrackerList[ iterTracker ]->GetRootLogicalVolumeIterator() )->
91  GetMaterial()->GetRadlen() ) );
92  fTrackerList[ iterTracker ]->GetProductionCuts()->
93  SetProductionCut( 1.0*m, idxG4GammaCut );
94  }
95  for ( G4int iterECal = 0; iterECal < G4int( fECalList.size() ); iterECal++ ) {
96  fECalList[ iterECal ]->SetProductionCuts( new G4ProductionCuts() );
97  fECalList[ iterECal ]->GetProductionCuts()->SetProductionCut
98  ( 0.5* ( ( *fECalList[ iterECal ]->GetRootLogicalVolumeIterator() )->
99  GetMaterial()->GetRadlen() ) );
100  fECalList[ iterECal ]->GetProductionCuts()->
101  SetProductionCut( 0.1*m, idxG4GammaCut );
102  }
103  for ( G4int iterHCal = 0; iterHCal < G4int( fHCalList.size() ); iterHCal++ ) {
104  fHCalList[ iterHCal ]->SetProductionCuts( new G4ProductionCuts() );
105  fHCalList[ iterHCal ]->GetProductionCuts()->SetProductionCut(
106  0.5* ( ( *fHCalList[iterHCal]->GetRootLogicalVolumeIterator() )->
107  GetMaterial()->GetRadlen() ) );
108  fHCalList[ iterHCal ]->GetProductionCuts()->
109  SetProductionCut( 1.0*m, idxG4GammaCut );
110  }
111 
112  // Returns the pointer to the physical world.
113  return parser.GetWorldVolume();
114 }
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
std::vector< G4Region * > fTrackerList
A vector of the tracking detector regions.
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static constexpr double m
Definition: G4SIunits.hh:129
CommandLineParser * parser(0)
std::vector< G4Region * > fMuonList
A vector of the muon detector regions.
const G4GDMLAuxMapType * GetAuxMap() const
void Read(const G4String &filename, G4bool Validate=true)
std::vector< G4Region * > fHCalList
A vector of the the hadronic calorimeter regions.
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const
std::map< G4LogicalVolume *, G4GDMLAuxListType > G4GDMLAuxMapType
std::vector< G4Region * > fECalList
A vector of the the electromagnetic calorimeter regions.

Here is the call graph for this function:

void Par02DetectorConstruction::ConstructSDandField ( )
virtual

A method invoked by G4RunManager::Initialize() to construct thread local objects.

Reimplemented from G4VUserDetectorConstruction.

Definition at line 118 of file Par02DetectorConstruction.cc.

118  {
119  for ( G4int iterTracker = 0; iterTracker < G4int( fTrackerList.size() );
120  iterTracker++ ) {
121  // Bound the fast simulation model for the tracker subdetector
122  // to all the corresponding Geant4 regions
123  Par02FastSimModelTracker* fastSimModelTracker
124  = new Par02FastSimModelTracker( "fastSimModelTracker", fTrackerList[ iterTracker ],
126 
127  // Register the fast simulation model for deleting
128  G4AutoDelete::Register(fastSimModelTracker);
129  }
130  for ( G4int iterECal = 0; iterECal < G4int( fECalList.size() ); iterECal++ ) {
131  // Bound the fast simulation model for the electromagnetic calorimeter
132  // to all the corresponding Geant4 regions
133  Par02FastSimModelEMCal* fastSimModelEMCal
134  = new Par02FastSimModelEMCal( "fastSimModelEMCal", fECalList[ iterECal ],
136 
137  // Register the fast simulation model for deleting
138  G4AutoDelete::Register(fastSimModelEMCal);
139  }
140  for ( G4int iterHCal = 0; iterHCal < G4int( fHCalList.size() ); iterHCal++ ) {
141  // Bound the fast simulation model for the hadronic calorimeter
142  // to all the corresponding Geant4 regions
143  Par02FastSimModelHCal* fastSimModelHCal
144  = new Par02FastSimModelHCal( "fastSimModelHCal", fHCalList[ iterHCal ],
146 
147  // Register the fast simulation model for deleting
148  G4AutoDelete::Register( fastSimModelHCal );
149  }
150  // Currently we don't have a fast muon simulation model to be bound
151  // to all the corresponding Geant4 regions.
152  // But it could be added in future, in a similar way as done above for
153  // the tracker subdetector and the electromagnetic and hadronic calorimeters.
154 
155  // Add global magnetic field
156  G4ThreeVector fieldValue = G4ThreeVector();
157  fMagFieldMessenger = new G4GlobalMagFieldMessenger( fieldValue );
159 }
void SetVerboseLevel(G4int verboseLevel)
CLHEP::Hep3Vector G4ThreeVector
std::vector< G4Region * > fTrackerList
A vector of the tracking detector regions.
int G4int
Definition: G4Types.hh:78
void Register(T *inst)
Definition: G4AutoDelete.hh:65
std::vector< G4Region * > fHCalList
A vector of the the hadronic calorimeter regions.
std::vector< G4Region * > fECalList
A vector of the the electromagnetic calorimeter regions.
G4GlobalMagFieldMessenger * fMagFieldMessenger
Messenger of the magnetic field.

Here is the call graph for this function:

Member Data Documentation

std::vector< G4Region* > Par02DetectorConstruction::fECalList

A vector of the the electromagnetic calorimeter regions.

Definition at line 70 of file Par02DetectorConstruction.hh.

std::vector< G4Region* > Par02DetectorConstruction::fHCalList

A vector of the the hadronic calorimeter regions.

Definition at line 73 of file Par02DetectorConstruction.hh.

G4GlobalMagFieldMessenger* Par02DetectorConstruction::fMagFieldMessenger

Messenger of the magnetic field.

Definition at line 79 of file Par02DetectorConstruction.hh.

std::vector< G4Region* > Par02DetectorConstruction::fMuonList

A vector of the muon detector regions.

Definition at line 76 of file Par02DetectorConstruction.hh.

std::vector< G4Region* > Par02DetectorConstruction::fTrackerList

A vector of the tracking detector regions.

Definition at line 67 of file Par02DetectorConstruction.hh.


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