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
00105 G4double AbsorptionLengthSi[nEntries] = { 1136 * micrometer, 1136 * micrometer, 1136 * micrometer };
00106
00107 G4double AbsorptionLengthSiBarrel[nEntries] = { 0.1 * fermi,
00108 0.1 * fermi,
00109 0.1 * fermi };
00110
00111
00112
00113 G4double AbsorptionLengthMirror[nEntries] = { 11.7 * cm, 0.5 * 11.7 * cm, 11.7 * cm };
00114
00115
00116
00117
00118
00119 G4double AbsorptionLengthDead[nEntries] = { 0.001 * micrometer, 0.001 * micrometer,
00120 0.001 * micrometer };
00121
00122
00123 G4double AbsorptionLengthGeneral[nEntries] = { 75 * cm, 75 * cm, 75 * cm };
00124
00125
00126 G4double AbsorptionLengthTAir[nEntries] = { 10 * m, 1.8 * m, 10 * m };
00127
00128 G4double AbsorptionLengthAl[nEntries] = { 10 * mm, 10 * mm, 10 * mm};
00129 G4double AbsorptionLengthTOB_CF_Str[nEntries] = { 1 * cm, 10 * cm, 1 * cm };
00130 G4double AbsorptionLengthTOBCF[nEntries] = { 0.1 * mm, 20 * mm, 0.1 * mm };
00131 G4double AbsorptionLengthTIBCF[nEntries] = { 15.0 * cm, 15.0 * cm, 15.0 * cm };
00132
00133
00134 G4double SiReflectivity[nEntries] = { 0.0, 0.0, 0.0 };
00135
00136
00137 G4double TECEfficiency[nEntries] = { 0.9, 0.9, 0.9 };
00138 G4double BarrelEfficiency[nEntries] = { 1.0, 1.0, 1.0 };
00139
00140
00141 G4double Reflectivity[nEntries] = { 0.05, 0.05, 0.05 };
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 {
00156 for(G4MaterialTable::const_iterator theMTEntry = theMaterialTable->begin();
00157 theMTEntry != theMaterialTable->end(); theMTEntry++)
00158 {
00159 if(*theMTEntry)
00160 {
00161 G4Material * theMaterial = const_cast<G4Material*>(*theMTEntry);
00162
00163 if (theMaterial->GetMaterialPropertiesTable())
00164 {
00165 theMPT = theMaterial->GetMaterialPropertiesTable();
00166 }
00167 else
00168 {
00169 theMPT = new G4MaterialPropertiesTable;
00170 }
00171
00172
00173 if ( theMaterial->GetName() == "TEC_Wafer" )
00174 {
00175 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00176 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00177 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
00178 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
00179 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
00180
00181 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
00182 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
00183 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
00184 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
00185 theMPT->AddConstProperty("YIELDRATIO", 1.0);
00186
00187
00188 theMaterial->SetMaterialPropertiesTable(theMPT);
00189 }
00190
00191
00192 else if ( theMaterial->GetName() == "Silicon" )
00193 {
00194 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00195 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00196 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
00197 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSi, nEntries);
00198 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, TECEfficiency, nEntries);
00199
00200 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
00201 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
00202 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
00203 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
00204 theMPT->AddConstProperty("YIELDRATIO", 1.0);
00205
00206
00207 theMaterial->SetMaterialPropertiesTable(theMPT);
00208 }
00209
00210
00211 else if ( ( theMaterial->GetName() == "TOB_Wafer" ) ||
00212 ( theMaterial->GetName() == "TIB_Wafer" ) )
00213 {
00214 theMPT->AddProperty("FASTCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00215 theMPT->AddProperty("SLOWCOMPONENT", PhotonEnergy, Scintillation, nEntries);
00216 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
00217 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthSiBarrel, nEntries);
00218 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00219 theMPT->AddProperty("EFFICIENCY", PhotonEnergy, BarrelEfficiency, nEntries);
00220
00221 theMPT->AddConstProperty("SCINTILLATIONYIELD", 12000.0/MeV);
00222 theMPT->AddConstProperty("RESOLTUIONSCALE", 1.0);
00223 theMPT->AddConstProperty("FASTTIMECONSTANT", 20.0 * ns);
00224 theMPT->AddConstProperty("SLOWTIMECONSTANT", 45.0 * ns);
00225 theMPT->AddConstProperty("YIELDRATIO", 1.0);
00226
00227
00228 theMaterial->SetMaterialPropertiesTable(theMPT);
00229 }
00230
00231
00232 else if ( theMaterial->GetName() == "TIB_ledge_side" )
00233 {
00234
00235 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00236 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
00237
00238
00239 theMaterial->SetMaterialPropertiesTable(theMPT);
00240 }
00241
00242
00243 else if ( ( theMaterial->GetName() == "T_Air" ) ||
00244 ( theMaterial->GetName() == "Air" ) )
00245 {
00246
00247 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00248
00249 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00250
00251 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTAir, nEntries);
00252
00253
00254 theMaterial->SetMaterialPropertiesTable(theMPT);
00255 }
00256
00257
00258
00259 else if ( ( theMaterial->GetName() == "TIB_connector" ) ||
00260 ( theMaterial->GetName() == "TIB_cylinder" ) ||
00261 ( theMaterial->GetName() == "TID_Connector" ) )
00262 {
00263
00264 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00265
00266 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00267
00268 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthDead, nEntries);
00269
00270
00271 theMaterial->SetMaterialPropertiesTable(theMPT);
00272 }
00273
00274
00275 else if ( theMaterial->GetName() == "Si O_2" )
00276 {
00277
00278 theMPT->AddProperty("RINDEX", PhotonEnergy,RefractiveIndexMirror, nEntries);
00279
00280 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthMirror, nEntries);
00281
00282 theMPT->AddProperty("REFLECTIVITY",PhotonEnergy,Reflectivity, nEntries);
00283
00284
00285 theMaterial->SetMaterialPropertiesTable(theMPT);
00286 }
00287
00288
00289 else if ( ( theMaterial->GetName() == "TOB_Aluminium" ) ||
00290 ( theMaterial->GetName() == "Aluminium" ) )
00291 {
00292
00293 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00294
00295 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00296
00297 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthAl, nEntries);
00298
00299
00300 theMaterial->SetMaterialPropertiesTable(theMPT);
00301 }
00302
00303
00304 else if ( ( theMaterial->GetName() == "TOB_CF_Str" ) )
00305 {
00306
00307 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00308
00309 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00310
00311 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOB_CF_Str, nEntries);
00312
00313
00314 theMaterial->SetMaterialPropertiesTable(theMPT);
00315 }
00316
00317
00318 else if ( ( theMaterial->GetName() == "TID_CF" ) ||
00319 ( theMaterial->GetName() == "Nomex" ) ||
00320 ( theMaterial->GetName() == "TOB_Nomex" ) ||
00321 ( theMaterial->GetName() == "TID_Nomex" ) ||
00322 ( theMaterial->GetName() == "TOB_plate_C" ) ||
00323 ( theMaterial->GetName() == "TOB_rod" ) ||
00324 ( theMaterial->GetName() == "TOB_cool_DS" ) ||
00325 ( theMaterial->GetName() == "TOB_cool_SS" ) ||
00326 ( theMaterial->GetName() == "TID_in_cable" ) ||
00327 ( theMaterial->GetName() == "TOB_PA_rphi" ) ||
00328 ( theMaterial->GetName() == "TOB_frame_ele" ) ||
00329 ( theMaterial->GetName() == "TOB_PA_ster" ) ||
00330 ( theMaterial->GetName() == "TOB_ICB" ) ||
00331 ( theMaterial->GetName() == "TOB_CONN1" ) ||
00332 ( theMaterial->GetName() == "TOB_CONN2" ) ||
00333 ( theMaterial->GetName() == "TOB_CONN3" ) ||
00334 ( theMaterial->GetName() == "TOB_rail" ) ||
00335 ( theMaterial->GetName() == "TOB_sid_rail1" ) ||
00336 ( theMaterial->GetName() == "TOB_sid_rail2" ) )
00337 {
00338
00339 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00340
00341 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00342
00343 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTOBCF, nEntries);
00344
00345
00346 theMaterial->SetMaterialPropertiesTable(theMPT);
00347 }
00348
00349
00350 else if ( ( theMaterial->GetName() == "TIB_CF" ) ||
00351 ( theMaterial->GetName() == "TIB_cables_ax_out" ) ||
00352 ( theMaterial->GetName() == "TIB_outer_supp" ) ||
00353 ( theMaterial->GetName() == "TIB_PA_rphi" ) ||
00354 ( theMaterial->GetName() == "TIB_rail" ) ||
00355 ( theMaterial->GetName() == "TIB_sid_rail1" ) ||
00356 ( theMaterial->GetName() == "TIB_sid_rail2" ) ||
00357 ( theMaterial->GetName() == "TIB_mod_cool" ) )
00358 {
00359
00360 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00361
00362 theMPT->AddProperty("REFLECTIVITY", PhotonEnergy, SiReflectivity, nEntries);
00363
00364 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthTIBCF, nEntries);
00365
00366
00367 theMaterial->SetMaterialPropertiesTable(theMPT);
00368 }
00369
00370
00371 else
00372 {
00373
00374 theMPT->AddProperty("RINDEX", PhotonEnergy, RefractiveIndexGeneral, nEntries);
00375
00376 theMPT->AddProperty("ABSLENGTH", PhotonEnergy, AbsorptionLengthGeneral, nEntries);
00377
00378
00379 theMaterial->SetMaterialPropertiesTable(theMPT);
00380 }
00381
00382 }
00383 }
00384 }
00385
00386
00387 const G4LogicalVolumeStore * theLogicalVolumeStore = G4LogicalVolumeStore::GetInstance();
00388 std::vector<G4LogicalVolume*>::const_iterator theLogicalVolume;
00389
00390 for ( theLogicalVolume = theLogicalVolumeStore->begin(); theLogicalVolume != theLogicalVolumeStore->end(); theLogicalVolume++ )
00391 {
00392 if ( ( (*theLogicalVolume)->GetName() == "TECModule0StereoActive" ) ||
00393 ( (*theLogicalVolume)->GetName() == "TECModule0RphiActive" ) ||
00394 ( (*theLogicalVolume)->GetName() == "TECModule1StereoActive" ) ||
00395 ( (*theLogicalVolume)->GetName() == "TECModule1RphiActive" ) ||
00396 ( (*theLogicalVolume)->GetName() == "TECModule2RphiActive" ) ||
00397 ( (*theLogicalVolume)->GetName() == "TECModule3RphiActive" ) ||
00398 ( (*theLogicalVolume)->GetName() == "TECModule4StereoActive" ) ||
00399 ( (*theLogicalVolume)->GetName() == "TECModule4RphiActive" ) ||
00400 ( (*theLogicalVolume)->GetName() == "TECModule5RphiActive" ) ||
00401 ( (*theLogicalVolume)->GetName() == "TECModule6RphiActive" ) )
00402 {
00403
00404 (*theLogicalVolume)->SetMaterial(theTECWafer);
00405
00406 if (theMPDebugLevel > 2)
00407 {
00408 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
00409 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
00410 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
00411 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
00412 }
00413 }
00414 else if ( ( (*theLogicalVolume)->GetName() == "TOBActiveSter0" ) ||
00415 ( (*theLogicalVolume)->GetName() == "TOBActiveRphi0" ) ||
00416 ( (*theLogicalVolume)->GetName() == "TOBActiveRphi2" ) ||
00417 ( (*theLogicalVolume)->GetName() == "TOBActiveRphi4" ) )
00418 {
00419
00420 (*theLogicalVolume)->SetMaterial(theTOBWafer);
00421
00422 if (theMPDebugLevel > 2)
00423 {
00424 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
00425 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
00426 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
00427 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
00428 }
00429 }
00430 else if ( ( (*theLogicalVolume)->GetName() == "TIBActiveSter0" ) ||
00431 ( (*theLogicalVolume)->GetName() == "TIBActiveRphi0" ) ||
00432 ( (*theLogicalVolume)->GetName() == "TIBActiveRphi2" ) )
00433 {
00434
00435 (*theLogicalVolume)->SetMaterial(theTIBWafer);
00436
00437 if (theMPDebugLevel > 2)
00438 {
00439 std::cout << " AC1CMS: found a logical volume: " << (*theLogicalVolume)->GetName() << std::endl;
00440 std::cout << " AC1CMS: the logical volume material = " << (*theLogicalVolume)->GetMaterial()->GetName() << std::endl;
00441 std::cout << " AC1CMS: the MaterialPropertiesTable = " << std::endl;
00442 (*theLogicalVolume)->GetMaterial()->GetMaterialPropertiesTable()->DumpTable();
00443 }
00444 }
00445 }
00446 }