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

#include <Doxymodules_biasing.h>

Inheritance diagram for GB03DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 GB03DetectorConstruction ()
 
virtual ~GB03DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
void PrintCalorParameters () const
 
void SetAbsorberMaterial (G4String materialChoice)
 
G4String GetAbsorberMaterial () const
 
void SetGapMaterial (G4String materialChoice)
 
G4String GetGapMaterial () const
 
void SetNumberOfLayers (G4int nl)
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int val)
 

Static Public Member Functions

static G4int GetNumberOfLayers ()
 

Private Member Functions

void DefineMaterials ()
 
void SetupGeometry ()
 
void SetupDetectors ()
 
void SetupBiasing ()
 

Private Attributes

G4double fTotalThickness
 
G4double fLayerThickness
 total thinkness of one calorimeter
 
G4bool fConstructed
 = fTotalThickness / fNumberOfLayers
 
G4String fCalName
 
G4MaterialfWorldMaterial
 
G4MaterialfAbsorberMaterial
 
G4MaterialfGapMaterial
 
G4BoxfLayerSolid
 
G4BoxfGapSolid
 
G4LogicalVolumefWorldLogical
 
G4LogicalVolumefCalorLogical
 
G4LogicalVolumefLayerLogical
 
G4LogicalVolumefGapLogical
 
G4VPhysicalVolumefWorldPhysical
 
G4VPhysicalVolumefCalorPhysical
 
G4PVReplicafLayerPhysical
 
G4VPhysicalVolumefGapPhysical
 
GB03DetectorMessengerfDetectorMessenger
 
G4int fVerboseLevel
 

Static Private Attributes

static G4int fNumberOfLayers = 40
 
static G4ThreadLocal G4bool fConstructedSDandField = false
 

Detailed Description

Definition at line 96 of file Doxymodules_biasing.h.

Constructor & Destructor Documentation

◆ GB03DetectorConstruction()

GB03DetectorConstruction::GB03DetectorConstruction ( )

Definition at line 63 of file GB03DetectorConstruction.cc.

66 fConstructed(false),
72{
74 fCalName = "Calor";
76}
G4double fLayerThickness
total thinkness of one calorimeter
G4bool fConstructed
= fTotalThickness / fNumberOfLayers
GB03DetectorMessenger * fDetectorMessenger

◆ ~GB03DetectorConstruction()

GB03DetectorConstruction::~GB03DetectorConstruction ( )
virtual

Definition at line 80 of file GB03DetectorConstruction.cc.

81{ delete fDetectorMessenger;}

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * GB03DetectorConstruction::Construct ( )
virtual

◆ ConstructSDandField()

void GB03DetectorConstruction::ConstructSDandField ( )
virtual

Definition at line 101 of file GB03DetectorConstruction.cc.

◆ PrintCalorParameters()

void GB03DetectorConstruction::PrintCalorParameters ( ) const

Definition at line 321 of file GB03DetectorConstruction.cc.

322{
323 G4cout
324 << "--------------------------------------------------------" << G4endl;
325 G4cout
326 << " Absorber is made of " << fAbsorberMaterial->GetName() << G4endl
327 << " Gap is made of " << fGapMaterial->GetName() << G4endl
328 << "--------------------------------------------------------" << G4endl;
329}

◆ SetAbsorberMaterial()

void GB03DetectorConstruction::SetAbsorberMaterial ( G4String  materialChoice)

Definition at line 333 of file GB03DetectorConstruction.cc.

334{
335 // search the material by its name
336 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
337 if(pttoMaterial)
338 {
339 fAbsorberMaterial = pttoMaterial;
340 if(fConstructed)
341 {
342 fCalorLogical->SetMaterial(fAbsorberMaterial);
343 fLayerLogical->SetMaterial(fAbsorberMaterial);
344 }
345 G4RunManager::GetRunManager()->GeometryHasBeenModified();
346 if (GetVerboseLevel()>1) {
348 }
349 }
350 else
351 {
352 G4cerr
353 << materialChoice << " is not defined. - Command is ignored." << G4endl;
354 }
355}

◆ GetAbsorberMaterial()

G4String GB03DetectorConstruction::GetAbsorberMaterial ( ) const

Definition at line 359 of file GB03DetectorConstruction.cc.

360{ return fAbsorberMaterial->GetName(); }

◆ SetGapMaterial()

void GB03DetectorConstruction::SetGapMaterial ( G4String  materialChoice)

Definition at line 364 of file GB03DetectorConstruction.cc.

