Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eRositaDetectorConstruction.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 //
26 //
27 // $Id$
28 //
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
33 #include "eRositaTrackerSD.hh"
34 
35 #include "G4PhysicalConstants.hh"
36 #include "G4SystemOfUnits.hh"
37 #include "G4Material.hh"
38 #include "G4Box.hh"
39 #include "G4LogicalVolume.hh"
40 #include "G4PVPlacement.hh"
41 #include "G4PVParameterised.hh"
42 #include "G4SDManager.hh"
43 #include "G4GeometryTolerance.hh"
44 #include "G4GeometryManager.hh"
45 
46 #include "G4UserLimits.hh"
47 
48 #include "G4VisAttributes.hh"
49 #include "G4Colour.hh"
50 
51 #include "G4ios.hh"
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
56 
57 {
58 
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 
64 {
65 
66 }
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69 
71 {
72 //--------- Material definition ---------
73 
74  G4double a, z;
75  G4double density;
76 // G4int nel;
77 
78 // //Air
79 // G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
80 // G4Element* O = new G4Element("Oxygen" , "O", z=8., a= 16.00*g/mole);
81 
82 // G4Material* Air = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
83 // Air->AddElement(N, 70*perCent);
84 // Air->AddElement(O, 30*perCent);
85 
86  //Copper
87  G4Material* Cu =
88  new G4Material("Copper", z=29., a= 63.55*g/mole, density= 8.92*g/cm3);
89 
90 // //Aluminium for testing
91 // G4Material* Cu =
92 // new G4Material("Aluminium", z=13., a= 26.98*g/mole, density= 2.7*g/cm3);
93 
94  //Silicon
95  G4Material* Si =
96  new G4Material("Silicon", z=14., a= 28.09*g/mole, density= 2.33*g/cm3);
97 
98  // Vacuum
99  density = universe_mean_density; //from PhysicalConstants.h
100  G4double pressure = 3.e-18*pascal;
101  G4double temperature = 2.73*kelvin;
102  a = 1.01*g/mole;
103  z = 1;
104  vacuum = new G4Material("Galactic", z, a,
105  density, kStateGas, temperature, pressure);
106 
107  // Print all the materials defined.
108  //
109  G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
110  G4cout << *(G4Material::GetMaterialTable()) << G4endl;
111 
112 //--------- Sizes of the principal geometrical components (solids) ---------
113 
114  // world volume
115  hWorldLength = 50.0*mm;
116 
117  // target
118  hTargetLength = 2.5*mm;
119  hTargetDepth = 15.0*mm;
120 
121  // CCD
122  hTrackerLength = 20.0*mm;
123  hTrackerDepth = 0.225*mm;
124 
125 //--------- positions of the principal geometrical components --------
126 
127  // target
128  xPosTarget = 0.0*cm;
129  yPosTarget = 0.0*cm;
130  zPosTarget = 0.0*cm;
131 
132  // tracker
133  xPosTracker = 0.0*cm;
134  yPosTracker = 2.0*cm;
135  zPosTracker = 0.0*cm;
136 
137 //--------- material names of the principal geometrical components --------
138 
139 // WorldMater = Air;
140  WorldMater = vacuum;
141  TargetMater = Cu;
142  TrackerMater = Si;
143 
144 //--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
145 
146 
147  //------------------------------
148  // World
149  //------------------------------
150 
151  solidWorld= new G4Box("world",hWorldLength,hWorldLength,hWorldLength);
152  logicWorld= new G4LogicalVolume(solidWorld,WorldMater,"World",0,0,0);
153 
154  // Must place the World Physical volume unrotated at (0,0,0).
155  //
156  physiWorld = new G4PVPlacement(0, // no rotation
157  G4ThreeVector(), // at (0,0,0)
158  logicWorld, // its logical volume
159  "World", // its name
160  0, // its mother volume
161  false, // no boolean operations
162  0); // copy number
163 
164 
165  //------------------------------
166  // Target
167  //------------------------------
168 
169  G4ThreeVector positionTarget =
170  G4ThreeVector(xPosTarget,yPosTarget,zPosTarget);
171 
172  solidTarget = new G4Box("target",hTargetLength,hTargetLength,hTargetDepth);
173  logicTarget = new G4LogicalVolume(solidTarget,TargetMater,"Target",0,0,0);
174  physiTarget = new G4PVPlacement(0, // no rotation
175  positionTarget, // at (x,y,z)
176  logicTarget, // its logical volume
177  "Target", // its name
178  logicWorld, // its mother volume
179  false, // no boolean operations
180  0); // copy number
181 
182 
183  //------------------------------
184  // Tracker
185  //------------------------------
186 
187  G4ThreeVector positionTracker =
188  G4ThreeVector(xPosTracker,yPosTracker,zPosTracker);
189 
190  solidTracker =
191  new G4Box("tracker",hTrackerLength,hTrackerDepth,hTrackerLength);
192  logicTracker =
193  new G4LogicalVolume(solidTracker,TrackerMater,"Tracker",0,0,0);
194  physiTracker = new G4PVPlacement(0, // no rotation
195  positionTracker, // at (x,y,z)
196  logicTracker, // its logical volume
197  "Tracker", // its name
198  logicWorld, // its mother volume
199  false, // no boolean operations
200  0); // copy number
201 
202 
203 
204 
205  //------------------------------------------------
206  // Sensitive detectors
207  //------------------------------------------------
208 
210 
211  G4String trackerChamberSDname = "eRosita/TrackerChamberSD";
212  eRositaTrackerSD* aTrackerSD = new eRositaTrackerSD( trackerChamberSDname );
213  SDman->AddNewDetector( aTrackerSD );
214  logicTracker->SetSensitiveDetector( aTrackerSD );
215 
216 
217 //--------- Visualization attributes -------------------------------
218 
219  // use this to make world volume invisible
220  visWorld = new G4VisAttributes();
221  visWorld->SetVisibility(false);
222  logicWorld->SetVisAttributes(visWorld);
223 
224  // render target in redish color
225  visTarget = new G4VisAttributes();
226 // visTarget->SetColor(G4Color(1.0,0.3,0.3)); // redish
227  visTarget->SetColor(G4Color(1.0,1.0,1.0)); // black
228  logicTarget->SetVisAttributes(visTarget);
229 
230  // render tracker in blueish color
231  visTracker = new G4VisAttributes();
232 // visTracker->SetColor(G4Color(0.3,0.3,1.0)); // blueish
233  visTracker->SetColor(G4Color(1.0,1.0,1.0)); // black
234  logicTracker->SetVisAttributes(visTracker);
235 
236 
237 
238  return physiWorld;
239 }
240 
241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
242 /*
243 void eRositaDetectorConstruction::setTargetMaterial(G4String materialName)
244 {
245  // search the material by its name
246  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
247  if (pttoMaterial)
248  {TargetMater = pttoMaterial;
249  logicTarget->SetMaterial(pttoMaterial);
250  G4cout << "\n----> The target is " << fTargetLength/cm << " cm of "
251  << materialName << G4endl;
252  }
253 }
254 */
255 
static constexpr double mm
Definition: G4SIunits.hh:115
void SetColor(const G4Color &)
CLHEP::Hep3Vector G4ThreeVector
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
int universe_mean_density
Definition: hepunit.py:307
Definition: G4Box.hh:64
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:587
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
G4GLOB_DLL std::ostream G4cout
void SetVisibility(G4bool=true)
static constexpr double cm
Definition: G4SIunits.hh:119
#define pascal
G4Colour G4Color
Definition: G4Color.hh:42
static constexpr double kelvin
Definition: G4SIunits.hh:281
static constexpr double cm3
Definition: G4SIunits.hh:121
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
tuple z
Definition: test.py:28
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static constexpr double mole
Definition: G4SIunits.hh:286
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)