From: ivana Date: Thu, 7 Mar 2002 10:33:28 +0000 (+0000) Subject: method PrintLogicalVolumeStore() added; added formatting in PrintStatistics() X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=fd81f1f59da7c650582063c32d48bbdf9f16d84f;p=u%2Fmrichter%2FAliRoot.git method PrintLogicalVolumeStore() added; added formatting in PrintStatistics() --- diff --git a/TGeant4/TG4GeometryServices.cxx b/TGeant4/TG4GeometryServices.cxx index 57bc5bcfb5d..62fc485ffdc 100644 --- a/TGeant4/TG4GeometryServices.cxx +++ b/TGeant4/TG4GeometryServices.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -357,21 +358,58 @@ void TG4GeometryServices::PrintStatistics(G4bool open, G4bool close) const if (open) TG4Globals::PrintStars(true); G4cout << " GEANT4 Geometry statistics: " << G4endl - << " " << NofG4LogicalVolumes() + << " " << G4std::setw(5) << NofG4LogicalVolumes() << " logical volumes" << G4endl << " " - << NofG4PhysicalVolumes() + << G4std::setw(5) << NofG4PhysicalVolumes() << " physical volumes" << G4endl << " " - << G4Material::GetNumberOfMaterials() + << G4std::setw(5) << G4Material::GetNumberOfMaterials() << " materials" << G4endl << " " - << TG4Limits::GetNofLimits() + << G4std::setw(5) << TG4Limits::GetNofLimits() << " user limits" << G4endl; if (close) TG4Globals::PrintStars(false); } +//_____________________________________________________________________________ +void +TG4GeometryServices::PrintLogicalVolumeStore() const +{ +// Prints all logical volumes and their daughters. +// --- + + G4LogicalVolumeStore* lvStore = G4LogicalVolumeStore::GetInstance(); + + G4cout << "Logical volume store: " << G4endl; + + for (G4int i=0; isize(); i++) { + + G4LogicalVolume* lv = (*lvStore)[i]; + + G4cout << "Logical volume: " << G4endl; + G4cout << " " << G4std::setw(5) << i + << " " << lv + << " " << lv->GetName() + << " " << G4std::setw(5) << lv->GetNoDaughters() << " daughters" + << " limits: " << lv->GetUserLimits() + << G4endl; + + for (G4int j=0; jGetNoDaughters(); j++) { + G4cout << " Daughter: " + << G4std::setw(5) << j + << " " << lv->GetDaughter(j) + << " " << lv->GetDaughter(j)->GetName() + << " of LV: " << lv->GetDaughter(j)->GetLogicalVolume() + << " " << lv->GetDaughter(j)->GetLogicalVolume()->GetName() + << " copy no: " << lv->GetDaughter(j)->GetCopyNo() + << G4endl; + + } + } +} + //_____________________________________________________________________________ Int_t TG4GeometryServices::NofG3Volumes() const { @@ -485,7 +523,6 @@ TG4GeometryServices::FindLogicalVolume(const G4String& name, G4bool silent) cons return 0; } - //_____________________________________________________________________________ TG4Limits* TG4GeometryServices::FindLimits(const G4String& name, G4bool silent) const