365{
366 // search the material by its name
367 G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
368 if(pttoMaterial)
369 {
370 fGapMaterial = pttoMaterial;
371 if(fConstructed)
372 { fGapLogical->SetMaterial(fGapMaterial); }
373 G4RunManager::GetRunManager()->GeometryHasBeenModified();
374 if (GetVerboseLevel()>1) {
376 }
377 }
378 else
379 {
380 G4cerr
381 << materialChoice << " is not defined. - Command is ignored." << G4endl;
382 }
383}

◆ GetGapMaterial()

G4String GB03DetectorConstruction::GetGapMaterial ( ) const

Definition at line 387 of file GB03DetectorConstruction.cc.

388{ return fGapMaterial->GetName(); }

◆ SetNumberOfLayers()

void GB03DetectorConstruction::SetNumberOfLayers ( G4int  nl)

Definition at line 392 of file GB03DetectorConstruction.cc.

393{
394 fNumberOfLayers = nl;
396 if(!fConstructed) return;
397
398 fLayerSolid->SetZHalfLength(fLayerThickness/2.);
399 fGapSolid->SetZHalfLength(fLayerThickness/4.);
400
401 fCalorLogical->RemoveDaughter(fLayerPhysical);
402 delete fLayerPhysical;
406 fGapPhysical->SetTranslation(G4ThreeVector(0.,0.,fLayerThickness/4.));
407
408 G4RunManager::GetRunManager()->GeometryHasBeenModified();
409}

◆ GetNumberOfLayers()

static G4int GB03DetectorConstruction::GetNumberOfLayers ( )
inlinestatic

Definition at line 58 of file GB03DetectorConstruction.hh.

58{ return fNumberOfLayers; }

◆ GetVerboseLevel()

G4int GB03DetectorConstruction::GetVerboseLevel ( ) const
inline

Definition at line 60 of file GB03DetectorConstruction.hh.

60{ return fVerboseLevel; }

◆ SetVerboseLevel()

void GB03DetectorConstruction::SetVerboseLevel ( G4int  val)
inline

Definition at line 61 of file GB03DetectorConstruction.hh.

61{ fVerboseLevel = val; }

◆ DefineMaterials()

void GB03DetectorConstruction::DefineMaterials ( )
private

Definition at line 113 of file GB03DetectorConstruction.cc.

114{
115 G4String name, symbol; //a=mass of a mole;
116 G4double a, z, density; //z=mean number of protons;
117 G4int iz; //iz=number of protons in an isotope;
118 G4int n; // n=number of nucleons in an isotope;
119
120 G4int ncomponents, natoms;
121 G4double abundance, fractionmass;
122 G4double temperature, pressure;
123
124 //
125 // define Elements
126 //
127
128 a = 1.01*g/mole;
129 G4Element* H = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
130
131 a = 12.01*g/mole;
132 G4Element* C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
133
134 a = 14.01*g/mole;
135 G4Element* N = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
136
137 a = 16.00*g/mole;
138 G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
139
140 //
141 // define an Element from isotopes, by relative abundance
142 //
143
144 G4Isotope* U5 = new G4Isotope(name="U235", iz=92, n=235, a=235.01*g/mole);
145 G4Isotope* U8 = new G4Isotope(name="U238", iz=92, n=238, a=238.03*g/mole);
146
147 G4Element* U = new G4Element(name="enriched Uranium",symbol="U",ncomponents=2);
148 U->AddIsotope(U5, abundance= 90.*perCent);
149 U->AddIsotope(U8, abundance= 10.*perCent);
150
151 //
152 // define simple materials
153 //
154
155 new G4Material(name="Aluminium", z=13., a=26.98*g/mole, density=2.700*g/cm3);
156 new G4Material(name="Silicon", z=14., a= 28.09*g/mole, density= 2.33*g/cm3);
157 new G4Material(name="Iron", z=26., a=55.85*g/mole, density=7.87*g/cm3);
158 new G4Material(name="ArgonGas",z=18., a= 39.95*g/mole, density=1.782*mg/cm3);
159 new G4Material(name="He", z=2., a=4.0*g/mole, density=0.1786e-03*g/cm3);
160
161 density = 1.390*g/cm3;
162 a = 39.95*g/mole;
163 new G4Material(name="liquidArgon", z=18., a, density);
164
165 density = 11.35*g/cm3;
166 a = 207.19*g/mole;
167 G4Material* Pb = new G4Material(name="Lead" , z=82., a, density);
168
169 //
170 // define a material from elements. case 1: chemical molecule
171 //
172
173 density = 1.000*g/cm3;
174 G4Material* H2O = new G4Material(name="Water", density, ncomponents=2);
175 H2O->AddElement(H, natoms=2);
176 H2O->AddElement(O, natoms=1);
177
178 density = 1.032*g/cm3;
179 G4Material* Sci = new G4Material(name="Scintillator", density, ncomponents=2);
180 Sci->AddElement(C, natoms=9);
181 Sci->AddElement(H, natoms=10);
182
183 //
184 // define a material from elements. case 2: mixture by fractional mass
185 //
186
187 density = 1.290*mg/cm3;
188 G4Material* Air = new G4Material(name="Air" , density, ncomponents=2);
189 Air->AddElement(N, fractionmass=0.7);
190 Air->AddElement(O, fractionmass=0.3);
191
192 //
193 // examples of vacuum
194 //
195
196 density = universe_mean_density;
197 pressure = 3.e-18*pascal;
198 temperature = 2.73*kelvin;
199 G4Material* Vacuum = new G4Material(name="Galactic", z=1., a=1.01*g/mole,
200 density,kStateGas,temperature,pressure);
201
202 if (GetVerboseLevel()>1) {
203 G4cout << *(G4Material::GetMaterialTable()) << G4endl;
204 }
205
206 //default materials of the calorimeter
207 fWorldMaterial = Vacuum;
209 fGapMaterial = Sci;
210}
std::vector< ExP01TrackerHit * > a

