00001
00009 #include "Alignment/LaserAlignmentSimulation/interface/MaterialProperties.h"
00010 #include "G4LogicalVolumeStore.hh"
00011
00012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00013
00014 MaterialProperties::MaterialProperties(int DebugLevel, double SiAbsLengthScale)
00015 : theMaterialTable(), theMPDebugLevel(0),
00016 theSiAbsLengthScalingFactor(0),
00017 theMPT(),
00018 theTECWafer(), theTOBWafer(), theTIBWafer()
00019 {
00020 theMPDebugLevel = DebugLevel;
00021 theSiAbsLengthScalingFactor = SiAbsLengthScale;
00022
00023
00024
00025
00026
00027
00028
00029
00030 G4double theDensity = 2.33*g/cm3;
00031 G4double theAtomicWeight = 28.09*g/mole;
00032 G4double theAtomicNumber = 14.0;
00033
00034 theTECWafer = new G4Material("TEC_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
00035 theTOBWafer = new G4Material("TOB_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
00036 theTIBWafer = new G4Material("TIB_Wafer", theAtomicNumber, theAtomicWeight, theDensity);
00037
00038
00039 setMaterialProperties();
00040 }
00041
00042 MaterialProperties::~MaterialProperties()
00043 {
00044 if ( theMPT != 0 ) { delete theMPT; }
00045 if ( theTECWafer != 0 ) { delete theTECWafer; }
00046 if ( theTOBWafer != 0 ) { delete theTOBWafer; }
00047 if ( theTIBWafer != 0 ) { delete theTIBWafer; }
00048 }
00049
00050
00051 void MaterialProperties::setMaterialProperties()
00052 {
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 theMaterialTable = G4Material::GetMaterialTable();
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 LogDebug("SimLaserAlignment:MaterialProperties") << " **** here comes the material table **** "
00077 << *(G4Material::GetMaterialTable());
00078
00079
00080
00081
00082
00083 const G4int nEntries = 3;
00084
00085
00086 G4double PhotonEnergy[nEntries] = { 1.10 * eV, 1.15 * eV, 1.20 * eV };
00087
00088
00089 G4double Scintillation[nEntries] = { 0.1, 1.0, 0.1 };
00090
00091
00092 G4double RefractiveIndex[nEntries] = { 3.5400, 3.5425, 3.5450 };
00093
00094 G4double RefractiveIndexMirror[nEntries] = { 1.50669, 1.50669, 1.50669 };
00095
00096
00097
00098
00099
00100
00101 G4double RefractiveIndexGeneral[nEntries] = { 1.0, 1.0, 1.0 };
00102
00103
00104 G4double AbsorptionLengthSi[nEntries] = { 198.8 * micrometer,
00105 198.8 * micrometer,
00106 198.8 * micrometer };
00107
00108 G4double AbsorptionLengthSiBarrel[nEntries] = { 0.1 * fermi,
00109 0.1 * fermi,
00110 0.1 * fermi };
00111
00112
00113
00114 G4double AbsorptionLengthMirror[nEntries] = { 11.7 * cm, 0.5 * 11.7 * cm, 11.7 * cm };
00115
00116
00117
00118
00119
00120 G4double AbsorptionLengthDead[nEntries] = { 0.001 * micrometer, 0.001 * micrometer,
00121 0.001 * micrometer };
00122
00123
00124 G4double AbsorptionLengthGeneral[nEntries] = { 75 * cm, 75 * cm, 75 * cm };
00125
00126
00127 G4double AbsorptionLengthTAir[nEntries] = { 10 * m, 1.8 * m, 10 * m };
00128
00129 G4double AbsorptionLengthAl[nEntries] = { 10 * mm, 10 * mm, 10 * mm};
00130 G4double AbsorptionLengthTOB_CF_Str[nEntries] = { 1 * cm, 10 * cm, 1 * cm };
00131 G4double AbsorptionLengthTOBCF[nEntries] = { 0.1 * mm, 20 * mm, 0.1 * mm };
00132 G4double AbsorptionLengthTIBCF[nEntries] = { 15.0 * cm, 15.0 * cm, 15.0 * cm };
00133
00134
00135 G4double SiReflectivity[nEntries] = { 0.0, 0.0, 0.0 };
00136
00137
00138 G4double TECEfficiency[nEntries] = { 0.9, 0.9, 0.9 };
00139 G4double BarrelEfficiency[nEntries] = { 1.0, 1.0, 1.0 };
00140
00141
00142 G4double Reflectivity[nEntries] = { 0.05, 0.05, 0.05 };
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 {
00157 for(G4MaterialTable::const_iterator theMTEntry = theMaterialTable->begin();
00158 theMTEntry != theMaterialTable->end(); theMTEntry++)
00159 {
00160 if(*theMTEntry)
00161 {
00162 G4Material * theMaterial = const_cast<G4Material*>(*theMTEntry);
00163
00164 if (theMaterial->GetMaterialPropertiesTable())
00165 {
00166 theMPT = theMaterial->GetMaterialPropertiesTable();
00167 }
00168 else
00169 {
00170 theMPT = new G4MaterialPropertiesTable;
00171 }
00172
00173
00174 if ( theMaterial->GetName() == "TEC_Wafer" )
00175 {
00176 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00177 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00178 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
00179 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
00180 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
00181
00182 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
00183 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
00184 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
00185 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
00186 theMPT->AddConstProperty("YIELDRATIO", 1.0);
00187
00188
00189 theMaterial->SetMaterialPropertiesTable(theMPT);
00190 }
00191
00192
00193 else if ( theMaterial->GetName() == "Silicon" )
00194 {
00195 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00196 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00197 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
00198 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
00199 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
00200
00201 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
00202 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
00203 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
00204 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
00205 theMPT->AddConstProperty("YIELDRATIO", 1.0);
00206
00207
00208 theMaterial->SetMaterialPropertiesTable(theMPT);
00209 }
00210
00211
00212 else if ( ( theMaterial->GetName() == "TOB_Wafer" ) ||
00213 ( theMaterial->GetName() == "TIB_Wafer" ) )
00214 {
00215 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00216 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00217 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
00218 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSiBarrel, nEntries);
00219 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00220 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, BarrelEfficiency, nEntries);
00221
00222 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
00223 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
00224 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
00225 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
00226 theMPT->AddConstProperty("YIELDRATIO", 1.0);
00227
00228
00229 theMaterial->SetMaterialPropertiesTable(theMPT);
00230 }
00231
00232
00233 else if ( theMaterial->GetName() == "TIB_ledge_side" )
00234 {
00235
00236 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00237 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
00238
00239
00240 theMaterial->SetMaterialPropertiesTable(theMPT);
00241 }
00242
00243
00244 else if ( ( theMaterial->GetName() == "T_Air" ) ||
00245 ( theMaterial->GetName() == "Air" ) )
00246 {
00247
00248 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00249
00250 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00251
00252 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTAir, nEntries);
00253
00254
00255 theMaterial->SetMaterialPropertiesTable(theMPT);
00256 }
00257
00258
00259
00260 else if ( ( theMaterial->GetName() == "TIB_connector" ) ||
00261 ( theMaterial->GetName() == "TIB_cylinder" ) ||
00262 ( theMaterial->GetName() == "TID_Connector" ) )
00263 {
00264
00265 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00266
00267 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00268
00269 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthDead, nEntries);
00270
00271
00272 theMaterial->SetMaterialPropertiesTable(theMPT);
00273 }
00274
00275
00276 else if ( theMaterial->GetName() == "Si O_2" )
00277 {
00278
00279 theMPT->AddProperty("RINDEX", PhotonEnergy,RefractiveIndexMirror, nEntries);
00280
00281 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthMirror, nEntries);
00282
00283 theMPT->AddProperty("REFLECTIVITY",PhotonEnergy,Reflectivity, nEntries);
00284
00285
00286 theMaterial->SetMaterialPropertiesTable(theMPT);
00287 }
00288
00289
00290 else if ( ( theMaterial->GetName() == "TOB_Aluminium" ) ||
00291 ( theMaterial->GetName() == "Aluminium" ) )
00292 {
00293
00294 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00295
00296 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00297
00298 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthAl, nEntries);
00299
00300
00301 theMaterial->SetMaterialPropertiesTable(theMPT);
00302 }
00303
00304
00305 else if ( ( theMaterial->GetName() == "TOB_CF_Str" ) )
00306 {
00307
00308 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00309
00310 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00311
00312 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOB_CF_Str, nEntries);
00313
00314
00315 theMaterial->SetMaterialPropertiesTable(theMPT);
00316 }
00317
00318
00319 else if ( ( theMaterial->GetName() == "TID_CF" ) ||
00320 ( theMaterial->GetName() == "Nomex" ) ||
00321 ( theMaterial->GetName() == "TOB_Nomex" ) ||
00322 ( theMaterial->GetName() == "TID_Nomex" ) ||
00323 ( theMaterial->GetName() == "TOB_plate_C" ) ||
00324 ( theMaterial->GetName() == "TOB_rod" ) ||
00325 ( theMaterial->GetName() == "TOB_cool_DS" ) ||
00326 ( theMaterial->GetName() == "TOB_cool_SS" ) ||
00327 ( theMaterial->GetName() == "TID_in_cable" ) ||
00328 ( theMaterial->GetName() == "TOB_PA_rphi" ) ||
00329 ( theMaterial->GetName() == "TOB_frame_ele" ) ||
00330 ( theMaterial->GetName() == "TOB_PA_ster" ) ||
00331 ( theMaterial->GetName() == "TOB_ICB" ) ||
00332 ( theMaterial->GetName() == "TOB_CONN1" ) ||
00333 ( theMaterial->GetName() == "TOB_CONN2" ) ||
00334 ( theMaterial->GetName() == "TOB_CONN3" ) ||
00335 ( theMaterial->GetName() == "TOB_rail" ) ||
00336 ( theMaterial->GetName() == "TOB_sid_rail1" ) ||
00337 ( theMaterial->GetName() == "TOB_sid_rail2" ) )
00338 {
00339
00340 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00341
00342 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00343
00344 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOBCF, nEntries);
00345
00346
00347 theMaterial->SetMaterialPropertiesTable(theMPT);
00348 }
00349
00350
00351 else if ( ( theMaterial->GetName() == "TIB_CF" ) ||
00352 ( theMaterial->GetName() == "TIB_cables_ax_out" ) ||
00353 ( theMaterial->GetName() == "TIB_outer_supp" ) ||
00354 ( theMaterial->GetName() == "TIB_PA_rphi" ) ||
00355 ( theMaterial->GetName() == "TIB_rail" ) ||
00356 ( theMaterial->GetName() == "TIB_sid_rail1" ) ||
00357 ( theMaterial->GetName() == "TIB_sid_rail2" ) ||
00358 ( theMaterial->GetName() == "TIB_mod_cool" ) )
00359 {
00360
00361 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00362
00363 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00364
00365 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTIBCF, nEntries);
00366
00367
00368 theMaterial->SetMaterialPropertiesTable(theMPT);
00369 }
00370
00371
00372 else
00373 {
00374
00375 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00376
00377 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
00378
00379
00380 theMaterial->SetMaterialPropertiesTable(theMPT);
00381 }
00382
00383 }
00384 }
00385 }
00386
00387
00388 const G4LogicalVolumeStore * theLogicalVolumeStore = G4LogicalVolumeStore::GetInstance();
00389 std::vector<G4LogicalVolume*>::const_iterator theLogicalVolume;
00390
00391 for ( theLogicalVolume = theLogicalVolumeStore->begin(); theLogicalVolume != theLogicalVolumeStore->end(); theLogicalVolume++ )
00392 {
00393 if ( ( (*theLogicalVolume)->GetName() == "TECModule0StereoActive" ) ||
00394 ( (*theLogicalVolume)->GetName() == "TECModule0RphiActive" ) ||
00395 ( (*theLogicalVolume)->GetName() == "TECModule1StereoActive" ) ||
00396 ( (*theLogicalVolume)->GetName() == "TECModule1RphiActive" ) ||
00397 ( (*theLogicalVolume)->GetName() == "TECModule2RphiActive" ) ||
00398 ( (*theLogicalVolume)->GetName() == "TECModule3RphiActive" ) ||
00399 ( (*theLogicalVolume)->GetName() == "TECModule4StereoActive" ) ||
00400 ( (*theLogicalVolume)->GetName() == "TECModule4RphiActive" ) ||
00401 ( (*theLogicalVolume)->GetName() == "TECModule5RphiActive" ) ||
00402 ( (*theLogicalVolume)->GetName() == "TECModule6RphiActive" ) )
00403 {
00404
00405 (*theLogicalVolume)->SetMaterial(theTECWafer);
00406
00407 if (theMPDebugLevel > 2)
00408 {
00409 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
00410 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
00411 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
00412 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
00413 }
00414 }
00415 else if ( ( (*theLogicalVolume)->GetName() == "TOBActiveSter0" ) ||
00416 ( (*theLogicalVolume)->GetName() == "TOBActiveRphi0" ) ||
00417 ( (*theLogicalVolume)->GetName() == "TOBActiveRphi2" ) ||
00418 ( (*theLogicalVolume)->GetName() == "TOBActiveRphi4" ) )
00419 {
00420
00421 (*theLogicalVolume)->SetMaterial(theTOBWafer);
00422
00423 if (theMPDebugLevel > 2)
00424 {
00425 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
00426 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
00427 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
00428 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
00429 }
00430 }
00431 else if ( ( (*theLogicalVolume)->GetName() == "TIBActiveSter0" ) ||
00432 ( (*theLogicalVolume)->GetName() == "TIBActiveRphi0" ) ||
00433 ( (*theLogicalVolume)->GetName() == "TIBActiveRphi2" ) )
00434 {
00435
00436 (*theLogicalVolume)->SetMaterial(theTIBWafer);
00437
00438 if (theMPDebugLevel > 2)
00439 {
00440 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
00441 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
00442 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
00443 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
00444 }
00445 }
00446 }
00447 }