VMC Examples Version 6.6
Loading...
Searching...
No Matches
VMC::Monopole::DetectorConstruction Class Reference

The detector construction (via TGeo ) More...

#include <DetectorConstruction.h>

Inheritance diagram for VMC::Monopole::DetectorConstruction:

Public Member Functions

 DetectorConstruction ()
 
virtual ~DetectorConstruction ()
 
void ConstructMaterials ()
 
void ConstructGeometry ()
 
void SetAbsorberSizeX (Double_t sizeX)
 
void SetAbsorberSizeYZ (Double_t sizeYZ)
 
void SetAbsorberMaterial (const TString &name)
 
void SetMaxStepSize (Double_t maxStepSize)
 
void SetGeometryInitialized (Bool_t geometryInitialized)
 
Double_t GetWorldSizeX () const
 
Double_t GetAbsorberSizeX () const
 
Double_t GetMaxStepSize () const
 
TString GetAbsorberMaterial () const
 
Bool_t GetGeometryInitialized () const
 

Private Member Functions

void PrintParameters ()
 

Private Attributes

TString fWorldMaterial
 
TString fAbsorberMaterial
 
Double_t fAbsorberSizeX
 
Double_t fAbsorberSizeYZ
 
Double_t fWorldSizeX
 
Double_t fWorldSizeYZ
 
Double_t fMaxStepSize
 
Bool_t fGeometryInitialized
 

Detailed Description

The detector construction (via TGeo )

Date
06/07/2018
Author
I. Hrivnacova; IPN, Orsay

Definition at line 37 of file DetectorConstruction.h.

Constructor & Destructor Documentation

◆ DetectorConstruction()

VMC::Monopole::DetectorConstruction::DetectorConstruction ( )

◆ ~DetectorConstruction()

VMC::Monopole::DetectorConstruction::~DetectorConstruction ( )
virtual

Destructor

Definition at line 54 of file DetectorConstruction.cxx.

55 {
56 /// Destructor
57 }

Member Function Documentation

◆ ConstructMaterials()

void VMC::Monopole::DetectorConstruction::ConstructMaterials ( )

Construct materials using TGeo modeller

Definition at line 68 of file DetectorConstruction.cxx.

69 {
70 /// Construct materials using TGeo modeller
71
72 //
73 // Tracking medias (defaut parameters)
74 //
75
76 // Create Root geometry manager
77 new TGeoManager("Monopole_geometry", "Monopole VMC example geometry");
78
79 //--------- Material definition ---------
80
81 TString name; // Material name
82 Double_t a; // Mass of a mole in g/mole
83 Double_t z; // Atomic number
84 Double_t density; // Material density in g/cm3
85
86 //
87 // define simple materials
88 //
89
90 new TGeoMaterial("Aluminium", a = 26.98, z = 13., density = 2.700);
91 new TGeoMaterial("Si", a = 28.085, z = 14., density = 2.330);
92 new TGeoMaterial("Galactic", a = 1.e-16, z = 1.e-16, density = 1.e-16);
93
94 //
95 // Tracking media
96 //
97
98 // Paremeter for tracking media
99 Double_t param[20];
100 param[0] = 0; // isvol - Not used
101 param[1] = 2; // ifield - User defined magnetic field
102 param[2] = 10.; // fieldm - Maximum field value (in kiloGauss)
103 param[3] = -20.; // tmaxfd - Maximum angle due to field deflection
104 param[4] = -0.01; // stemax - Maximum displacement for multiple scat
105 param[5] = -.3; // deemax - Maximum fractional energy loss, DLS
106 param[6] = .001; // epsil - Tracking precision
107 param[7] = -.8; // stmin
108 for (Int_t i = 8; i < 20; ++i) param[i] = 0.;
109
110 Int_t mediumId = 0;
111 TList* materials = gGeoManager->GetListOfMaterials();
112 TIter next(materials);
113 while (TObject* obj = next()) {
114 TGeoMaterial* material = (TGeoMaterial*)obj;
115 // set step limit to other than world material
116 if (material->GetName() != TString("Galactic")) {
117 param[4] = fMaxStepSize;
118 }
119 else {
120 param[4] = -0.01;
121 }
122 new TGeoMedium(material->GetName(), ++mediumId, material, param);
123 }
124 }

◆ ConstructGeometry()

void VMC::Monopole::DetectorConstruction::ConstructGeometry ( )

Contruct volumes using TGeo modeller

Definition at line 127 of file DetectorConstruction.cxx.

128 {
129 /// Contruct volumes using TGeo modeller
130
131 // Construct materials
133
134 // Media Ids
135 Int_t worldMediumId =
136 gGeoManager->GetMedium(fWorldMaterial.Data())->GetId();
137 Int_t absorberMediumId =
138 gGeoManager->GetMedium(fAbsorberMaterial.Data())->GetId();
139
140 //
141 // World
142 //
143
144 Double_t world[3];
145 world[0] = fWorldSizeX / 2.;
146 world[1] = fWorldSizeYZ / 2.;
147 world[2] = fWorldSizeYZ / 2.;
148 TGeoVolume* top =
149 gGeoManager->Volume("World", "BOX", worldMediumId, world, 3);
150 gGeoManager->SetTopVolume(top);
151
152 //
153 // Absorber
154 //
155 Double_t absorber[3];
156 absorber[0] = fAbsorberSizeX / 2.;
157 absorber[1] = fAbsorberSizeYZ / 2.;
158 absorber[2] = fAbsorberSizeYZ / 2.;
159 gGeoManager->Volume("Absorber", "BOX", absorberMediumId, absorber, 3);
160
161 Double_t posX = 0.;
162 Double_t posY = 0.;
163 Double_t posZ = 0.;
164 Double_t* ubuf = 0;
165 gGeoManager->Node("Absorber", 1, "World", posX, posY, posZ, 0, kTRUE, ubuf);
166
167 // close geometry
168 gGeoManager->CloseGeometry();
169
170 // notify VMC about Root geometry
171 gMC->SetRootGeometry();
172
174 }

