Geant4  10.01.p01
LXeMainVolume.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 // $Id: LXeMainVolume.cc 82853 2014-07-14 09:07:11Z gcosmo $
27 //
30 //
31 //
32 #include "globals.hh"
33 
34 #include "LXeMainVolume.hh"
35 
36 #include "G4LogicalSkinSurface.hh"
38 
39 #include "G4SystemOfUnits.hh"
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
44  const G4ThreeVector &tlate,
45  G4LogicalVolume *pMotherLogical,
46  G4bool pMany,
47  G4int pCopyNo,
49  //Pass info to the G4PVPlacement constructor
50  :G4PVPlacement(pRot,tlate,
51  //Temp logical volume must be created here
52  new G4LogicalVolume(new G4Box("temp",1,1,1),
53  G4Material::GetMaterial("Vacuum"),
54  "temp",0,0,0),
55  "housing",pMotherLogical,pMany,pCopyNo),fConstructor(c)
56 {
57  CopyValues();
58 
59  G4double housing_x=fScint_x+2.*fD_mtl;
60  G4double housing_y=fScint_y+2.*fD_mtl;
61  G4double housing_z=fScint_z+2.*fD_mtl;
62 
63  //*************************** housing and scintillator
64  fScint_box = new G4Box("scint_box",fScint_x/2.,fScint_y/2.,fScint_z/2.);
65  fHousing_box = new G4Box("housing_box",housing_x/2.,housing_y/2.,
66  housing_z/2.);
67 
69  "scint_log",0,0,0);
72  "housing_log",0,0,0);
73 
74  new G4PVPlacement(0,G4ThreeVector(),fScint_log,"scintillator",
75  fHousing_log,false,0);
76 
77  //*************** Miscellaneous sphere to demonstrate skin surfaces
78  fSphere = new G4Sphere("sphere",0.*mm,2.*cm,0.*deg,360.*deg,0.*deg,360.*deg);
80  "sphere_log");
81  if(fSphereOn)
82  new G4PVPlacement(0,G4ThreeVector(5.*cm,5.*cm,5.*cm),
83  fSphere_log,"sphere",fScint_log,false,0);
84 
85  //****************** Build PMTs
86  G4double innerRadius_pmt = 0.*cm;
87  G4double height_pmt = fD_mtl/2.;
88  G4double startAngle_pmt = 0.*deg;
89  G4double spanningAngle_pmt = 360.*deg;
90 
91  fPmt = new G4Tubs("pmt_tube",innerRadius_pmt,fOuterRadius_pmt,
92  height_pmt,startAngle_pmt,spanningAngle_pmt);
93 
94  //the "photocathode" is a metal slab at the back of the glass that
95  //is only a very rough approximation of the real thing since it only
96  //absorbs or detects the photons based on the efficiency set below
97  fPhotocath = new G4Tubs("photocath_tube",innerRadius_pmt,fOuterRadius_pmt,
98  height_pmt/2,startAngle_pmt,spanningAngle_pmt);
99 
101  "pmt_log");
104  "photocath_log");
105 
106  new G4PVPlacement(0,G4ThreeVector(0,0,-height_pmt/2),
107  fPhotocath_log,"photocath",
108  fPmt_log,false,0);
109 
110  //***********Arrange pmts around the outside of housing**********
111 
112  G4double dx = fScint_x/fNx;
113  G4double dy = fScint_y/fNy;
114  G4double dz = fScint_z/fNz;
115 
116  G4double x,y,z;
117  G4double xmin = -fScint_x/2. - dx/2.;
118  G4double ymin = -fScint_y/2. - dy/2.;
119  G4double zmin = -fScint_z/2. - dz/2.;
120  G4int k=0;
121 
122  z = -fScint_z/2. - height_pmt; //front
123  PlacePMTs(fPmt_log,0,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k);
124 
125  G4RotationMatrix* rm_z = new G4RotationMatrix();
126  rm_z->rotateY(180*deg);
127  z = fScint_z/2. + height_pmt; //back
128  PlacePMTs(fPmt_log,rm_z,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k);
129 
130  G4RotationMatrix* rm_y1 = new G4RotationMatrix();
131  rm_y1->rotateY(-90*deg);
132  x = -fScint_x/2. - height_pmt; //left
133  PlacePMTs(fPmt_log,rm_y1,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k);
134 
135  G4RotationMatrix* rm_y2 = new G4RotationMatrix();
136  rm_y2->rotateY(90*deg);
137  x = fScint_x/2. + height_pmt; //right
138  PlacePMTs(fPmt_log,rm_y2,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k);
139 
140  G4RotationMatrix* rm_x1 = new G4RotationMatrix();
141  rm_x1->rotateX(90*deg);
142  y = -fScint_y/2. - height_pmt; //bottom
143  PlacePMTs(fPmt_log,rm_x1,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k);
144 
145  G4RotationMatrix* rm_x2 = new G4RotationMatrix();
146  rm_x2->rotateX(-90*deg);
147  y = fScint_y/2. + height_pmt; //top
148  PlacePMTs(fPmt_log,rm_x2,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k);
149 
150  VisAttributes();
152 
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172 
174  G4RotationMatrix *rot,
175  G4double &a, G4double &b, G4double da,
176  G4double db, G4double amin,
177  G4double bmin, G4int na, G4int nb,
178  G4double &x, G4double &y, G4double &z,
179  G4int &k){
180 /*PlacePMTs : a different way to parameterize placement that does not depend on
181  calculating the position from the copy number
182 
183  pmt_log = logical volume for pmts to be placed
184  rot = rotation matrix to apply
185  a,b = coordinates to vary(ie. if varying in the xy plane then pass x,y)
186  da,db = value to increment a,b by
187  amin,bmin = start values for a,b
188  na,nb = number of repitions in a and b
189  x,y,z = just pass x,y, and z by reference (the same ones passed for a,b)
190  k = copy number to start with
191  sd = sensitive detector for pmts
192 */
193  a=amin;
194  for(G4int j=1;j<=na;j++){
195  a+=da;
196  b=bmin;
197  for(G4int i=1;i<=nb;i++){
198  b+=db;
199  new G4PVPlacement(rot,G4ThreeVector(x,y,z),pmt_log,"pmt",
200  fHousing_log,false,k);
201  fPmtPositions.push_back(G4ThreeVector(x,y,z));
202  k++;
203  }
204  }
205 }
206 
207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
208 
210  G4VisAttributes* housing_va = new G4VisAttributes(G4Colour(0.8,0.8,0.8));
211  fHousing_log->SetVisAttributes(housing_va);
212 
213  G4VisAttributes* sphere_va = new G4VisAttributes();
214  sphere_va->SetForceSolid(true);
215  fSphere_log->SetVisAttributes(sphere_va);
216 }
217 
218 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
219 
221  G4double ephoton[] = {7.0*eV, 7.14*eV};
222  const G4int num = sizeof(ephoton)/sizeof(G4double);
223 
224  //**Scintillator housing properties
225  G4double reflectivity[] = {fRefl, fRefl};
226  assert(sizeof(reflectivity) == sizeof(ephoton));
227  G4double efficiency[] = {0.0, 0.0};
228  assert(sizeof(efficiency) == sizeof(ephoton));
230  scintHsngPT->AddProperty("REFLECTIVITY", ephoton, reflectivity, num);
231  scintHsngPT->AddProperty("EFFICIENCY", ephoton, efficiency, num);
232  G4OpticalSurface* OpScintHousingSurface =
233  new G4OpticalSurface("HousingSurface",unified,polished,dielectric_metal);
234  OpScintHousingSurface->SetMaterialPropertiesTable(scintHsngPT);
235 
236  //**Sphere surface properties
237  G4double sphereReflectivity[] = {1.0, 1.0};
238  assert(sizeof(sphereReflectivity) == sizeof(ephoton));
239  G4double sphereEfficiency[] = {0.0, 0.0};
240  assert(sizeof(sphereEfficiency) == sizeof(ephoton));
242  spherePT->AddProperty("REFLECTIVITY", ephoton, sphereReflectivity, num);
243  spherePT->AddProperty("EFFICIENCY", ephoton, sphereEfficiency, num);
244  G4OpticalSurface* OpSphereSurface =
245  new G4OpticalSurface("SphereSurface",unified,polished,dielectric_metal);
246  OpSphereSurface->SetMaterialPropertiesTable(spherePT);
247 
248  //**Photocathode surface properties
249  G4double photocath_EFF[]={1.,1.}; //Enables 'detection' of photons
250  assert(sizeof(photocath_EFF) == sizeof(ephoton));
251  G4double photocath_ReR[]={1.92,1.92};
252  assert(sizeof(photocath_ReR) == sizeof(ephoton));
253  G4double photocath_ImR[]={1.69,1.69};
254  assert(sizeof(photocath_ImR) == sizeof(ephoton));
256  photocath_mt->AddProperty("EFFICIENCY",ephoton,photocath_EFF,num);
257  photocath_mt->AddProperty("REALRINDEX",ephoton,photocath_ReR,num);
258  photocath_mt->AddProperty("IMAGINARYRINDEX",ephoton,photocath_ImR,num);
259  G4OpticalSurface* photocath_opsurf=
260  new G4OpticalSurface("photocath_opsurf",glisur,polished,
262  photocath_opsurf->SetMaterialPropertiesTable(photocath_mt);
263 
264  //**Create logical skin surfaces
265  new G4LogicalSkinSurface("photocath_surf",fHousing_log,
266  OpScintHousingSurface);
267  new G4LogicalSkinSurface("sphere_surface",fSphere_log,OpSphereSurface);
268  new G4LogicalSkinSurface("photocath_surf",fPhotocath_log,photocath_opsurf);
269 }
static const double cm
Definition: G4SIunits.hh:106
LXeMainVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, G4LogicalVolume *pMotherLogical, G4bool pMany, G4int pCopyNo, LXeDetectorConstruction *c)
G4double fScint_y
G4Tubs * fPhotocath
G4Box * fScint_box
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
G4LogicalVolume * fPmt_log
G4double fScint_z
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:603
G4double z
Definition: TRTMaterials.hh:39
G4LogicalVolume * fScint_log
Definition: G4Box.hh:64
Definition: G4Tubs.hh:85
Definition of the LXeMainVolume class.
G4double a
Definition: TRTMaterials.hh:39
void SetForceSolid(G4bool)
void VisAttributes()
int G4int
Definition: G4Types.hh:78
G4double fD_mtl
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
G4double fOuterRadius_pmt
void SurfaceProperties()
G4Box * fHousing_box
static const double deg
Definition: G4SIunits.hh:133
bool G4bool
Definition: G4Types.hh:79
G4PVPlacement(G4RotationMatrix *pRot, const G4ThreeVector &tlate, G4LogicalVolume *pCurrentLogical, const G4String &pName, G4LogicalVolume *pMotherLogical, G4bool pMany, G4int pCopyNo, G4bool pSurfChk=false)
G4double fScint_x
G4LogicalVolume * fHousing_log
G4Sphere * fSphere
static const double eV
Definition: G4SIunits.hh:194
std::vector< G4ThreeVector > fPmtPositions
G4LogicalVolume * fSphere_log
G4double fRefl
double G4double
Definition: G4Types.hh:76
void PlacePMTs(G4LogicalVolume *pmt_Log, G4RotationMatrix *rot, G4double &a, G4double &b, G4double da, G4double db, G4double amin, G4double bmin, G4int na, G4int nb, G4double &x, G4double &y, G4double &z, G4int &k)
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
static const double mm
Definition: G4SIunits.hh:102
G4LogicalVolume * fPhotocath_log
void SetVisAttributes(const G4VisAttributes *pVA)
LXeDetectorConstruction * fConstructor
void SetLogicalVolume(G4LogicalVolume *pLogical)