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
PrintGeomMatInfo Class Reference

#include <PrintGeomMatInfo.h>

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

Public Member Functions

 PrintGeomMatInfo (edm::ParameterSet const &p)
 
 ~PrintGeomMatInfo ()
 
- 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 dumpG4LVLeafWithMat (G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
 
void dumpG4LVList (std::ostream &out=std::cout)
 
void dumpG4LVMatBudget (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

std::vector< double > _areaLayer
 
std::vector< unsigned int > _countsPerLevel
 
bool _dumpAtts
 
unsigned int _dumpIndex
 
bool _dumpIt
 
bool _dumpLV
 
bool _dumpLVList
 
bool _dumpLVMatBudget
 
bool _dumpLVTree
 
bool _dumpMaterial
 
bool _dumpPV
 
bool _dumpReplica
 
bool _dumpRotation
 
bool _dumpSense
 
bool _dumpSolid
 
bool _dumpSummary
 
bool _dumpTouch
 
unsigned int _level2Dump
 
std::vector< std::string > _lvNames2Dump
 
unsigned int _maxLevelsCounted
 
std::vector< double > _radiusLayer
 
std::vector< double > _zLayer
 
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 PrintGeomMatInfo.h.

Constructor & Destructor Documentation

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

Definition at line 32 of file PrintGeomMatInfo.cc.

References _areaLayer, _countsPerLevel, _dumpAtts, _dumpIndex, _dumpIt, _dumpLV, _dumpLVList, _dumpLVMatBudget, _dumpLVTree, _dumpMaterial, _dumpPV, _dumpReplica, _dumpRotation, _dumpSense, _dumpSolid, _dumpSummary, _dumpTouch, _level2Dump, _lvNames2Dump, _maxLevelsCounted, _radiusLayer, _zLayer, gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), i, name, names, nchar, and AlCaHLTBitMon_QueryRunRegistry::string.

33 {
34  _dumpSummary = p.getUntrackedParameter<bool>("DumpSummary", true);
35  _dumpLVTree = p.getUntrackedParameter<bool>("DumpLVTree", true);
36  _dumpLVMatBudget = p.getUntrackedParameter<bool>("DumpLVMatBudget", false);
37  _lvNames2Dump= p.getUntrackedParameter<std::vector<std::string> >("LVNames2Dump");
38  _level2Dump = 0;
39  _dumpIndex = 0;
40  _dumpIt = false;
41  _radiusLayer = p.getUntrackedParameter<std::vector<double> >("Radius2Use");
42  _zLayer = p.getUntrackedParameter<std::vector<double> >("Z2Use");
43  _maxLevelsCounted = 50;
44  _countsPerLevel.assign(_maxLevelsCounted,0);
45  _dumpMaterial= p.getUntrackedParameter<bool>("DumpMaterial",false);
46  _dumpLVList = p.getUntrackedParameter<bool>("DumpLVList", false);
47  _dumpLV = p.getUntrackedParameter<bool>("DumpLV", false);
48  _dumpSolid = p.getUntrackedParameter<bool>("DumpSolid", false);
49  _dumpAtts = p.getUntrackedParameter<bool>("DumpAttributes", false);
50  _dumpPV = p.getUntrackedParameter<bool>("DumpPV", false);
51  _dumpRotation= p.getUntrackedParameter<bool>("DumpRotation",false);
52  _dumpReplica = p.getUntrackedParameter<bool>("DumpReplica", false);
53  _dumpTouch = p.getUntrackedParameter<bool>("DumpTouch", false);
54  _dumpSense = p.getUntrackedParameter<bool>("DumpSense", false);
55  name = p.getUntrackedParameter<std::string>("Name","*");
56  nchar = name.find("*");
57  name.assign(name,0,nchar);
58  names = p.getUntrackedParameter<std::vector<std::string> >("Names");
59  std::cout << "size of _lvNames2Dump = " << _lvNames2Dump.size()
60  << " size of _radiusLayer = " << _radiusLayer.size()
61  << " size of _zLayer = " << _zLayer.size() << std::endl;
62  std::cout << "PrintGeomMatInfo:: initialised with verbosity levels:"
63  << " Summary " << _dumpSummary << " LVTree " << _dumpLVTree
64  << " LVList " << _dumpLVList << " Material " << _dumpMaterial
65  << "\n "
66  << " LVMatBudget " << _dumpLVMatBudget << " for";
67  _areaLayer.reserve(_lvNames2Dump.size());
68  if(_lvNames2Dump.size() == _radiusLayer.size() &&
69  _lvNames2Dump.size() == _zLayer.size()) {
70  for (unsigned int i=0; i<_lvNames2Dump.size(); i++) {
71  _areaLayer[i] = 2.0*3.14159*_radiusLayer[i]*_zLayer[i];
72  std::cout << "\n "
73  << " " << _lvNames2Dump[i] << " radius = " << _radiusLayer[i]
74  << " z = " << _zLayer[i] << " area = " << _areaLayer[i];
75  }
76  } else {
77  _areaLayer.assign(3,0.0);
78  std::cout << "\n "
79  << " Problem with unequal sizes!! Fix and rerun";
80  }
81  std::cout << "\n "
82  << " and max levels for count = " << _maxLevelsCounted;
83  std::cout << "\n "
84  << " LV " << _dumpLV << " Solid " << _dumpSolid
85  << " Attribs " << _dumpAtts
86  << "\n "
87  << " PV " << _dumpPV << " Rotation " << _dumpRotation
88  << " Replica " << _dumpReplica
89  << "\n "
90  << " Touchable " << _dumpTouch << " for names (0-" << nchar
91  << ") = " << name
92  << "\n "
93  << " Sensitive " << _dumpSense << " for " << names.size()
94  << " names";
95  for (unsigned int i=0; i<names.size(); i++) std::cout << " " << names[i];
96  std::cout << std::endl;
97 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > _radiusLayer
std::vector< std::string > names
std::vector< double > _areaLayer
std::vector< double > _zLayer
unsigned int _dumpIndex
std::vector< std::string > _lvNames2Dump
tuple cout
Definition: gather_cfg.py:121
unsigned int _maxLevelsCounted
unsigned int _level2Dump
std::vector< unsigned int > _countsPerLevel
PrintGeomMatInfo::~PrintGeomMatInfo ( )

Definition at line 99 of file PrintGeomMatInfo.cc.

99 {}

Member Function Documentation

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

Definition at line 292 of file PrintGeomMatInfo.cc.

References cuy::ii.

Referenced by countNoTouchables().

293 {
294  int siz = lv->GetNoDaughters();
295  for(int ii = 0; ii < siz; ii++)
296  add1touchable(lv->GetDaughter(ii)->GetLogicalVolume(), ++nTouch);
297 }
int ii
Definition: cuy.py:588
void add1touchable(G4LogicalVolume *lv, int &nTouch)
int PrintGeomMatInfo::countNoTouchables ( )
private

Definition at line 283 of file PrintGeomMatInfo.cc.

References add1touchable(), and getTopLV().

Referenced by dumpSummary().

284 {
285  int nTouch = 0;
286  G4LogicalVolume * lv = getTopLV();
287  add1touchable(lv, nTouch);
288  return nTouch;
289 }
void add1touchable(G4LogicalVolume *lv, int &nTouch)
G4LogicalVolume * getTopLV()
void PrintGeomMatInfo::dumpG4LVLeaf ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
unsigned int  count,
std::ostream &  out = std::cout 
)
private

Definition at line 208 of file PrintGeomMatInfo.cc.

References cuy::ii.

Referenced by dumpG4LVTree().

209 {
210  for (unsigned int ii=0; ii < leafDepth; ii++) out << " ";
211  out << " LV:(" << leafDepth << ") " << lv->GetName() << " (" << count
212  << ")" << std::endl;
213  //--- If a volume is placed n types as daughter of this LV, it should only be counted once
214  std::map<G4LogicalVolume*, unsigned int> lvCount;
215  std::map<G4LogicalVolume*, unsigned int>::const_iterator cite;
216  for (int ii = 0; ii < lv->GetNoDaughters(); ii++) {
217  cite = lvCount.find(lv->GetDaughter(ii)->GetLogicalVolume());
218  if (cite != lvCount.end()) lvCount[cite->first] = (cite->second) + 1;
219  else lvCount.insert(std::pair< G4LogicalVolume*,unsigned int>(lv->GetDaughter(ii)->GetLogicalVolume(),1));
220  }
221  for (cite = lvCount.begin(); cite != lvCount.end(); cite++)
222  dumpG4LVLeaf((cite->first), leafDepth+1, (cite->second), out);
223 }
int ii
Definition: cuy.py:588
tuple out
Definition: dbtoconf.py:99
void dumpG4LVLeaf(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
void PrintGeomMatInfo::dumpG4LVLeafWithMat ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
unsigned int  count,
std::ostream &  out = std::cout 
)
private

Definition at line 232 of file PrintGeomMatInfo.cc.

References _areaLayer, _countsPerLevel, _dumpIndex, _dumpIt, _level2Dump, _lvNames2Dump, _maxLevelsCounted, compare_using_db::compare, prof2calltree::count, i, and cuy::ii.

Referenced by dumpG4LVMatBudget().

233 {
234  // switch off dumping at the next same level as the dump
235  if(_dumpIt && _level2Dump == leafDepth) {
236  _dumpIt = false;
237 // std::cout << " stopped dumping " << std::endl;
238  }
239  // loop over volumes to dump: volumes cannot not overlap in hierarchy!!
240  for (unsigned int i=0; i<_lvNames2Dump.size(); i++) {
241  if(_lvNames2Dump[i].compare(lv->GetName()) == 0) {
242  _dumpIt = true;
243  _dumpIndex = i;
244  _level2Dump = leafDepth;
245 // std::cout << " start dumping " << _lvNames2Dump[i] << " at level " << _level2Dump << std::endl;
246  break;
247  }
248  }
249 
250  if(_dumpIt) {
251  if(leafDepth < _maxLevelsCounted) _countsPerLevel[leafDepth] = count;
252  unsigned int total_multipler = 1;
253  for (unsigned int ii=_level2Dump; ii <= leafDepth; ii++) total_multipler *= _countsPerLevel[ii];
254  double thick = (lv->GetSolid()->GetCubicVolume() * total_multipler)/_areaLayer[_dumpIndex];
255  for (unsigned int ii=0; ii < leafDepth; ii++) out << " ";
256  // print out Level, Logical volume name, volume in mm**3, material name, rad len of mat in mm
257  // total number of volumes from dump level start, equivalent thickness when spread over
258  // a cylinder of _radiusLayer and length _zLayer; equivalent thick in rad len
259  out << " LV::" << leafDepth << ": " << lv->GetName() << " :" << count
260  << ": " << lv->GetSolid()->GetName() << " :" << lv->GetSolid()->GetCubicVolume()
261  << ": "<< lv->GetMaterial()->GetName() << " :" << lv->GetMaterial()->GetRadlen()
262  << ":" << " :" << total_multipler << ":"
263  << " thk :" << thick << ": x/X0 :" << thick/lv->GetMaterial()->GetRadlen()
264  << ":" << " Kg : " << lv->GetMass()/kg << std::endl;
265  } else {
266  for (unsigned int ii=0; ii < leafDepth; ii++) out << " ";
267  out << " LV:(" << leafDepth << ") " << lv->GetName() << " (" << count << ")" << std::endl;
268  }
269 
270  //--- If a volume is placed n types as daughter of this LV, it should only be counted once
271  std::map<G4LogicalVolume*, unsigned int> lvCount;
272  std::map<G4LogicalVolume*, unsigned int>::const_iterator cite;
273  for (int ii = 0; ii < lv->GetNoDaughters(); ii++) {
274  cite = lvCount.find(lv->GetDaughter(ii)->GetLogicalVolume());
275  if (cite != lvCount.end()) lvCount[cite->first] = (cite->second) + 1;
276  else lvCount.insert(std::pair< G4LogicalVolume*,unsigned int>(lv->GetDaughter(ii)->GetLogicalVolume(),1));
277  }
278  for (cite = lvCount.begin(); cite != lvCount.end(); cite++)
279  dumpG4LVLeafWithMat((cite->first), leafDepth+1, (cite->second), out);
280 }
int i
Definition: DBlmapReader.cc:9
void dumpG4LVLeafWithMat(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
int ii
Definition: cuy.py:588
std::vector< double > _areaLayer
unsigned int _dumpIndex
tuple out
Definition: dbtoconf.py:99
std::vector< std::string > _lvNames2Dump
unsigned int _maxLevelsCounted
unsigned int _level2Dump
std::vector< unsigned int > _countsPerLevel
void PrintGeomMatInfo::dumpG4LVList ( std::ostream &  out = std::cout)
private

Definition at line 182 of file PrintGeomMatInfo.cc.

Referenced by update().

183 {
184  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's List " << std::endl;
185  const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
186  std::vector<G4LogicalVolume*>::const_iterator lvcite;
187  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
188  out << "LV:" << (*lvcite)->GetName() << "\tMaterial: " << (*lvcite)->GetMaterial()->GetName() << std::endl;
189 }
tuple out
Definition: dbtoconf.py:99
void PrintGeomMatInfo::dumpG4LVMatBudget ( std::ostream &  out = std::cout)
private

Definition at line 225 of file PrintGeomMatInfo.cc.

References dumpG4LVLeafWithMat(), and getTopLV().

Referenced by update().

226 {
227  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's Material Budget Tree " << std::endl;
228  G4LogicalVolume * lv = getTopLV();
229  dumpG4LVLeafWithMat(lv,0,1,out);
230 }
void dumpG4LVLeafWithMat(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
tuple out
Definition: dbtoconf.py:99
G4LogicalVolume * getTopLV()
void PrintGeomMatInfo::dumpG4LVTree ( std::ostream &  out = std::cout)
private

Definition at line 191 of file PrintGeomMatInfo.cc.

References dumpG4LVLeaf(), and getTopLV().

Referenced by update().

192 {
193  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's Tree " << std::endl;
194  G4LogicalVolume * lv = getTopLV();
195  dumpG4LVLeaf(lv,0,1,out);
196 }
tuple out
Definition: dbtoconf.py:99
G4LogicalVolume * getTopLV()
void dumpG4LVLeaf(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
void PrintGeomMatInfo::dumpHierarchyLeafPVLV ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 317 of file PrintGeomMatInfo.cc.

References dumpLV(), and dumpPV().

Referenced by dumpHierarchyTreePVLV().

318 {
319  //----- Dump this LV
320  dumpLV(lv, leafDepth, out);
321 
322  //----- Get LV daughters from list of PV daughters
323  mmlvpv lvpvDaughters;
324  std::set< G4LogicalVolume * > lvDaughters;
325  int NoDaughters = lv->GetNoDaughters();
326  while ((NoDaughters--)>0)
327  {
328  G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
329  lvpvDaughters.insert(mmlvpv::value_type(pvD->GetLogicalVolume(), pvD));
330  lvDaughters.insert(pvD->GetLogicalVolume());
331  }
332 
333  std::set< G4LogicalVolume * >::const_iterator scite;
334  mmlvpv::const_iterator mmcite;
335 
336  //----- Dump daughters PV and LV
337  for (scite = lvDaughters.begin(); scite != lvDaughters.end(); scite++)
338  {
339  std::pair< mmlvpv::iterator, mmlvpv::iterator > mmER = lvpvDaughters.equal_range(*scite);
340  //----- Dump daughters PV of this LV
341  for (mmcite = mmER.first ; mmcite != mmER.second; mmcite++)
342  dumpPV((*mmcite).second, leafDepth+1, out);
343  //----- Dump daughters LV
344  dumpHierarchyLeafPVLV(*scite, leafDepth+1, out );
345  }
346 }
std::multimap< G4LogicalVolume *, G4VPhysicalVolume *, std::less< G4LogicalVolume * > > mmlvpv
void dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
void dumpLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
void dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
Container::value_type value_type
tuple out
Definition: dbtoconf.py:99
void PrintGeomMatInfo::dumpHierarchyTreePVLV ( std::ostream &  out = std::cout)
private

Definition at line 299 of file PrintGeomMatInfo.cc.

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

Referenced by update().

300 {
301  //dumps in the following order:
302  // 1) a LV with details
303  // 2) list of PVs daughters of this LV with details
304  // 3) list of LVs daughters of this LV and for each go to 1)
305 
306  //----- Get top PV
307  G4LogicalVolume* topLV = getTopLV();
308 
309  //----- Dump this leaf (it will recursively dump all the tree)
310  dumpHierarchyLeafPVLV(topLV, 0, out);
311  dumpPV(theTopPV, 0, out);
312 
313  //----- Dump the touchables (it will recursively dump all the tree)
314  if (_dumpTouch) dumpTouch(theTopPV, 0, out);
315 }
G4VPhysicalVolume * theTopPV
void dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
void dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
tuple out
Definition: dbtoconf.py:99
G4LogicalVolume * getTopLV()
void PrintGeomMatInfo::dumpLV ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 348 of file PrintGeomMatInfo.cc.

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

Referenced by dumpHierarchyLeafPVLV().

349 {
350  std::string spaces = spacesFromLeafDepth(leafDepth);
351 
352  //----- dump name
353  if (_dumpLV) {
354  out << leafDepth << spaces << "$$$ VOLUME = " << lv->GetName()
355  << " Solid: " << lv->GetSolid()->GetName() << " MATERIAL: "
356  << lv->GetMaterial()->GetName() << std::endl;
357  if (_dumpSolid)
358  dumpSolid(lv->GetSolid(), leafDepth, out); //----- dump solid
359 
360  //----- dump LV info
361  //--- material
362  if (_dumpAtts) {
363  //--- Visualisation attributes
364  const G4VisAttributes * fVA = lv->GetVisAttributes();
365  if (fVA!=0) {
366  out << spaces << " VISUALISATION ATTRIBUTES: " << std::endl;
367  out << spaces << " IsVisible " << fVA->IsVisible() << std::endl;
368  out << spaces << " IsDaughtersInvisible " << fVA->IsDaughtersInvisible() << std::endl;
369  out << spaces << " Colour " << fVA->GetColour() << std::endl;
370  out << spaces << " LineStyle " << fVA->GetLineStyle() << std::endl;
371  out << spaces << " LineWidth " << fVA->GetLineWidth() << std::endl;
372  out << spaces << " IsForceDrawingStyle " << fVA->IsForceDrawingStyle() << std::endl;
373  out << spaces << " ForcedDrawingStyle " << fVA->GetForcedDrawingStyle() << std::endl;
374  }
375 
376  //--- User Limits
377  G4UserLimits * fUL = lv->GetUserLimits();
378  G4Track dummy;
379  if (fUL!=0) {
380  out << spaces << " MaxAllowedStep " << fUL->GetMaxAllowedStep(dummy) << std::endl;
381  out << spaces << " UserMaxTrackLength " << fUL->GetUserMaxTrackLength(dummy) << std::endl;
382  out << spaces << " UserMaxTime " << fUL->GetUserMaxTime(dummy) << std::endl;
383  out << spaces << " UserMinEkine " << fUL->GetUserMinEkine(dummy) << std::endl;
384  out << spaces << " UserMinRange " << fUL->GetUserMinRange(dummy) << std::endl;
385  }
386 
387  //--- other LV info
388  if (lv->GetSensitiveDetector())
389  out << spaces << " IS SENSITIVE DETECTOR " << std::endl;
390  if (lv->GetFieldManager())
391  out << spaces << " FIELD ON " << std::endl;
392 
393  // Pointer (possibly NULL) to optimisation info objects.
394  out << spaces
395  << " Quality for optimisation, average number of voxels to be spent per content "
396  << lv->GetSmartless() << std::endl;
397 
398  // Pointer (possibly NULL) to G4FastSimulationManager object.
399  if (lv->GetFastSimulationManager())
400  out << spaces << " Logical Volume is an envelope for a FastSimulationManager "
401  << std::endl;
402  out << spaces << " Weight used in the event biasing technique = "
403  << lv->GetBiasWeight() << std::endl;
404  }
405  }
406 }
std::string spacesFromLeafDepth(unsigned int leafDepth)
tuple out
Definition: dbtoconf.py:99
void dumpSolid(G4VSolid *sol, unsigned int leafDepth, std::ostream &out=std::cout)
void PrintGeomMatInfo::dumpMaterialList ( std::ostream &  out = std::cout)
private

Definition at line 198 of file PrintGeomMatInfo.cc.

Referenced by update().

199 {
200  out << " @@@@@@@@@@@@@@@@ DUMPING G4Material List ";
201  const G4MaterialTable * matTab = G4Material::GetMaterialTable();
202  out << " with " << matTab->size() << " materials " << std::endl;
203  std::vector<G4Material*>::const_iterator matite;
204  for (matite = matTab->begin(); matite != matTab->end(); matite++)
205  out << "Material: " << (*matite) << std::endl;
206 }
tuple out
Definition: dbtoconf.py:99
void PrintGeomMatInfo::dumpPV ( G4VPhysicalVolume *  pv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 408 of file PrintGeomMatInfo.cc.

References _dumpPV, _dumpReplica, _dumpRotation, evf::evtn::offset(), spacesFromLeafDepth(), AlCaHLTBitMon_QueryRunRegistry::string, and create_public_lumi_plots::width.

Referenced by dumpHierarchyLeafPVLV(), and dumpHierarchyTreePVLV().

409 {
410  std::string spaces = spacesFromLeafDepth(leafDepth);
411 
412  //----- PV info
413  if (_dumpPV)
414  {
415  std::string mother = "World";
416  if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
417  out << leafDepth << spaces << "### VOLUME = " << pv->GetName()
418  << " Copy No " << pv->GetCopyNo() << " in " << mother
419  << " at " << pv->GetTranslation();
420  }
421  if (!pv->IsReplicated())
422  {
423  if (_dumpPV)
424  {
425  if(pv->GetRotation() == 0) out << " with no rotation" << std::endl;
426  else if(!_dumpRotation) out << " with rotation" << std::endl; //just rotation name
427  else out << " with rotation " << *(pv->GetRotation()) << std::endl;
428  }
429  }
430  else
431  {
432  if (_dumpReplica )
433  {
434  out << spaces << " It is replica: " << std::endl;
435  EAxis axis;
436  int nReplicas;
437  double width;
438  double offset;
439  bool consuming;
440  pv->GetReplicationData(axis, nReplicas, width, offset, consuming);
441  out << spaces << " axis " << axis << std::endl
442  << spaces << " nReplicas " << nReplicas << std::endl;
443  if (pv->GetParameterisation() != 0)
444  out << spaces << " It is parameterisation " << std::endl;
445  else
446  out << spaces << " width " << width << std::endl
447  << spaces << " offset " << offset << std::endl
448  << spaces << " consuming" << consuming << std::endl;
449  if (pv->GetParameterisation() != 0)
450  out << spaces << " It is parameterisation " << std::endl;
451  }
452  }
453 }
std::string spacesFromLeafDepth(unsigned int leafDepth)
unsigned int offset(bool)
tuple out
Definition: dbtoconf.py:99
void PrintGeomMatInfo::dumpSolid ( G4VSolid *  sol,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 494 of file PrintGeomMatInfo.cc.

References spacesFromLeafDepth(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dumpLV().

495 {
496  std::string spaces = spacesFromLeafDepth(leafDepth);
497  out << spaces << *(sol) << std::endl;
498 }
std::string spacesFromLeafDepth(unsigned int leafDepth)
tuple out
Definition: dbtoconf.py:99
void PrintGeomMatInfo::dumpSummary ( std::ostream &  out = std::cout)
private

Definition at line 157 of file PrintGeomMatInfo.cc.

References countNoTouchables(), and theTopPV.

Referenced by update().

158 {
159  //---------- Dump number of objects of each class
160  out << " @@@@@@@@@@@@@@@@@@ Dumping G4 geometry objects Summary " << std::endl;
161  if(theTopPV == 0)
162  {
163  out << " No volume created " << std::endl;
164  return;
165  }
166  out << " @@@ Geometry built inside world volume: " << theTopPV->GetName() << std::endl;
167  // Get number of solids (< # LV if several LV share a solid)
168  const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
169  std::vector<G4LogicalVolume *>::const_iterator lvcite;
170  std::set<G4VSolid *> theSolids;
171  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
172  theSolids.insert((*lvcite)->GetSolid());
173  out << " Number of G4VSolid's: " << theSolids.size() << std::endl;
174  out << " Number of G4LogicalVolume's: " << lvs->size() << std::endl;
175  const G4PhysicalVolumeStore * pvs = G4PhysicalVolumeStore::GetInstance();
176  out << " Number of G4VPhysicalVolume's: " << pvs->size() << std::endl;
177  out << " Number of Touchable's: " << countNoTouchables() << std::endl;
178  const G4MaterialTable * matTab = G4Material::GetMaterialTable();
179  out << " Number of G4Material's: " << matTab->size() << std::endl;
180 }
G4VPhysicalVolume * theTopPV
tuple out
Definition: dbtoconf.py:99
void PrintGeomMatInfo::dumpTouch ( G4VPhysicalVolume *  pv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 455 of file PrintGeomMatInfo.cc.

References fHistory, name, nchar, spacesFromLeafDepth(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dumpHierarchyTreePVLV().

456 {
457  std::string spaces = spacesFromLeafDepth(leafDepth);
458  if (leafDepth == 0) fHistory.SetFirstEntry(pv);
459  else fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
460 
461  G4ThreeVector globalpoint = fHistory.GetTopTransform().Inverse().
462  TransformPoint(G4ThreeVector(0,0,0));
463  G4LogicalVolume * lv = pv->GetLogicalVolume();
464 
465  std::string mother = "World";
466  if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
467  std::string lvname = lv->GetName();
468  lvname.assign(lvname,0,nchar);
469  if (lvname == name)
470  out << leafDepth << spaces << "### VOLUME = " << lv->GetName()
471  << " Copy No " << pv->GetCopyNo() << " in " << mother
472  << " global position of centre " << globalpoint << " (r = "
473  << globalpoint.perp() << ", phi = " << globalpoint.phi()/deg
474  << ")" << std::endl;
475 
476  int NoDaughters = lv->GetNoDaughters();
477  while ((NoDaughters--)>0)
478  {
479  G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
480  if (!pvD->IsReplicated()) dumpTouch(pvD, leafDepth+1, out);
481  }
482 
483  if (leafDepth > 0) fHistory.BackLevel();
484 }
std::string spacesFromLeafDepth(unsigned int leafDepth)
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
tuple out
Definition: dbtoconf.py:99
G4NavigationHistory fHistory
G4LogicalVolume * PrintGeomMatInfo::getTopLV ( )
private

Definition at line 506 of file PrintGeomMatInfo.cc.

References theTopPV.

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

507 { return theTopPV->GetLogicalVolume(); }
G4VPhysicalVolume * theTopPV
G4VPhysicalVolume * PrintGeomMatInfo::getTopPV ( )
private

Definition at line 500 of file PrintGeomMatInfo.cc.

Referenced by update().

501 {
502  return G4TransportationManager::GetTransportationManager()
503  ->GetNavigatorForTracking()->GetWorldVolume();
504 }
std::string PrintGeomMatInfo::spacesFromLeafDepth ( unsigned int  leafDepth)
private

Definition at line 486 of file PrintGeomMatInfo.cc.

References cuy::ii, and AlCaHLTBitMon_QueryRunRegistry::string.

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

487 {
488  std::string spaces;
489  unsigned int ii;
490  for(ii = 0; ii < leafDepth; ii++) { spaces += " "; }
491  return spaces;
492 }
int ii
Definition: cuy.py:588
void PrintGeomMatInfo::update ( const BeginOfJob )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 101 of file PrintGeomMatInfo.cc.

References _dumpSense, DDFilteredView::addFilter(), filterCSVwithJSON::copy, DDFilteredView::copyNumbers(), gather_cfg::cout, DDSplit(), DDSpecificsFilter::equals, alcazmumu_cfi::filter, first, DDFilteredView::firstChild(), i, gen::k, create_public_lumi_plots::log, DDFilteredView::logicalPart(), DDBase< N, C >::name(), names, DDFilteredView::next(), sd, DDSpecificsFilter::setCriteria(), spacesFromLeafDepth(), AlCaHLTBitMon_QueryRunRegistry::string, 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().

102 {
103  if (_dumpSense) {
105  (*job)()->get<IdealGeometryRecord>().get(pDD);
106 
107  std::cout << "PrintGeomMatInfo::Get Printout of Sensitive Volumes "
108  << "for " << names.size() << " Readout Units" << std::endl;
109  for (unsigned int i=0; i<names.size(); i++) {
110  std::string attribute = "ReadOutName";
111  std::string sd = names[i];
113  DDValue ddv(attribute,sd,0);
115  DDFilteredView fv(*pDD);
116  std::cout << "PrintGeomMatInfo:: Get Filtered view for "
117  << attribute << " = " << sd << std::endl;
118  fv.addFilter(filter);
119  bool dodet = fv.firstChild();
120 
121  std::string spaces = spacesFromLeafDepth(1);
122 
123  while (dodet) {
124  const DDLogicalPart & log = fv.logicalPart();
125  std::string lvname = DDSplit(log.name()).first;
126  DDTranslation tran = fv.translation();
127  std::vector<int> copy = fv.copyNumbers();
128 
129  unsigned int leafDepth = copy.size();
130  std::cout << leafDepth << spaces << "### VOLUME = " << lvname
131  << " Copy No";
132  for (int k=leafDepth-1; k>=0; k--) std::cout << " " << copy[k];
133  std::cout << " Centre at " << tran << " (r = " << tran.Rho()
134  << ", phi = " << tran.phi()/deg << ")" << std::endl;
135  dodet = fv.next();
136  }
137  }
138  }
139 }
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
std::string spacesFromLeafDepth(unsigned int leafDepth)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:88
bool first
Definition: L1TdeRCT.cc:94
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
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:4
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:37
void PrintGeomMatInfo::update ( const BeginOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 141 of file PrintGeomMatInfo.cc.

References _dumpLV, _dumpLVList, _dumpLVMatBudget, _dumpLVTree, _dumpMaterial, _dumpPV, _dumpSummary, _dumpTouch, gather_cfg::cout, dumpG4LVList(), dumpG4LVMatBudget(), 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().

142 {
143  theTopPV = getTopPV();
144 
148 
149  //---------- Dump list of objects of each class with detail of parameters
152 
153  //---------- Dump LV and PV information
155 }
G4VPhysicalVolume * getTopPV()
void dumpG4LVTree(std::ostream &out=std::cout)
void dumpMaterialList(std::ostream &out=std::cout)
G4VPhysicalVolume * theTopPV
void dumpG4LVList(std::ostream &out=std::cout)
void dumpG4LVMatBudget(std::ostream &out=std::cout)
void dumpHierarchyTreePVLV(std::ostream &out=std::cout)
void dumpSummary(std::ostream &out=std::cout)
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::vector<double> PrintGeomMatInfo::_areaLayer
private

Definition at line 63 of file PrintGeomMatInfo.h.

Referenced by dumpG4LVLeafWithMat(), and PrintGeomMatInfo().

std::vector<unsigned int> PrintGeomMatInfo::_countsPerLevel
private

Definition at line 64 of file PrintGeomMatInfo.h.

Referenced by dumpG4LVLeafWithMat(), and PrintGeomMatInfo().

bool PrintGeomMatInfo::_dumpAtts
private

Definition at line 55 of file PrintGeomMatInfo.h.

Referenced by dumpLV(), and PrintGeomMatInfo().

unsigned int PrintGeomMatInfo::_dumpIndex
private

Definition at line 67 of file PrintGeomMatInfo.h.

Referenced by dumpG4LVLeafWithMat(), and PrintGeomMatInfo().

bool PrintGeomMatInfo::_dumpIt
private

Definition at line 68 of file PrintGeomMatInfo.h.

Referenced by dumpG4LVLeafWithMat(), and PrintGeomMatInfo().

bool PrintGeomMatInfo::_dumpLV
private

Definition at line 55 of file PrintGeomMatInfo.h.

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

bool PrintGeomMatInfo::_dumpLVList
private

Definition at line 53 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo(), and update().

bool PrintGeomMatInfo::_dumpLVMatBudget
private

Definition at line 53 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo(), and update().

bool PrintGeomMatInfo::_dumpLVTree
private

Definition at line 53 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo(), and update().

bool PrintGeomMatInfo::_dumpMaterial
private

Definition at line 54 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo(), and update().

bool PrintGeomMatInfo::_dumpPV
private

Definition at line 56 of file PrintGeomMatInfo.h.

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

bool PrintGeomMatInfo::_dumpReplica
private

Definition at line 56 of file PrintGeomMatInfo.h.

Referenced by dumpPV(), and PrintGeomMatInfo().

bool PrintGeomMatInfo::_dumpRotation
private

Definition at line 56 of file PrintGeomMatInfo.h.

Referenced by dumpPV(), and PrintGeomMatInfo().

bool PrintGeomMatInfo::_dumpSense
private

Definition at line 55 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo(), and update().

bool PrintGeomMatInfo::_dumpSolid
private

Definition at line 55 of file PrintGeomMatInfo.h.

Referenced by dumpLV(), and PrintGeomMatInfo().

bool PrintGeomMatInfo::_dumpSummary
private

Definition at line 53 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo(), and update().

bool PrintGeomMatInfo::_dumpTouch
private

Definition at line 56 of file PrintGeomMatInfo.h.

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

unsigned int PrintGeomMatInfo::_level2Dump
private

Definition at line 66 of file PrintGeomMatInfo.h.

Referenced by dumpG4LVLeafWithMat(), and PrintGeomMatInfo().

std::vector<std::string> PrintGeomMatInfo::_lvNames2Dump
private

Definition at line 60 of file PrintGeomMatInfo.h.

Referenced by dumpG4LVLeafWithMat(), and PrintGeomMatInfo().

unsigned int PrintGeomMatInfo::_maxLevelsCounted
private

Definition at line 65 of file PrintGeomMatInfo.h.

Referenced by dumpG4LVLeafWithMat(), and PrintGeomMatInfo().

std::vector<double> PrintGeomMatInfo::_radiusLayer
private

Definition at line 61 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo().

std::vector<double> PrintGeomMatInfo::_zLayer
private

Definition at line 62 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo().

G4NavigationHistory PrintGeomMatInfo::fHistory
private

Definition at line 71 of file PrintGeomMatInfo.h.

Referenced by dumpTouch().

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

Definition at line 59 of file PrintGeomMatInfo.h.

Referenced by PrintGeomMatInfo(), and update().

int PrintGeomMatInfo::nchar
private

Definition at line 58 of file PrintGeomMatInfo.h.

Referenced by dumpTouch(), and PrintGeomMatInfo().

mpvpv PrintGeomMatInfo::thePVTree
private

Definition at line 69 of file PrintGeomMatInfo.h.

G4VPhysicalVolume* PrintGeomMatInfo::theTopPV
private

Definition at line 70 of file PrintGeomMatInfo.h.

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