18 #include "G4PhysicalVolumeStore.hh" 19 #include "G4LogicalVolumeStore.hh" 20 #include "G4VPhysicalVolume.hh" 21 #include "G4LogicalVolume.hh" 22 #include "G4VSolid.hh" 23 #include "G4Material.hh" 25 #include "G4VisAttributes.hh" 26 #include "G4UserLimits.hh" 27 #include "G4TransportationManager.hh" 33 std::vector<std::string> defNames;
35 G4cout <<
"PrintGeomSummary:: initialised for " <<
nodeNames_.size() <<
" nodes:" << G4endl;
65 (*job)()->get<IdealGeometryRecord>().get(pDD);
68 const auto& gra = cpv->
graph();
75 for (
adjl_iterator git = gra.begin(); git != gra.end(); ++git) {
81 for (Graph::edge_list::const_iterator cit = git->begin(); cit != git->end(); ++cit) {
87 G4cout <<
"Finds " <<
solidMap_.size() <<
" different solids in the tree" << G4endl;
92 std::map<DDSolidShape, std::string>::iterator it =
solidShape_.find(solid.
shape());
112 const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
113 std::vector<G4LogicalVolume*>::const_iterator lvcite;
114 for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) {
115 if ((*lvcite)->GetName() == (G4String)(
nodeNames_[
k])) {
130 G4VSolid* sl = lv->GetSolid();
134 for (
int ii = 0;
ii < (
int)(lv->GetNoDaughters());
ii++)
135 fillLV(lv->GetDaughter(
ii)->GetLogicalVolume());
140 out << G4endl << G4endl <<
"@@@@@@@@@@@@@@@@@@ Dumping Summary For Node " << name << G4endl;
141 out <<
" Number of G4VSolid's: " <<
sls_.size() << G4endl;
142 out <<
" Number of G4LogicalVolume's: " <<
lvs_.size() << G4endl;
143 out <<
" Number of Touchable's: " <<
touch_.size() << G4endl;
145 out << G4endl <<
"Occurence of each type of shape among Solids" << G4endl;
147 for (std::vector<G4VSolid*>::iterator it =
sls_.begin(); it !=
sls_.end(); ++it) {
153 out << G4endl <<
"Occurence of each type of shape among Logical Volumes" << G4endl;
155 for (std::vector<G4LogicalVolume*>::iterator it =
lvs_.begin(); it !=
lvs_.end(); ++it) {
161 out << G4endl <<
"Occurence of each type of shape among Touchables" << G4endl;
163 for (std::vector<G4LogicalVolume*>::iterator it =
touch_.begin(); it !=
touch_.end(); ++it) {
171 return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
176 if (name.find(
"_refl") < name.size()) {
178 name = name.substr(0, (name.find(
"_refl")));
180 std::map<std::string, DDSolidShape>::const_iterator jt =
solidMap_.find(name);
183 if (itr ==
kount_.end()) {
184 kount_[shape] = (
refl) ? std::pair<int, int>(0, 1) : std::pair<int, int>(1, 0);
186 kount_[shape] = (
refl) ? std::pair<int, int>(((itr->second).first), ++((itr->second).second))
187 : std::pair<int, int>(++((itr->second).
first), ((itr->second).
second));
195 out <<
"Shape [" << k <<
"] " << shape <<
" # " << (itr->second).
first <<
" : " << (itr->second).second << G4endl;
std::vector< G4VSolid * > sls_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double >::size_type index_type
void addName(std::string name)
void addSolid(const DDLogicalPart &part)
void printSummary(std::ostream &out)
std::map< DDSolidShape, std::string > solidShape_
G4VPhysicalVolume * getTopPV()
G4VPhysicalVolume * theTopPV_
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Compact representation of the geometrical detector hierarchy.
A DDSolid represents the shape of a part.
U second(std::pair< T, U > const &p)
~PrintGeomSummary() override
PrintGeomSummary(edm::ParameterSet const &p)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
DDSolidShape shape(void) const
The type of the solid.
Graph::const_adj_iterator adjl_iterator
std::vector< std::string > nodeNames_
void fillLV(G4LogicalVolume *lv)
const Graph & graph() const
Provides read-only access to the data structure of the compact-view.
void update(const BeginOfJob *job) override
This routine will be called when the appropriate signal arrives.
void dumpSummary(std::ostream &out, std::string name)
std::vector< G4LogicalVolume * > lvs_
math::Graph< DDLogicalPart, DDPosData * > Graph
adj_list::const_iterator const_adj_iterator
std::vector< G4LogicalVolume * > touch_
std::map< std::string, DDSolidShape > solidMap_
const std::string & name() const
Returns the name.
std::map< DDSolidShape, std::pair< int, int > > kount_