◆ SetupGeometry()

void GB03DetectorConstruction::SetupGeometry ( )
private

Definition at line 214 of file GB03DetectorConstruction.cc.

215{
216 //
217 // World
218 //
219 G4VSolid* worldSolid = new G4Box("World",2.*m,2.*m,fTotalThickness*2.);
220 fWorldLogical = new G4LogicalVolume(worldSolid,fWorldMaterial,"World");
221 fWorldPhysical = new G4PVPlacement(0,G4ThreeVector(),fWorldLogical,"World",
222 0,false,0);
223
224 //
225 // Calorimeter
226 //
227 G4VSolid* calorSolid = new G4Box("Calor",0.5*m,0.5*m,fTotalThickness/2.);
229 fCalorPhysical = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
231
232 //
233 // Layers --- as absorbers
234 //
235 fLayerSolid = new G4Box("Layer",0.5*m,0.5*m,fLayerThickness/2.);
241
242 //
243 // Gap
244 //
245 fGapSolid = new G4Box("Gap",0.5*m,0.5*m,fLayerThickness/4.);
247 fGapPhysical = new G4PVPlacement(0,G4ThreeVector(0.,0.,fLayerThickness/4.),
248 fGapLogical,fCalName+"_gap",fLayerLogical,false,0);
249
250 //
251 // Visualization attributes
252 //
253 fWorldLogical->SetVisAttributes(G4VisAttributes::GetInvisible());
254 G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
255 simpleBoxVisAtt->SetVisibility(true);
256 fCalorLogical->SetVisAttributes(simpleBoxVisAtt);
257 fLayerLogical->SetVisAttributes(simpleBoxVisAtt);
258 fGapLogical->SetVisAttributes(simpleBoxVisAtt);
259
260}

◆ SetupDetectors()

void GB03DetectorConstruction::SetupDetectors ( )
private

Definition at line 264 of file GB03DetectorConstruction.cc.

265{
266 G4SDManager::GetSDMpointer()->SetVerboseLevel(1);
267 G4String filterName;
268
269 G4SDNeutralFilter* neutralFilter
270 = new G4SDNeutralFilter(filterName="neutralFilter");
271 G4SDChargedFilter* chargedFilter
272 = new G4SDChargedFilter(filterName="chargedFilter");
273
274 for(G4int j=0;j<2;j++)
275 {
276 // Loop counter j = 0 : absorber
277 // = 1 : gap
278 G4String detName = fCalName;
279 if(j==0)
280 { detName += "_abs"; }
281 else
282 { detName += "_gap"; }
284 G4SDManager::GetSDMpointer()->AddNewDetector(det);
285 // The second argument in each primitive means the "level" of geometrical
286 // hierarchy, the copy number of that level is used as the key of the
287 // G4THitsMap.
288 // For absorber (j = 0), the copy number of its own physical volume is used.
289 // For gap (j = 1), the copy number of its mother physical volume is used,
290 // since there is only one physical volume of gap is placed with respect
291 // to its mother.
292 G4VPrimitiveScorer* primitive;
293 primitive = new G4PSEnergyDeposit("eDep",j);
294 det->RegisterPrimitive(primitive);
295 primitive = new G4PSFlatSurfaceFlux("nNeutral",1,j);
296 primitive->SetFilter(neutralFilter);
297 det->RegisterPrimitive(primitive);
298 primitive = new G4PSFlatSurfaceFlux("nCharged",1,j);
299 primitive->SetFilter(chargedFilter);
300 det->RegisterPrimitive(primitive);
301
302 if(j==0)
303 { SetSensitiveDetector(fLayerLogical, det); }
304 else
305 { SetSensitiveDetector(fGapLogical, det);}
306
307 }
308 G4SDManager::GetSDMpointer()->SetVerboseLevel(0);
309}

