CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MaterialProperties.cc
Go to the documentation of this file.
1 
10 #include "G4LogicalVolumeStore.hh"
11 
13 
14 #include "G4SystemOfUnits.hh"
15 
16  MaterialProperties::MaterialProperties(int DebugLevel, double SiAbsLengthScale)
17  : theMaterialTable(), theMPDebugLevel(0),
18  theSiAbsLengthScalingFactor(0),
19  theMPT(),
20  theTECWafer(), theTOBWafer(), theTIBWafer()
21 {
22  theMPDebugLevel = DebugLevel;
23  theSiAbsLengthScalingFactor = SiAbsLengthScale;
24  /* *********************************************************************** */
25  /*
26  define the materials for the sensitive detectors in TEC, TIB and TOB
27  we need this to specify different properties for Barrel and Endcap
28  detectors, which is by default no longer possible in CMSSW due to
29  the fact that all modules are made out of the same G4Material
30  */
31  /* *********************************************************************** */
32  G4double theDensity = 2.33*g/cm3;
33  G4double theAtomicWeight = 28.09*g/mole;
34  G4double theAtomicNumber = 14.0;
35 
36  theTECWafer = new G4Material("TEC_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
37  theTOBWafer = new G4Material("TOB_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
38  theTIBWafer = new G4Material("TIB_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
39 
40  // set the properties of the materials
42 }
43 
45 {
46  if ( theMPT != 0 ) { delete theMPT; }
47  if ( theTECWafer != 0 ) { delete theTECWafer; }
48  if ( theTOBWafer != 0 ) { delete theTOBWafer; }
49  if ( theTIBWafer != 0 ) { delete theTIBWafer; }
50 }
51 
52 
54 {
55  /* *********************************************************************** */
56  /*
57  use this function to define material properties (like refraction
58  index, absorptionlenght and so on) and add them to the
59  MaterialPropertiesTable. Finally set the MPT to a give Material.
60  */
61  /* *********************************************************************** */
62 
63  // get the MaterialTable as it is defined in OSCAR (CMSSW now)
64  theMaterialTable = G4Material::GetMaterialTable();
65 
66  /* *********************************************************************** */
67  /*
68  with the following code one can access the MaterialTable defined in
69  OSCAR. This contains all the materials needed for the CMS detector,
70  which are defined in the Geometry and DDD packages. COBRA takes care
71  of the proper conversion between a DDMaterial and a G4Material.
72  */
73  /* *********************************************************************** */
74 
75 // if (theMPDebugLevel > 1)
76 // {
77  // print the materialtable
78  LogDebug("SimLaserAlignment:MaterialProperties") << " **** here comes the material table **** "
79  << *(G4Material::GetMaterialTable());
80 // }
81 
82  // define the MateriapropertiesTable for the Sensitive Regions in the Tracker
83  // TOB_Wafer, TOB_Silicon, TID_Wafer, TIB_Wafer and TEC_Wafer
84 
85  const G4int nEntries = 3;
86 
87  // Photon energies
88  G4double PhotonEnergy[nEntries] = { 1.10 * eV, 1.15 * eV, 1.20 * eV };
89 
90  // scintillation
91  G4double Scintillation[nEntries] = { 0.1, 1.0, 0.1 };
92 
93  // Refractive Index
94  G4double RefractiveIndex[nEntries] = { 3.5400, 3.5425, 3.5450 };
95  // Refractive Index of the Mirrors (BK7)
96  G4double RefractiveIndexMirror[nEntries] = { 1.50669, 1.50669, 1.50669 };
97 
98  /* *********************************************************************** */
99  /* set the refractive index for the other materials to 1.0. This is *
100  * needed to propagate the optical photons through the detector according *
101  * to Peter Gumplinger. */
102  /* *********************************************************************** */
103  G4double RefractiveIndexGeneral[nEntries] = { 1.0, 1.0, 1.0 };
104 
105  // Absorption Length
106  // G4double AbsorptionLengthSi[nEntries] = { 198.8 * micrometer, 198.8 * micrometer, 198.8 * micrometer }; ///////////////////////////////////
107  G4double AbsorptionLengthSi[nEntries] = { 1136 * micrometer, 1136 * micrometer, 1136 * micrometer };
108 
109  G4double AbsorptionLengthSiBarrel[nEntries] = { 0.1 * fermi,
110  0.1 * fermi,
111  0.1 * fermi };
112 
113 
114  // Absorption length of the mirrors
115  G4double AbsorptionLengthMirror[nEntries] = { 11.7 * cm, 0.5 * 11.7 * cm, 11.7 * cm };
116 
117  // Absorption Length for dead material in the tracker; set to small values
118  // to kill the optical photons outside the TEC. Maybe this is later a problem
119  // when implementing Ray 1 to connect both TECs which eachother and with TIB
120  // and TOB!??
121  G4double AbsorptionLengthDead[nEntries] = { 0.001 * micrometer, 0.001 * micrometer,
122  0.001 * micrometer };
123 
124  // Absorption Length of the other Materials in the Tracker
125  G4double AbsorptionLengthGeneral[nEntries] = { 75 * cm, 75 * cm, 75 * cm };
126 
127  // Absorption Length of the Air in the Tracker
128  G4double AbsorptionLengthTAir[nEntries] = { 10 * m, 1.8 * m, 10 * m };
129 
130  G4double AbsorptionLengthAl[nEntries] = { 10 * mm, 10 * mm, 10 * mm};
131  G4double AbsorptionLengthTOB_CF_Str[nEntries] = { 1 * cm, 10 * cm, 1 * cm };
132  G4double AbsorptionLengthTOBCF[nEntries] = { 0.1 * mm, 20 * mm, 0.1 * mm };
133  G4double AbsorptionLengthTIBCF[nEntries] = { 15.0 * cm, 15.0 * cm, 15.0 * cm };
134 
135  // Reflectivity of the modules
136  G4double SiReflectivity[nEntries] = { 0.0, 0.0, 0.0 };
137 
138  // Efficiency of the modules
139  G4double TECEfficiency[nEntries] = { 0.9, 0.9, 0.9 };
140  G4double BarrelEfficiency[nEntries] = { 1.0, 1.0, 1.0 };
141 
142  // Reflectivity of the mirrors in the Alignment Tubes
143  G4double Reflectivity[nEntries] = { 0.05, 0.05, 0.05 };
144 
145  /* *********************************************************************** */
146 
147  /* *********************************************************************** */
148  /*
149  define the materials for the sensitive detectors in TEC, TIB and TOB
150  we need this to specify different properties for Barrel and Endcap
151  detectors, which is by default no longer possible in CMSSW due to
152  the fact that all modules are made out of the same G4Material
153  */
154  /* *********************************************************************** */
155 
156  // set the options for the materials
157  {
158  for(G4MaterialTable::const_iterator theMTEntry = theMaterialTable->begin();
159  theMTEntry != theMaterialTable->end(); theMTEntry++)
160  {
161  if(*theMTEntry)
162  {
163  G4Material * theMaterial = const_cast<G4Material*>(*theMTEntry);
164 
165  if (theMaterial->GetMaterialPropertiesTable())
166  {
167  theMPT = theMaterial->GetMaterialPropertiesTable();
168  }
169  else
170  {
171  theMPT = new G4MaterialPropertiesTable;
172  }
173 
174  // properties of the TEC_Wafer
175  if ( theMaterial->GetName() == "TEC_Wafer" )
176  {
177  theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
178  theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
179  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
180  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
181  theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
182 
183  theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
184  theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
185  theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
186  theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
187  theMPT->AddConstProperty("YIELDRATIO", 1.0);
188 
189  // set the MaterialPropertiesTable
190  theMaterial->SetMaterialPropertiesTable(theMPT);
191  }
192 
193  // properties of Silicon (used as Module Material in CMSSW)
194  else if ( theMaterial->GetName() == "Silicon" )
195  {
196  theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
197  theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
198  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
199  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
200  theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
201 
202  theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
203  theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
204  theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
205  theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
206  theMPT->AddConstProperty("YIELDRATIO", 1.0);
207 
208  // set the MaterialPropertiesTable
209  theMaterial->SetMaterialPropertiesTable(theMPT);
210  }
211 
212  // properties of the TOB_Wafer, TOB_Silicon, TIB_Wafer
213  else if ( ( theMaterial->GetName() == "TOB_Wafer" ) ||
214  ( theMaterial->GetName() == "TIB_Wafer" ) )
215  {
216  theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
217  theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
218  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
219  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSiBarrel, nEntries);
220  theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
221  theMPT->AddProperty("EFFICIENCY", PhotonEnergy, BarrelEfficiency, nEntries);
222 
223  theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
224  theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
225  theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
226  theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
227  theMPT->AddConstProperty("YIELDRATIO", 1.0);
228 
229  // set the MaterialPropertiesTable
230  theMaterial->SetMaterialPropertiesTable(theMPT);
231  }
232 
233  // properties of the TIB_ledge_side
234  else if ( theMaterial->GetName() == "TIB_ledge_side" )
235  {
236  // set the refractive index
237  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
238  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
239 
240  // set the MaterialPropertiesTable
241  theMaterial->SetMaterialPropertiesTable(theMPT);
242  }
243 
244  // properties of air
245  else if ( ( theMaterial->GetName() == "T_Air" ) ||
246  ( theMaterial->GetName() == "Air" ) )
247  {
248  // set the refractive index
249  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
250  // set the reflectivity
251  theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
252  // set the absorptionlength
253  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTAir, nEntries);
254 
255  // set the MaterialPropertiesTable
256  theMaterial->SetMaterialPropertiesTable(theMPT);
257  }
258 
259  // properties of some materials in the Barrel
260  // used to absorb photons to avoid hits in other TEC
261  else if ( ( theMaterial->GetName() == "TIB_connector" ) ||
262  ( theMaterial->GetName() == "TIB_cylinder" ) ||
263  ( theMaterial->GetName() == "TID_Connector" ) )
264  {
265  // set the refractive index
266  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
267  // set the reflectivity
268  theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
269  // set the absorptionlength
270  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthDead, nEntries);
271 
272  // set the MaterialPropertiesTable
273  theMaterial->SetMaterialPropertiesTable(theMPT);
274  }
275 
276  // properties of SiO2; used for the mirrors of the Alignment Tubes
277  else if ( theMaterial->GetName() == "Si O_2" )
278  {
279  // set the refractive index
280  theMPT->AddProperty("RINDEX", PhotonEnergy,RefractiveIndexMirror, nEntries);
281  //set the absorptionlength
282  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthMirror, nEntries);
283  // set the reflectivity
284  theMPT->AddProperty("REFLECTIVITY",PhotonEnergy,Reflectivity, nEntries);
285 
286  // set the MaterialPropertiesTable
287  theMaterial->SetMaterialPropertiesTable(theMPT);
288  }
289 
290  // properties of Aluminium
291  else if ( ( theMaterial->GetName() == "TOB_Aluminium" ) ||
292  ( theMaterial->GetName() == "Aluminium" ) )
293  {
294  // set the refractive index
295  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
296  // set the reflectivity
297  theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
298  // set the absorptionlength
299  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthAl, nEntries);
300 
301  // set the MaterialPropertiesTable
302  theMaterial->SetMaterialPropertiesTable(theMPT);
303  }
304 
305  // properties of TOB_CF_Str
306  else if ( ( theMaterial->GetName() == "TOB_CF_Str" ) )
307  {
308  // set the refractive index
309  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
310  // set the reflectivity
311  theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
312  // set the absorptionlength
313  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOB_CF_Str, nEntries);
314 
315  // set the MaterialPropertiesTable
316  theMaterial->SetMaterialPropertiesTable(theMPT);
317  }
318 
319  // some other Tracker materials
320  else if ( ( theMaterial->GetName() == "TID_CF" ) ||
321  ( theMaterial->GetName() == "Nomex" ) ||
322  ( theMaterial->GetName() == "TOB_Nomex" ) ||
323  ( theMaterial->GetName() == "TID_Nomex" ) ||
324  ( theMaterial->GetName() == "TOB_plate_C" ) ||
325  ( theMaterial->GetName() == "TOB_rod" ) ||
326  ( theMaterial->GetName() == "TOB_cool_DS" ) ||
327  ( theMaterial->GetName() == "TOB_cool_SS" ) ||
328  ( theMaterial->GetName() == "TID_in_cable" ) ||
329  ( theMaterial->GetName() == "TOB_PA_rphi" ) ||
330  ( theMaterial->GetName() == "TOB_frame_ele" ) ||
331  ( theMaterial->GetName() == "TOB_PA_ster" ) ||
332  ( theMaterial->GetName() == "TOB_ICB" ) ||
333  ( theMaterial->GetName() == "TOB_CONN1" ) ||
334  ( theMaterial->GetName() == "TOB_CONN2" ) ||
335  ( theMaterial->GetName() == "TOB_CONN3" ) ||
336  ( theMaterial->GetName() == "TOB_rail" ) ||
337  ( theMaterial->GetName() == "TOB_sid_rail1" ) ||
338  ( theMaterial->GetName() == "TOB_sid_rail2" ) )
339  {
340  // set the refractive index
341  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
342  // set the reflectivity
343  theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
344  // set the absorptionlength
345  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOBCF, nEntries);
346 
347  // set the MaterialPropertiesTable
348  theMaterial->SetMaterialPropertiesTable(theMPT);
349  }
350 
351  // properties of some TIB materials
352  else if ( ( theMaterial->GetName() == "TIB_CF" ) ||
353  ( theMaterial->GetName() == "TIB_cables_ax_out" ) ||
354  ( theMaterial->GetName() == "TIB_outer_supp" ) ||
355  ( theMaterial->GetName() == "TIB_PA_rphi" ) ||
356  ( theMaterial->GetName() == "TIB_rail" ) ||
357  ( theMaterial->GetName() == "TIB_sid_rail1" ) ||
358  ( theMaterial->GetName() == "TIB_sid_rail2" ) ||
359  ( theMaterial->GetName() == "TIB_mod_cool" ) )
360  {
361  // set the refractive index
362  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
363  // set the reflectivity
364  theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
365  // set the absorptionlength
366  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTIBCF, nEntries);
367 
368  // set the MaterialPropertiesTable
369  theMaterial->SetMaterialPropertiesTable(theMPT);
370  }
371 
372  // properties of all other materials in the detector
373  else
374  {
375  // set the refractive index
376  theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
377  // set the absorptionlength
378  theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
379 
380  // set the MaterialPropertiesTable
381  theMaterial->SetMaterialPropertiesTable(theMPT);
382  }
383 
384  }
385  }
386  }
387 
388  // loop over the logical volumes and set the material for the sensitive detectors
389  const G4LogicalVolumeStore * theLogicalVolumeStore = G4LogicalVolumeStore::GetInstance();
390  std::vector<G4LogicalVolume*>::const_iterator theLogicalVolume;
391 
392  for ( theLogicalVolume = theLogicalVolumeStore->begin(); theLogicalVolume != theLogicalVolumeStore->end(); theLogicalVolume++ )
393  {
394  if ( ( (*theLogicalVolume)->GetName() == "TECModule0StereoActive" ) ||
395  ( (*theLogicalVolume)->GetName() == "TECModule0RphiActive" ) ||
396  ( (*theLogicalVolume)->GetName() == "TECModule1StereoActive" ) ||
397  ( (*theLogicalVolume)->GetName() == "TECModule1RphiActive" ) ||
398  ( (*theLogicalVolume)->GetName() == "TECModule2RphiActive" ) ||
399  ( (*theLogicalVolume)->GetName() == "TECModule3RphiActive" ) ||
400  ( (*theLogicalVolume)->GetName() == "TECModule4StereoActive" ) ||
401  ( (*theLogicalVolume)->GetName() == "TECModule4RphiActive" ) ||
402  ( (*theLogicalVolume)->GetName() == "TECModule5RphiActive" ) ||
403  ( (*theLogicalVolume)->GetName() == "TECModule6RphiActive" ) )
404  {
405  // set the material
406  (*theLogicalVolume)->SetMaterial(theTECWafer);
407 
408  if (theMPDebugLevel > 2)
409  {
410  std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
411  std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
412  std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
413  (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
414  }
415  }
416  else if ( ( (*theLogicalVolume)->GetName() == "TOBActiveSter0" ) ||
417  ( (*theLogicalVolume)->GetName() == "TOBActiveRphi0" ) ||
418  ( (*theLogicalVolume)->GetName() == "TOBActiveRphi2" ) ||
419  ( (*theLogicalVolume)->GetName() == "TOBActiveRphi4" ) )
420  {
421  // set the material
422  (*theLogicalVolume)->SetMaterial(theTOBWafer);
423 
424  if (theMPDebugLevel > 2)
425  {
426  std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
427  std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
428  std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
429  (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
430  }
431  }
432  else if ( ( (*theLogicalVolume)->GetName() == "TIBActiveSter0" ) ||
433  ( (*theLogicalVolume)->GetName() == "TIBActiveRphi0" ) ||
434  ( (*theLogicalVolume)->GetName() == "TIBActiveRphi2" ) )
435  {
436  // set the material
437  (*theLogicalVolume)->SetMaterial(theTIBWafer);
438 
439  if (theMPDebugLevel > 2)
440  {
441  std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
442  std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
443  std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
444  (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
445  }
446  }
447  }
448 }
#define LogDebug(id)
G4MaterialPropertiesTable * theMPT
G4Material * theTOBWafer
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
MaterialProperties(int DebugLevel, double SiAbsLengthScale)
constructor
void setMaterialProperties()
define optical properties of materials in the detector
G4Material * theTECWafer
G4Material * theTIBWafer
~MaterialProperties()
destructor
tuple cout
Definition: gather_cfg.py:121
const G4MaterialTable * theMaterialTable