◆ SetAbsorberSizeX()

void VMC::Monopole::DetectorConstruction::SetAbsorberSizeX ( Double_t sizeX)

Definition at line 186 of file DetectorConstruction.cxx.

187 {
189 cerr << "Geometry alredy initialized: cannot set absorber sizeX" << endl;
190 return;
191 }
192
193 if (value > 0.0) {
194 fAbsorberSizeX = value;
196 }
197 }

◆ SetAbsorberSizeYZ()

void VMC::Monopole::DetectorConstruction::SetAbsorberSizeYZ ( Double_t sizeYZ)

Definition at line 200 of file DetectorConstruction.cxx.

201 {
203 cerr << "Geometry alredy initialized: cannot set absorber sizeXY" << endl;
204 return;
205 }
206
207 if (value > 0.0) {
208 fAbsorberSizeYZ = value;
210 }
211 }

◆ SetAbsorberMaterial()

void VMC::Monopole::DetectorConstruction::SetAbsorberMaterial ( const TString & name)

Definition at line 214 of file DetectorConstruction.cxx.

215 {
216 // search the material by its name
218 cerr << "Geometry alredy initialized: cannot set absorber material"
219 << endl;
220 return;
221 }
222
223 fAbsorberMaterial = name;
224 }

◆ SetMaxStepSize()

void VMC::Monopole::DetectorConstruction::SetMaxStepSize ( Double_t maxStepSize)

Definition at line 286 of file DetectorConstruction.cxx.

287 {
289 cerr << "Geometry alredy initialized: cannot set max step size" << endl;
290 return;
291 }
292
293 fMaxStepSize = step;
294 }

◆ SetGeometryInitialized()

void VMC::Monopole::DetectorConstruction::SetGeometryInitialized ( Bool_t geometryInitialized)
inline

Definition at line 82 of file DetectorConstruction.h.

84{
85 fGeometryInitialized = geometryInitialized;
86}

◆ GetWorldSizeX()

Double_t VMC::Monopole::DetectorConstruction::GetWorldSizeX ( ) const
inline

Definition at line 58 of file DetectorConstruction.h.

58{ return fWorldSizeX; }

◆ GetAbsorberSizeX()

Double_t VMC::Monopole::DetectorConstruction::GetAbsorberSizeX ( ) const
inline

Definition at line 59 of file DetectorConstruction.h.

59{ return fAbsorberSizeX; }

◆ GetMaxStepSize()

Double_t VMC::Monopole::DetectorConstruction::GetMaxStepSize ( ) const
inline

Definition at line 60 of file DetectorConstruction.h.

60{ return fMaxStepSize; }

◆ GetAbsorberMaterial()

TString VMC::Monopole::DetectorConstruction::GetAbsorberMaterial ( ) const
inline

Definition at line 61 of file DetectorConstruction.h.

61{ return fAbsorberMaterial; }

◆ GetGeometryInitialized()

Bool_t VMC::Monopole::DetectorConstruction::GetGeometryInitialized ( ) const
inline

Definition at line 62 of file DetectorConstruction.h.

62{ return fGeometryInitialized; }

◆ PrintParameters()

void VMC::Monopole::DetectorConstruction::PrintParameters ( )
private

Definition at line 177 of file DetectorConstruction.cxx.

178 {
179 cout << "\n---------------------------------------------------------\n";
180 cout << "---> The Absorber is " << fAbsorberSizeX << " of "
181 << fAbsorberMaterial << endl;
182 cout << "\n---------------------------------------------------------\n";
183 }

Member Data Documentation

◆ fWorldMaterial

TString VMC::Monopole::DetectorConstruction::fWorldMaterial
private

Definition at line 68 of file DetectorConstruction.h.

◆ fAbsorberMaterial

TString VMC::Monopole::DetectorConstruction::fAbsorberMaterial
private

Definition at line 69 of file DetectorConstruction.h.

◆ fAbsorberSizeX

Double_t VMC::Monopole::DetectorConstruction::fAbsorberSizeX
private

Definition at line 70 of file DetectorConstruction.h.

◆ fAbsorberSizeYZ

Double_t VMC::Monopole::DetectorConstruction::fAbsorberSizeYZ
private

Definition at line 71 of file DetectorConstruction.h.

◆ fWorldSizeX

Double_t VMC::Monopole::DetectorConstruction::fWorldSizeX
private

Definition at line 72 of file DetectorConstruction.h.

◆ fWorldSizeYZ

Double_t VMC::Monopole::DetectorConstruction::fWorldSizeYZ
private

Definition at line 73 of file DetectorConstruction.h.

◆ fMaxStepSize

Double_t VMC::Monopole::DetectorConstruction::fMaxStepSize
private

Definition at line 74 of file DetectorConstruction.h.

◆ fGeometryInitialized

Bool_t VMC::Monopole::DetectorConstruction::fGeometryInitialized
private

Definition at line 75 of file DetectorConstruction.h.


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