Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorALICE06.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 //
30 // $Id: DetectorALICE06.cc 72517 2013-07-24 23:01:29Z gum $
31 //
32 //
33 
34 #include "DetectorALICE06.hh"
35 #include "SensitiveDetector.hh"
36 #include "Materials.hh"
37 
38 #include "G4Material.hh"
39 #include "G4Box.hh"
40 #include "G4LogicalVolume.hh"
41 #include "G4PVPlacement.hh"
42 #include "G4UniformMagField.hh"
43 #include "G4FieldManager.hh"
45 #include "G4SDManager.hh"
46 
47 #include "G4Region.hh"
48 
49 #include "G4UnitsTable.hh"
50 #include "G4SystemOfUnits.hh"
51 #include "G4ios.hh"
52 
53 #include <cmath>
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58  : fRadiatorDescription(0)
59 {}
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 
64 {
65  // delete fRadiatorDescription;
66  // the description is deleted in detector construction
67 }
68 
69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70 
72 {
73  // Geometry parameters
74  //
75 
76  G4cout << "DetectorALICE06 setup" << G4endl;
77 
78  G4double worldSizeZ = 600.*cm;
79  G4double worldSizeR = 22.*cm;
80 
81  // Radiator and detector parameters
82 
83  G4double radThickness = 0.020*mm;
84  G4double gasGap = 0.500*mm;
85  G4double foilGasRatio = radThickness/(radThickness+gasGap);
86  G4int foilNumber = 120;
87 
88  G4double absorberThickness = 37*mm;
89  G4double absorberRadius = 100.*mm;
90 
91  G4double electrodeThick = 100.0*micrometer;
92  G4double pipeLength = 160.0*cm;
93  G4double mylarThick = 20.0*micrometer;
94  G4double detGap = 0.01*mm;
95 
96  G4double startZ = 100.0*mm;
97 
98  // Materials
99  //
100 
101  // Change to create materials using NIST
104  G4Material* xe15CO2 = Materials::GetInstance()->GetMaterial("Xe15CO2");
105 
106  G4double foilDensity = ch2->GetDensity();
107  G4double gasDensity = air->GetDensity();
108  G4double totDensity = foilDensity*foilGasRatio
109  + gasDensity*(1.0-foilGasRatio);
110 
111  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
112  G4double fractionGas = 1.0 - fractionFoil;
113  G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
114  radiatorMat->AddMaterial(ch2, fractionFoil);
115  radiatorMat->AddMaterial(air, fractionGas);
116 
117  // Radiator description
118  fRadiatorDescription = new RadiatorDescription;
119  fRadiatorDescription->fFoilMaterial = ch2; // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
120  fRadiatorDescription->fGasMaterial = air; // CO2; // He; //
121  fRadiatorDescription->fFoilThickness = radThickness;
122  fRadiatorDescription->fGasThickness = gasGap;
123  fRadiatorDescription->fFoilNumber = foilNumber;
124 
125  G4Material* worldMaterial = air; // CO2;
126  G4Material* absorberMaterial = xe15CO2;
127 
128  // Volumes
129  //
130 
131  G4VSolid* solidWorld
132  = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ/2.);
133 
134  G4LogicalVolume* logicWorld
135  = new G4LogicalVolume(solidWorld, worldMaterial, "World");
136 
137  G4VPhysicalVolume* physicsWorld
138  = new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0, false, 0);
139 
140  // TR radiator envelope
141 
142  G4double radThick = foilNumber*(radThickness + gasGap) - gasGap + detGap;
143  G4double radZ = startZ + 0.5*radThick;
144 
145  G4VSolid* solidRadiator
146  = new G4Box("Radiator", 1.1*absorberRadius, 1.1*absorberRadius, 0.5*radThick);
147 
148  G4LogicalVolume* logicRadiator
149  = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
150 
151  new G4PVPlacement(0, G4ThreeVector(0, 0, radZ),
152  "Radiator", logicRadiator, physicsWorld, false, 0 );
153 
154  fRadiatorDescription->fLogicalVolume = logicRadiator;
155 
156  // Create region for radiator
157 
158  G4Region* radRegion = new G4Region("XTRradiator");
159  radRegion->AddRootLogicalVolume(logicRadiator);
160 
161  // Drift Electrode on both sides of Radiator
162  // (not placed)
163 
164  G4double zElectrode1 = radZ - radThick/2. - electrodeThick/2.;
165  G4double zElectrode2 = radZ + radThick/2. + electrodeThick/2.;
166 
167  G4cout << "zElectrode1 = " << zElectrode1/mm << " mm" <<G4endl;
168  G4cout << "zElectrode2 = " << zElectrode2/mm << " mm" <<G4endl;
169  G4cout << "fElectrodeThick = " << electrodeThick/mm << " mm" << G4endl <<G4endl;
170 
171  // Helium Pipe
172  // (not placed)
173 
174  //Distance between pipe and radiator / absorber
175  G4double pipeDist = 1.*cm;
176  G4double zPipe = zElectrode2 + electrodeThick/2. + pipeDist/2. + pipeLength/2.;
177 
178  G4cout << "zPipe = " << zPipe/mm << " mm" << G4endl;
179  G4cout << "pipeLength = " << pipeLength/mm <<" mm" << G4endl << G4endl;
180 
181  // Mylar Foil on both sides of helium pipe
182  // (not placed)
183 
184  G4double zMylar1 = zPipe - pipeLength/2. - mylarThick/2. - 0.001*mm;
185  G4double zMylar2 = zPipe + pipeLength/2. + mylarThick/2. + 0.001*mm;
186 
187  G4cout << "zMylar1 = " << zMylar1/mm << " mm" << G4endl;
188  G4cout << "zMylar2 = " << zMylar2/mm << " mm" << G4endl;
189  G4cout << "fMylarThick = " << mylarThick/mm << " mm" << G4endl << G4endl;
190 
191  // Mylar Foil on Chamber
192  // (not placed)
193 
194  G4double zMylar = zElectrode2 + electrodeThick/2. + mylarThick/2. + 1.0*mm;
195  zMylar += ( pipeLength + pipeDist );
196 
197  G4cout << "zMylar = " << zMylar/mm <<" mm" <<G4endl;
198  G4cout << "mylarThick = " << mylarThick/mm << " mm" << G4endl << G4endl;
199 
200  // Absorber
201 
202  G4double absorberZ = zMylar + mylarThick + absorberThickness/2.;
203 
204  G4VSolid* solidAbsorber
205  = new G4Box("Absorber", absorberRadius, 10.*mm, absorberThickness/2.);
206 
207  G4LogicalVolume* logicAbsorber
208  = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
209 
210  new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ),
211  "Absorber", logicAbsorber, physicsWorld, false, 0);
212 
213  G4Region* regGasDet = new G4Region("XTRdEdxDetector");
214  regGasDet->AddRootLogicalVolume(logicAbsorber);
215 
216  // Sensitive Detectors: Absorber
217 
218  SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
220  logicAbsorber->SetSensitiveDetector(sd);
221 
222  // Print geometry parameters
223 
224  G4cout << "\n The WORLD is made of "
225  << worldSizeZ/mm << "mm of " << worldMaterial->GetName();
226  G4cout << ", the transverse size (R) of the world is "
227  << worldSizeR/mm << " mm. " << G4endl;
228  G4cout << " The ABSORBER is made of "
229  << absorberThickness/mm << "mm of " << absorberMaterial->GetName();
230  G4cout << ", the transverse size (R) is "
231  << absorberRadius/mm << " mm. " << G4endl;
232  G4cout << " Z position of the (middle of the) absorber "
233  << absorberZ/mm << " mm." << G4endl;
234 
235  G4cout << "radZ = " << radZ/mm << " mm" << G4endl;
236  G4cout << "startZ = " << startZ/mm<< " mm" << G4endl;
237 
238  G4cout << "fRadThick = " << radThick/mm << " mm"<<G4endl;
239  G4cout << "fFoilNumber = " << foilNumber << G4endl;
240  G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
241  G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
242  G4cout << G4endl;
243 
244  return physicsWorld;
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static constexpr double mm
Definition: G4SIunits.hh:115
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:290
void AddMaterial(G4Material *material, G4double fraction)
Definition: G4Material.cc:467
Definition of the DetectorALICE06 class.
Definition: G4Box.hh:64
const G4String & GetName() const
Definition: G4Material.hh:178
G4double GetDensity() const
Definition: G4Material.hh:180
int G4int
Definition: G4Types.hh:78
static Materials * GetInstance()
Definition: Materials.cc:52
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
G4Material * GetMaterial(const G4String &)
Definition: Materials.cc:460
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
G4VPhysicalVolume * Construct()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4LogicalVolume * fLogicalVolume
static constexpr double micrometer
Definition: G4SIunits.hh:100
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)