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