Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorBarr90.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: DetectorBarr90.cc 72517 2013-07-24 23:01:29Z gum $
31 //
32 //
33 
34 #include "DetectorBarr90.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 << "DetectorBarr90 setup" << G4endl;
75 
76  G4double worldSizeZ = 400.*cm;
77  G4double worldSizeR = 20.*cm;
78 
79  // Radiator and detector parameters
80 
81  G4double radThickness = 0.019*mm;
82  G4double gasGap = 0.6*mm;
83  G4double foilGasRatio = radThickness/(radThickness+gasGap);
84  G4double foilNumber = 350;
85 
86  G4double absorberThickness = 50.0*mm;
87  G4double absorberRadius = 100.*mm;
88 
89  G4double electrodeThick = 10.0*micrometer;
90  G4double windowThick = 51.0*micrometer;
91  G4double gapThick = 10.0*cm;
92  G4double detGap = 0.01*mm;
93 
94  G4double startZ = 100.0*mm;
95 
96  // Materials
97  //
98 
99  // Change to create materials using NIST
103  G4Material* xe55he15ch4 = Materials::GetInstance()->GetMaterial("Xe55He15CH4");
104 
105  G4double foilDensity = ch2->GetDensity();
106  G4double gasDensity = co2->GetDensity();
107  G4double totDensity = foilDensity*foilGasRatio
108  + gasDensity*(1.0-foilGasRatio);
109 
110  G4double fractionFoil = foilDensity*foilGasRatio/totDensity;
111  G4double fractionGas = gasDensity*(1.0-foilGasRatio)/totDensity;
112  G4Material* radiatorMat = new G4Material("radiatorMat", totDensity, 2);
113  radiatorMat->AddMaterial(ch2, fractionFoil);
114  radiatorMat->AddMaterial(co2, fractionGas);
115 
116  // Radiator description
117  fRadiatorDescription = new RadiatorDescription;
118  fRadiatorDescription->fFoilMaterial = ch2; // CH2; // Kapton; // Mylar ; // Li ; // CH2 ;
119  fRadiatorDescription->fGasMaterial = co2; // CO2; // He; //
120  fRadiatorDescription->fFoilThickness = radThickness;
121  fRadiatorDescription->fGasThickness = gasGap;
122  fRadiatorDescription->fFoilNumber = foilNumber;
123 
124  G4Material* worldMaterial = air; // CO2;
125  G4Material* absorberMaterial = xe55he15ch4;
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, 0.5*radThick);
146 
147  G4LogicalVolume* logicRadiator
148  = new G4LogicalVolume(solidRadiator, radiatorMat, "Radiator");
149 
150  new G4PVPlacement(0, G4ThreeVector(0, 0, radZ),
151  "Radiator", logicRadiator, physicsWorld, false, 0 );
152 
153  fRadiatorDescription->fLogicalVolume = logicRadiator;
154 
155  // create region for radiator
156 
157  G4Region* radRegion = new G4Region("XTRradiator");
158  radRegion->AddRootLogicalVolume(logicRadiator);
159 
160  G4double windowZ = startZ + radThick + windowThick/2. + 15.0*mm;
161 
162  G4double gapZ = windowZ + windowThick/2. + gapThick/2. + 0.01*mm;
163 
164  G4double electrodeZ = gapZ + gapThick/2. + electrodeThick/2. + 0.01*mm;
165 
166  // Absorber
167 
168  G4double absorberZ = electrodeZ + electrodeThick/2. +
169  + absorberThickness/2. + 0.01*mm;
170 
171  G4VSolid* solidAbsorber
172  = new G4Box("Absorber", absorberRadius, absorberRadius, absorberThickness/2.);
173 
174  G4LogicalVolume* logicAbsorber
175  = new G4LogicalVolume(solidAbsorber, absorberMaterial, "Absorber");
176 
177  new G4PVPlacement(0, G4ThreeVector(0., 0., absorberZ),
178  "Absorber", logicAbsorber, physicsWorld, false, 0);
179 
180  G4Region* regGasDet = new G4Region("XTRdEdxDetector");
181  regGasDet->AddRootLogicalVolume(logicAbsorber);
182 
183  // Sensitive Detectors: Absorber
184 
185  SensitiveDetector* sd = new SensitiveDetector("AbsorberSD");
187  logicAbsorber->SetSensitiveDetector(sd);
188 
189  // Print geometry parameters
190 
191  G4cout << "\n The WORLD is made of "
192  << worldSizeZ/mm << "mm of " << worldMaterial->GetName();
193  G4cout << ", the transverse size (R) of the world is "
194  << worldSizeR/mm << " mm. " << G4endl;
195  G4cout << " The ABSORBER is made of "
196  << absorberThickness/mm << "mm of " << absorberMaterial->GetName();
197  G4cout << ", the transverse size (R) is "
198  << absorberRadius/mm << " mm. " << G4endl;
199  G4cout << " Z position of the (middle of the) absorber "
200  << absorberZ/mm << " mm." << G4endl;
201 
202  G4cout << "radZ = " << radZ/mm << " mm" << G4endl;
203  G4cout << "startZ = " << startZ/mm<< " mm" << G4endl;
204 
205  G4cout << "fRadThick = " << radThick/mm << " mm"<<G4endl;
206  G4cout << "fFoilNumber = " << foilNumber << G4endl;
207  G4cout << "fRadiatorMat = " << radiatorMat->GetName() << G4endl;
208  G4cout << "WorldMaterial = " << worldMaterial->GetName() << G4endl;
209  G4cout << G4endl;
210 
211  return physicsWorld;
212 }
213 
214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
215 
static constexpr double mm
Definition: G4SIunits.hh:115
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
Definition of the DetectorBarr90 class.
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
#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)
G4VPhysicalVolume * Construct()