VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex02DetectorConstructionOld Class Reference

The old detector construction (via VMC functions) More...

#include <Ex02DetectorConstructionOld.h>

Inheritance diagram for Ex02DetectorConstructionOld:

Public Member Functions

 Ex02DetectorConstructionOld ()
 
virtual ~Ex02DetectorConstructionOld ()
 
void ConstructMaterials ()
 
void ConstructGeometry ()
 
void SetTargetMaterial (const TString &name)
 
void SetChamberMaterial (const TString &name)
 
Double_t GetTrackerFullLength ()
 
Double_t GetTargetFullLength ()
 
Double_t GetWorldFullLength ()
 

Private Attributes

Double_t fWorldLength
 Full length of the world volume.
 
Double_t fTargetLength
 Full length of Target.
 
Double_t fTrackerLength
 Full length of Tracker.
 
Int_t fNofChambers
 Nb of chambers in the tracker region.
 
Double_t fChamberWidth
 Width of the chambers.
 
Double_t fChamberSpacing
 Distance between chambers.
 
Int_t fImedAir
 The Air medium Id.
 
Int_t fImedPb
 The Lead medium Id.
 
Int_t fImedXe
 The Xenon gas medium Id.
 

Detailed Description

The old detector construction (via VMC functions)

Date
21/04/2002
Author
I. Hrivnacova; IPN, Orsay

Definition at line 31 of file Ex02DetectorConstructionOld.h.

Constructor & Destructor Documentation

◆ Ex02DetectorConstructionOld()

Ex02DetectorConstructionOld::Ex02DetectorConstructionOld ( )

Default constuctor

Definition at line 34 of file Ex02DetectorConstructionOld.cxx.

35 : TObject(),
36 fWorldLength(0.),
37 fTargetLength(0.),
39 fNofChambers(0),
40 fChamberWidth(0.),
42 fImedAir(0),
43 fImedPb(0),
44 fImedXe(0)
45
46{
47 /// Default constuctor
48
49 // fpMagField = new ExN02MagneticField();
50
51 //--------- Sizes of the principal geometrical components (solids) ---------
52
53 fNofChambers = 5;
54 fChamberWidth = 20;
55 fChamberSpacing = 80;
56
58 (fNofChambers + 1) * fChamberSpacing; // Full length of Tracker
59 fTargetLength = 5.0; // Full length of Target
61}
Int_t fImedXe
The Xenon gas medium Id.
Double_t fWorldLength
Full length of the world volume.
Double_t fTrackerLength
Full length of Tracker.
Double_t fChamberWidth
Width of the chambers.
Int_t fNofChambers
Nb of chambers in the tracker region.
Double_t fTargetLength
Full length of Target.
Double_t fChamberSpacing
Distance between chambers.

◆ ~Ex02DetectorConstructionOld()

Ex02DetectorConstructionOld::~Ex02DetectorConstructionOld ( )
virtual

Destructor

Definition at line 64 of file Ex02DetectorConstructionOld.cxx.

65{
66 /// Destructor
67
68 // delete fpMagField;
69}

Member Function Documentation

◆ ConstructMaterials()

void Ex02DetectorConstructionOld::ConstructMaterials ( )

Construct materials using VMC functions

Definition at line 72 of file Ex02DetectorConstructionOld.cxx.

73{
74 /// Construct materials using VMC functions
75
76 //--------- Material definition ---------
77
78 Double_t a;
79 Double_t z;
80 Double_t density;
81 Double_t radl;
82 Double_t absl;
83 Float_t* ubuf = 0;
84
85 Double_t a2[2] = { 14.01, 16.00 };
86 Double_t z2[2] = { 7.0, 8.0 };
87 Double_t w2[2] = { 0.7, 0.3 };
88 density = 1.29e-03;
89 Int_t imatAir;
90 gMC->Mixture(imatAir, "Air", a2, z2, density, 2, w2);
91
92 a = 207.19;
93 z = 82.;
94 density = 11.35;
95 radl = 0.5612;
96 absl = 0.1;
97 Int_t imatPb;
98 gMC->Material(imatPb, "Lead", a, z, density, radl, absl, ubuf, 0);
99
100 a = 131.29;
101 z = 54.;
102 density = 5.458e-03;
103 // pressure = 1*atmosphere;
104 // temperature = 293.15*kelvin;
105 radl = 1553.9;
106 absl = 0.1;
107 Int_t imatXe;
108 gMC->Material(imatXe, "XenonGas", a, z, density, radl, absl, ubuf, 0);
109
110 //
111 // Tracking medias
112 //
113
114 Int_t ifield = 2; // User defined magnetic field
115 Double_t fieldm = 10.; // Maximum field value (in kiloGauss)
116 Double_t epsil = .001; // Tracking precision,
117 Double_t stemax = -0.01; // Maximum displacement for multiple scat
118 Double_t tmaxfd = -20.; // Maximum angle due to field deflection
119 Double_t deemax = -.3; // Maximum fractional energy loss, DLS
120 Double_t stmin = -.8;
121 gMC->Medium(fImedAir, "Air", imatAir, 0, ifield, fieldm, tmaxfd, stemax,
122 deemax, epsil, stmin, ubuf, 0);
123 gMC->Medium(fImedPb, "Lead", imatPb, 0, ifield, fieldm, tmaxfd, stemax,
124 deemax, epsil, stmin, ubuf, 0);
125 gMC->Medium(fImedXe, "XenonGas", imatXe, 0, ifield, fieldm, tmaxfd, stemax,
126 deemax, epsil, stmin, ubuf, 0);
127
128 // Print all the materials defined.
129 //
130 // G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
131 // G4cout << *(G4Material::GetMaterialTable()) << G4endl;
132}