◆ SetupBiasing()

void GB03DetectorConstruction::SetupBiasing ( )
private

Definition at line 313 of file GB03DetectorConstruction.cc.

314{
316 biasingOperator->AttachTo(fLayerLogical);
317}

Member Data Documentation

◆ fNumberOfLayers

G4int GB03DetectorConstruction::fNumberOfLayers = 40
staticprivate

Definition at line 70 of file GB03DetectorConstruction.hh.

◆ fTotalThickness

G4double GB03DetectorConstruction::fTotalThickness
private

Definition at line 72 of file GB03DetectorConstruction.hh.

◆ fLayerThickness

G4double GB03DetectorConstruction::fLayerThickness
private

total thinkness of one calorimeter

Definition at line 73 of file GB03DetectorConstruction.hh.

◆ fConstructed

G4bool GB03DetectorConstruction::fConstructed
private

= fTotalThickness / fNumberOfLayers

Definition at line 75 of file GB03DetectorConstruction.hh.

◆ fConstructedSDandField

G4ThreadLocal G4bool GB03DetectorConstruction::fConstructedSDandField = false
staticprivate

Definition at line 76 of file GB03DetectorConstruction.hh.

◆ fCalName

G4String GB03DetectorConstruction::fCalName
private

Definition at line 78 of file GB03DetectorConstruction.hh.

◆ fWorldMaterial

G4Material* GB03DetectorConstruction::fWorldMaterial
private

Definition at line 80 of file GB03DetectorConstruction.hh.

◆ fAbsorberMaterial

G4Material* GB03DetectorConstruction::fAbsorberMaterial
private

Definition at line 81 of file GB03DetectorConstruction.hh.

◆ fGapMaterial

G4Material* GB03DetectorConstruction::fGapMaterial
private

Definition at line 82 of file GB03DetectorConstruction.hh.

◆ fLayerSolid

G4Box* GB03DetectorConstruction::fLayerSolid
private

Definition at line 84 of file GB03DetectorConstruction.hh.

◆ fGapSolid

G4Box* GB03DetectorConstruction::fGapSolid
private

Definition at line 85 of file GB03DetectorConstruction.hh.

◆ fWorldLogical

G4LogicalVolume* GB03DetectorConstruction::fWorldLogical
private

Definition at line 87 of file GB03DetectorConstruction.hh.

◆ fCalorLogical

G4LogicalVolume* GB03DetectorConstruction::fCalorLogical
private

Definition at line 88 of file GB03DetectorConstruction.hh.

◆ fLayerLogical

G4LogicalVolume* GB03DetectorConstruction::fLayerLogical
private

Definition at line 89 of file GB03DetectorConstruction.hh.

◆ fGapLogical

G4LogicalVolume* GB03DetectorConstruction::fGapLogical
private

Definition at line 90 of file GB03DetectorConstruction.hh.

◆ fWorldPhysical

G4VPhysicalVolume* GB03DetectorConstruction::fWorldPhysical
private

Definition at line 92 of file GB03DetectorConstruction.hh.

◆ fCalorPhysical

G4VPhysicalVolume* GB03DetectorConstruction::fCalorPhysical
private

Definition at line 93 of file GB03DetectorConstruction.hh.

◆ fLayerPhysical

G4PVReplica* GB03DetectorConstruction::fLayerPhysical
private

Definition at line 94 of file GB03DetectorConstruction.hh.

◆ fGapPhysical

G4VPhysicalVolume* GB03DetectorConstruction::fGapPhysical
private

Definition at line 95 of file GB03DetectorConstruction.hh.

◆ fDetectorMessenger

GB03DetectorMessenger* GB03DetectorConstruction::fDetectorMessenger
private

Definition at line 97 of file GB03DetectorConstruction.hh.

◆ fVerboseLevel

G4int GB03DetectorConstruction::fVerboseLevel
private

Definition at line 99 of file GB03DetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration