Geant4_10
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 77561 2013-11-26 09:00:04Z 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 
68  fScint_log = new G4LogicalVolume(fScint_box,G4Material::GetMaterial("LXe"),
69  "scint_log",0,0,0);
70  fHousing_log = new G4LogicalVolume(fHousing_box,
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);
79  fSphere_log = new G4LogicalVolume(fSphere,G4Material::GetMaterial("Al"),
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 
100  fPmt_log = new G4LogicalVolume(fPmt,G4Material::GetMaterial("Glass"),
101  "pmt_log");
102  fPhotocath_log = new G4LogicalVolume(fPhotocath,
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();
151  SurfaceProperties();
152 
153  SetLogicalVolume(fHousing_log);
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 
158 void LXeMainVolume::CopyValues(){
159  fScint_x=fConstructor->GetScintX();
160  fScint_y=fConstructor->GetScintY();
161  fScint_z=fConstructor->GetScintZ();
162  fD_mtl=fConstructor->GetHousingThickness();
163  fNx=fConstructor->GetNX();
164  fNy=fConstructor->GetNY();
165  fNz=fConstructor->GetNZ();
166  fOuterRadius_pmt=fConstructor->GetPMTRadius();
167  fSphereOn=fConstructor->GetSphereOn();
168  fRefl=fConstructor->GetHousingReflectivity();
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172 
173 void LXeMainVolume::PlacePMTs(G4LogicalVolume* pmt_log,
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 
209 void LXeMainVolume::VisAttributes(){
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 
220 void LXeMainVolume::SurfaceProperties(){
221  const G4int num = 2;
222  G4double ephoton[num] = {7.0*eV, 7.14*eV};
223 
224  //**Scintillator housing properties
225  G4double reflectivity[num] = {fRefl, fRefl};
226  G4double efficiency[num] = {0.0, 0.0};
228  scintHsngPT->AddProperty("REFLECTIVITY", ephoton, reflectivity, num);
229  scintHsngPT->AddProperty("EFFICIENCY", ephoton, efficiency, num);
230  G4OpticalSurface* OpScintHousingSurface =
231  new G4OpticalSurface("HousingSurface",unified,polished,dielectric_metal);
232  OpScintHousingSurface->SetMaterialPropertiesTable(scintHsngPT);
233 
234  //**Sphere surface properties
235  G4double sphereReflectivity[num] = {1.0, 1.0};
236  G4double sphereEfficiency[num] = {0.0, 0.0};
238  spherePT->AddProperty("REFLECTIVITY", ephoton, sphereReflectivity, num);
239  spherePT->AddProperty("EFFICIENCY", ephoton, sphereEfficiency, num);
240  G4OpticalSurface* OpSphereSurface =
241  new G4OpticalSurface("SphereSurface",unified,polished,dielectric_metal);
242  OpSphereSurface->SetMaterialPropertiesTable(spherePT);
243 
244  //**Photocathode surface properties
245  G4double photocath_EFF[num]={1.,1.}; //Enables 'detection' of photons
246  G4double photocath_ReR[num]={1.92,1.92};
247  G4double photocath_ImR[num]={1.69,1.69};
249  photocath_mt->AddProperty("EFFICIENCY",ephoton,photocath_EFF,num);
250  photocath_mt->AddProperty("REALRINDEX",ephoton,photocath_ReR,num);
251  photocath_mt->AddProperty("IMAGINARYRINDEX",ephoton,photocath_ImR,num);
252  G4OpticalSurface* photocath_opsurf=
253  new G4OpticalSurface("photocath_opsurf",glisur,polished,
255  photocath_opsurf->SetMaterialPropertiesTable(photocath_mt);
256 
257  //**Create logical skin surfaces
258  new G4LogicalSkinSurface("photocath_surf",fHousing_log,
259  OpScintHousingSurface);
260  new G4LogicalSkinSurface("sphere_surface",fSphere_log,OpSphereSurface);
261  new G4LogicalSkinSurface("photocath_surf",fPhotocath_log,photocath_opsurf);
262 }
LXeMainVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, G4LogicalVolume *pMotherLogical, G4bool pMany, G4int pCopyNo, LXeDetectorConstruction *c)
tuple a
Definition: test.py:11
CLHEP::Hep3Vector G4ThreeVector
HepRotation & rotateX(double delta)
Definition: Rotation.cc:66
CLHEP::HepRotation G4RotationMatrix
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
Definition: G4Box.hh:63
Definition: G4Tubs.hh:84
Definition of the LXeMainVolume class.
tuple x
Definition: test.py:50
HepRotation & rotateY(double delta)
Definition: Rotation.cc:79
void SetForceSolid(G4bool)
int G4int
Definition: G4Types.hh:78
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
Double_t y
Definition: plot.C:279
tuple b
Definition: test.py:12
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)
tuple z
Definition: test.py:28
double G4double
Definition: G4Types.hh:76
tuple c
Definition: test.py:13
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
void SetVisAttributes(const G4VisAttributes *pVA)
void SetLogicalVolume(G4LogicalVolume *pLogical)