◆ ConstructGeometry()

void Ex02DetectorConstructionOld::ConstructGeometry ( )

Construct volumes using VMC functions

Definition at line 135 of file Ex02DetectorConstructionOld.cxx.

136{
137 /// Construct volumes using VMC functions
138
139 //--------- Sizes of the principal geometrical components (solids) ---------
140
141 Int_t targetMater = fImedPb;
142 Int_t chamberMater = fImedXe;
143
144 Double_t targetSize = 0.5 * fTargetLength; // Half length of the Target
145 Double_t trackerSize = 0.5 * fTrackerLength; // Half length of the Tracker
146
147 //--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
148
149 //------------------------------
150 // World
151 //------------------------------
152
153 Double_t halfWorldLength = 0.5 * fWorldLength;
154
155 Double_t world[3];
156 world[0] = halfWorldLength;
157 world[1] = halfWorldLength;
158 world[2] = halfWorldLength;
159 gMC->Gsvolu("WRLD", "BOX", fImedAir, world, 3);
160
161 //------------------------------
162 // Target
163 //------------------------------
164
165 Double_t target[3];
166 target[0] = targetSize;
167 target[1] = targetSize;
168 target[2] = targetSize;
169 gMC->Gsvolu("TARG", "BOX", targetMater, target, 3);
170
171 Double_t posX = 0.;
172 Double_t posY = 0.;
173 Double_t posZ = -(targetSize + trackerSize);
174 gMC->Gspos("TARG", 1, "WRLD", posX, posY, posZ, 0, "ONLY");
175
176 cout << "Target is " << fTargetLength
177 << " cm"
178 //<< " of " << TargetMater->GetName()
179 << " of lead " << endl;
180
181 //------------------------------
182 // Tracker
183 //------------------------------
184
185 Double_t tracker[3];
186 tracker[0] = trackerSize;
187 tracker[1] = trackerSize;
188 tracker[2] = trackerSize;
189 gMC->Gsvolu("TRAK", "BOX", fImedAir, tracker, 3);
190
191 posX = 0.;
192 posY = 0.;
193 posZ = 0.;
194 gMC->Gspos("TRAK", 1, "WRLD", posX, posY, posZ, 0, "ONLY");
195
196 //------------------------------
197 // Tracker segments
198 //------------------------------
199 //
200 // An example of Parameterised volumes
201 // dummy values for G4Box -- modified by parameterised volume
202 // - implemented using Gsposp
203
204 Double_t chamber[3];
205 chamber[0] = -1;
206 chamber[1] = -1;
207 chamber[2] = -1;
208 gMC->Gsvolu("CHMB", "BOX", chamberMater, chamber, 0);
209
210 Double_t firstPosition = -trackerSize + 0.5 * fChamberWidth;
211 Double_t firstLength = fTrackerLength / 10;
212 Double_t lastLength = fTrackerLength;
213 Ex02ChamberParameterisation* chamberParam =
215 firstPosition, // Z of center of first
216 fChamberSpacing, // Z spacing of centers
217 fChamberWidth, // Width Chamber
218 firstLength, // lengthInitial
219 lastLength); // lengthFinal
220 for (Int_t i = 0; i < fNofChambers; i++) {
221 Double_t pos[3];
222 Double_t dim[3];
223 chamberParam->ComputeTransformation(i, pos);
224 chamberParam->ComputeDimensions(i, dim);
225 gMC->Gsposp("CHMB", i, "TRAK", pos[0], pos[1], pos[2], 0, "ONLY", dim, 3);
226 }
227
228 cout << "There are " << fNofChambers << " chambers in the tracker region. "
229 << "The chambers are " << fChamberWidth / 10.
230 << " mm of "
231 //<< ChamberMater->GetName()
232 << "Xenon gas"
233 << "\n The distance between chamber is " << fChamberSpacing << " cm"
234 << endl;
235
236 //------------------------------------------------
237 // Sensitive detectors
238 //------------------------------------------------
239 /*
240
241 G4SDManager* SDman = G4SDManager::GetSDMpointer();
242
243 G4String trackerChamberSDname = "ExN02/TrackerChamberSD";
244 ExN02TrackerSD* aTrackerSD = new ExN02TrackerSD( trackerChamberSDname );
245 SDman->AddNewDetector( aTrackerSD );
246 logicChamber->SetSensitiveDetector( aTrackerSD );
247 */
248
249 //--------- Visualization attributes -------------------------------
250 /*
251 G4VisAttributes* BoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
252 logicWorld ->SetVisAttributes(BoxVisAtt);
253 logicTarget ->SetVisAttributes(BoxVisAtt);
254 logicTracker->SetVisAttributes(BoxVisAtt);
255
256 G4VisAttributes* ChamberVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
257 logicChamber->SetVisAttributes(ChamberVisAtt);
258 */
259 //--------- example of User Limits -------------------------------
260
261 // below is an example of how to set tracking constraints in a given
262 // logical volume(see also in N02PhysicsList how to setup the process
263 // G4UserSpecialCuts).
264 // Sets a max Step length in the tracker region
265 // Double_t maxStep = 0.5*fChamberWidth, maxLength = 2*fTrackerLength;
266 // Double_t maxTime = 0.1*ns, minEkin = 10*MeV;
267 // logicTracker->SetUserLimits(new G4UserLimits(maxStep,maxLength,maxTime,
268 // minEkin));
269}
The chamber parameterisation.
void ComputeTransformation(Int_t copyNo, Double_t *position) const
void ComputeDimensions(Int_t copyNo, Double_t *dimension) const

