CMS 3D CMS Logo

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