VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex06DetectorConstructionOld.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 Ex06DetectorConstructionOld.cxx
11/// \brief Implementation of the Ex06DetectorConstructionOld class
12///
13/// Geant4 ExampleN06 adapted to Virtual Monte Carlo \n
14/// Id: ExN06DetectorConstruction.cc,v 1.14 2004/03/17 22:41:12 gum Exp \n
15/// GEANT4 tag Name: geant4-07-00-cand-01
16///
17/// \date 16/05/2005
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <Riostream.h>
21#include <TGeoManager.h>
22#include <TVirtualMC.h>
23
25
26/// \cond CLASSIMP
28 /// \endcond
29
30 //_____________________________________________________________________________
32 : TObject(),
33 fWorldSize(1500), // 15*m
34 fExpHallSize(1000), // 10*m
35 fTankSize(500), // 5*m
36 fBubbleSize(50), // 0.5*m
37 fImedAir(-1),
38 fImedWater(-1)
39{
40 /// Default constuctor
41}
42
43//_____________________________________________________________________________
48
49//
50// public methods
51//
52
53//_____________________________________________________________________________
55{
56 /// Construct materials using VMC functions
57
58 Double_t a1[2] = { 14.01, 16.00 };
59 Double_t z1[2] = { 7.0, 8.0 };
60 Double_t w1[2] = { 0.7, 0.3 };
61 Double_t density = 1.29e-03;
62 Int_t imatAir;
63 gMC->Mixture(imatAir, "Air", a1, z1, density, 2, w1);
64
65 Double_t a2[2] = { 1.01, 16.00 };
66 Double_t z2[2] = { 1.0, 8.0 };
67 Double_t w2[2] = { 2.0, 1.0 };
68 density = 1.0;
69 Int_t imatWater;
70 gMC->Mixture(imatWater, "Water", a2, z2, density, -2, w2);
71
72 //
73 // Tracking medias
74 //
75
76 Int_t ifield = 0; // No magnetic field
77 Double_t fieldm = 0.; //
78 Double_t epsil = .001; // Tracking precision,
79 Double_t stemax = -0.01; // Maximum displacement for multiple scat
80 Double_t tmaxfd = -20.; // Maximum angle due to field deflection
81 Double_t deemax = -.3; // Maximum fractional energy loss, DLS
82 Double_t stmin = -.8;
83 Float_t* ubuf = 0;
84 gMC->Medium(fImedAir, "Air", imatAir, 0, ifield, fieldm, tmaxfd, stemax,
85 deemax, epsil, stmin, ubuf, 0);
86 gMC->Medium(fImedWater, "Water", imatWater, 0, ifield, fieldm, tmaxfd, stemax,
87 deemax, epsil, stmin, ubuf, 0);
88}
89
90//_____________________________________________________________________________
92{
93 /// Contruct volumes using VMC functions
94
95 // The world
96 //
97 Double_t world[3];
98 world[0] = fWorldSize;
99 world[1] = fWorldSize;
100 world[2] = fWorldSize;
101 gMC->Gsvolu("WRLD", "BOX", fImedAir, world, 3);
102
103 // The experimental Hall
104 //
105 Double_t expHall[3];
106 expHall[0] = fExpHallSize;
107 expHall[1] = fExpHallSize;
108 expHall[2] = fExpHallSize;
109 gMC->Gsvolu("EXPH", "BOX", fImedAir, expHall, 3);
110
111 Double_t posX = 0.;
112 Double_t posY = 0.;
113 Double_t posZ = 0.;
114 gMC->Gspos("EXPH", 1, "WRLD", posX, posY, posZ, 0, "ONLY");
115
116 // The Water Tank
117 //
118 Double_t waterTank[3];
119 waterTank[0] = fTankSize;
120 waterTank[1] = fTankSize;
121 waterTank[2] = fTankSize;
122 gMC->Gsvolu("TANK", "BOX", fImedWater, waterTank, 3);
123
124 gMC->Gspos("TANK", 1, "EXPH", posX, posY, posZ, 0, "ONLY");
125
126 // The Air Bubble
127 //
128 Double_t bubbleAir[3];
129 bubbleAir[0] = fBubbleSize;
130 bubbleAir[1] = fBubbleSize;
131 bubbleAir[2] = fBubbleSize;
132 gMC->Gsvolu("BUBL", "BOX", fImedAir, bubbleAir, 3);
133
134 posX = 0.;
135 posY = 250.;
136 posZ = 0.;
137 gMC->Gspos("BUBL", 1, "TANK", posX, posY, posZ, 0, "ONLY");
138}
Definition of the Ex06DetectorConstructionOld class.
The detector construction (via TGeo )
Double_t fExpHallSize
The experimental hall size.