VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex01DetectorConstructionOld.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Virtual Monte Carlo examples
3// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
10/// \file Ex01DetectorConstructionOld.cxx
11/// \brief Implementation of the Ex01DetectorConstructionOld class
12///
13/// Geant4 ExampleN03 adapted to Virtual Monte Carlo \n
14/// Id: Ex01DetectorConstructionOld.cc,v 1.11 2002/01/09 17:24:09 ranjard Exp \n
15/// GEANT4 tag Name: geant4-04-00-patch-02
16///
17/// \date 21/04/2002
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <iostream>
21
22#include <TVirtualMC.h>
23
25
26/// \cond CLASSIMP
28 /// \endcond
29
30 using namespace std;
31
32//_____________________________________________________________________________
34 : TObject(), fImedAr(0), fImedAl(0), fImedPb(0)
35{
36 /// Default constructor
37}
38
39//_____________________________________________________________________________
44
45//_____________________________________________________________________________
47{
48 /// Construct materials using VMC functions
49
50 Double_t a;
51 Double_t z;
52 Double_t density;
53 Double_t radl;
54 Double_t absl;
55 Float_t* ubuf = 0;
56
57 a = 39.95;
58 z = 18.;
59 density = 1.782e-03;
60 radl = 0.1;
61 absl = 0.1;
62 Int_t imatAr;
63 gMC->Material(imatAr, "ArgonGas", a, z, density, radl, absl, ubuf, 0);
64
65 a = 26.98;
66 z = 13.;
67 density = 2.7;
68 radl = 0.1;
69 absl = 0.1;
70 Int_t imatAl;
71 gMC->Material(imatAl, "Aluminium", a, z, density, radl, absl, ubuf, 0);
72 // user defined parameters (only for test)
73 // Float_t ubuf2[3];
74 // ubuf2[0]=5.5; ubuf2[1]=6.5; ubuf2[2] = 7.5;
75 // gMC->Material(imatAl, "Aluminium", a, z, density, radl, absl, ubuf2, 3);
76
77 a = 207.19;
78 z = 82.;
79 density = 11.35;
80 radl = 0.1;
81 absl = 0.1;
82 Int_t imatLead;
83 gMC->Material(imatLead, "Lead", a, z, density, radl, absl, ubuf, 0);
84
85 // Polyethylene
86 // Mixture defined with the negative number of component, to test updating
87 // wmat. (If nlmat < 0 then wmat contains the number of atoms of a given kind
88 // into the molecule of the compound. In this case, wmat in output is changed
89 // to relative weights.)
90 Float_t apoly[2] = { 12.01, 1. };
91 Float_t zpoly[2] = { 6., 1. };
92 Float_t wpoly[2] = { .33, .67 };
93 Int_t imatPoly;
94 cout << "imatPoly"
95 << " wpoly: " << wpoly[0] << ", " << wpoly[1] << endl;
96 gMC->Mixture(imatPoly, "POLYETHYLEN0$", apoly, zpoly, .95, -2, wpoly);
97 cout << "imatPoly"
98 << " wpoly: " << wpoly[0] << ", " << wpoly[1] << endl;
99
100 //
101 // Tracking medias
102 //
103
104 Int_t ifield = 0; // No magnetic field
105 Double_t fieldm = 0.; //
106 Double_t epsil = .001; // Tracking precision,
107 Double_t stemax = -0.01; // Maximum displacement for multiple scat
108 Double_t tmaxfd = -20.; // Maximum angle due to field deflection
109 Double_t deemax = -.3; // Maximum fractional energy loss, DLS
110 Double_t stmin = -.8;
111 gMC->Medium(fImedAr, "ArgonGas", imatAr, 0, ifield, fieldm, tmaxfd, stemax,
112 deemax, epsil, stmin, ubuf, 0);
113 gMC->Medium(fImedAl, "Aluminium", imatAl, 0, ifield, fieldm, tmaxfd, stemax,
114 deemax, epsil, stmin, ubuf, 0);
115 gMC->Medium(fImedPb, "Lead", imatLead, 0, ifield, fieldm, tmaxfd, stemax,
116 deemax, epsil, stmin, ubuf, 0);
117}
118
119//_____________________________________________________________________________
121{
122 /// Construct volumes using VMC functions
123
124 //------------------------------ experimental hall (world volume)
125 //------------------------------ beam line along x axis
126
127 Double_t expHall[3];
128 expHall[0] = 300.;
129 expHall[1] = 100.;
130 expHall[2] = 100.;
131 gMC->Gsvolu("EXPH", "BOX", fImedAr, expHall, 3);
132
133 //------------------------------ a tracker tube
134
135 Double_t trackerTube[3];
136 trackerTube[0] = 0.;
137 trackerTube[1] = 60.;
138 trackerTube[2] = 50.;
139 gMC->Gsvolu("TRTU", "TUBE", fImedAl, trackerTube, 3);
140
141 Double_t posX = -100.;
142 Double_t posY = 0.;
143 Double_t posZ = 0.;
144 gMC->Gspos("TRTU", 1, "EXPH", posX, posY, posZ, 0, "ONLY");
145
146 //------------------------------ a calorimeter block
147
148 Double_t calBox[3];
149 calBox[0] = 100.;
150 calBox[1] = 50.;
151 calBox[2] = 50.;
152 gMC->Gsvolu("CALB", "BOX", fImedPb, calBox, 3);
153
154 posX = 100.;
155 posY = 0.;
156 posZ = 0.;
157 gMC->Gspos("CALB", 1, "EXPH", posX, posY, posZ, 0, "ONLY");
158
159 //------------------------------ calorimeter layers
160
161 Double_t layerBox[3];
162 layerBox[0] = 1.;
163 layerBox[1] = 40.;
164 layerBox[2] = 40.;
165 gMC->Gsvolu("LAYB", "BOX", fImedAl, layerBox, 3);
166
167 for (Int_t i = 0; i < 19; i++) {
168 posX = (i - 9) * 10.;
169 posY = 0.;
170 posZ = 0.;
171 gMC->Gspos("LAYB", i, "CALB", posX, posY, posZ, 0, "ONLY");
172 }
173}
Definition of the Ex01DetectorConstructionOld class.
The old (deprecated) detector construction class.
Int_t fImedAl
The Aluminium medium Id.