◆ SetTargetMaterial()

void Ex02DetectorConstructionOld::SetTargetMaterial ( const TString & name)

Set target material (not available with VMC)

Definition at line 272 of file Ex02DetectorConstructionOld.cxx.

274{
275 /// Set target material (not available with VMC)
276
277 Warning("SetTargetMaterial", "Not available in virtual Monte Carlo");
278}

◆ SetChamberMaterial()

void Ex02DetectorConstructionOld::SetChamberMaterial ( const TString & name)

Set chamber material (not available with VMC)

Definition at line 281 of file Ex02DetectorConstructionOld.cxx.

283{
284 /// Set chamber material (not available with VMC)
285
286 Warning("SetTargetMaterial", "Not available in virtual Monte Carlo");
287}

◆ GetTrackerFullLength()

Double_t Ex02DetectorConstructionOld::GetTrackerFullLength ( )
inline
Returns
The tracker full length

Definition at line 46 of file Ex02DetectorConstructionOld.h.

46{ return fTrackerLength; };

◆ GetTargetFullLength()

Double_t Ex02DetectorConstructionOld::GetTargetFullLength ( )
inline
Returns
The target full length

Definition at line 48 of file Ex02DetectorConstructionOld.h.

48{ return fTargetLength; };

◆ GetWorldFullLength()

Double_t Ex02DetectorConstructionOld::GetWorldFullLength ( )
inline
Returns
The world full length

Definition at line 50 of file Ex02DetectorConstructionOld.h.

50{ return fWorldLength; };

Member Data Documentation

◆ fWorldLength

Double_t Ex02DetectorConstructionOld::fWorldLength
private

Full length of the world volume.

Definition at line 53 of file Ex02DetectorConstructionOld.h.

◆ fTargetLength

Double_t Ex02DetectorConstructionOld::fTargetLength
private

Full length of Target.

Definition at line 54 of file Ex02DetectorConstructionOld.h.

◆ fTrackerLength

Double_t Ex02DetectorConstructionOld::fTrackerLength
private

Full length of Tracker.

Definition at line 55 of file Ex02DetectorConstructionOld.h.

◆ fNofChambers

Int_t Ex02DetectorConstructionOld::fNofChambers
private

Nb of chambers in the tracker region.

Definition at line 56 of file Ex02DetectorConstructionOld.h.

◆ fChamberWidth

Double_t Ex02DetectorConstructionOld::fChamberWidth
private

Width of the chambers.

Definition at line 57 of file Ex02DetectorConstructionOld.h.

◆ fChamberSpacing

Double_t Ex02DetectorConstructionOld::fChamberSpacing
private

Distance between chambers.

Definition at line 58 of file Ex02DetectorConstructionOld.h.

◆ fImedAir

Int_t Ex02DetectorConstructionOld::fImedAir
private

The Air medium Id.

Definition at line 59 of file Ex02DetectorConstructionOld.h.

◆ fImedPb

Int_t Ex02DetectorConstructionOld::fImedPb
private

The Lead medium Id.

Definition at line 60 of file Ex02DetectorConstructionOld.h.

◆ fImedXe

Int_t Ex02DetectorConstructionOld::fImedXe
private

The Xenon gas medium Id.

Definition at line 61 of file Ex02DetectorConstructionOld.h.


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