File indexing completed on 2024-05-10 02:20:15
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Alignment/LaserAlignmentSimulation/interface/MaterialProperties.h"
0010 #include "G4LogicalVolumeStore.hh"
0011
0012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0013
0014 #include <CLHEP/Units/SystemOfUnits.h>
0015 using CLHEP::cm;
0016 using CLHEP::fermi;
0017 using CLHEP::m;
0018 using CLHEP::MeV;
0019 using CLHEP::micrometer;
0020 using CLHEP::mm;
0021 using CLHEP::ns;
0022
0023 MaterialProperties::MaterialProperties(int DebugLevel, double SiAbsLengthScale)
0024 : theMaterialTable(),
0025 theMPDebugLevel(0),
0026 theSiAbsLengthScalingFactor(0),
0027 theMPT(),
0028 theTECWafer(),
0029 theTOBWafer(),
0030 theTIBWafer() {
0031 theMPDebugLevel = DebugLevel;
0032 theSiAbsLengthScalingFactor = SiAbsLengthScale;
0033
0034
0035
0036
0037
0038
0039
0040
0041 G4double theDensity = 2.33 * CLHEP::g / CLHEP::cm3;
0042 G4double theAtomicWeight = 28.09 * CLHEP::g / CLHEP::mole;
0043 G4double theAtomicNumber = 14.0;
0044
0045 theTECWafer = new G4Material("TEC_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
0046 theTOBWafer = new G4Material("TOB_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
0047 theTIBWafer = new G4Material("TIB_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
0048
0049
0050 setMaterialProperties();
0051 }
0052
0053 MaterialProperties::~MaterialProperties() {
0054 if (theMPT != nullptr) {
0055 delete theMPT;
0056 }
0057 if (theTECWafer != nullptr) {
0058 delete theTECWafer;
0059 }
0060 if (theTOBWafer != nullptr) {
0061 delete theTOBWafer;
0062 }
0063 if (theTIBWafer != nullptr) {
0064 delete theTIBWafer;
0065 }
0066 }
0067
0068 void MaterialProperties::setMaterialProperties() {
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078 theMaterialTable = G4Material::GetMaterialTable();
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092 LogDebug("SimLaserAlignment:MaterialProperties")
0093 << " **** here comes the material table **** " << *(G4Material::GetMaterialTable());
0094
0095
0096
0097
0098
0099 const G4int nEntries = 3;
0100
0101
0102 G4double PhotonEnergy[nEntries] = {1.10 * CLHEP::eV, 1.15 * CLHEP::eV, 1.20 * CLHEP::eV};
0103
0104
0105 G4double Scintillation[nEntries] = {0.1, 1.0, 0.1};
0106
0107
0108 G4double RefractiveIndex[nEntries] = {3.5400, 3.5425, 3.5450};
0109
0110 G4double RefractiveIndexMirror[nEntries] = {1.50669, 1.50669, 1.50669};
0111
0112
0113
0114
0115
0116
0117 G4double RefractiveIndexGeneral[nEntries] = {1.0, 1.0, 1.0};
0118
0119
0120
0121
0122 G4double AbsorptionLengthSi[nEntries] = {1136 * micrometer, 1136 * micrometer, 1136 * micrometer};
0123
0124 G4double AbsorptionLengthSiBarrel[nEntries] = {0.1 * fermi, 0.1 * fermi, 0.1 * fermi};
0125
0126
0127 G4double AbsorptionLengthMirror[nEntries] = {11.7 * cm, 0.5 * 11.7 * cm, 11.7 * cm};
0128
0129
0130
0131
0132
0133 G4double AbsorptionLengthDead[nEntries] = {0.001 * micrometer, 0.001 * micrometer, 0.001 * micrometer};
0134
0135
0136 G4double AbsorptionLengthGeneral[nEntries] = {75 * cm, 75 * cm, 75 * cm};
0137
0138
0139 G4double AbsorptionLengthTAir[nEntries] = {10 * m, 1.8 * m, 10 * m};
0140
0141 G4double AbsorptionLengthAl[nEntries] = {10 * mm, 10 * mm, 10 * mm};
0142 G4double AbsorptionLengthTOB_CF_Str[nEntries] = {1 * cm, 10 * cm, 1 * cm};
0143 G4double AbsorptionLengthTOBCF[nEntries] = {0.1 * mm, 20 * mm, 0.1 * mm};
0144 G4double AbsorptionLengthTIBCF[nEntries] = {15.0 * cm, 15.0 * cm, 15.0 * cm};
0145
0146
0147 G4double SiReflectivity[nEntries] = {0.0, 0.0, 0.0};
0148
0149
0150 G4double TECEfficiency[nEntries] = {0.9, 0.9, 0.9};
0151 G4double BarrelEfficiency[nEntries] = {1.0, 1.0, 1.0};
0152
0153
0154 G4double Reflectivity[nEntries] = {0.05, 0.05, 0.05};
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168 {
0169 for (G4MaterialTable::const_iterator theMTEntry = theMaterialTable->begin(); theMTEntry != theMaterialTable->end();
0170 theMTEntry++) {
0171 if (*theMTEntry) {
0172 G4Material *theMaterial = const_cast<G4Material *>(*theMTEntry);
0173
0174 if (theMaterial->GetMaterialPropertiesTable()) {
0175 theMPT = theMaterial->GetMaterialPropertiesTable();
0176 } else {
0177 theMPT = new G4MaterialPropertiesTable;
0178 }
0179
0180
0181 if (theMaterial->GetName() == "TEC_Wafer") {
0182 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
0183 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
0184 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
0185 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
0186 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
0187
0188 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0 / MeV);
0189 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
0190 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
0191 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
0192 theMPT->AddConstProperty("YIELDRATIO", 1.0);
0193
0194
0195 theMaterial->SetMaterialPropertiesTable(theMPT);
0196 }
0197
0198
0199 else if (theMaterial->GetName() == "Silicon") {
0200 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
0201 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
0202 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
0203 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
0204 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
0205
0206 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0 / MeV);
0207 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
0208 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
0209 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
0210 theMPT->AddConstProperty("YIELDRATIO", 1.0);
0211
0212
0213 theMaterial->SetMaterialPropertiesTable(theMPT);
0214 }
0215
0216
0217 else if ((theMaterial->GetName() == "TOB_Wafer") || (theMaterial->GetName() == "TIB_Wafer")) {
0218 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
0219 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
0220 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
0221 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSiBarrel, nEntries);
0222 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
0223 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, BarrelEfficiency, nEntries);
0224
0225 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0 / MeV);
0226 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
0227 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
0228 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
0229 theMPT->AddConstProperty("YIELDRATIO", 1.0);
0230
0231
0232 theMaterial->SetMaterialPropertiesTable(theMPT);
0233 }
0234
0235
0236 else if (theMaterial->GetName() == "TIB_ledge_side") {
0237
0238 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0239 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
0240
0241
0242 theMaterial->SetMaterialPropertiesTable(theMPT);
0243 }
0244
0245
0246 else if ((theMaterial->GetName() == "T_Air") || (theMaterial->GetName() == "Air")) {
0247
0248 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0249
0250 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
0251
0252 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTAir, nEntries);
0253
0254
0255 theMaterial->SetMaterialPropertiesTable(theMPT);
0256 }
0257
0258
0259
0260 else if ((theMaterial->GetName() == "TIB_connector") || (theMaterial->GetName() == "TIB_cylinder") ||
0261 (theMaterial->GetName() == "TID_Connector")) {
0262
0263 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0264
0265 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
0266
0267 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthDead, nEntries);
0268
0269
0270 theMaterial->SetMaterialPropertiesTable(theMPT);
0271 }
0272
0273
0274 else if (theMaterial->GetName() == "Si O_2") {
0275
0276 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexMirror, nEntries);
0277
0278 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthMirror, nEntries);
0279
0280 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, Reflectivity, nEntries);
0281
0282
0283 theMaterial->SetMaterialPropertiesTable(theMPT);
0284 }
0285
0286
0287 else if ((theMaterial->GetName() == "TOB_Aluminium") || (theMaterial->GetName() == "Aluminium")) {
0288
0289 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0290
0291 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
0292
0293 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthAl, nEntries);
0294
0295
0296 theMaterial->SetMaterialPropertiesTable(theMPT);
0297 }
0298
0299
0300 else if ((theMaterial->GetName() == "TOB_CF_Str")) {
0301
0302 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0303
0304 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
0305
0306 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOB_CF_Str, nEntries);
0307
0308
0309 theMaterial->SetMaterialPropertiesTable(theMPT);
0310 }
0311
0312
0313 else if ((theMaterial->GetName() == "TID_CF") || (theMaterial->GetName() == "Nomex") ||
0314 (theMaterial->GetName() == "TOB_Nomex") || (theMaterial->GetName() == "TID_Nomex") ||
0315 (theMaterial->GetName() == "TOB_plate_C") || (theMaterial->GetName() == "TOB_rod") ||
0316 (theMaterial->GetName() == "TOB_cool_DS") || (theMaterial->GetName() == "TOB_cool_SS") ||
0317 (theMaterial->GetName() == "TID_in_cable") || (theMaterial->GetName() == "TOB_PA_rphi") ||
0318 (theMaterial->GetName() == "TOB_frame_ele") || (theMaterial->GetName() == "TOB_PA_ster") ||
0319 (theMaterial->GetName() == "TOB_ICB") || (theMaterial->GetName() == "TOB_CONN1") ||
0320 (theMaterial->GetName() == "TOB_CONN2") || (theMaterial->GetName() == "TOB_CONN3") ||
0321 (theMaterial->GetName() == "TOB_rail") || (theMaterial->GetName() == "TOB_sid_rail1") ||
0322 (theMaterial->GetName() == "TOB_sid_rail2")) {
0323
0324 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0325
0326 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
0327
0328 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOBCF, nEntries);
0329
0330
0331 theMaterial->SetMaterialPropertiesTable(theMPT);
0332 }
0333
0334
0335 else if ((theMaterial->GetName() == "TIB_CF") || (theMaterial->GetName() == "TIB_cables_ax_out") ||
0336 (theMaterial->GetName() == "TIB_outer_supp") || (theMaterial->GetName() == "TIB_PA_rphi") ||
0337 (theMaterial->GetName() == "TIB_rail") || (theMaterial->GetName() == "TIB_sid_rail1") ||
0338 (theMaterial->GetName() == "TIB_sid_rail2") || (theMaterial->GetName() == "TIB_mod_cool")) {
0339
0340 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0341
0342 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
0343
0344 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTIBCF, nEntries);
0345
0346
0347 theMaterial->SetMaterialPropertiesTable(theMPT);
0348 }
0349
0350
0351 else {
0352
0353 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
0354
0355 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
0356
0357
0358 theMaterial->SetMaterialPropertiesTable(theMPT);
0359 }
0360 }
0361 }
0362 }
0363
0364
0365
0366 const G4LogicalVolumeStore *theLogicalVolumeStore = G4LogicalVolumeStore::GetInstance();
0367 std::vector<G4LogicalVolume *>::const_iterator theLogicalVolume;
0368
0369 for (theLogicalVolume = theLogicalVolumeStore->begin(); theLogicalVolume != theLogicalVolumeStore->end();
0370 theLogicalVolume++) {
0371 if (((*theLogicalVolume)->GetName() == "TECModule0StereoActive") ||
0372 ((*theLogicalVolume)->GetName() == "TECModule0RphiActive") ||
0373 ((*theLogicalVolume)->GetName() == "TECModule1StereoActive") ||
0374 ((*theLogicalVolume)->GetName() == "TECModule1RphiActive") ||
0375 ((*theLogicalVolume)->GetName() == "TECModule2RphiActive") ||
0376 ((*theLogicalVolume)->GetName() == "TECModule3RphiActive") ||
0377 ((*theLogicalVolume)->GetName() == "TECModule4StereoActive") ||
0378 ((*theLogicalVolume)->GetName() == "TECModule4RphiActive") ||
0379 ((*theLogicalVolume)->GetName() == "TECModule5RphiActive") ||
0380 ((*theLogicalVolume)->GetName() == "TECModule6RphiActive")) {
0381
0382 (*theLogicalVolume)->SetMaterial(theTECWafer);
0383
0384 if (theMPDebugLevel > 2) {
0385 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
0386 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName()
0387 << std::endl;
0388 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
0389 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
0390 }
0391 } else if (((*theLogicalVolume)->GetName() == "TOBActiveSter0") ||
0392 ((*theLogicalVolume)->GetName() == "TOBActiveRphi0") ||
0393 ((*theLogicalVolume)->GetName() == "TOBActiveRphi2") ||
0394 ((*theLogicalVolume)->GetName() == "TOBActiveRphi4")) {
0395
0396 (*theLogicalVolume)->SetMaterial(theTOBWafer);
0397
0398 if (theMPDebugLevel > 2) {
0399 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
0400 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName()
0401 << std::endl;
0402 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
0403 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
0404 }
0405 } else if (((*theLogicalVolume)->GetName() == "TIBActiveSter0") ||
0406 ((*theLogicalVolume)->GetName() == "TIBActiveRphi0") ||
0407 ((*theLogicalVolume)->GetName() == "TIBActiveRphi2")) {
0408
0409 (*theLogicalVolume)->SetMaterial(theTIBWafer);
0410
0411 if (theMPDebugLevel > 2) {
0412 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
0413 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName()
0414 << std::endl;
0415 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
0416 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
0417 }
0418 }
0419 }
0420 }