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

#include <Doxymodules_field.h>

Inheritance diagram for F02DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 F02DetectorConstruction ()
 
 ~F02DetectorConstruction () override
 
void SetAbsorberMaterial (G4String)
 
void SetAbsorberThickness (G4double)
 
void SetAbsorberRadius (G4double)
 
void SetAbsorberZpos (G4double)
 
void SetWorldMaterial (G4String)
 
void SetWorldSizeZ (G4double)
 
void SetWorldSizeR (G4double)
 
G4VPhysicalVolumeConstruct () override
 
void ConstructSDandField () override
 
void PrintCalorParameters ()
 
G4MaterialGetWorldMaterial ()
 
G4double GetWorldSizeZ ()
 
G4double GetWorldSizeR ()
 
G4double GetAbsorberZpos ()
 
G4double GetZStartAbs ()
 
G4double GetZEndAbs ()
 
G4MaterialGetAbsorberMaterial ()
 
G4double GetAbsorberThickness ()
 
G4double GetAbsorberRadius ()
 
const G4VPhysicalVolumeGetPhysiWorld ()
 
const G4VPhysicalVolumeGetAbsorber ()
 
G4LogicalVolumeGetLogicalAbsorber ()
 

Private Member Functions

void DefineMaterials ()
 
void ComputeCalorParameters ()
 
G4VPhysicalVolumeConstructCalorimeter ()
 

Private Attributes

F02DetectorMessengerfDetectorMessenger = nullptr
 
G4Cache< F02CalorimeterSD * > fCalorimeterSD = nullptr
 
G4Cache< F02ElectricFieldSetup * > fEmFieldSetup = nullptr
 
G4TubsfSolidWorld = nullptr
 
G4LogicalVolumefLogicWorld = nullptr
 
G4VPhysicalVolumefPhysiWorld = nullptr
 
G4TubsfSolidAbsorber = nullptr
 
G4LogicalVolumefLogicAbsorber = nullptr
 
G4VPhysicalVolumefPhysiAbsorber = nullptr
 
G4MaterialfAbsorberMaterial = nullptr
 
G4double fAbsorberThickness = 4. * CLHEP::cm
 
G4double fAbsorberRadius = 10. * CLHEP::cm
 
G4bool fWorldChanged
 
G4double fZAbsorber = 36. * CLHEP::cm
 
G4double fZStartAbs = 0.
 
G4double fZEndAbs = 0.
 
G4MaterialfWorldMaterial = nullptr
 
G4double fWorldSizeR = 20. * CLHEP::cm
 
G4double fWorldSizeZ = 80. * CLHEP::cm
 

Detailed Description

Definition at line 57 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F02DetectorConstruction()

F02DetectorConstruction::F02DetectorConstruction ( )

Definition at line 59 of file F02DetectorConstruction.cc.

60{
61 // create commands for interactive definition of the calorimeter
62
64
65 // create materials
66
68
69}
F02DetectorMessenger * fDetectorMessenger

◆ ~F02DetectorConstruction()

F02DetectorConstruction::~F02DetectorConstruction ( )
override

Definition at line 73 of file F02DetectorConstruction.cc.

74{
75 delete fDetectorMessenger;
76}

Member Function Documentation

◆ SetAbsorberMaterial()

void F02DetectorConstruction::SetAbsorberMaterial ( G4String  materialChoice)

Definition at line 277 of file F02DetectorConstruction.cc.

278{
279 // get the pointer to the material table
280 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
281
282 // search the material by its name
283 G4Material* material;
284 for (size_t j=0 ; j<theMaterialTable->size() ; j++)
285 { material = (*theMaterialTable)[j];
286 if (material->GetName() == materialChoice)
287 {
288 fAbsorberMaterial = material;
289 fLogicAbsorber->SetMaterial(material);
290 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
291 }
292 }
293}

◆ SetAbsorberThickness()

void F02DetectorConstruction::SetAbsorberThickness ( G4double  val)

Definition at line 317 of file F02DetectorConstruction.cc.

