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,M_NEMA_FR4_plate,Silicon,StainlessSteel,WCu, oth;
92 Air=Cables=Copper=H_Scintillator=Lead=M_NEMA_FR4_plate=Silicon=StainlessSteel=WCu=0.;
95 while(theMaterialFile) {
96 theMaterialFile >> materialName;
97 theMaterialFile >> Air >> Cables >> Copper >> H_Scintillator >> Lead >> M_NEMA_FR4_plate >> Silicon >> StainlessSteel >> WCu;
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(M_NEMA_FR4_plate);
111 theMap[materialName].push_back(Silicon );
112 theMap[materialName].push_back(StainlessSteel );
113 theMap[materialName].push_back(WCu );
114 theMap[materialName].push_back(oth );
116 <<
"MaterialBudgetCategorizer: material " << materialName <<
" filled " 118 <<
"\tAir " << Air << std::endl
119 <<
"\tCables " << Cables << std::endl
120 <<
"\tCopper " << Copper << std::endl
121 <<
"\tH_Scintillator " << H_Scintillator << std::endl
122 <<
"\tLead " << Lead << std::endl
123 <<
"\tM_NEMA_FR4_plate " << M_NEMA_FR4_plate << std::endl
124 <<
"\tSilicon " << Silicon << std::endl
125 <<
"\tStainlessSteel " << StainlessSteel << std::endl
126 <<
"\tWCu " << WCu << 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)