3 #include "G4LogicalVolumeStore.hh" 4 #include "G4Material.hh" 5 #include "G4UnitsTable.hh" 6 #include "G4EmCalculator.hh" 7 #include "G4UnitsTable.hh" 18 G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
19 G4LogicalVolumeStore::iterator ite;
21 for (ite = lvs->begin(); ite != lvs->end(); ite++) {
25 if ( mode.compare(
"Tracker") == 0 ) {
30 }
else if ( mode.compare(
"HGCal") == 0 ){
42 std::ifstream theMaterialFile(theMaterialFileName);
45 cms::Exception(
"LogicError") <<
" File not found " << theMaterialFileName;
47 float sup,sen,cab,
col,ele,oth,air;
48 sup=sen=cab=col=ele=0.;
52 while(theMaterialFile) {
53 theMaterialFile >> materialName;
54 theMaterialFile >> sup >> sen >> cab >> col >> ele;
56 if (materialName[0] ==
'#')
61 theMap[materialName].clear();
62 theMap[materialName].push_back(sup);
63 theMap[materialName].push_back(sen);
64 theMap[materialName].push_back(cab);
65 theMap[materialName].push_back(col);
66 theMap[materialName].push_back(ele);
67 theMap[materialName].push_back(oth);
68 theMap[materialName].push_back(air);
70 <<
"MaterialBudgetCategorizer: Material " << materialName <<
" filled: " 78 <<
"\n\tAdd up to: " << sup + sen + cab + col + ele + oth + air;
86 std::ifstream theMaterialFile(theMaterialFileName);
88 cms::Exception(
"LogicError") <<
" File not found " << theMaterialFileName;
91 float air,cables,copper,h_scintillator,lead,hgc_g10_fr4,silicon,stainlesssteel,wcu,oth,epoxy,kapton,aluminium;
92 air=cables=copper=h_scintillator=lead=hgc_g10_fr4=silicon=stainlesssteel=wcu=epoxy=kapton=aluminium=0.;
95 while(theMaterialFile) {
96 theMaterialFile >> materialName;
97 theMaterialFile >> air >> cables >> copper >> h_scintillator >> lead >> hgc_g10_fr4 >> silicon >> stainlesssteel >> wcu >> epoxy >> kapton >> aluminium;
99 if (materialName[0] ==
'#')
102 std::replace(materialName.begin(), materialName.end(),
'*',
' ');
104 theMap[materialName].clear();
105 theMap[materialName].push_back(air );
106 theMap[materialName].push_back(cables );
107 theMap[materialName].push_back(copper );
108 theMap[materialName].push_back(h_scintillator );
109 theMap[materialName].push_back(lead );
110 theMap[materialName].push_back(hgc_g10_fr4);
111 theMap[materialName].push_back(silicon );
112 theMap[materialName].push_back(stainlesssteel );
113 theMap[materialName].push_back(wcu );
114 theMap[materialName].push_back(oth );
115 theMap[materialName].push_back(epoxy );
116 theMap[materialName].push_back(kapton );
117 theMap[materialName].push_back(aluminium );
119 <<
"MaterialBudgetCategorizer: material " << materialName <<
" filled " 121 <<
"\tair " << air << std::endl
122 <<
"\tcables " << cables << std::endl
123 <<
"\tcopper " << copper << std::endl
124 <<
"\th_scintillator " << h_scintillator << std::endl
125 <<
"\tlead " << lead << std::endl
126 <<
"\thgc_g10_fr4 " << hgc_g10_fr4 << std::endl
127 <<
"\tsilicon " << silicon << std::endl
128 <<
"\tstainlesssteel " << stainlesssteel << std::endl
129 <<
"\twcu " << wcu << std::endl
130 <<
"\tepoxy " << epoxy << std::endl
131 <<
"\tkapton " << kapton<< std::endl
132 <<
"\taluminium " << aluminium<< std::endl
std::map< std::string, int > theVolumeMap
def replace(string, replacements)
std::map< std::string, std::vector< float > > theX0Map
std::map< std::string, std::vector< float > > theHGCalL0Map
void buildCategoryMap(std::string theMaterialFileName, std::map< std::string, std::vector< float > > &theMap)
std::map< std::string, std::vector< float > > theL0Map
std::map< std::string, std::vector< float > > theHGCalX0Map
std::string fullPath() const
MaterialBudgetCategorizer(std::string mode)
void buildHGCalCategoryMap(std::string theMaterialFileName, std::map< std::string, std::vector< float > > &theMap)