3 #include "G4LogicalVolumeStore.hh" 4 #include "G4Material.hh" 5 #include "G4UnitsTable.hh" 6 #include "G4EmCalculator.hh" 7 #include "G4UnitsTable.hh" 17 G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
18 G4LogicalVolumeStore::iterator ite;
20 for (ite = lvs->begin(); ite != lvs->end(); ite++) {
24 if (
mode.compare(
"Tracker") == 0) {
29 }
else if (
mode.compare(
"Mtd") == 0) {
34 }
else if (
mode.compare(
"HGCal") == 0) {
44 std::ifstream theMaterialFile(theMaterialFileName);
47 cms::Exception(
"LogicError") <<
" File not found " << theMaterialFileName;
49 float sup, sen, cab,
col, ele, oth, air;
50 sup = sen = cab =
col = ele = 0.;
54 while (theMaterialFile) {
55 theMaterialFile >> materialName;
56 theMaterialFile >> sup >> sen >> cab >>
col >> ele;
58 if (materialName[0] ==
'#')
63 theMap[materialName].clear();
64 theMap[materialName].push_back(sup);
65 theMap[materialName].push_back(sen);
66 theMap[materialName].push_back(cab);
67 theMap[materialName].push_back(
col);
68 theMap[materialName].push_back(ele);
69 theMap[materialName].push_back(oth);
70 theMap[materialName].push_back(air);
71 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetCategorizer: Material " << materialName <<
" filled: " 72 <<
"\n\tSUP " << sup <<
"\n\tSEN " << sen <<
"\n\tCAB " << cab <<
"\n\tCOL " <<
col 73 <<
"\n\tELE " << ele <<
"\n\tOTH " << oth <<
"\n\tAIR " << air
74 <<
"\n\tAdd up to: " << sup + sen + cab +
col + ele + oth + air;
80 std::ifstream theMaterialFile(theMaterialFileName);
82 cms::Exception(
"LogicError") <<
" File not found " << theMaterialFileName;
85 float air, cables, copper, h_scintillator, lead, hgc_g10_fr4, silicon, stainlesssteel, wcu, oth, epoxy, kapton,
86 aluminium, polystyrene, hgc_eeconnector, hgc_heconnector;
87 air = cables = copper = h_scintillator = lead = hgc_g10_fr4 = silicon = stainlesssteel = wcu = epoxy = kapton =
88 aluminium = polystyrene = hgc_eeconnector = hgc_heconnector = 0.;
91 while (theMaterialFile) {
92 theMaterialFile >> materialName;
93 theMaterialFile >> air >> cables >> copper >> h_scintillator >> lead >> hgc_g10_fr4 >> silicon >> stainlesssteel >>
94 wcu >> epoxy >> kapton >> aluminium >> polystyrene >> hgc_eeconnector >> hgc_heconnector;
96 if (materialName[0] ==
'#')
99 std::replace(materialName.begin(), materialName.end(),
'*',
' ');
101 theMap[materialName].clear();
102 theMap[materialName].push_back(air);
103 theMap[materialName].push_back(cables);
104 theMap[materialName].push_back(copper);
105 theMap[materialName].push_back(h_scintillator);
106 theMap[materialName].push_back(lead);
107 theMap[materialName].push_back(hgc_g10_fr4);
108 theMap[materialName].push_back(silicon);
109 theMap[materialName].push_back(stainlesssteel);
110 theMap[materialName].push_back(wcu);
111 theMap[materialName].push_back(oth);
112 theMap[materialName].push_back(epoxy);
113 theMap[materialName].push_back(kapton);
114 theMap[materialName].push_back(aluminium);
115 theMap[materialName].push_back(polystyrene);
116 theMap[materialName].push_back(hgc_eeconnector);
117 theMap[materialName].push_back(hgc_heconnector);
118 edm::LogInfo(
"MaterialBudget") <<
"MaterialBudgetCategorizer: material " << materialName <<
" filled " << std::endl
119 <<
"\tair " << air << std::endl
120 <<
"\tcables " << cables << std::endl
121 <<
"\tcopper " << copper << std::endl
122 <<
"\th_scintillator " << h_scintillator << std::endl
123 <<
"\tlead " << lead << std::endl
124 <<
"\thgc_g10_fr4 " << hgc_g10_fr4 << std::endl
125 <<
"\tsilicon " << silicon << std::endl
126 <<
"\tstainlesssteel " << stainlesssteel << std::endl
127 <<
"\twcu " << wcu << std::endl
128 <<
"\tepoxy " << epoxy << std::endl
129 <<
"\tkapton " << kapton << std::endl
130 <<
"\taluminium " << aluminium << std::endl
131 <<
"\tpolystyrene " << polystyrene << std::endl
132 <<
"\thgc_eeconnector " << hgc_eeconnector << std::endl
133 <<
"\thgc_heconnector " << hgc_heconnector << std::endl
std::map< std::string, std::vector< float > > theHGCalX0Map
std::string fullPath() const
def replace(string, replacements)
void buildCategoryMap(std::string theMaterialFileName, std::map< std::string, std::vector< float > > &theMap)
std::map< std::string, int > theVolumeMap
std::map< std::string, std::vector< float > > theHGCalL0Map
Log< level::Info, false > LogInfo
std::map< std::string, std::vector< float > > theX0Map
std::map< std::string, std::vector< float > > theL0Map
MaterialBudgetCategorizer(std::string mode)
void buildHGCalCategoryMap(std::string theMaterialFileName, std::map< std::string, std::vector< float > > &theMap)