318{
319 // change Absorber thickness and recompute the calorimeter parameters
320 fAbsorberThickness = val;
322 G4RunManager::GetRunManager()->ReinitializeGeometry();
323}

◆ SetAbsorberRadius()

void F02DetectorConstruction::SetAbsorberRadius ( G4double  val)

Definition at line 327 of file F02DetectorConstruction.cc.

328{
329 // change the transverse size and recompute the calorimeter parameters
330 fAbsorberRadius = val;
332 G4RunManager::GetRunManager()->ReinitializeGeometry();
333}

◆ SetAbsorberZpos()

void F02DetectorConstruction::SetAbsorberZpos ( G4double  val)

Definition at line 357 of file F02DetectorConstruction.cc.

358{
359 fZAbsorber = val;
361 G4RunManager::GetRunManager()->ReinitializeGeometry();
362}

◆ SetWorldMaterial()

void F02DetectorConstruction::SetWorldMaterial ( G4String  materialChoice)

Definition at line 297 of file F02DetectorConstruction.cc.

298{
299 // get the pointer to the material table
300 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
301
302 // search the material by its name
303 G4Material* material;
304 for (size_t j=0 ; j<theMaterialTable->size() ; j++)
305 { material = (*theMaterialTable)[j];
306 if(material->GetName() == materialChoice)
307 {
308 fWorldMaterial = material;
309 fLogicWorld->SetMaterial(material);
310 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
311 }
312 }
313}

◆ SetWorldSizeZ()

void F02DetectorConstruction::SetWorldSizeZ ( G4double  val)

Definition at line 337 of file F02DetectorConstruction.cc.

338{
339 fWorldChanged = true;
340 fWorldSizeZ = val;
342 G4RunManager::GetRunManager()->ReinitializeGeometry();
343}

◆ SetWorldSizeR()

void F02DetectorConstruction::SetWorldSizeR ( G4double  val)

Definition at line 347 of file F02DetectorConstruction.cc.

348{
349 fWorldChanged = true;
350 fWorldSizeR = val;
352 G4RunManager::GetRunManager()->ReinitializeGeometry();
353}

◆ Construct()

G4VPhysicalVolume * F02DetectorConstruction::Construct ( )
override

Definition at line 80 of file F02DetectorConstruction.cc.

81{
82 return ConstructCalorimeter();
83}
G4VPhysicalVolume * ConstructCalorimeter()

◆ ConstructSDandField()

void F02DetectorConstruction::ConstructSDandField ( )
override

Definition at line 366 of file F02DetectorConstruction.cc.

367{
368 // Sensitive Detectors: Absorber
369
370 if (!fCalorimeterSD.Get()) {
371 auto calorimeterSD = new F02CalorimeterSD("CalorSD",this);
372 fCalorimeterSD.Put(calorimeterSD);
373 }
374 G4SDManager::GetSDMpointer()->AddNewDetector(fCalorimeterSD.Get());
375 SetSensitiveDetector(fLogicAbsorber, fCalorimeterSD.Get());
376
377 // Construct the field creator - this will register the field it creates
378
379 if (!fEmFieldSetup.Get()) {
380 auto fieldSetup = new F02ElectricFieldSetup();
381 G4AutoDelete::Register(fieldSetup); //Kernel will delete the messenger
382 fEmFieldSetup.Put(fieldSetup);
383 }
384}
G4Cache< F02ElectricFieldSetup * > fEmFieldSetup
G4Cache< F02CalorimeterSD * > fCalorimeterSD
A class for control of the Electric Field of the detector.

◆ PrintCalorParameters()

void F02DetectorConstruction::PrintCalorParameters ( )

Definition at line 260 of file F02DetectorConstruction.cc.

261{
262 G4cout << "\n The WORLD is made of "
263 << fWorldSizeZ/mm << "mm of " << fWorldMaterial->GetName();
264 G4cout << ", the transverse size (R) of the world is "
265 << fWorldSizeR/mm << " mm. " << G4endl;
266 G4cout << " The ABSORBER is made of "
267 << fAbsorberThickness/mm << "mm of " << fAbsorberMaterial->GetName();
268 G4cout << ", the transverse size (R) is " << fAbsorberRadius/mm
269 << " mm. " << G4endl;
270 G4cout << " Z position of the (middle of the) absorber "
271 << fZAbsorber/mm << " mm." << G4endl;
272 G4cout << G4endl;
273}

