SToGS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SToGS_MaterialConsultant.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 //----------------------------------------------------------------------------------
28 
30 #include "G4MaterialTable.hh"
31 #include "G4NistManager.hh"
32 
33 #include "globals.hh"
34 
35 SToGS::MaterialConsultant *SToGS::MaterialConsultant::theMaterialConsultant = 0x0;
36 
37 SToGS::MaterialConsultant::MaterialConsultant() :
38  theElements(),
39  theMaterials(),
40  fIsSToGDBSSearchedFirst(true)
41 {
42 }
43 
44 G4Element *SToGS::MaterialConsultant::BuildElement(G4String name_element)
45 {
46  G4double z, a; G4String stogsname = name_element, name, symbol;
47 
48  if ( name_element.index("SToGS_") != 0 ) {
49  stogsname = "SToGS_" + name_element;
50  }
51  if ( !stogsname.contains("_El") ) {
52  stogsname += "_El";
53  }
54 
55  // first search the already created elements
56  G4Element *element = 0x0;
57  for (size_t i = 0; i < theElements.size(); i++) {
58  if ( theElements[i]->GetName() == stogsname ) {
59  return theElements[i];
60  }
61  }
62  size_t size_before = theElements.size();
63 
64  // not found so add it
65  if ( stogsname == "SToGS_H_El" ) {
66  a=1.01*CLHEP::g/CLHEP::mole;
67  theElements.push_back(new G4Element(name="SToGS_H_El",symbol="H",z=1.,a));
68  }
69  if ( stogsname == "SToGS_Deuterium_El" ) {
70  a=2.01*CLHEP::g/CLHEP::mole;
71  theElements.push_back(new G4Element(name="SToGS_Deuterium_El",symbol="D",z=1.,a));
72  }
73  if ( stogsname == "SToGS_D_El" ) {
74  a=2.01*CLHEP::g/CLHEP::mole;
75  theElements.push_back(new G4Element(name="SToGS_D_El",symbol="D",z=1.,a));
76  }
77  if ( stogsname == "SToGS_He_El" ) {
78  a=4.*CLHEP::g/CLHEP::mole;
79  theElements.push_back(new G4Element(name="SToGS_He_El",symbol="He",z=2.,a));
80  }
81  if ( stogsname == "SToGS_Li_El" ) {
82  a=6.94*CLHEP::g/CLHEP::mole;
83  theElements.push_back(new G4Element(name="SToGS_Li_El",symbol="Li",z=3.,a));
84  }
85  if ( stogsname == "SToGS_Be_El" ) {
86  a=9.01*CLHEP::g/CLHEP::mole;
87  theElements.push_back(new G4Element(name="SToGS_Be_El",symbol="Be",z=4.,a));
88  }
89  if ( stogsname == "SToGS_C_El" ) {
90  a=12.01*CLHEP::g/CLHEP::mole;
91  theElements.push_back(new G4Element(name="SToGS_C_El",symbol="C",z=6.,a));
92  }
93  if ( stogsname == "SToGS_N_El" ) {
94  a=14.00674*CLHEP::g/CLHEP::mole;
95  theElements.push_back(new G4Element(name="SToGS_N_El",symbol="N",z=7.,a));
96  }
97  if ( stogsname == "SToGS_O_El" ) {
98  a=15.9994*CLHEP::g/CLHEP::mole;
99  theElements.push_back(new G4Element(name="SToGS_O_El",symbol="O",z=8.,a));
100  }
101  if ( stogsname == "SToGS_Ne_El" ) {
102  a=20.18*CLHEP::g/CLHEP::mole;
103  theElements.push_back(new G4Element(name="SToGS_Ne_El",symbol="Ne",z=10.,a));
104  }
105  if ( stogsname == "SToGS_Na_El" ) {
106  a=22.99*CLHEP::g/CLHEP::mole;
107  theElements.push_back(new G4Element(name="SToGS_Na_El",symbol="Na",z=11.,a));
108  }
109  if ( stogsname == "SToGS_Mg_El" ) {
110  a=24.305*CLHEP::g/CLHEP::mole;
111  theElements.push_back(new G4Element(name="SToGS_Mg_El",symbol="Mg",z=12.,a));
112  }
113  if ( stogsname == "SToGS_Al_El" ) {
114  a=26.98154*CLHEP::g/CLHEP::mole;
115  theElements.push_back(new G4Element(name="SToGS_Al_El",symbol="Al",z=13.,a));
116  }
117  if ( stogsname == "SToGS_Si_El" ) {
118  a=28.085*CLHEP::g/CLHEP::mole;
119  theElements.push_back(new G4Element(name="SToGS_Si_El",symbol="Si",z=14.,a));
120  }
121  if ( stogsname == "SToGS_Cl_El" ) {
122  a=35.453*CLHEP::g/CLHEP::mole;
123  theElements.push_back(new G4Element(name="SToGS_Cl_El",symbol="Cl",z=17.,a));
124  }
125  if ( stogsname == "SToGS_Fe_El" ) {
126  a=55.850*CLHEP::g/CLHEP::mole;
127  theElements.push_back(new G4Element(name="SToGS_Fe_El",symbol="Fe",z=26.,a));
128  }
129  if ( stogsname == "SToGS_Cu_El" ) {
130  a=63.546*CLHEP::g/CLHEP::mole;
131  theElements.push_back(new G4Element(name="SToGS_Cu_El",symbol="Cu",z=29.,a));
132  }
133  if ( stogsname == "SToGS_Ba_El" ) {
134  a=137.327*CLHEP::g/CLHEP::mole;
135  theElements.push_back(new G4Element(name="SToGS_Ba_El",symbol="Ba",z=56.,a));
136  }
137  if ( stogsname == "SToGS_F_El" ) {
138  a=18.9984032*CLHEP::g/CLHEP::mole;
139  theElements.push_back(new G4Element(name="SToGS_F_El",symbol="F",z=9.,a));
140  }
141  if ( stogsname == "SToGS_Ge_El" ) {
142  // Germanium isotopes
143  G4Isotope* Ge70 = new G4Isotope(name="SToGS_Ge70", 32, 70, 69.9242*CLHEP::g/CLHEP::mole);
144  G4Isotope* Ge72 = new G4Isotope(name="SToGS_Ge72", 32, 72, 71.9221*CLHEP::g/CLHEP::mole);
145  G4Isotope* Ge73 = new G4Isotope(name="SToGS_Ge73", 32, 73, 72.9235*CLHEP::g/CLHEP::mole);
146  G4Isotope* Ge74 = new G4Isotope(name="SToGS_Ge74", 32, 74, 73.9212*CLHEP::g/CLHEP::mole);
147  G4Isotope* Ge76 = new G4Isotope(name="SToGS_Ge76", 32, 76, 75.9214*CLHEP::g/CLHEP::mole);
148  // germanium defined via its isotopes
149  G4Element* elGe = new G4Element(name="SToGS_Ge_El",symbol="Ge", 5);
150  elGe->AddIsotope(Ge70, 0.2123);
151  elGe->AddIsotope(Ge72, 0.2766);
152  elGe->AddIsotope(Ge73, 0.0773);
153  elGe->AddIsotope(Ge74, 0.3594);
154  elGe->AddIsotope(Ge76, 0.0744);
155  theElements.push_back(elGe);
156  }
157  if ( stogsname == "SToGS_Br_El" ) {
158  a=79.904*CLHEP::g/CLHEP::mole;
159  theElements.push_back(new G4Element(name="SToGS_Br_El",symbol="Br",z=35.,a));
160  }
161  if ( stogsname == "SToGS_I_El" ) {
162  a=126.90477*CLHEP::g/CLHEP::mole;
163  theElements.push_back(new G4Element(name="SToGS_I_El",symbol="I",z=53.,a));
164  }
165  if ( stogsname == "SToGS_Cs_El" ) {
166  a=132.90545*CLHEP::g/CLHEP::mole;
167  theElements.push_back(new G4Element(name="SToGS_Cs_El",symbol="Cs",z=55.,a));
168  }
169  if ( stogsname == "SToGS_La_El" ) {
170  a=138.9055*CLHEP::g/CLHEP::mole;
171  theElements.push_back(new G4Element(name="SToGS_La_El",symbol="La",z=57.,a));
172  }
173  if ( stogsname == "SToGS_W_El" ) {
174  a=183.85*CLHEP::g/CLHEP::mole;
175  theElements.push_back(new G4Element(name="SToGS_W_El",symbol="W",z=74.,a));
176  }
177  if ( stogsname == "SToGS_Pb_El" ) {
178  a=207.19*CLHEP::g/CLHEP::mole;
179  theElements.push_back(new G4Element(name="SToGS_Pb_El",symbol="Pb",z=82.,a));
180  }
181  if ( stogsname == "SToGS_Bi_El" ) {
182  a=208.98038*CLHEP::g/CLHEP::mole;
183  theElements.push_back(new G4Element(name="SToGS_Bi_El",symbol="Bi",z=83.,a));
184  }
185  // to be checked ..
186  if ( stogsname == "SToGS_Calcium_El" ) {
187  // a=40.08*CLHEP::g/CLHEP::mole;
188  // theElements.push_back(new G4Element(name="SToGS_Calcium",symbol="Ca",z=20.,a));
189  }
190  if ( stogsname == "SToGS_Manganese_El" ) {
191  // a=54.938*CLHEP::g/CLHEP::mole;
192  // theElements.push_back(new G4Element(name="SToGS_Manganese",symbol="Mn",z=25.,a));
193  }
194  if ( stogsname == "SToGS_Uranium_El" ) {
195  // a=238.03*CLHEP::g/CLHEP::mole;
196  // theElements.push_back(new G4Element(name="SToGS_Uranium",symbol="U",z=92.,a));
197  }
198  if ( theElements.size() != size_before ) {
199  element = theElements.back();
200  }
201  return element;
202 }
203 
204 G4Material *SToGS::MaterialConsultant::BuildSimpleMaterial(G4String name_material, G4double density)
205 {
206  G4String name_el = name_material + "_El"; G4Element *el = BuildElement(name_el); G4Material *mat = 0x0;
207  if ( el == 0x0 )
208  return 0x0;
209 
210  G4int nel = 1; mat = new G4Material(name_material,density,nel);
211  mat->AddElement(el, 1);
212 
213  return mat;
214 }
215 
216 G4Material *SToGS::MaterialConsultant::BuildMaterial(G4String name_material)
217 {
218  G4double density; G4int nel,natoms; G4String name; G4String stogsname = name_material, symbol;
219 
220  if ( name_material.index("SToGS_") != 0 ) {
221  stogsname = "SToGS_" + name_material;
222  }
223 
224  // first search the already created elements
225  G4Material *mat = 0x0;
226  for (size_t i = 0; i < theMaterials.size(); i++) {
227  if ( theMaterials[i]->GetName() == stogsname ) {
228  return theMaterials[i];
229  }
230  }
231  size_t size_before = theMaterials.size();
232 
233  //-------------------
234  // simple materials
235  //-------------------
236  if ( stogsname == "SToGS_Al" ) {
237  //density = 2.7*CLHEP::g/CLHEP::cm3;
238  //a = 26.98*CLHEP::g/CLHEP::mole;
239  //theMaterials.push_back(new G4Material(name="SToGS_Al",z=13.,a,density));
240 
241  mat = BuildSimpleMaterial(name_material,density = 2.6989*CLHEP::g/CLHEP::cm3);
242 
243  }
244  if ( stogsname == "SToGS_Fe" ) {
245  //density = 7.87*CLHEP::g/CLHEP::cm3;
246  //a = 55.85*CLHEP::g/CLHEP::mole;
247  //theMaterials.push_back(new G4Material(name="SToGS_Fe",z=26.,a,density));
248 
249  mat = BuildSimpleMaterial(name_material,density = 7.874*CLHEP::g/CLHEP::cm3);
250 
251  }
252  if ( stogsname == "SToGS_Ni" ) {
253  //density = 8.96*CLHEP::g/CLHEP::cm3;
254  //a = 58.69*CLHEP::g/CLHEP::mole;
255  //theMaterials.push_back(new G4Material(name="SToGS_Ni",z=28.,a,density));
256 
257  mat = BuildSimpleMaterial(name_material,density = 8.902*CLHEP::g/CLHEP::cm3);
258 
259  }
260  if ( stogsname == "SToGS_Cu" ) {
261  //density = 8.96*CLHEP::g/CLHEP::cm3;
262  //a = 63.54*CLHEP::g/CLHEP::mole;
263  //theMaterials.push_back(new G4Material(name="SToGS_Cu",z=29.,a,density));
264 
265  mat = BuildSimpleMaterial(name_material,density = 8.96*CLHEP::g/CLHEP::cm3);
266 
267  }
268  if ( stogsname == "SToGS_W" ) {
269  //density = 19.3*CLHEP::g/CLHEP::cm3;
270  //a = 183.85*CLHEP::g/CLHEP::mole;
271  //theMaterials.push_back(new G4Material(name="SToGS_W",z=74.,a,density));
272 
273  mat = BuildSimpleMaterial(name_material,density = 19.3*CLHEP::g/CLHEP::cm3);
274 
275  }
276  if ( stogsname == "SToGS_Pb" ) {
277  //density = 11.35*CLHEP::g/CLHEP::cm3;
278  //a = 207.19*CLHEP::g/CLHEP::mole;
279  //theMaterials.push_back(new G4Material(name="SToGS_Pb",z=82.,a,density));
280 
281  density = 11.35*CLHEP::mg/CLHEP::cm3; nel = 1; mat = new G4Material(name="SToGS_Pb",density,nel);
282  mat->AddElement(BuildElement("SToGS_Pb"), 1);
283  theMaterials.push_back(mat);
284 
285  mat = BuildSimpleMaterial(name_material,density = 11.35*CLHEP::mg/CLHEP::cm3);
286 
287  }
288 
289  //------------
290  // Registering of all the needed element. Don't forget to do it if you use one
291  // element to build a composite material
292  //------------
293  if ( stogsname == "SToGS_AIR" ) {
294  density = 1.290*CLHEP::mg/CLHEP::cm3; nel = 2; mat = new G4Material(name="SToGS_AIR",density,nel);
295  mat->AddElement(BuildElement("SToGS_N"), 70);
296  mat->AddElement(BuildElement("SToGS_O"), 30);
297  theMaterials.push_back(mat);
298  }
299  if ( stogsname == "SToGS_Ge" ) {
300  density = 5.323*CLHEP::g/CLHEP::cm3; nel = 1; mat = new G4Material(name="SToGS_Ge",density,nel);
301  mat->AddElement(BuildElement("SToGS_Ge"), 100*CLHEP::perCent);
302  theMaterials.push_back(mat);
303  }
304  if ( stogsname == "SToGS_NaI" ) {
305  density = 3.67*CLHEP::g/CLHEP::cm3, nel = 2; mat = new G4Material(name="SToGS_NaI",density,nel);
306  mat->AddElement(BuildElement("SToGS_Na"), natoms = 1);
307  mat->AddElement(BuildElement("SToGS_I"), natoms = 1);
308  theMaterials.push_back(mat);
309  }
310  if ( stogsname == "SToGS_LaCl3" ) {
311  density = 3.79*CLHEP::g/CLHEP::cm3, nel = 2; mat = new G4Material(name="SToGS_LaCl3",density,nel);
312  mat->AddElement(BuildElement("SToGS_La"), natoms = 1);
313  mat->AddElement(BuildElement("SToGS_Cl"), natoms = 3);
314  theMaterials.push_back(mat);
315  }
316  if ( stogsname == "SToGS_CsI" ) {
317  density = 4.51*CLHEP::g/CLHEP::cm3, nel = 2; mat = new G4Material(name="SToGS_CsI", density, nel);
318  mat->AddElement(BuildElement("SToGS_Cs"), natoms = 1);
319  mat->AddElement(BuildElement("SToGS_I"), natoms = 1);
320  theMaterials.push_back(mat);
321  }
322  if ( stogsname == "SToGS_LaBr3" ) {
323  density = 5.29*CLHEP::g/CLHEP::cm3, nel = 2; mat = new G4Material(name="SToGS_LaBr3",density,nel);
324  mat->AddElement(BuildElement("SToGS_La"), natoms = 1);
325  mat->AddElement(BuildElement("SToGS_Br"), natoms = 3);
326  theMaterials.push_back(mat);
327  }
328  if ( stogsname == "SToGS_BGO" ) {
329  density = 7.13*CLHEP::g/CLHEP::cm3, nel = 3; mat = new G4Material(name="SToGS_BGO", density, nel);
330  mat->AddElement(BuildElement("SToGS_Bi"), natoms = 4);
331  mat->AddElement(BuildElement("SToGS_Ge"), natoms = 3);
332  mat->AddElement(BuildElement("SToGS_O"), natoms = 12);
333  theMaterials.push_back(mat);
334  }
335  if ( stogsname == "SToGS_BaF2" ) {
336  density = 4.89*CLHEP::g/CLHEP::cm3, nel = 2; mat = new G4Material(name="SToGS_BaF2", density, nel);
337  mat->AddElement(BuildElement("SToGS_Ba"), natoms = 1);
338  mat->AddElement(BuildElement("SToGS_F"), natoms = 2);
339  theMaterials.push_back(mat);
340  }
341  if ( stogsname == "SToGS_Quartz" ) {
342  density = 2.648*CLHEP::g/CLHEP::cm3, nel = 2; mat = new G4Material(name="SToGS_Quartz", density, nel);
343  mat->AddElement(BuildElement("SToGS_Si"), natoms = 1);
344  mat->AddElement(BuildElement("SToGS_O") , natoms = 2);
345  theMaterials.push_back(mat);
346  }
347  if ( name_material == "SToGS_Vacuum_Ge" ) {
348  density = 2.376e-15*CLHEP::g/CLHEP::cm3, nel = 2; mat = new G4Material(name="SToGS_Vacuum_Ge", density, nel);
349  mat->AddElement(BuildElement("SToGS_N"), 70);
350  mat->AddElement(BuildElement("SToGS_O"), 30);
351  theMaterials.push_back(mat);
352  }
353  // must have the right composition for stainless steel
354 
355  // density = 8.96*CLHEP::g/CLHEP::cm3;
356  // StainlessSteel = new G4Material(name="StainlessSteel",density,nel=1);
357  // StainlessSteel->AddElement(elO, fractionmass = 1.);
358 
359  // density = 1.e-5*CLHEP::g/CLHEP::cm3;
360  // G4double pressure = 2.e-2*bar;
361  // G4double temperature = STP_Temperature; //from PhysicalConstants.h
362  // G4Material* Vacuum = new G4Material(name="Vacuum", density, nel=1,
363  // kStateGas,temperature,pressure);
364  // Vacuum->AddMaterial(Air, fractionmass=1.);
365 
366  if ( theMaterials.size() != size_before ) {
367  mat = theMaterials.back();
368  }
369  return mat;
370 }
371 
372 
373 SToGS::MaterialConsultant *SToGS::MaterialConsultant::theConsultant()
374 {
375  if (theMaterialConsultant == 0x0) {
376  theMaterialConsultant = new SToGS::MaterialConsultant();
377  }
378  return theMaterialConsultant;
379 }
380 
381 G4Material *SToGS::MaterialConsultant::FindOrBuildMaterial(G4String what)
382 {
383  // to be sure the inner table is built
384  G4Material* material = G4Material::GetMaterial(what,false); G4String lwhat = what;
385 
386  if ( material == 0x0 ) { // try to look for in Nist or by adding G4_ or StoGS_ to material
387  if ( fIsSToGDBSSearchedFirst ) {
388  material = SToGS::MaterialConsultant::theConsultant()->BuildMaterial(lwhat);
389  if ( material == 0x0 ) {
390  lwhat = "SToGS_";
391  lwhat += what;
392  material = SToGS::MaterialConsultant::theConsultant()->BuildMaterial(lwhat);
393  if ( material == 0x0 ) {
394  lwhat = what;
395  material = G4NistManager::Instance()->FindOrBuildMaterial(lwhat);
396  if ( material == 0x0 ) {
397  lwhat = "G4_";
398  lwhat += what;
399  material = G4NistManager::Instance()->FindOrBuildMaterial(lwhat);
400  }
401  }
402  }
403  }
404  else {
405  material = G4NistManager::Instance()->FindOrBuildMaterial(lwhat);
406  if ( material == 0x0 ) {
407  lwhat = "G4_";
408  lwhat += what;
409  material = G4NistManager::Instance()->FindOrBuildMaterial(lwhat);
410  if ( material == 0x0 ) {
411  lwhat = what;
412  SToGS::MaterialConsultant::theConsultant()->BuildMaterial(lwhat);
413  if ( material == 0x0 ) {
414  lwhat = "SToGS_";
415  lwhat += what;
416  material = SToGS::MaterialConsultant::theConsultant()->BuildMaterial(lwhat);
417  }
418  }
419  }
420  }
421  }
422  if ( material && what != lwhat )
423  G4cout << "[W] in SToGS::MaterialConsultant::FindOrBuildMaterial " << what << " replaced by " << lwhat << G4endl;
424  if ( material == 0x0 )
425  G4cout << "[E] in SToGS::MaterialConsultant::FindOrBuildMaterial, material " << what << " not found " << G4endl;
426 
427  return material;
428 }
429 
430 
431 /*
432 G4Material *SToGS::MaterialConsultant::GetMaterial(G4String what) const
433 {
434  // to be sure the inner table is built
435  SToGS::MaterialConsultant::theConsultant(); G4Material* material = G4Material::GetMaterial(what,false); G4String lwhat = what;
436 
437  if ( material == 0x0 ) { // try NIST first else add
438  material = G4NistManager::Instance()->FindOrBuildMaterial(lwhat);
439 
440  if ( material == 0x0 ) {
441  G4String tmp = "SToGS_";
442  tmp+=what;
443  material = G4Material::GetMaterial(tmp);
444  }
445  }
446 
447  return material;
448 }
449 */
450 
451 G4Element *SToGS::MaterialConsultant::GetElement(G4String what) const
452 {
453  G4Element *element = G4Element::GetElement(what);
454  return element;
455 }
456 
457 void SToGS::MaterialConsultant::SetOpticalProperties(G4Material *mat, G4String which_properties)
458 {
459  G4MaterialPropertiesTable *mat_mt = 0x0;
460  //
461  if ( which_properties == G4String("LaBr3") ) {
462 
463  const G4int NUMENTRIES = 3; G4double Energy[NUMENTRIES] = { 2.0*CLHEP::eV , 5*CLHEP::eV, 9*CLHEP::eV };
464 
465  G4double SCINT[NUMENTRIES] = { 1.0, 1.0, 1.0 };
466  G4double RIND[NUMENTRIES] = { 1.9 , 1.9, 1.9 };
467 
468  G4double ABSL[NUMENTRIES] = { 400.*CLHEP::cm, 400.*CLHEP::cm, 400.*CLHEP::cm};
469 
470  // G4double ABSL[NUMENTRIES] = { 0.35*CLHEP::cm, 0.35*CLHEP::cm, 0.35*CLHEP::cm};
471 
472  mat_mt = new G4MaterialPropertiesTable();
473  mat_mt->AddProperty("FASTCOMPONENT", Energy, SCINT, NUMENTRIES);
474  mat_mt->AddProperty("SLOWCOMPONENT", Energy, SCINT, NUMENTRIES);
475  mat_mt->AddProperty("RINDEX", Energy, RIND, NUMENTRIES);
476  mat_mt->AddProperty("ABSLENGTH", Energy, ABSL, NUMENTRIES); // mean free path before being absorbed
477  mat_mt->AddConstProperty("SCINTILLATIONYIELD",20000./CLHEP::MeV);
478  // mat_mt->AddConstProperty("SCINTILLATIONYIELD",63000./CLHEP::MeV);
479  mat_mt->AddConstProperty("FASTSCINTILLATIONRISETIME",1.*CLHEP::ns);
480  mat_mt->AddConstProperty("SLOWSCINTILLATIONRISETIME",1.*CLHEP::ns);
481  mat_mt->AddConstProperty("FASTTIMECONSTANT",20.*CLHEP::ns);
482  mat_mt->AddConstProperty("SLOWTIMECONSTANT",20.*CLHEP::ns);
483 
484  mat_mt->AddConstProperty("RESOLUTIONSCALE",1.0);
485  mat_mt->AddConstProperty("YIELDRATIO",1.0); //relative strenght of the fast against total
486 
487  // Set the Birks Constant for the LXe scintillator
488  // mat->GetIonisation()->SetBirksConstant(0.126*CLHEP::mm/CLHEP::MeV);
489  }
490  if ( which_properties == G4String("NaI") ) {
491 
492  const G4int NUMENTRIES = 3; G4double Energy[NUMENTRIES] = { 2.0*CLHEP::eV , 5*CLHEP::eV, 9*CLHEP::eV };
493 
494  G4double SCINT[NUMENTRIES] = { 1.0, 1.0, 0.1 };
495  G4double RIND[NUMENTRIES] = { 1.85 , 1.85, 1.85 };
496  G4double ABSL[NUMENTRIES] = { 500.*CLHEP::cm, 500.*CLHEP::cm, 500.*CLHEP::cm };
497 
498  mat_mt = new G4MaterialPropertiesTable();
499  mat_mt->AddProperty("FASTCOMPONENT", Energy, SCINT, NUMENTRIES);
500  mat_mt->AddProperty("SLOWCOMPONENT", Energy, SCINT, NUMENTRIES);
501  mat_mt->AddProperty("RINDEX", Energy, RIND, NUMENTRIES);
502  mat_mt->AddProperty("ABSLENGTH", Energy, ABSL, NUMENTRIES); // mean free path before being absorbed
503  mat_mt->AddConstProperty("SCINTILLATIONYIELD",3800./CLHEP::MeV);
504  // mat_mt->AddConstProperty("SCINTILLATIONYIELD",38000./CLHEP::MeV);
505  mat_mt->AddConstProperty("FASTTIMECONSTANT",230.*CLHEP::ns);
506  mat_mt->AddConstProperty("SLOWTIMECONSTANT",2300.*CLHEP::ns);
507  mat_mt->AddConstProperty("FASTSCINTILLATIONRISETIME",1.*CLHEP::ns);
508  mat_mt->AddConstProperty("SLOWSCINTILLATIONRISETIME",1.*CLHEP::ns);
509 
510  mat_mt->AddConstProperty("RESOLUTIONSCALE",4.0);
511  mat_mt->AddConstProperty("YIELDRATIO",0.5);
512 
513  // Set the Birks Constant for the LXe scintillator
514  //mat->GetIonisation()->SetBirksConstant(0.126*CLHEP::mm/CLHEP::MeV);
515  }
516  //
517  if ( which_properties == G4String("AIR") || which_properties == G4String("Vacuum") ) {
518 
519  const G4int NUMENTRIES = 3; G4double Energy[NUMENTRIES]={2.0*CLHEP::eV,7.0*CLHEP::eV,9*CLHEP::eV};
520 
521  G4double RIND[NUMENTRIES]={1.,1.,1.};
522  G4double ABSL[NUMENTRIES]={0.1*CLHEP::mm,0.1*CLHEP::mm,0.1*CLHEP::mm};
523  mat_mt = new G4MaterialPropertiesTable();
524  mat_mt->AddProperty("ABSLENGTH",Energy,ABSL,NUMENTRIES);
525  mat_mt->AddProperty("RINDEX", Energy, RIND,NUMENTRIES);
526  }
527  //
528  if ( which_properties == G4String("Glass") ) {
529 
530  const G4int NUMENTRIES = 3; G4double Energy[NUMENTRIES] = { 7.0*CLHEP::eV , 7.07*CLHEP::eV, 7.14*CLHEP::eV };
531  G4double RIND[NUMENTRIES]={1.49,1.49,1.49};
532  G4double ABSL[NUMENTRIES]={420.*CLHEP::cm,420.*CLHEP::cm,420.*CLHEP::cm};
533  mat_mt = new G4MaterialPropertiesTable();
534  mat_mt->AddProperty("ABSLENGTH",Energy,ABSL,NUMENTRIES);
535  mat_mt->AddProperty("RINDEX",Energy,RIND,NUMENTRIES);
536  }
537 
538  if ( mat_mt ) {
539  mat->SetMaterialPropertiesTable(mat_mt);
540  }
541 }
542 
543 
544