ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorSimpleALICE.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DetectorSimpleALICE.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 "DetectorSimpleALICE.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 << "DetectorSimpleALICE setup" << G4endl;
74 
75  G4double worldSizeZ = 400.*cm;
76  G4double worldSizeR = 20.*cm;
77 
78  // Radiator and detector parameters
79 
80  G4double radThickness = 0.020*mm;
81  G4double gasGap = 0.250*mm;
82  G4double foilGasRatio = radThickness/(radThickness+gasGap);
83  G4int foilNumber = 220;
84 
85  G4double absorberThickness = 38.3*mm;
86  G4double absorberRadius = 100.*mm;
87 
88  G4double windowThick = 51.0*micrometer;
89  G4double electrodeThick = 10.0*micrometer;
90  G4double gapThick = 10.0*cm;
91  G4double detGap = 0.01*mm;
92 
93  G4double startZ = 100.0*mm;
94 
95  // Materials
96  //
97 
98  // Change to create materials using NIST
100  G4Material* mylar = Materials::GetInstance()->GetMaterial("Mylar");
101  G4Material* xe15CO2 = Materials::GetInstance()->GetMaterial("Xe15CO2");
102 
103  G4double foilDensity = mylar->GetDensity();
104  G4double gasDensity = air->GetDensity();
105  G4double totDensity = foilDensity*foilGasRatio
106  + gasDensity*(1.0-foilGasRatio);
107 
108  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
109  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
110 
111  G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
112  radiatorMat->AddMaterial(mylar, fractionFoil);
113  radiatorMat->AddMaterial(air, fractionGas);
114 
115  // Radiator description
118  // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
119  fRadiatorDescription->fGasMaterial = air; // CO2; // He; //
120  fRadiatorDescription->fFoilThickness = radThickness;
122  fRadiatorDescription->fFoilNumber = foilNumber;
123 
124  G4Material* worldMaterial = air; // CO2;
125  G4Material* absorberMaterial = xe15CO2;
126 
127  // Volumes
128  //
129 
130  G4VSolid* solidWorld
131  = new G4Box("World", worldSizeR, worldSizeR, worldSizeZ/2.);
132 
133  G4LogicalVolume* logicWorld
134  = new G4LogicalVolume(solidWorld, worldMaterial, "World");
135 
136  G4VPhysicalVolume* physicsWorld
137  = new G4PVPlacement(0, G4ThreeVector(), "World", logicWorld, 0, false, 0);
138 
139  // TR radiator envelope
140 
141  G4double radThick = foilNumber*(radThickness + gasGap) - gasGap + detGap;
142  G4double radZ = startZ + 0.5*radThick;
143 
144  G4VSolid* solidRadiator
145  = new G4Box("Radiator", 1.1*absorberRadius, 1.1*absorberRadius,
146  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 window inside windowR for
157 
158  G4Region* radRegion = new G4Region("XTRradiator");
159  radRegion->AddRootLogicalVolume(logicRadiator);
160 
161  // Absorber
162 
163  G4VSolid* solidAbsorber
164  = new G4Box("Absorber", absorberRadius, absorberRadius,
165  absorberThickness/2.);
166 
167  G4LogicalVolume* logicAbsorber
168  = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
169 
170  G4double windowZ = startZ + radThick + windowThick/2. + 15.0*mm;
171  G4double gapZ = windowZ + windowThick/2. + gapThick/2. + 0.01*mm;
172  G4double electrodeZ = gapZ + gapThick/2. + electrodeThick/2. + 0.01*mm;
173  G4double absorberZ = electrodeZ + electrodeThick/2.
174  + absorberThickness/2. + 0.01*mm;
175 
176  new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ),
177  "Absorber", logicAbsorber, physicsWorld, false, 0);
178 
179  G4Region* regGasDet = new G4Region("XTRdEdxDetector");
180  regGasDet->AddRootLogicalVolume(logicAbsorber);
181 
182  // Sensitive Detectors: Absorber
183 
184  SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
186  logicAbsorber->SetSensitiveDetector(sd);
187 
188  // Print geometry parameters
189 
190  G4cout << "\n The WORLD is made of "
191  << worldSizeZ/mm << "mm of " << worldMaterial->GetName();
192  G4cout << ", the transverse size (R) of the world is "
193  << worldSizeR/mm << " mm. " << G4endl;
194  G4cout << " The ABSORBER is made of "
195  << absorberThickness/mm << "mm of " << absorberMaterial->GetName();
196  G4cout << ", the transverse size (R) is "
197  << absorberRadius/mm << " mm. " << G4endl;
198  G4cout << " Z position of the (middle of the) absorber "
199  << absorberZ/mm << " mm." << G4endl;
200 
201  G4cout << "radZ = " << radZ/mm << " mm" << G4endl;
202  G4cout << "startZ = " << startZ/mm<< " mm" << G4endl;
203 
204  G4cout << "fRadThick = " << radThick/mm << " mm"<<G4endl;
205  G4cout << "fFoilNumber = " << foilNumber << G4endl;
206  G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
207  G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
208  G4cout << G4endl;
209 
210  return physicsWorld;
211 }
212 
213 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......