Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Par02DetectorConstruction Class Reference

Construction of detector geometry. More...

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par02DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 Par02DetectorConstruction ()
 A default constructor.
 
virtual ~Par02DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 A method invoked by G4RunManager::Initialize()
 
virtual void ConstructSDandField ()
 A method invoked by G4RunManager::Initialize() to construct thread local objects.
 

Public Attributes

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

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 37 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par02DetectorConstruction()

Par02DetectorConstruction::Par02DetectorConstruction ( )
default

A default constructor.

◆ ~Par02DetectorConstruction()

Par02DetectorConstruction::~Par02DetectorConstruction ( )
virtualdefault

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * Par02DetectorConstruction::Construct ( )
virtual

A method invoked by G4RunManager::Initialize()

Returns
A pointer to the world volume.

Definition at line 49 of file Par02DetectorConstruction.cc.

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

◆ ConstructSDandField()

void Par02DetectorConstruction::ConstructSDandField ( )
virtual

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

Definition at line 117 of file Par02DetectorConstruction.cc.

117 {
118 for ( G4int iterTracker = 0; iterTracker < G4int( fTrackerList.size() );
119 iterTracker++ ) {
120 // Bound the fast simulation model for the tracker subdetector
121 // to all the corresponding Geant4 regions
122 Par02FastSimModelTracker* fastSimModelTracker
123 = new Par02FastSimModelTracker( "fastSimModelTracker", fTrackerList[ iterTracker ],
125
126 // Register the fast simulation model for deleting
127 G4AutoDelete::Register(fastSimModelTracker);
128 }
129 for ( G4int iterECal = 0; iterECal < G4int( fECalList.size() ); iterECal++ ) {
130 // Bound the fast simulation model for the electromagnetic calorimeter
131 // to all the corresponding Geant4 regions
132 Par02FastSimModelEMCal* fastSimModelEMCal
133 = new Par02FastSimModelEMCal( "fastSimModelEMCal", fECalList[ iterECal ],
135
136 // Register the fast simulation model for deleting
137 G4AutoDelete::Register(fastSimModelEMCal);
138 }
139 for ( G4int iterHCal = 0; iterHCal < G4int( fHCalList.size() ); iterHCal++ ) {
140 // Bound the fast simulation model for the hadronic calorimeter
141 // to all the corresponding Geant4 regions
142 Par02FastSimModelHCal* fastSimModelHCal
143 = new Par02FastSimModelHCal( "fastSimModelHCal", fHCalList[ iterHCal ],
145
146 // Register the fast simulation model for deleting
147 G4AutoDelete::Register( fastSimModelHCal );
148 }
149 // Currently we don't have a fast muon simulation model to be bound
150 // to all the corresponding Geant4 regions.
151 // But it could be added in future, in a similar way as done above for
152 // the tracker subdetector and the electromagnetic and hadronic calorimeters.
153
154 // Add global magnetic field
155 G4ThreeVector fieldValue = G4ThreeVector();
157 fMagFieldMessenger->SetVerboseLevel(1);
158}
G4GlobalMagFieldMessenger * fMagFieldMessenger
Messenger of the magnetic field.
Shortcut to the ordinary tracking for electromagnetic calorimeters.
Shortcut to the ordinary tracking for hadronic calorimeters.
Shortcut to the ordinary tracking for tracking detectors.

Member Data Documentation

◆ fTrackerList

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

A vector of the tracking detector regions.

Definition at line 66 of file Par02DetectorConstruction.hh.

◆ fECalList

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

A vector of the the electromagnetic calorimeter regions.

Definition at line 69 of file Par02DetectorConstruction.hh.

◆ fHCalList

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

A vector of the the hadronic calorimeter regions.

Definition at line 72 of file Par02DetectorConstruction.hh.

◆ fMuonList

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

A vector of the muon detector regions.

Definition at line 75 of file Par02DetectorConstruction.hh.

◆ fMagFieldMessenger

G4GlobalMagFieldMessenger* Par02DetectorConstruction::fMagFieldMessenger

Messenger of the magnetic field.

Definition at line 78 of file Par02DetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration