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"
47 nchar = name.find(
"*");
48 name.assign(name,0,nchar);
50 std::cout <<
"PrintGeomInfoAction:: initialised with verbosity levels:"
51 <<
" Summary " <<
_dumpSummary <<
" LVTree " << _dumpLVTree
52 <<
" LVList " << _dumpLVList <<
" Material " << _dumpMaterial
54 <<
" LV " << _dumpLV <<
" Solid " << _dumpSolid
55 <<
" Attribs " << _dumpAtts
57 <<
" PV " << _dumpPV <<
" Rotation " << _dumpRotation
58 <<
" Replica " << _dumpReplica
60 <<
" Touchable " << _dumpTouch <<
" for names (0-" << nchar
63 <<
" Sensitive " << _dumpSense <<
" for " <<
names.size()
75 (*job)()->get<IdealGeometryRecord>().get(pDD);
77 std::cout <<
"PrintGeomInfoAction::Get Printout of Sensitive Volumes "
78 <<
"for " <<
names.size() <<
" Readout Units" << std::endl;
79 for (
unsigned int i=0;
i<
names.size();
i++) {
86 std::cout <<
"PrintGeomInfoAction:: Get Filtered view for "
87 << attribute <<
" = " << sd << std::endl;
99 unsigned int leafDepth = copy.size();
100 std::cout << leafDepth << spaces <<
"### VOLUME = " << lvname
102 for (
int k=leafDepth-1;
k>=0;
k--)
std::cout <<
" " << copy[
k];
103 std::cout <<
" Centre at " << tran <<
" (r = " << tran.Rho()
104 <<
", phi = " << tran.phi()/deg <<
")" << std::endl;
129 out <<
" @@@@@@@@@@@@@@@@@@ Dumping G4 geometry objects Summary " << std::endl;
131 out <<
" No volume created " << std::endl;
134 out <<
" @@@ Geometry built inside world volume: " <<
theTopPV->GetName() << std::endl;
136 const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
137 std::vector<G4LogicalVolume *>::const_iterator lvcite;
138 std::set<G4VSolid *> theSolids;
139 for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
140 theSolids.insert((*lvcite)->GetSolid());
141 out <<
" Number of G4VSolid's: " << theSolids.size() << std::endl;
142 out <<
" Number of G4LogicalVolume's: " << lvs->size() << std::endl;
143 const G4PhysicalVolumeStore * pvs = G4PhysicalVolumeStore::GetInstance();
144 out <<
" Number of G4VPhysicalVolume's: " << pvs->size() << std::endl;
146 const G4MaterialTable * matTab = G4Material::GetMaterialTable();
147 out <<
" Number of G4Material's: " << matTab->size() << std::endl;
152 out <<
" @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's List " << std::endl;
153 const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
154 std::vector<G4LogicalVolume*>::const_iterator lvcite;
155 for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
156 out <<
"LV:" << (*lvcite)->GetName() <<
"\tMaterial: " << (*lvcite)->GetMaterial()->GetName() << std::endl;
161 out <<
" @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's Tree " << std::endl;
168 out <<
" @@@@@@@@@@@@@@@@ DUMPING G4Material List ";
169 const G4MaterialTable * matTab = G4Material::GetMaterialTable();
170 out <<
" with " << matTab->size() <<
" materials " << std::endl;
171 std::vector<G4Material*>::const_iterator matite;
172 for (matite = matTab->begin(); matite != matTab->end(); matite++)
173 out <<
"Material: " << (*matite) << std::endl;
178 for (
unsigned int ii=0;
ii < leafDepth;
ii++) out <<
" ";
179 out <<
" LV:(" << leafDepth <<
") " << lv->GetName() <<
" (" << count
182 std::map<G4LogicalVolume*, unsigned int> lvCount;
183 std::map<G4LogicalVolume*, unsigned int>::const_iterator cite;
184 for (
int ii = 0;
ii < lv->GetNoDaughters();
ii++) {
185 cite = lvCount.find(lv->GetDaughter(
ii)->GetLogicalVolume());
186 if (cite != lvCount.end()) lvCount[cite->first] = (cite->second) + 1;
187 else lvCount.insert(std::pair< G4LogicalVolume*,unsigned int>(lv->GetDaughter(
ii)->GetLogicalVolume(),1));
189 for (cite = lvCount.begin(); cite != lvCount.end(); cite++)
190 dumpG4LVLeaf((cite->first), leafDepth+1, (cite->second), out);
203 int siz = lv->GetNoDaughters();
204 for(
int ii = 0;
ii < siz;
ii++)
216 G4LogicalVolume* topLV =
getTopLV();
229 dumpLV(lv, leafDepth, out);
233 std::set< G4LogicalVolume * > lvDaughters;
234 int NoDaughters = lv->GetNoDaughters();
235 while ((NoDaughters--)>0) {
236 G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
238 lvDaughters.insert(pvD->GetLogicalVolume());
241 std::set< G4LogicalVolume * >::const_iterator scite;
242 mmlvpv::const_iterator mmcite;
245 for (scite = lvDaughters.begin(); scite != lvDaughters.end(); scite++) {
246 std::pair< mmlvpv::iterator, mmlvpv::iterator > mmER = lvpvDaughters.equal_range(*scite);
248 for (mmcite = mmER.first ; mmcite != mmER.second; mmcite++)
249 dumpPV((*mmcite).second, leafDepth+1, out);
261 out << leafDepth << spaces <<
"$$$ VOLUME = " << lv->GetName()
262 <<
" Solid: " << lv->GetSolid()->GetName() <<
" MATERIAL: "
263 << lv->GetMaterial()->GetName() << std::endl;
271 const G4VisAttributes * fVA = lv->GetVisAttributes();
273 out << spaces <<
" VISUALISATION ATTRIBUTES: " << std::endl;
274 out << spaces <<
" IsVisible " << fVA->IsVisible() << std::endl;
275 out << spaces <<
" IsDaughtersInvisible " << fVA->IsDaughtersInvisible() << std::endl;
276 out << spaces <<
" Colour " << fVA->GetColour() << std::endl;
277 out << spaces <<
" LineStyle " << fVA->GetLineStyle() << std::endl;
278 out << spaces <<
" LineWidth " << fVA->GetLineWidth() << std::endl;
279 out << spaces <<
" IsForceDrawingStyle " << fVA->IsForceDrawingStyle() << std::endl;
280 out << spaces <<
" ForcedDrawingStyle " << fVA->GetForcedDrawingStyle() << std::endl;
284 G4UserLimits * fUL = lv->GetUserLimits();
287 out << spaces <<
" MaxAllowedStep " << fUL->GetMaxAllowedStep(dummy) << std::endl;
288 out << spaces <<
" UserMaxTrackLength " << fUL->GetUserMaxTrackLength(dummy) << std::endl;
289 out << spaces <<
" UserMaxTime " << fUL->GetUserMaxTime(dummy) << std::endl;
290 out << spaces <<
" UserMinEkine " << fUL->GetUserMinEkine(dummy) << std::endl;
291 out << spaces <<
" UserMinRange " << fUL->GetUserMinRange(dummy) << std::endl;
295 if (lv->GetSensitiveDetector())
296 out << spaces <<
" IS SENSITIVE DETECTOR " << std::endl;
297 if (lv->GetFieldManager())
298 out << spaces <<
" FIELD ON " << std::endl;
302 <<
" Quality for optimisation, average number of voxels to be spent per content "
303 << lv->GetSmartless() << std::endl;
306 if (lv->GetFastSimulationManager())
307 out << spaces <<
" Logical Volume is an envelope for a FastSimulationManager "
309 out << spaces <<
" Weight used in the event biasing technique = "
310 << lv->GetBiasWeight() << std::endl;
322 if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
323 out << leafDepth << spaces <<
"### VOLUME = " << pv->GetName()
324 <<
" Copy No " << pv->GetCopyNo() <<
" in " << mother
325 <<
" at " << pv->GetTranslation();
327 if (!pv->IsReplicated()) {
329 if(pv->GetRotation() == 0) out <<
" with no rotation" << std::endl;
330 else if(!
_dumpRotation) out <<
" with rotation" << std::endl;
331 else out <<
" with rotation " << *(pv->GetRotation()) << std::endl;
335 out << spaces <<
" It is replica: " << std::endl;
341 pv->GetReplicationData(axis, nReplicas, width, offset, consuming);
342 out << spaces <<
" axis " << axis << std::endl
343 << spaces <<
" nReplicas " << nReplicas << std::endl;
344 if (pv->GetParameterisation() != 0)
345 out << spaces <<
" It is parameterisation " << std::endl;
347 out << spaces <<
" width " << width << std::endl
348 << spaces <<
" offset " << offset << std::endl
349 << spaces <<
" consuming" << consuming << std::endl;
350 if (pv->GetParameterisation() != 0)
351 out << spaces <<
" It is parameterisation " << std::endl;
359 if (leafDepth == 0)
fHistory.SetFirstEntry(pv);
360 else fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
362 G4ThreeVector globalpoint =
fHistory.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0,0,0));
363 G4LogicalVolume * lv = pv->GetLogicalVolume();
366 if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
368 lvname.assign(lvname,0,
nchar);
370 out << leafDepth << spaces <<
"### VOLUME = " << lv->GetName()
371 <<
" Copy No " << pv->GetCopyNo() <<
" in " << mother
372 <<
" global position of centre " << globalpoint <<
" (r = "
373 << globalpoint.perp() <<
", phi = " << globalpoint.phi()/deg
376 int NoDaughters = lv->GetNoDaughters();
377 while ((NoDaughters--)>0) {
378 G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
379 if (!pvD->IsReplicated())
dumpTouch(pvD, leafDepth+1, out);
382 if (leafDepth > 0)
fHistory.BackLevel();
389 for(ii = 0; ii < leafDepth; ii++) { spaces +=
" "; }
396 out << spaces << *(sol) << std::endl;
401 return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
405 return theTopPV->GetLogicalVolume();
void add1touchable(G4LogicalVolume *lv, int &nTouch)
T getUntrackedParameter(std::string const &, T const &) const
void dumpMaterialList(std::ostream &out=std::cout)
void dumpSummary(std::ostream &out=std::cout)
PrintGeomInfoAction(edm::ParameterSet const &p)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
void addFilter(const DDFilter &, log_op op=AND)
void dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
std::multimap< G4LogicalVolume *, G4VPhysicalVolume *, std::less< G4LogicalVolume * > > mmlvpv
nav_type copyNumbers() const
return the stack of copy numbers
G4VPhysicalVolume * theTopPV
void dumpHierarchyTreePVLV(std::ostream &out=std::cout)
std::vector< std::string > names
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
void update(const BeginOfJob *job)
This routine will be called when the appropriate signal arrives.
void dumpG4LVTree(std::ostream &out=std::cout)
bool next()
set current node to the next node in the filtered tree
void dumpSolid(G4VSolid *sol, unsigned int leafDepth, std::ostream &out=std::cout)
void dumpLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
G4NavigationHistory fHistory
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::string spacesFromLeafDepth(unsigned int leafDepth)
unsigned int offset(bool)
Container::value_type value_type
G4VPhysicalVolume * getTopPV()
void dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
G4LogicalVolume * getTopLV()
void dumpG4LVList(std::ostream &out=std::cout)
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
bool firstChild()
set the current node to the first child ...
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
const DDTranslation & translation() const
The absolute translation of the current node.
const std::string & name() const
Returns the name.
void dumpG4LVLeaf(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.