94 const Int_t lcin_Z = 150;
95 const Int_t lcin_A = 300;
98 Double_t density_unit_to_SI = density_unit /
units::kg_m3;
99 Double_t length_unit_to_SI = length_unit /
units::m;
100 Double_t volume_unit_to_SI = TMath::Power(length_unit_to_SI, 3.);
102 cout <<
"Input density unit --> kg/m^3 : x" << density_unit_to_SI << endl;
103 cout <<
"Input length unit --> m : x" << length_unit_to_SI << endl;
107 TList *
matlist = gGeoManager->GetListOfMaterials();
109 cout <<
"Null list of materials!" << endl;
118 Int_t nmat = matlist->GetEntries();
119 for( Int_t imat = 0; imat < nmat; imat++ )
121 Int_t idx = gGeoManager->GetMaterial(imat)->GetIndex();
122 max_idx = TMath::Max(max_idx, idx);
126 Int_t * checkindex =
new Int_t[max_idx+1];
127 for( Int_t
i = 0;
i<max_idx+1;
i++ ) checkindex[
i] = 0;
128 for( Int_t imat = 0; imat < nmat; imat++ )
130 if( !checkindex[imat] ) checkindex[imat] = 1;
133 cout <<
"material index is not unique" << endl;
139 cout <<
"max_idx = " << max_idx << endl;
140 cout <<
"nmat = " << nmat << endl;
143 TGeoVolume * topvol = gGeoManager->GetTopVolume();
145 cout <<
"volume does not exist" << endl;
149 TGeoIterator NodeIter(topvol);
153 Double_t *
volume =
new Double_t[max_idx+1];
154 Double_t * mass =
new Double_t[max_idx+1];
156 for( Int_t
i = 0;
i<max_idx+1;
i++ ){ volume[
i]=0.; mass[
i]=0.; }
158 volume[ topvol->GetMaterial()->GetIndex() ] = topvol->Capacity() * volume_unit_to_SI;
160 while ( (node=NodeIter()) )
162 Int_t momidx = node->GetMotherVolume()->GetMaterial()->GetIndex() ;
163 Int_t idx = node->GetVolume() ->GetMaterial()->GetIndex() ;
165 Double_t node_vol = node->GetVolume()->Capacity() * volume_unit_to_SI;
167 volume[ momidx ] -= node_vol;
168 volume[ idx ] += node_vol;
172 Double_t larr_MassIsotopes[lcin_Z][lcin_A] = {0.};
173 Double_t larr_VolumeIsotopes[lcin_Z][lcin_A] = {0.};
175 for( Int_t
i=0;
i<gGeoManager->GetListOfMaterials()->GetEntries();
i++ )
177 TGeoMaterial *lgeo_Mat = gGeoManager->GetMaterial(
i);
178 Int_t idx = gGeoManager->GetMaterial(
i)->GetIndex();
180 if( lgeo_Mat->IsMixture() )
182 TGeoMixture * lgeo_Mix = dynamic_cast <TGeoMixture*> ( lgeo_Mat );
183 Int_t lint_Nelements = lgeo_Mix->GetNelements();
185 for ( Int_t j=0; j<lint_Nelements; j++)
187 Int_t lint_Z = TMath::Nint( (Double_t) lgeo_Mix->GetZmixt()[j] );
188 Int_t lint_A = TMath::Nint( (Double_t) lgeo_Mix->GetAmixt()[j] );
189 Double_t ldou_Fraction = lgeo_Mix->GetWmixt()[j];
190 Double_t ldou_Density = lgeo_Mix->GetDensity() * density_unit_to_SI;
192 larr_MassIsotopes[ lint_Z ][ lint_A ] += volume[idx] * ldou_Fraction * ldou_Density;
193 larr_VolumeIsotopes[ lint_Z ][ lint_A ] += volume[idx] * ldou_Fraction;
202 Double_t ldou_MinimumVolume = 1
e-20;
205 <<
" Geometry: \"" <<
gFileName <<
"\"" << endl
206 <<
" TopVolume: \"" << topvol->GetName() <<
"\"" 209 cout <<endl <<
"materials:" << endl;
210 cout << setw(5) <<
"index" 211 << setw(15) <<
"name" 213 << setw(14) <<
"volume (m^3)" 214 << setw(14) <<
"mass (kg)" 215 << setw(14) <<
"mass (%)" 218 double total_mass_materials = 0;
219 for( Int_t
i=0;
i<gGeoManager->GetListOfMaterials()->GetEntries();
i++ )
221 Int_t idx = gGeoManager->GetMaterial(
i)->GetIndex();
222 Double_t
density = gGeoManager->GetMaterial(
i)->GetDensity() * density_unit_to_SI;
223 Double_t mass_material = density * volume[idx];
224 if ( volume[idx] > ldou_MinimumVolume ) {
225 total_mass_materials += mass_material;
230 for( Int_t
i=0;
i<gGeoManager->GetListOfMaterials()->GetEntries();
i++ )
232 Int_t idx = gGeoManager->GetMaterial(
i)->GetIndex();
233 Double_t density = gGeoManager->GetMaterial(
i)->GetDensity() * density_unit_to_SI;
235 mass[idx] = density * volume[idx];
237 if( volume[idx] > ldou_MinimumVolume ) {
239 << setw(15) << gGeoManager->GetMaterial(
i)->GetName()
241 << setw(14) << volume[idx]
242 << setw(14) << mass[idx]
243 << setw(14) << mass[idx]*100./total_mass_materials
254 cout <<endl <<
"isotopes:" << endl;
255 cout << setw(4) <<
"Z" 257 << setw(14) <<
"PDG isotope" 260 << setw(14) <<
"volume (m^3)" 261 << setw(14) <<
"mass (kg)" 262 << setw(14) <<
"mass (%)" 265 double total_mass_isotopes = 0;
266 for( Int_t
i=0;
i<lcin_Z;
i++ ) {
267 for( Int_t j=0; j<lcin_A; j++ ) {
268 if( larr_VolumeIsotopes[
i ][ j ] > ldou_MinimumVolume ) {
269 total_mass_isotopes += larr_MassIsotopes[
i ][ j ];
274 for( Int_t
i=0;
i<lcin_Z;
i++ )
276 for( Int_t j=0; j<lcin_A; j++ )
278 if( larr_VolumeIsotopes[
i ][ j ] > ldou_MinimumVolume ) {
279 int pdgcode = 1000000000 +
i*10000 + j*10;
282 << setw(14) << pdgcode
283 << setw(6) << pdglib->
Find(pdgcode)->GetName()
285 << setw(14) << larr_VolumeIsotopes[
i ][ j ]
286 << setw(14) << larr_MassIsotopes[
i ][ j ]
287 << setw(14) << larr_MassIsotopes[
i ][ j ]*100.0/total_mass_isotopes
290 else if ( larr_VolumeIsotopes[
i ][ j ] < -ldou_MinimumVolume ) {
291 cout <<
"negative volume, check geometry " << larr_VolumeIsotopes[
i ][ j ] << endl;
296 cout << endl <<
" mass totals: " << total_mass_materials <<
" " << total_mass_isotopes
the ParameterSet object passed in for the configuration of a destination should be the only source that can affect the behavior of that destination This is to eliminate the dependencies of configuring a destination from multiple mostly from the defaults It suppresses possible glitches about changing the configuration file somewhere outside of a destination segament might still affect the behavior of that destination In the previous configuration for a specific the value of a certain e may come from following and have been suppressed It the configuring ParameterSet object for each destination will be required to carry a parameter list as complete as possible If a parameter still cannot be found in the ParameterSet the configuration code will go look for a hardwired default directly The model is a great simplicity comparing with the previous especially when looking for default values Another great advantage is most of the parameters now have very limited places that allows to appear Usually they can only appear at one certain level in a configuration file For in the old configuring model or in a default ParameterSet object inside of a or in a category or in a severity object This layout of multiple sources for a single parameter brings great confusion in both writing a configuration and in processing the configuration file Under the new the only allowed place for the parameter limit to appear is inside of a category which is inside of a destination object Other improvements simplify the meaning of a destination name In the old a destination name has multiple folds of meanings the e cout and cerr have the special meaning of logging messages to standard output or standard error the name also serves as the output filename if the destination is a file these names are also references to look up for detailed configurations in configuring the MessageFacility The multi purpose of the destination name might cause some unwanted behavior in either writing or parsing the configuration file To amend in the new model the destination name is now merely a name for a which might represent the literal purpose of this or just an id All other meanings of the destinations names now go into the destination ParameterSet as individual such as the type parameter and filename parameter Following is the deatiled rule for the new configuring Everything that is related with MessageFacility configuration must be wrapped in a single ParameterSet object with the name MessageFacility The MessageFacility ParameterSet object contains a series of top level parameters These parameters can be chosen a vector of string listing the name of debug enabled models Or use *to enable debug messages in all modules a vector of string a vector of string a vector of string a ParameterSet object containing the list of all destinations The destinations ParameterSet object is a combination of ParameterSet objects for individual destinations There are two types of destinations that you can insert in the destinations ParameterSet ordinary including cout
static const char * volume[nvol]
static const double kg_m3
Singleton class to load & serve a TDatabasePDG.
TParticlePDG * Find(int pdgc)
static const char * matlist[nspecialmat]