CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PrintGeomInfoAction Class Reference

#include <PrintGeomInfoAction.h>

Inheritance diagram for PrintGeomInfoAction:
SimWatcher Observer< const BeginOfJob * > Observer< const BeginOfRun * >

Public Member Functions

 PrintGeomInfoAction (edm::ParameterSet const &p)
 
 ~PrintGeomInfoAction ()
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun *iT)
 
virtual ~Observer ()
 

Private Member Functions

void add1touchable (G4LogicalVolume *lv, int &nTouch)
 
int countNoTouchables ()
 
void dumpG4LVLeaf (G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
 
void dumpG4LVList (std::ostream &out=std::cout)
 
void dumpG4LVTree (std::ostream &out=std::cout)
 
void dumpHierarchyLeafPVLV (G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
 
void dumpHierarchyTreePVLV (std::ostream &out=std::cout)
 
void dumpLV (G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
 
void dumpMaterialList (std::ostream &out=std::cout)
 
void dumpPV (G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
 
void dumpSolid (G4VSolid *sol, unsigned int leafDepth, std::ostream &out=std::cout)
 
void dumpSummary (std::ostream &out=std::cout)
 
void dumpTouch (G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
 
G4LogicalVolume * getTopLV ()
 
G4VPhysicalVolume * getTopPV ()
 
std::string spacesFromLeafDepth (unsigned int leafDepth)
 
void update (const BeginOfJob *job)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *run)
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

bool _dumpAtts
 
bool _dumpLV
 
bool _dumpLVList
 
bool _dumpLVTree
 
bool _dumpMaterial
 
bool _dumpPV
 
bool _dumpReplica
 
bool _dumpRotation
 
bool _dumpSense
 
bool _dumpSolid
 
bool _dumpSummary
 
bool _dumpTouch
 
G4NavigationHistory fHistory
 
std::string name
 
std::vector< std::string > names
 
int nchar
 
mpvpv thePVTree
 
G4VPhysicalVolume * theTopPV
 

Additional Inherited Members

Detailed Description

Definition at line 24 of file PrintGeomInfoAction.h.

Constructor & Destructor Documentation

PrintGeomInfoAction::PrintGeomInfoAction ( edm::ParameterSet const &  p)

Definition at line 32 of file PrintGeomInfoAction.cc.

References _dumpAtts, _dumpLV, _dumpLVList, _dumpLVTree, _dumpMaterial, _dumpPV, _dumpReplica, _dumpRotation, _dumpSense, _dumpSolid, _dumpSummary, _dumpTouch, gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), i, name, names, and nchar.

32  {
33 
34  _dumpSummary = p.getUntrackedParameter<bool>("DumpSummary", true);
35  _dumpLVTree = p.getUntrackedParameter<bool>("DumpLVTree", true);
36  _dumpMaterial= p.getUntrackedParameter<bool>("DumpMaterial",false);
37  _dumpLVList = p.getUntrackedParameter<bool>("DumpLVList", false);
38  _dumpLV = p.getUntrackedParameter<bool>("DumpLV", false);
39  _dumpSolid = p.getUntrackedParameter<bool>("DumpSolid", false);
40  _dumpAtts = p.getUntrackedParameter<bool>("DumpAttributes", false);
41  _dumpPV = p.getUntrackedParameter<bool>("DumpPV", false);
42  _dumpRotation= p.getUntrackedParameter<bool>("DumpRotation",false);
43  _dumpReplica = p.getUntrackedParameter<bool>("DumpReplica", false);
44  _dumpTouch = p.getUntrackedParameter<bool>("DumpTouch", false);
45  _dumpSense = p.getUntrackedParameter<bool>("DumpSense", false);
46  name = p.getUntrackedParameter<std::string>("Name","*");
47  nchar = name.find("*");
48  name.assign(name,0,nchar);
49  names = p.getUntrackedParameter<std::vector<std::string> >("Names");
50  std::cout << "PrintGeomInfoAction:: initialised with verbosity levels:"
51  << " Summary " << _dumpSummary << " LVTree " << _dumpLVTree
52  << " LVList " << _dumpLVList << " Material " << _dumpMaterial
53  << "\n "
54  << " LV " << _dumpLV << " Solid " << _dumpSolid
55  << " Attribs " << _dumpAtts
56  << "\n "
57  << " PV " << _dumpPV << " Rotation " << _dumpRotation
58  << " Replica " << _dumpReplica
59  << "\n "
60  << " Touchable " << _dumpTouch << " for names (0-" << nchar
61  << ") = " << name
62  << "\n "
63  << " Sensitive " << _dumpSense << " for " << names.size()
64  << " namess";
65  for (unsigned int i=0; i<names.size(); i++) std::cout << " " << names[i];
66  std::cout << std::endl;
67 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > names
tuple cout
Definition: gather_cfg.py:121
PrintGeomInfoAction::~PrintGeomInfoAction ( )

Definition at line 69 of file PrintGeomInfoAction.cc.

69 {}

Member Function Documentation

void PrintGeomInfoAction::add1touchable ( G4LogicalVolume *  lv,
int &  nTouch 
)
private

Definition at line 201 of file PrintGeomInfoAction.cc.

Referenced by countNoTouchables().

201  {
202 
203  int siz = lv->GetNoDaughters();
204  for(int ii = 0; ii < siz; ii++)
205  add1touchable(lv->GetDaughter(ii)->GetLogicalVolume(), ++nTouch);
206 }
void add1touchable(G4LogicalVolume *lv, int &nTouch)
int PrintGeomInfoAction::countNoTouchables ( )
private

Definition at line 193 of file PrintGeomInfoAction.cc.

References add1touchable(), and getTopLV().

Referenced by dumpSummary().

193  {
194 
195  int nTouch = 0;
196  G4LogicalVolume * lv = getTopLV();
197  add1touchable(lv, nTouch);
198  return nTouch;
199 }
void add1touchable(G4LogicalVolume *lv, int &nTouch)
G4LogicalVolume * getTopLV()
void PrintGeomInfoAction::dumpG4LVLeaf ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
unsigned int  count,
std::ostream &  out = std::cout 
)
private

Definition at line 176 of file PrintGeomInfoAction.cc.

Referenced by dumpG4LVTree().

176  {
177 
178  for (unsigned int ii=0; ii < leafDepth; ii++) out << " ";
179  out << " LV:(" << leafDepth << ") " << lv->GetName() << " (" << count
180  << ")" << std::endl;
181  //--- If a volume is placed n types as daughter of this LV, it should only be counted once
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));
188  }
189  for (cite = lvCount.begin(); cite != lvCount.end(); cite++)
190  dumpG4LVLeaf((cite->first), leafDepth+1, (cite->second), out);
191 }
tuple out
Definition: dbtoconf.py:99
void dumpG4LVLeaf(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
void PrintGeomInfoAction::dumpG4LVList ( std::ostream &  out = std::cout)
private

Definition at line 150 of file PrintGeomInfoAction.cc.

Referenced by update().

150  {
151 
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;
157 }
tuple out
Definition: dbtoconf.py:99
void PrintGeomInfoAction::dumpG4LVTree ( std::ostream &  out = std::cout)
private

Definition at line 159 of file PrintGeomInfoAction.cc.

References dumpG4LVLeaf(), and getTopLV().

Referenced by update().

159  {
160 
161  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's Tree " << std::endl;
162  G4LogicalVolume * lv = getTopLV();
163  dumpG4LVLeaf(lv,0,1,out);
164 }
tuple out
Definition: dbtoconf.py:99
G4LogicalVolume * getTopLV()
void dumpG4LVLeaf(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
void PrintGeomInfoAction::dumpHierarchyLeafPVLV ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 226 of file PrintGeomInfoAction.cc.

References dumpLV(), and dumpPV().

Referenced by dumpHierarchyTreePVLV().

226  {
227 
228  //----- Dump this LV
229  dumpLV(lv, leafDepth, out);
230 
231  //----- Get LV daughters from list of PV daughters
232  mmlvpv lvpvDaughters;
233  std::set< G4LogicalVolume * > lvDaughters;
234  int NoDaughters = lv->GetNoDaughters();
235  while ((NoDaughters--)>0) {
236  G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
237  lvpvDaughters.insert(mmlvpv::value_type(pvD->GetLogicalVolume(), pvD));
238  lvDaughters.insert(pvD->GetLogicalVolume());
239  }
240 
241  std::set< G4LogicalVolume * >::const_iterator scite;
242  mmlvpv::const_iterator mmcite;
243 
244  //----- Dump daughters PV and LV
245  for (scite = lvDaughters.begin(); scite != lvDaughters.end(); scite++) {
246  std::pair< mmlvpv::iterator, mmlvpv::iterator > mmER = lvpvDaughters.equal_range(*scite);
247  //----- Dump daughters PV of this LV
248  for (mmcite = mmER.first ; mmcite != mmER.second; mmcite++)
249  dumpPV((*mmcite).second, leafDepth+1, out);
250  //----- Dump daughters LV
251  dumpHierarchyLeafPVLV(*scite, leafDepth+1, out );
252  }
253 }
void dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
std::multimap< G4LogicalVolume *, G4VPhysicalVolume *, std::less< G4LogicalVolume * > > mmlvpv
void dumpLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
Container::value_type value_type
tuple out
Definition: dbtoconf.py:99
void dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
void PrintGeomInfoAction::dumpHierarchyTreePVLV ( std::ostream &  out = std::cout)
private

Definition at line 208 of file PrintGeomInfoAction.cc.

References _dumpTouch, dumpHierarchyLeafPVLV(), dumpPV(), dumpTouch(), getTopLV(), and theTopPV.

Referenced by update().

208  {
209 
210  //dumps in the following order:
211  // 1) a LV with details
212  // 2) list of PVs daughters of this LV with details
213  // 3) list of LVs daughters of this LV and for each go to 1)
214 
215  //----- Get top PV
216  G4LogicalVolume* topLV = getTopLV();
217 
218  //----- Dump this leaf (it will recursively dump all the tree)
219  dumpHierarchyLeafPVLV(topLV, 0, out);
220  dumpPV(theTopPV, 0, out);
221 
222  //----- Dump the touchables (it will recursively dump all the tree)
223  if (_dumpTouch) dumpTouch(theTopPV, 0, out);
224 }
void dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
G4VPhysicalVolume * theTopPV
tuple out
Definition: dbtoconf.py:99
void dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
G4LogicalVolume * getTopLV()
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
void PrintGeomInfoAction::dumpLV ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 255 of file PrintGeomInfoAction.cc.

References _dumpAtts, _dumpLV, _dumpSolid, dumpSolid(), dbtoconf::out, and spacesFromLeafDepth().

Referenced by dumpHierarchyLeafPVLV().

255  {
256 
257  std::string spaces = spacesFromLeafDepth(leafDepth);
258 
259  //----- dump name
260  if (_dumpLV) {
261  out << leafDepth << spaces << "$$$ VOLUME = " << lv->GetName()
262  << " Solid: " << lv->GetSolid()->GetName() << " MATERIAL: "
263  << lv->GetMaterial()->GetName() << std::endl;
264  if (_dumpSolid)
265  dumpSolid(lv->GetSolid(), leafDepth, out); //----- dump solid
266 
267  //----- dump LV info
268  //--- material
269  if (_dumpAtts) {
270  //--- Visualisation attributes
271  const G4VisAttributes * fVA = lv->GetVisAttributes();
272  if (fVA!=0) {
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;
281  }
282 
283  //--- User Limits
284  G4UserLimits * fUL = lv->GetUserLimits();
285  G4Track dummy;
286  if (fUL!=0) {
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;
292  }
293 
294  //--- other LV info
295  if (lv->GetSensitiveDetector())
296  out << spaces << " IS SENSITIVE DETECTOR " << std::endl;
297  if (lv->GetFieldManager())
298  out << spaces << " FIELD ON " << std::endl;
299 
300  // Pointer (possibly NULL) to optimisation info objects.
301  out << spaces
302  << " Quality for optimisation, average number of voxels to be spent per content "
303  << lv->GetSmartless() << std::endl;
304 
305  // Pointer (possibly NULL) to G4FastSimulationManager object.
306  if (lv->GetFastSimulationManager())
307  out << spaces << " Logical Volume is an envelope for a FastSimulationManager "
308  << std::endl;
309  out << spaces << " Weight used in the event biasing technique = "
310  << lv->GetBiasWeight() << std::endl;
311  }
312  }
313 }
void dumpSolid(G4VSolid *sol, unsigned int leafDepth, std::ostream &out=std::cout)
std::string spacesFromLeafDepth(unsigned int leafDepth)
tuple out
Definition: dbtoconf.py:99
void PrintGeomInfoAction::dumpMaterialList ( std::ostream &  out = std::cout)
private

Definition at line 166 of file PrintGeomInfoAction.cc.

Referenced by update().

166  {
167 
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;
174 }
tuple out
Definition: dbtoconf.py:99
void PrintGeomInfoAction::dumpPV ( G4VPhysicalVolume *  pv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 315 of file PrintGeomInfoAction.cc.

References _dumpPV, _dumpReplica, _dumpRotation, evf::evtn::offset(), spacesFromLeafDepth(), and tablePrinter::width.

Referenced by dumpHierarchyLeafPVLV(), and dumpHierarchyTreePVLV().

315  {
316 
317  std::string spaces = spacesFromLeafDepth(leafDepth);
318 
319  //----- PV info
320  if (_dumpPV) {
321  std::string mother = "World";
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();
326  }
327  if (!pv->IsReplicated()) {
328  if (_dumpPV) {
329  if(pv->GetRotation() == 0) out << " with no rotation" << std::endl;
330  else if(!_dumpRotation) out << " with rotation" << std::endl; //just rotation name
331  else out << " with rotation " << *(pv->GetRotation()) << std::endl;
332  }
333  } else {
334  if (_dumpReplica ) {
335  out << spaces << " It is replica: " << std::endl;
336  EAxis axis;
337  int nReplicas;
338  double width;
339  double offset;
340  bool consuming;
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;
346  else
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;
352  }
353  }
354 }
std::string spacesFromLeafDepth(unsigned int leafDepth)
unsigned int offset(bool)
tuple out
Definition: dbtoconf.py:99
void PrintGeomInfoAction::dumpSolid ( G4VSolid *  sol,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 393 of file PrintGeomInfoAction.cc.

References spacesFromLeafDepth().

Referenced by dumpLV().

393  {
394 
395  std::string spaces = spacesFromLeafDepth(leafDepth);
396  out << spaces << *(sol) << std::endl;
397 }
std::string spacesFromLeafDepth(unsigned int leafDepth)
tuple out
Definition: dbtoconf.py:99
void PrintGeomInfoAction::dumpSummary ( std::ostream &  out = std::cout)
private

Definition at line 126 of file PrintGeomInfoAction.cc.

References countNoTouchables(), and theTopPV.

Referenced by update().

126  {
127 
128  //---------- Dump number of objects of each class
129  out << " @@@@@@@@@@@@@@@@@@ Dumping G4 geometry objects Summary " << std::endl;
130  if (theTopPV == 0) {
131  out << " No volume created " << std::endl;
132  return;
133  }
134  out << " @@@ Geometry built inside world volume: " << theTopPV->GetName() << std::endl;
135  // Get number of solids (< # LV if several LV share a solid)
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;
145  out << " Number of Touchable's: " << countNoTouchables() << std::endl;
146  const G4MaterialTable * matTab = G4Material::GetMaterialTable();
147  out << " Number of G4Material's: " << matTab->size() << std::endl;
148 }
G4VPhysicalVolume * theTopPV
tuple out
Definition: dbtoconf.py:99
void PrintGeomInfoAction::dumpTouch ( G4VPhysicalVolume *  pv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 356 of file PrintGeomInfoAction.cc.

References fHistory, name, nchar, and spacesFromLeafDepth().

Referenced by dumpHierarchyTreePVLV().

356  {
357 
358  std::string spaces = spacesFromLeafDepth(leafDepth);
359  if (leafDepth == 0) fHistory.SetFirstEntry(pv);
360  else fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
361 
362  G4ThreeVector globalpoint = fHistory.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0,0,0));
363  G4LogicalVolume * lv = pv->GetLogicalVolume();
364 
365  std::string mother = "World";
366  if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
367  std::string lvname = lv->GetName();
368  lvname.assign(lvname,0,nchar);
369  if (lvname == name)
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
374  << ")" << std::endl;
375 
376  int NoDaughters = lv->GetNoDaughters();
377  while ((NoDaughters--)>0) {
378  G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
379  if (!pvD->IsReplicated()) dumpTouch(pvD, leafDepth+1, out);
380  }
381 
382  if (leafDepth > 0) fHistory.BackLevel();
383 }
G4NavigationHistory fHistory
std::string spacesFromLeafDepth(unsigned int leafDepth)
tuple out
Definition: dbtoconf.py:99
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
G4LogicalVolume * PrintGeomInfoAction::getTopLV ( )
private

Definition at line 404 of file PrintGeomInfoAction.cc.

References theTopPV.

Referenced by countNoTouchables(), dumpG4LVTree(), and dumpHierarchyTreePVLV().

404  {
405  return theTopPV->GetLogicalVolume();
406 }
G4VPhysicalVolume * theTopPV
G4VPhysicalVolume * PrintGeomInfoAction::getTopPV ( )
private

Definition at line 399 of file PrintGeomInfoAction.cc.

Referenced by update().

399  {
400 
401  return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
402 }
std::string PrintGeomInfoAction::spacesFromLeafDepth ( unsigned int  leafDepth)
private

Definition at line 385 of file PrintGeomInfoAction.cc.

Referenced by dumpLV(), dumpPV(), dumpSolid(), dumpTouch(), and update().

385  {
386 
387  std::string spaces;
388  unsigned int ii;
389  for(ii = 0; ii < leafDepth; ii++) { spaces += " "; }
390  return spaces;
391 }
void PrintGeomInfoAction::update ( const BeginOfJob )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 71 of file PrintGeomInfoAction.cc.

References _dumpSense, DDFilteredView::addFilter(), filterCSVwithJSON::copy, DDFilteredView::copyNumbers(), gather_cfg::cout, DDSpecificsFilter::equals, alcazmumu_cfi::filter, DDFilteredView::firstChild(), i, gen::k, create_public_lumi_plots::log, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), names, DDFilteredView::next(), sd, DDSpecificsFilter::setCriteria(), spacesFromLeafDepth(), and DDFilteredView::translation().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

71  {
72 
73  if (_dumpSense) {
75  (*job)()->get<IdealGeometryRecord>().get(pDD);
76 
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++) {
80  std::string attribute = "ReadOutName";
81  std::string sd = names[i];
83  DDValue ddv(attribute,sd,0);
85  DDFilteredView fv(*pDD);
86  std::cout << "PrintGeomInfoAction:: Get Filtered view for "
87  << attribute << " = " << sd << std::endl;
88  fv.addFilter(filter);
89  bool dodet = fv.firstChild();
90 
91  std::string spaces = spacesFromLeafDepth(1);
92 
93  while (dodet) {
94  const DDLogicalPart & log = fv.logicalPart();
95  std::string lvname = log.name().name();
96  DDTranslation tran = fv.translation();
97  std::vector<int> copy = fv.copyNumbers();
98 
99  unsigned int leafDepth = copy.size();
100  std::cout << leafDepth << spaces << "### VOLUME = " << lvname
101  << " Copy No";
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;
105  dodet = fv.next();
106  }
107  }
108  }
109 }
int i
Definition: DBlmapReader.cc:9
const N & name() const
Definition: DDBase.h:82
std::vector< std::string > names
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
std::string spacesFromLeafDepth(unsigned int leafDepth)
int k[5][pyjets_maxn]
double sd
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:285
tuple cout
Definition: gather_cfg.py:121
const std::string & name() const
Returns the name.
Definition: DDName.cc:87
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:37
void PrintGeomInfoAction::update ( const BeginOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 111 of file PrintGeomInfoAction.cc.

References _dumpLV, _dumpLVList, _dumpLVTree, _dumpMaterial, _dumpPV, _dumpSummary, _dumpTouch, gather_cfg::cout, dumpG4LVList(), dumpG4LVTree(), dumpHierarchyTreePVLV(), dumpMaterialList(), dumpSummary(), getTopPV(), and theTopPV.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

111  {
112 
113  theTopPV = getTopPV();
114 
117 
118  //---------- Dump list of objects of each class with detail of parameters
121 
122  //---------- Dump LV and PV information
124 }
void dumpMaterialList(std::ostream &out=std::cout)
void dumpSummary(std::ostream &out=std::cout)
G4VPhysicalVolume * theTopPV
void dumpHierarchyTreePVLV(std::ostream &out=std::cout)
void dumpG4LVTree(std::ostream &out=std::cout)
G4VPhysicalVolume * getTopPV()
void dumpG4LVList(std::ostream &out=std::cout)
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

bool PrintGeomInfoAction::_dumpAtts
private

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpLV
private

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpLVList
private

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpLVTree
private

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpMaterial
private

Definition at line 52 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpPV
private

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpReplica
private

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpRotation
private

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpSense
private

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpSolid
private

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), and PrintGeomInfoAction().

bool PrintGeomInfoAction::_dumpSummary
private

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

bool PrintGeomInfoAction::_dumpTouch
private

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpHierarchyTreePVLV(), PrintGeomInfoAction(), and update().

G4NavigationHistory PrintGeomInfoAction::fHistory
private

Definition at line 60 of file PrintGeomInfoAction.h.

Referenced by dumpTouch().

std::string PrintGeomInfoAction::name
private
std::vector<std::string> PrintGeomInfoAction::names
private

Definition at line 57 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

int PrintGeomInfoAction::nchar
private

Definition at line 56 of file PrintGeomInfoAction.h.

Referenced by dumpTouch(), and PrintGeomInfoAction().

mpvpv PrintGeomInfoAction::thePVTree
private

Definition at line 58 of file PrintGeomInfoAction.h.

G4VPhysicalVolume* PrintGeomInfoAction::theTopPV
private

Definition at line 59 of file PrintGeomInfoAction.h.

Referenced by dumpHierarchyTreePVLV(), dumpSummary(), getTopLV(), and update().