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