◆ GetWorldMaterial()

G4Material * F02DetectorConstruction::GetWorldMaterial ( )
inline

Definition at line 83 of file F02DetectorConstruction.hh.

83{return fWorldMaterial;}

◆ GetWorldSizeZ()

G4double F02DetectorConstruction::GetWorldSizeZ ( )
inline

Definition at line 84 of file F02DetectorConstruction.hh.

84{return fWorldSizeZ;}

◆ GetWorldSizeR()

G4double F02DetectorConstruction::GetWorldSizeR ( )
inline

Definition at line 85 of file F02DetectorConstruction.hh.

85{return fWorldSizeR;}

◆ GetAbsorberZpos()

G4double F02DetectorConstruction::GetAbsorberZpos ( )
inline

Definition at line 87 of file F02DetectorConstruction.hh.

87{return fZAbsorber;}

◆ GetZStartAbs()

G4double F02DetectorConstruction::GetZStartAbs ( )
inline

Definition at line 88 of file F02DetectorConstruction.hh.

◆ GetZEndAbs()

G4double F02DetectorConstruction::GetZEndAbs ( )
inline

Definition at line 89 of file F02DetectorConstruction.hh.

◆ GetAbsorberMaterial()

G4Material * F02DetectorConstruction::GetAbsorberMaterial ( )
inline

Definition at line 91 of file F02DetectorConstruction.hh.

91{return fAbsorberMaterial;}

◆ GetAbsorberThickness()

G4double F02DetectorConstruction::GetAbsorberThickness ( )
inline

Definition at line 92 of file F02DetectorConstruction.hh.

92{return fAbsorberThickness;}

◆ GetAbsorberRadius()

G4double F02DetectorConstruction::GetAbsorberRadius ( )
inline

Definition at line 93 of file F02DetectorConstruction.hh.

93{return fAbsorberRadius;}

◆ GetPhysiWorld()

const G4VPhysicalVolume * F02DetectorConstruction::GetPhysiWorld ( )
inline

Definition at line 95 of file F02DetectorConstruction.hh.

95{return fPhysiWorld;}

◆ GetAbsorber()

const G4VPhysicalVolume * F02DetectorConstruction::GetAbsorber ( )
inline

Definition at line 96 of file F02DetectorConstruction.hh.

96{return fPhysiAbsorber;}

◆ GetLogicalAbsorber()

G4LogicalVolume * F02DetectorConstruction::GetLogicalAbsorber ( )
inline

Definition at line 97 of file F02DetectorConstruction.hh.

97{return fLogicAbsorber;}

◆ DefineMaterials()

void F02DetectorConstruction::DefineMaterials ( )
private

Definition at line 87 of file F02DetectorConstruction.cc.

