CMS 3D CMS Logo

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