Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorBari05.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: DetectorBari05.cc 72517 2013-07-24 23:01:29Z gum $
31 //
32 //
33 
34 #include "DetectorBari05.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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
56  : fRadiatorDescription(0)
57 {}
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60 
62 {
63  // delete fRadiatorDescription;
64  // the description is deleted in detector construction
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {
71  // Geometry parameters
72  //
73 
74  G4cout << "DetectorBari05 setup" << G4endl;
75 
76  G4double worldSizeZ = 600.*cm;
77  G4double worldSizeR = 22.*cm;
78 
79  // Radiator and detector parameters
80 
81  G4double radThickness = 0.0055*mm; // Reg2
82  G4double gasGap = 0.23*mm; // Reg2
83  G4double foilGasRatio = radThickness/(radThickness+gasGap);
84  G4double foilNumber = 191; // Reg2
85 
86  G4double absorberThickness = 0.4*mm;
87  G4double absorberRadius = 100.*mm;
88 
89  G4double electrodeThick = 100.0*micrometer;
90  G4double pipeLength = 50.0*cm;
91  G4double mylarThick = 20.0*micrometer;
92  G4double detGap = 0.01*mm;
93 
94  G4double startZ = 100.0*mm;
95 
96  // Preparation of mixed radiator material
97 
98 
99  // Materials
100  //
101 
102  // Change to create materials using NIST
107 
108  G4double foilDensity = ch2->GetDensity();
109  G4double gasDensity = air->GetDensity();
110  G4double totDensity = foilDensity*foilGasRatio
111  + gasDensity*(1.0-foilGasRatio);
112 
113  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
114  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
115  G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
116  radiatorMat->AddMaterial(ch2, fractionFoil);
117  radiatorMat->AddMaterial(air, fractionGas);
118 
119  // Radiator description
120  fRadiatorDescription = new RadiatorDescription;
121  fRadiatorDescription->fFoilMaterial = ch2; // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
122  fRadiatorDescription->fGasMaterial = air; // CO2; // He; //
123  fRadiatorDescription->fFoilThickness = radThickness;
124  fRadiatorDescription->fGasThickness = gasGap;
125  fRadiatorDescription->fFoilNumber = foilNumber;
126 
127  // pipe material is assumed to be He + small admixture of air
128  foilGasRatio = 0.99999;
129  foilDensity = 1.2928*mg/cm3; // Air
130  gasDensity = 0.178*mg/cm3; // He
131  totDensity = foilDensity*foilGasRatio + gasDensity*(1.0-foilGasRatio);
132 
133  fractionFoil = foilDensity*foilGasRatio/totDensity;
134  fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
135 
136  G4Material* pipeMat = new G4Material("pipeMat", totDensity, 2);
137  pipeMat->AddMaterial(air, fractionFoil);
138  pipeMat->AddMaterial(he, fractionGas);
139 
140 
141  G4Material* worldMaterial = air; // CO2;
142  G4Material* absorberMaterial = si;
143 
144  // Volumes
145  //
146 
147  G4VSolid* solidWorld
148  = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ/2.);
149 
150  G4LogicalVolume* logicWorld
151  = new G4LogicalVolume(solidWorld, worldMaterial, "World");
152 
153  G4VPhysicalVolume* physicsWorld
154  = new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0, false, 0);
155 
156  // TR radiator envelope
157 
158  G4double radThick = foilNumber*(radThickness + gasGap) - gasGap + detGap;
159  G4double radZ = startZ + 0.5*radThick;
160 
161  G4VSolid* solidRadiator
162  = new G4Box("Radiator", 1.1*absorberRadius, 1.1*absorberRadius, 0.5*radThick);
163 
164  G4LogicalVolume* logicRadiator
165  = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
166 
167  new G4PVPlacement(0, G4ThreeVector(0, 0, radZ),
168  "Radiator", logicRadiator, physicsWorld, false, 0 );
169 
170  fRadiatorDescription->fLogicalVolume = logicRadiator;
171 
172  // create region for window inside windowR for
173 
174  G4Region* radRegion = new G4Region("XTRradiator");
175  radRegion->AddRootLogicalVolume(logicRadiator);
176 
177  // Drift Electrode on both sides of Radiator:
178  // (not placed)
179 
180  G4double zElectrode1 = radZ - radThick/2. - electrodeThick/2.;
181  G4double zElectrode2 = radZ + radThick/2. + electrodeThick/2.;
182 
183  G4cout << "zElectrode1 = " << zElectrode1/mm << " mm" << G4endl;
184  G4cout << "zElectrode2 = " << zElectrode2/mm << " mm" << G4endl;
185  G4cout << "electrodeThick = " << electrodeThick/mm << " mm" << G4endl << G4endl;
186 
187  // Helium Pipe
188  // (not placed)
189 
190  G4double pipeDist = 1.*cm; //Distance between pipe and radiator / absorber
191  G4double zPipe = zElectrode2 + electrodeThick/2. + pipeLength/2. + pipeDist/2.;
192 
193  G4cout << "zPipe = " << zPipe/mm << " mm" << G4endl;
194  G4cout << "pipeLength = " << pipeLength/mm << " mm" << G4endl << G4endl;
195 
196  // Mylar Foil on both sides of helium pipe
197  // (not placed)
198 
199  G4double zMylar1 = zPipe - pipeLength/2. - mylarThick/2 - 0.01*mm;
200  G4double zMylar2 = zPipe + pipeLength/2. + mylarThick/2 + 0.01*mm;
201 
202  G4cout << "zMylar1 = " << zMylar1/mm << " mm" << G4endl;
203  G4cout << "zMylar2 = " << zMylar2/mm << " mm" << G4endl;
204  G4cout << "fMylarThick = " << mylarThick/mm << " mm" << G4endl << G4endl;
205 
206  // Mylar Foil on Chamber
207  // (not placed)
208 
209  G4double zMylar = zElectrode2 + electrodeThick/2. + mylarThick/2. + 1.0*mm;
210  zMylar += ( pipeLength + pipeDist );
211 
212  G4cout << "zMylar = " << zMylar/mm <<" mm" <<G4endl;
213  G4cout << "mylarThick = " << mylarThick/mm << " mm" << G4endl << G4endl;
214 
215  // Absorber
216 
217  G4double absorberZ = zMylar + mylarThick/2. + absorberThickness/2.;
218 
219  G4VSolid* solidAbsorber
220  = new G4Box("Absorber", 10.*mm, 10.*mm, absorberThickness/2.);
221 
222  G4LogicalVolume* logicAbsorber
223  = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
224 
225  new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ),
226  "Absorber", logicAbsorber, physicsWorld, false, 0);
227 
228  // Create region for radiator
229 
230  G4Region* regGasDet = new G4Region("XTRdEdxDetector");
231  regGasDet->AddRootLogicalVolume(logicAbsorber);
232 
233  // Sensitive Detectors: Absorber
234 
235  SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
237  logicAbsorber->SetSensitiveDetector(sd);
238 
239  // Print geometry parameters
240 
241  G4cout << "\n The WORLD is made of "
242  << worldSizeZ/mm << "mm of " << worldMaterial->GetName();
243  G4cout << ", the transverse size (R) of the world is "
244  << worldSizeR/mm << " mm. " << G4endl;
245  G4cout << " The ABSORBER is made of "
246  << absorberThickness/mm << "mm of " << absorberMaterial->GetName();
247  G4cout << ", the transverse size (R) is "
248  << absorberRadius/mm << " mm. " << G4endl;
249  G4cout << " Z position of the (middle of the) absorber "
250  << absorberZ/mm << " mm." << G4endl;
251 
252  G4cout << "radZ = " << radZ/mm << " mm" << G4endl;
253  G4cout << "startZ = " << startZ/mm<< " mm" << G4endl;
254 
255  G4cout << "fRadThick = " << radThick/mm << " mm"<<G4endl;
256  G4cout << "fFoilNumber = " << foilNumber << G4endl;
257  G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
258  G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
259  G4cout << G4endl;
260 
261  return physicsWorld;
262 }
263 
264 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static constexpr double mm
Definition: G4SIunits.hh:115
static constexpr double mg
Definition: G4SIunits.hh:184
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:290
Definition: G4Box.hh:64
const G4String & GetName() const
Definition: G4Material.hh:178
G4double GetDensity() const
Definition: G4Material.hh:180
static Materials * GetInstance()
Definition: Materials.cc:52
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
static constexpr double cm3
Definition: G4SIunits.hh:121
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
G4Material * GetMaterial(const G4String &)
Definition: Materials.cc:460
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
Definition of the DetectorBari05 class.
#define G4endl
Definition: G4ios.hh:61
G4VPhysicalVolume * Construct()
double G4double
Definition: G4Types.hh:76
G4LogicalVolume * fLogicalVolume
static constexpr double micrometer
Definition: G4SIunits.hh:100
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)