88{
89 //This function illustrates the possible ways to define materials
90
91 G4String name, symbol; // a=mass of a mole;
92 G4double a, z, density; // z=mean number of protons;
93 G4int nel;
94 G4int ncomponents;
95 G4double fractionmass, pressure, temperature;
96
97 //
98 // define Elements
99 //
100
101 a = 1.01*g/mole;
102 auto elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
103
104 a = 12.01*g/mole;
105 auto elC = new G4Element(name="Carbon", symbol="C", z=6., a);
106
107 a = 14.01*g/mole;
108 auto elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
109
110 a = 16.00*g/mole;
111 auto elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
112
113 a = 39.948*g/mole;
114 auto elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
115
116 //
117 // define simple materials
118 //
119
120 // Mylar
121
122 density = 1.39*g/cm3;
123 auto mylar = new G4Material(name="Mylar", density, nel=3);
124 mylar->AddElement(elO,2);
125 mylar->AddElement(elC,5);
126 mylar->AddElement(elH,4);
127
128 // Polypropelene
129
130 auto CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
131 CH2->AddElement(elH,2);
132 CH2->AddElement(elC,1);
133
134 // Krypton as detector gas, STP
135
136 density = 3.700*mg/cm3;
137 a = 83.80*g/mole;
138 auto Kr = new G4Material(name="Kr",z=36., a, density );
139
140 // Dry air (average composition)
141
142 density = 1.7836*mg/cm3; // STP
143 auto argon = new G4Material(name="Argon" , density, ncomponents=1);
144 argon->AddElement(elAr, 1);
145
146 density = 1.25053*mg/cm3; // STP
147 auto nitrogen = new G4Material(name="N2" , density, ncomponents=1);
148 nitrogen->AddElement(elN, 2);
149
150 density = 1.4289*mg/cm3; // STP
151 auto oxygen = new G4Material(name="O2" , density, ncomponents=1);
152 oxygen->AddElement(elO, 2);
153
154 density = 1.2928*mg/cm3; // STP
155
156 temperature = STP_Temperature;
157 pressure = 1.0e-0*STP_Pressure;
158
159 auto air = new G4Material(name="Air" , density, ncomponents=3,
160 kStateGas,temperature,pressure);
161 air->AddMaterial( nitrogen, fractionmass = 0.7557 );
162 air->AddMaterial( oxygen, fractionmass = 0.2315 );
163 air->AddMaterial( argon, fractionmass = 0.0128 );
164
165 // Xenon as detector gas, STP
166
167 density = 5.858*mg/cm3;
168 a = 131.29*g/mole;
169 auto Xe = new G4Material(name="Xenon",z=54., a, density );
170
171 // Carbon dioxide, STP
172
173 density = 1.842*mg/cm3;
174 auto CarbonDioxide = new G4Material(name="CO2", density, nel=2);
175 CarbonDioxide->AddElement(elC,1);
176 CarbonDioxide->AddElement(elO,2);
177
178 // 80% Xe + 20% CO2, STP
179
180 density = 5.0818*mg/cm3;
181 auto Xe20CO2 = new G4Material(name="Xe20CO2", density, ncomponents=2);
182 Xe20CO2->AddMaterial( Xe, fractionmass = 0.922 );
183 Xe20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.078 );
184
185 // 80% Kr + 20% CO2, STP
186
187 density = 3.601*mg/cm3;
188 auto Kr20CO2 = new G4Material(name="Kr20CO2", density, ncomponents=2);
189 Kr20CO2->AddMaterial( Kr, fractionmass = 0.89 );
190 Kr20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.11 );
191
192 G4cout << *(G4Material::GetMaterialTable()) << G4endl;
193
194 // default materials of the calorimeter
195
196 fAbsorberMaterial = Kr20CO2; // XeCO2CF4;
197
198 fWorldMaterial = air;
199}
std::vector< ExP01TrackerHit * > a

◆ ComputeCalorParameters()

void F02DetectorConstruction::ComputeCalorParameters ( )
inlineprivate

Definition at line 135 of file F02DetectorConstruction.hh.

136{
137 // Compute derived parameters of the calorimeter
138
141}

◆ ConstructCalorimeter()

G4VPhysicalVolume * F02DetectorConstruction::ConstructCalorimeter ( )
private

Definition at line 203 of file F02DetectorConstruction.cc.

204{
205 // Cleanup old geometry
206
207 if (fPhysiWorld)
208 {
209 G4GeometryManager::GetInstance()->OpenGeometry();
210 G4PhysicalVolumeStore::GetInstance()->Clean();
211 G4LogicalVolumeStore::GetInstance()->Clean();
212 G4SolidStore::GetInstance()->Clean();
213 }
214
215 // complete the Calor parameters definition and Print
216
219
220 // World
221
222 fSolidWorld = new G4Tubs("World", // its name
223 0.,fWorldSizeR,fWorldSizeZ/2.,0.,twopi);// its size
224
225 fLogicWorld = new G4LogicalVolume(fSolidWorld, // its solid
226 fWorldMaterial, // its material
227 "World"); // its name
228
229 fPhysiWorld = new G4PVPlacement(nullptr, // no rotation
230 G4ThreeVector(), // at (0,0,0)
231 "World", // its name
232 fLogicWorld, // its logical volume
233 nullptr, // its mother volume
234 false, // no boolean op.
235 0); // copy number
236 // Absorber
237
238 fSolidAbsorber = new G4Tubs("Absorber",0.,
241 0.0,twopi);
242
245 "Absorber");
246
247 fPhysiAbsorber = new G4PVPlacement(nullptr,
248 G4ThreeVector(0.,0.,fZAbsorber),
249 "Absorber",
252 false,
253 0);
254
255 return fPhysiWorld;
256}

Member Data Documentation

◆ fDetectorMessenger

F02DetectorMessenger* F02DetectorConstruction::fDetectorMessenger = nullptr
private

Definition at line 101 of file F02DetectorConstruction.hh.

◆ fCalorimeterSD

G4Cache<F02CalorimeterSD*> F02DetectorConstruction::fCalorimeterSD = nullptr
private

Definition at line 102 of file F02DetectorConstruction.hh.

◆ fEmFieldSetup

G4Cache<F02ElectricFieldSetup*> F02DetectorConstruction::fEmFieldSetup = nullptr
private

Definition at line 103 of file F02DetectorConstruction.hh.

◆ fSolidWorld

G4Tubs* F02DetectorConstruction::fSolidWorld = nullptr
private

Definition at line 105 of file F02DetectorConstruction.hh.

◆ fLogicWorld

G4LogicalVolume* F02DetectorConstruction::fLogicWorld = nullptr
private

Definition at line 106 of file F02DetectorConstruction.hh.

◆ fPhysiWorld

G4VPhysicalVolume* F02DetectorConstruction::fPhysiWorld = nullptr
private

Definition at line 107 of file F02DetectorConstruction.hh.

◆ fSolidAbsorber

G4Tubs* F02DetectorConstruction::fSolidAbsorber = nullptr
private

Definition at line 109 of file F02DetectorConstruction.hh.

◆ fLogicAbsorber

G4LogicalVolume* F02DetectorConstruction::fLogicAbsorber = nullptr
private

Definition at line 110 of file F02DetectorConstruction.hh.

◆ fPhysiAbsorber

G4VPhysicalVolume* F02DetectorConstruction::fPhysiAbsorber = nullptr
private

Definition at line 111 of file F02DetectorConstruction.hh.

◆ fAbsorberMaterial

G4Material* F02DetectorConstruction::fAbsorberMaterial = nullptr
private

Definition at line 113 of file F02DetectorConstruction.hh.

◆ fAbsorberThickness

G4double F02DetectorConstruction::fAbsorberThickness = 4. * CLHEP::cm
private

Definition at line 114 of file F02DetectorConstruction.hh.

◆ fAbsorberRadius

G4double F02DetectorConstruction::fAbsorberRadius = 10. * CLHEP::cm
private

Definition at line 115 of file F02DetectorConstruction.hh.

◆ fWorldChanged

G4bool F02DetectorConstruction::fWorldChanged
private

Definition at line 116 of file F02DetectorConstruction.hh.

◆ fZAbsorber

G4double F02DetectorConstruction::fZAbsorber = 36. * CLHEP::cm
private

Definition at line 118 of file F02DetectorConstruction.hh.

◆ fZStartAbs

G4double F02DetectorConstruction::fZStartAbs = 0.
private

Definition at line 119 of file F02DetectorConstruction.hh.

◆ fZEndAbs

G4double F02DetectorConstruction::fZEndAbs = 0.
private

Definition at line 120 of file F02DetectorConstruction.hh.

◆ fWorldMaterial

G4Material* F02DetectorConstruction::fWorldMaterial = nullptr
private

Definition at line 122 of file F02DetectorConstruction.hh.

◆ fWorldSizeR

G4double F02DetectorConstruction::fWorldSizeR = 20. * CLHEP::cm
private

Definition at line 123 of file F02DetectorConstruction.hh.

◆ fWorldSizeZ

G4double F02DetectorConstruction::fWorldSizeZ = 80. * CLHEP::cm
private

Definition at line 124 of file F02DetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration