CMS 3D CMS Logo

PrintGeomInfoAction.cc
Go to the documentation of this file.
2 
5 
18 
19 #include "DD4hep/DD4hepUnits.h"
20 #include "DD4hep/Filter.h"
21 
22 #include "G4Run.hh"
23 #include "G4PhysicalVolumeStore.hh"
24 #include "G4LogicalVolumeStore.hh"
25 #include "G4VPhysicalVolume.hh"
26 #include "G4LogicalVolume.hh"
27 #include "G4VSolid.hh"
28 #include "G4Material.hh"
29 #include "G4Track.hh"
30 #include "G4VisAttributes.hh"
31 #include "G4UserLimits.hh"
32 #include "G4TransportationManager.hh"
33 
34 #include <algorithm>
35 #include <fstream>
36 #include <map>
37 #include <set>
38 #include <vector>
39 
41 
43  dumpSummary_ = p.getUntrackedParameter<bool>("DumpSummary", true);
44  dumpLVTree_ = p.getUntrackedParameter<bool>("DumpLVTree", true);
45  dumpLVList_ = p.getUntrackedParameter<bool>("DumpLVList", false);
46  dumpMaterial_ = p.getUntrackedParameter<bool>("DumpMaterial", 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  dd4hep_ = p.getUntrackedParameter<bool>("DD4Hep", false);
56  name_ = p.getUntrackedParameter<std::string>("Name", "*");
57  nchar_ = name_.find('*');
58  name_.assign(name_, 0, nchar_);
59  names_ = p.getUntrackedParameter<std::vector<std::string> >("Names");
60  fileMat_ = p.getUntrackedParameter<std::string>("MaterialFileName", "");
61  fileSolid_ = p.getUntrackedParameter<std::string>("SolidFileName", "");
62  fileLV_ = p.getUntrackedParameter<std::string>("LVFileName", "");
63  filePV_ = p.getUntrackedParameter<std::string>("PVFileName", "");
64  fileTouch_ = p.getUntrackedParameter<std::string>("TouchFileName", "");
65  fileDetail_ = p.getUntrackedParameter<bool>("FileDetail", false);
66  G4cout << "PrintGeomInfoAction:: initialised for dd4hep " << dd4hep_ << " with verbosity levels:"
67  << " Summary " << dumpSummary_ << " LVTree " << dumpLVTree_ << " LVList " << dumpLVList_ << " Material "
68  << dumpMaterial_ << "\n "
69  << " LV " << dumpLV_ << " Solid " << dumpSolid_ << " Attribs " << dumpAtts_
70  << "\n "
71  << " PV " << dumpPV_ << " Rotation " << dumpRotation_ << " Replica " << dumpReplica_
72  << "\n "
73  << " Touchable " << dumpTouch_ << " for names (0-" << nchar_ << ") = " << name_
74  << "\n "
75  << " Sensitive " << dumpSense_ << " Files " << fileMat_ << ":" << fileSolid_ << ":" << fileLV_ << ":"
76  << filePV_ << ":" << fileTouch_ << " FileDetail " << fileDetail_
77  << "\n for " << names_.size() << " names:";
78  for (unsigned int i = 0; i < names_.size(); i++)
79  G4cout << " " << names_[i];
80  G4cout << G4endl;
81 }
82 
84 
86  if (dumpSense_) {
87  if (dd4hep_) {
89  (*job)()->get<IdealGeometryRecord>().get(pDD);
90 
91  G4cout << "PrintGeomInfoAction::Get Printout of Sensitive Volumes "
92  << "for " << names_.size() << " Readout Units" << G4endl;
93  for (unsigned int i = 0; i < names_.size(); i++) {
95  const cms::DDFilter filter("ReadOutName", sd);
96  cms::DDFilteredView fv(*pDD, filter);
97  G4cout << "PrintGeomInfoAction:: Get Filtered view for ReadOutName = " << sd << G4endl;
98  G4cout << "Lengths are in mm, angles in degrees" << G4endl;
99 
100  std::string spaces = spacesFromLeafDepth(1);
101 
102  while (fv.firstChild()) {
103  auto tran = fv.translation() / dd4hep::mm;
104  std::vector<int> copy = fv.copyNos();
105  auto lvname = fv.name();
106  unsigned int leafDepth = copy.size();
107  G4cout << leafDepth << spaces << "### VOLUME = " << lvname << " Copy No";
108  for (unsigned int k = 0; k < leafDepth; ++k)
109  G4cout << " " << copy[k];
110  G4cout << " Centre at " << tran << " (r = " << tran.Rho() << ", phi = " << convertRadToDeg(tran.phi()) << ")"
111  << G4endl;
112  }
113  }
114  } else {
116  (*job)()->get<IdealGeometryRecord>().get(pDD);
117 
118  G4cout << "PrintGeomInfoAction::Get Printout of Sensitive Volumes "
119  << "for " << names_.size() << " Readout Units" << G4endl;
120  for (unsigned int i = 0; i < names_.size(); i++) {
121  std::string attribute = "ReadOutName";
122  std::string sd = names_[i];
124  DDFilteredView fv(*pDD, filter);
125  G4cout << "PrintGeomInfoAction:: Get Filtered view for " << attribute << " = " << sd << G4endl;
126  G4cout << "Lengths are in mm, angles in degrees" << G4endl;
127  bool dodet = fv.firstChild();
128 
129  std::string spaces = spacesFromLeafDepth(1);
130 
131  while (dodet) {
132  const DDLogicalPart &log = fv.logicalPart();
133  std::string lvname = log.name().name();
134  DDTranslation tran = fv.translation();
135  std::vector<int> copy = fv.copyNumbers();
136 
137  unsigned int leafDepth = copy.size();
138  G4cout << leafDepth << spaces << "### VOLUME = " << lvname << " Copy No";
139  for (int k = leafDepth - 1; k >= 0; k--)
140  G4cout << " " << copy[k];
141  G4cout << " Centre at " << tran << " (r = " << tran.Rho() << ", phi = " << convertRadToDeg(tran.phi()) << ")"
142  << G4endl;
143  dodet = fv.next();
144  }
145  }
146  }
147  }
148 }
149 
151  theTopPV_ = getTopPV();
152 
153  if (dumpSummary_)
155  if (dumpLVTree_)
157 
158  //---------- Dump list of objects of each class with detail of parameters
159  if (dumpMaterial_)
161  if (dumpLVList_)
163 
164  //---------- Dump LV and PV information
165  if (dumpLV_ || dumpPV_ || dumpTouch_)
167 
168  dumpInFile();
169 }
170 
172  //---------- Dump number of objects of each class
173  out << " @@@@@@@@@@@@@@@@@@ Dumping G4 geometry objects Summary " << G4endl;
174  if (theTopPV_ == nullptr) {
175  out << " No volume created " << G4endl;
176  return;
177  }
178  out << " @@@ Geometry built inside world volume: " << theTopPV_->GetName() << G4endl;
179  // Get number of solids (< # LV if several LV share a solid)
180  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
181  std::vector<G4LogicalVolume *>::const_iterator lvcite;
182  std::set<G4VSolid *> theSolids;
183  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
184  theSolids.insert((*lvcite)->GetSolid());
185  out << " Number of G4VSolid's: " << theSolids.size() << G4endl;
186  out << " Number of G4LogicalVolume's: " << lvs->size() << G4endl;
187  const G4PhysicalVolumeStore *pvs = G4PhysicalVolumeStore::GetInstance();
188  out << " Number of G4VPhysicalVolume's: " << pvs->size() << G4endl;
189  out << " Number of Touchable's: " << countNoTouchables() << G4endl;
190  const G4MaterialTable *matTab = G4Material::GetMaterialTable();
191  out << " Number of G4Material's: " << matTab->size() << G4endl;
192 }
193 
195  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's List " << G4endl;
196  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
197  std::vector<G4LogicalVolume *>::const_iterator lvcite;
198  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
199  out << "LV:" << (*lvcite)->GetName() << "\tMaterial: " << (*lvcite)->GetMaterial()->GetName() << G4endl;
200 }
201 
203  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's Tree " << G4endl;
204  G4LogicalVolume *lv = getTopLV();
205  dumpG4LVLeaf(lv, 0, 1, out);
206 }
207 
209  out << " @@@@@@@@@@@@@@@@ DUMPING G4Material List ";
210  const G4MaterialTable *matTab = G4Material::GetMaterialTable();
211  out << " with " << matTab->size() << " materials " << G4endl;
212  std::vector<G4Material *>::const_iterator matite;
213  for (matite = matTab->begin(); matite != matTab->end(); matite++)
214  out << "Material: " << (*matite) << G4endl;
215 }
216 
217 void PrintGeomInfoAction::dumpG4LVLeaf(G4LogicalVolume *lv,
218  unsigned int leafDepth,
219  unsigned int count,
220  std::ostream &out) {
221  for (unsigned int ii = 0; ii < leafDepth; ii++)
222  out << " ";
223  out << " LV:(" << leafDepth << ") " << lv->GetName() << " (" << count << ")" << G4endl;
224  //--- If a volume is placed n types as daughter of this LV, it should only be counted once
225  std::map<G4LogicalVolume *, unsigned int> lvCount;
226  std::map<G4LogicalVolume *, unsigned int>::const_iterator cite;
227  int siz = lv->GetNoDaughters();
228  for (int ii = 0; ii < siz; ii++) {
229  cite = lvCount.find(lv->GetDaughter(ii)->GetLogicalVolume());
230  if (cite != lvCount.end())
231  lvCount[cite->first] = (cite->second) + 1;
232  else
233  lvCount.insert(std::pair<G4LogicalVolume *, unsigned int>(lv->GetDaughter(ii)->GetLogicalVolume(), 1));
234  }
235  for (cite = lvCount.begin(); cite != lvCount.end(); cite++)
236  dumpG4LVLeaf((cite->first), leafDepth + 1, (cite->second), out);
237 }
238 
240  int nTouch = 0;
241  G4LogicalVolume *lv = getTopLV();
242  add1touchable(lv, nTouch);
243  return nTouch;
244 }
245 
246 void PrintGeomInfoAction::add1touchable(G4LogicalVolume *lv, int &nTouch) {
247  int siz = lv->GetNoDaughters();
248  for (int ii = 0; ii < siz; ii++)
249  add1touchable(lv->GetDaughter(ii)->GetLogicalVolume(), ++nTouch);
250 }
251 
253  //dumps in the following order:
254  // 1) a LV with details
255  // 2) list of PVs daughters of this LV with details
256  // 3) list of LVs daughters of this LV and for each go to 1)
257 
258  //----- Get top PV
259  G4LogicalVolume *topLV = getTopLV();
260 
261  //----- Dump this leaf (it will recursively dump all the tree)
262  dumpHierarchyLeafPVLV(topLV, 0, out);
263  dumpPV(theTopPV_, 0, out);
264 
265  //----- Dump the touchables (it will recursively dump all the tree)
266  if (dumpTouch_)
267  dumpTouch(theTopPV_, 0, out);
268 }
269 
270 void PrintGeomInfoAction::dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out) {
271  //----- Dump this LV
272  dumpLV(lv, leafDepth, out);
273 
274  //----- Get LV daughters from list of PV daughters
275  mmlvpv lvpvDaughters;
276  std::set<G4LogicalVolume *> lvDaughters;
277  int NoDaughters = lv->GetNoDaughters();
278  while ((NoDaughters--) > 0) {
279  G4VPhysicalVolume *pvD = lv->GetDaughter(NoDaughters);
280  lvpvDaughters.insert(mmlvpv::value_type(pvD->GetLogicalVolume(), pvD));
281  lvDaughters.insert(pvD->GetLogicalVolume());
282  }
283 
284  std::set<G4LogicalVolume *>::const_iterator scite;
285  mmlvpv::const_iterator mmcite;
286 
287  //----- Dump daughters PV and LV
288  for (scite = lvDaughters.begin(); scite != lvDaughters.end(); scite++) {
289  std::pair<mmlvpv::iterator, mmlvpv::iterator> mmER = lvpvDaughters.equal_range(*scite);
290  //----- Dump daughters PV of this LV
291  for (mmcite = mmER.first; mmcite != mmER.second; mmcite++)
292  dumpPV((*mmcite).second, leafDepth + 1, out);
293  //----- Dump daughters LV
294  dumpHierarchyLeafPVLV(*scite, leafDepth + 1, out);
295  }
296 }
297 
298 void PrintGeomInfoAction::dumpLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out) {
299  std::string spaces = spacesFromLeafDepth(leafDepth);
300 
301  //----- dump name
302  if (dumpLV_) {
303  out << leafDepth << spaces << "$$$ VOLUME = " << lv->GetName() << " Solid: " << lv->GetSolid()->GetName()
304  << " MATERIAL: " << lv->GetMaterial()->GetName() << G4endl;
305  if (dumpSolid_)
306  dumpSolid(lv->GetSolid(), leafDepth, out); //----- dump solid
307 
308  //----- dump LV info
309  //--- material
310  if (dumpAtts_) {
311  //--- Visualisation attributes
312  const G4VisAttributes *fVA = lv->GetVisAttributes();
313  if (fVA != nullptr) {
314  out << spaces << " VISUALISATION ATTRIBUTES: " << G4endl;
315  out << spaces << " IsVisible " << fVA->IsVisible() << G4endl;
316  out << spaces << " IsDaughtersInvisible " << fVA->IsDaughtersInvisible() << G4endl;
317  out << spaces << " Colour " << fVA->GetColour() << G4endl;
318  out << spaces << " LineStyle " << fVA->GetLineStyle() << G4endl;
319  out << spaces << " LineWidth " << fVA->GetLineWidth() << G4endl;
320  out << spaces << " IsForceDrawingStyle " << fVA->IsForceDrawingStyle() << G4endl;
321  out << spaces << " ForcedDrawingStyle " << fVA->GetForcedDrawingStyle() << G4endl;
322  }
323 
324  //--- User Limits
325  G4UserLimits *fUL = lv->GetUserLimits();
326  G4Track dummy;
327  if (fUL != nullptr) {
328  out << spaces << " MaxAllowedStep " << fUL->GetMaxAllowedStep(dummy) << G4endl;
329  out << spaces << " UserMaxTrackLength " << fUL->GetUserMaxTrackLength(dummy) << G4endl;
330  out << spaces << " UserMaxTime " << fUL->GetUserMaxTime(dummy) << G4endl;
331  out << spaces << " UserMinEkine " << fUL->GetUserMinEkine(dummy) << G4endl;
332  out << spaces << " UserMinRange " << fUL->GetUserMinRange(dummy) << G4endl;
333  }
334 
335  //--- other LV info
336  if (lv->GetSensitiveDetector())
337  out << spaces << " IS SENSITIVE DETECTOR " << G4endl;
338  if (lv->GetFieldManager())
339  out << spaces << " FIELD ON " << G4endl;
340 
341  // Pointer (possibly NULL) to optimisation info objects.
342  out << spaces << " Quality for optimisation, average number of voxels to be spent per content "
343  << lv->GetSmartless() << G4endl;
344 
345  // Pointer (possibly NULL) to G4FastSimulationManager object.
346  if (lv->GetFastSimulationManager())
347  out << spaces << " Logical Volume is an envelope for a FastSimulationManager " << G4endl;
348  out << spaces << " Weight used in the event biasing technique = " << lv->GetBiasWeight() << G4endl;
349  }
350  }
351 }
352 
353 void PrintGeomInfoAction::dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out) {
354  std::string spaces = spacesFromLeafDepth(leafDepth);
355 
356  //----- PV info
357  if (dumpPV_) {
358  std::string mother = "World";
359  if (pv->GetMotherLogical())
360  mother = pv->GetMotherLogical()->GetName();
361  out << leafDepth << spaces << "### VOLUME = " << pv->GetName() << " Copy No " << pv->GetCopyNo() << " in " << mother
362  << " at " << pv->GetTranslation();
363  }
364  if (!pv->IsReplicated()) {
365  if (dumpPV_) {
366  if (pv->GetRotation() == nullptr)
367  out << " with no rotation" << G4endl;
368  else if (!dumpRotation_)
369  out << " with rotation" << G4endl; //just rotation name
370  else
371  out << " with rotation " << *(pv->GetRotation()) << G4endl;
372  }
373  } else {
374  if (dumpReplica_) {
375  out << spaces << " It is replica: " << G4endl;
376  EAxis axis;
377  int nReplicas;
378  double width;
379  double offset;
380  bool consuming;
381  pv->GetReplicationData(axis, nReplicas, width, offset, consuming);
382  out << spaces << " axis " << axis << G4endl << spaces << " nReplicas " << nReplicas << G4endl;
383  if (pv->GetParameterisation() != nullptr)
384  out << spaces << " It is parameterisation " << G4endl;
385  else
386  out << spaces << " width " << width << G4endl << spaces << " offset " << offset << G4endl << spaces
387  << " consuming" << consuming << G4endl;
388  if (pv->GetParameterisation() != nullptr)
389  out << spaces << " It is parameterisation " << G4endl;
390  }
391  }
392 }
393 
394 void PrintGeomInfoAction::dumpSolid(G4VSolid *sol, unsigned int leafDepth, std::ostream &out) {
395  std::string spaces = spacesFromLeafDepth(leafDepth);
396  out << spaces << *(sol) << G4endl;
397 }
398 
399 void PrintGeomInfoAction::dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out) {
400  std::string spaces = spacesFromLeafDepth(leafDepth);
401  if (leafDepth == 0)
402  fHistory_.SetFirstEntry(pv);
403  else
404  fHistory_.NewLevel(pv, kNormal, pv->GetCopyNo());
405 
406  G4ThreeVector globalpoint = fHistory_.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0, 0, 0));
407  G4LogicalVolume *lv = pv->GetLogicalVolume();
408 
409  std::string mother = "World";
410  if (pv->GetMotherLogical())
411  mother = pv->GetMotherLogical()->GetName();
412  std::string lvname = lv->GetName();
413  lvname.assign(lvname, 0, nchar_);
414  if (lvname == name_)
415  out << leafDepth << spaces << "### VOLUME = " << lv->GetName() << " Copy No " << pv->GetCopyNo() << " in " << mother
416  << " global position of centre " << globalpoint << " (r = " << globalpoint.perp()
417  << ", phi = " << convertRadToDeg(globalpoint.phi()) << ")" << G4endl;
418 
419  int NoDaughters = lv->GetNoDaughters();
420  while ((NoDaughters--) > 0) {
421  G4VPhysicalVolume *pvD = lv->GetDaughter(NoDaughters);
422  if (!pvD->IsReplicated())
423  dumpTouch(pvD, leafDepth + 1, out);
424  }
425 
426  if (leafDepth > 0)
427  fHistory_.BackLevel();
428 }
429 
431  //---------- Dump number objects of each class in a file
432  if (theTopPV_ != nullptr) {
433  if (!fileMat_.empty()) {
434  const G4MaterialTable *matTab = G4Material::GetMaterialTable();
435  std::ofstream fout(fileMat_.c_str());
436  for (std::vector<G4Material *>::const_iterator matite = matTab->begin(); matite != matTab->end(); matite++) {
437  if (!fileDetail_)
438  fout << (*matite)->GetName() << "\n";
439  else
440  fout << (*matite)->GetName() << " " << (*matite)->GetRadlen() << " " << (*matite)->GetNuclearInterLength()
441  << "\n";
442  }
443  fout.close();
444  }
445  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
446  if (!fileSolid_.empty()) {
447  std::ofstream fout(fileSolid_.c_str());
448  for (std::vector<G4LogicalVolume *>::const_iterator lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
449  if (!fileDetail_)
450  fout << (*lvcite)->GetSolid()->GetName() << "\n";
451  else
452  fout << (*lvcite)->GetSolid()->GetName() << " " << (*lvcite)->GetSolid()->GetCubicVolume() << "\n";
453  fout.close();
454  }
455  if (!fileLV_.empty()) {
456  std::ofstream fout(fileLV_.c_str());
457  for (std::vector<G4LogicalVolume *>::const_iterator lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
458  if (!fileDetail_)
459  fout << (*lvcite)->GetName() << "\n";
460  else
461  fout << (*lvcite)->GetName() << " " << (*lvcite)->GetMass(false, false) << "\n";
462  fout.close();
463  }
464  if (!filePV_.empty()) {
465  const G4PhysicalVolumeStore *pvs = G4PhysicalVolumeStore::GetInstance();
466  std::ofstream fout(filePV_.c_str());
467  for (std::vector<G4VPhysicalVolume *>::const_iterator pvcite = pvs->begin(); pvcite != pvs->end(); pvcite++) {
468  if (fileDetail_) {
469  if (dd4hep_)
470  fout << (*pvcite)->GetName() << " " << (*pvcite)->GetTranslation().x() << " "
471  << (*pvcite)->GetTranslation().y() << " " << (*pvcite)->GetTranslation().z() << "\n";
472  else
473  fout << (*pvcite)->GetName() << "_" << (*pvcite)->GetCopyNo() << " " << (*pvcite)->GetTranslation().x()
474  << " " << (*pvcite)->GetTranslation().y() << " " << (*pvcite)->GetTranslation().z() << "\n";
475  } else {
476  if (dd4hep_)
477  fout << (*pvcite)->GetName() << "\n";
478  else
479  fout << (*pvcite)->GetName() << "_" << (*pvcite)->GetCopyNo() << "\n";
480  }
481  }
482  fout.close();
483  }
484  if (!fileTouch_.empty()) {
485  std::ofstream fout(fileTouch_.c_str());
486  std::vector<std::string> touches;
487  getTouch(theTopPV_, 0, 1, touches);
488  std::sort(touches.begin(), touches.end());
489  for (const auto &touch : touches)
490  fout << touch << "\n";
491  fout.close();
492  }
493  }
494 }
495 
496 void PrintGeomInfoAction::getTouch(G4VPhysicalVolume *pv,
497  unsigned int leafDepth,
498  unsigned int copym,
499  std::vector<std::string> &touches) {
500  if (leafDepth == 0)
501  fHistory_.SetFirstEntry(pv);
502  else
503  fHistory_.NewLevel(pv, kNormal, pv->GetCopyNo());
504 
505  std::string mother = "World";
506  if (pv->GetMotherLogical())
507  mother = static_cast<std::string>(dd4hep::dd::noNamespace(pv->GetMotherLogical()->GetName()));
508 
509  G4LogicalVolume *lv = pv->GetLogicalVolume();
510  std::string lvname = static_cast<std::string>(dd4hep::dd::noNamespace(lv->GetName()));
511  unsigned int copy = static_cast<unsigned int>(pv->GetCopyNo());
512 
513  std::string name = lvname + ":" + std::to_string(copy) + "_" + mother + ":" + std::to_string(copym);
514  touches.emplace_back(name);
515 
516  int NoDaughters = lv->GetNoDaughters();
517  while ((NoDaughters--) > 0) {
518  G4VPhysicalVolume *pvD = lv->GetDaughter(NoDaughters);
519  if (!pvD->IsReplicated())
520  getTouch(pvD, leafDepth + 1, copy, touches);
521  }
522 
523  if (leafDepth > 0)
524  fHistory_.BackLevel();
525 }
526 
528  std::string spaces;
529  unsigned int ii;
530  for (ii = 0; ii < leafDepth; ii++) {
531  spaces += " ";
532  }
533  return spaces;
534 }
535 
536 G4VPhysicalVolume *PrintGeomInfoAction::getTopPV() {
537  return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
538 }
539 
540 G4LogicalVolume *PrintGeomInfoAction::getTopLV() { return theTopPV_->GetLogicalVolume(); }
PrintGeomInfoAction::fileSolid_
std::string fileSolid_
Definition: PrintGeomInfoAction.h:57
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
PrintGeomInfoAction::names_
std::vector< std::string > names_
Definition: PrintGeomInfoAction.h:59
mps_fire.i
i
Definition: mps_fire.py:428
ESTransientHandle.h
mmlvpv
std::multimap< G4LogicalVolume *, G4VPhysicalVolume *, std::less< G4LogicalVolume * > > mmlvpv
Definition: PrintGeomInfoAction.h:19
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
BeginOfJob.h
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
PrintGeomInfoAction::dumpTouch
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:399
PrintGeomInfoAction.h
PrintGeomInfoAction::dumpSolid
void dumpSolid(G4VSolid *sol, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:394
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
DDSplit.h
PrintGeomInfoAction::filePV_
std::string filePV_
Definition: PrintGeomInfoAction.h:57
DDFilteredView::copyNumbers
nav_type copyNumbers() const
return the stack of copy numbers
Definition: DDFilteredView.cc:193
PrintGeomInfoAction::getTopPV
G4VPhysicalVolume * getTopPV()
Definition: PrintGeomInfoAction.cc:536
PrintGeomInfoAction::dumpTouch_
bool dumpTouch_
Definition: PrintGeomInfoAction.h:53
PrintGeomInfoAction::dumpPV_
bool dumpPV_
Definition: PrintGeomInfoAction.h:52
PrintGeomInfoAction::dumpG4LVList
void dumpG4LVList(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:194
cms::DDFilteredView
Definition: DDFilteredView.h:70
PrintGeomInfoAction::getTopLV
G4LogicalVolume * getTopLV()
Definition: PrintGeomInfoAction.cc:540
DDCompactView.h
PrintGeomInfoAction::dumpReplica_
bool dumpReplica_
Definition: PrintGeomInfoAction.h:53
PrintGeomInfoAction::add1touchable
void add1touchable(G4LogicalVolume *lv, int &nTouch)
Definition: PrintGeomInfoAction.cc:246
cms::DDFilteredView::name
std::string_view name() const
Definition: DDFilteredView.cc:857
cms::DDFilteredView::translation
const Translation translation() const
Definition: DDFilteredView.cc:103
PrintGeomInfoAction::dumpPV
void dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:353
BeginOfRun.h
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDFilteredView.h
cms::DDFilter
Definition: DDFilteredView.h:59
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
PrintGeomInfoAction::fileMat_
std::string fileMat_
Definition: PrintGeomInfoAction.h:57
DDFilteredView::next
bool next()
set current node to the next node in the filtered tree
Definition: DDFilteredView.cc:67
cms::DDFilteredView::copyNos
const std::vector< int > copyNos() const
The list of the volume copy numbers.
Definition: DDFilteredView.cc:89
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
PrintGeomInfoAction::dd4hep_
bool dd4hep_
Definition: PrintGeomInfoAction.h:54
DDFilteredView.h
PrintGeomInfoAction::~PrintGeomInfoAction
~PrintGeomInfoAction() override
Definition: PrintGeomInfoAction.cc:83
BeginOfJob
Definition: BeginOfJob.h:8
DDCompactView.h
PrintGeomInfoAction::nchar_
int nchar_
Definition: PrintGeomInfoAction.h:56
PrintGeomInfoAction::dumpLVList_
bool dumpLVList_
Definition: PrintGeomInfoAction.h:51
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
PrintGeomInfoAction::update
void update(const BeginOfJob *job) override
This routine will be called when the appropriate signal arrives.
Definition: PrintGeomInfoAction.cc:85
PrintGeomInfoAction::getTouch
void getTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, unsigned int copym, std::vector< std::string > &touches)
Definition: PrintGeomInfoAction.cc:496
DDValue.h
PrintGeomInfoAction::dumpSense_
bool dumpSense_
Definition: PrintGeomInfoAction.h:54
PrintGeomInfoAction::dumpG4LVLeaf
void dumpG4LVLeaf(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:217
PrintGeomInfoAction::dumpLV_
bool dumpLV_
Definition: PrintGeomInfoAction.h:52
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PrintGeomInfoAction::PrintGeomInfoAction
PrintGeomInfoAction(edm::ParameterSet const &p)
Definition: PrintGeomInfoAction.cc:42
PrintGeomInfoAction::dumpRotation_
bool dumpRotation_
Definition: PrintGeomInfoAction.h:53
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
PrintGeomInfoAction::dumpSolid_
bool dumpSolid_
Definition: PrintGeomInfoAction.h:52
groupFilesInBlocks.fout
fout
Definition: groupFilesInBlocks.py:162
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
DDFilter.h
PrintGeomInfoAction::dumpLVTree_
bool dumpLVTree_
Definition: PrintGeomInfoAction.h:51
BeginOfRun
Definition: BeginOfRun.h:6
IdealGeometryRecord.h
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
PrintGeomInfoAction::dumpSummary_
bool dumpSummary_
Definition: PrintGeomInfoAction.h:51
DDLogicalPart.h
FSQDQM_cfi.pvs
pvs
Definition: FSQDQM_cfi.py:12
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
PrintGeomInfoAction::dumpMaterial_
bool dumpMaterial_
Definition: PrintGeomInfoAction.h:51
PrintGeomInfoAction::dumpMaterialList
void dumpMaterialList(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:208
PrintGeomInfoAction::dumpHierarchyTreePVLV
void dumpHierarchyTreePVLV(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:252
writedatasetfile.run
run
Definition: writedatasetfile.py:27
PrintGeomInfoAction::dumpSummary
void dumpSummary(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:171
DDValue
Definition: DDValue.h:22
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
PrintGeomInfoAction::dumpLV
void dumpLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:298
PrintGeomInfoAction::fHistory_
G4NavigationHistory fHistory_
Definition: PrintGeomInfoAction.h:61
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventSetup.h
PrintGeomInfoAction::dumpHierarchyLeafPVLV
void dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:270
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
sd
double sd
Definition: CascadeWrapper.h:113
DDFilteredView
Definition: DDFilteredView.h:20
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
PrintGeomInfoAction::spacesFromLeafDepth
std::string spacesFromLeafDepth(unsigned int leafDepth)
Definition: PrintGeomInfoAction.cc:527
PrintGeomInfoAction::fileLV_
std::string fileLV_
Definition: PrintGeomInfoAction.h:57
PrintGeomInfoAction::dumpG4LVTree
void dumpG4LVTree(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:202
dummy
Definition: DummySelector.h:38
ecalTB2006H4_GenSimDigiReco_cfg.G4cout
G4cout
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:285
PrintGeomInfoAction::name_
std::string name_
Definition: PrintGeomInfoAction.h:55
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
angle_units.h
PrintGeomInfoAction::theTopPV_
G4VPhysicalVolume * theTopPV_
Definition: PrintGeomInfoAction.h:60
PrintGeomInfoAction::fileDetail_
bool fileDetail_
Definition: PrintGeomInfoAction.h:58
cuy.ii
ii
Definition: cuy.py:589
PrintGeomInfoAction::dumpAtts_
bool dumpAtts_
Definition: PrintGeomInfoAction.h:52
PrintGeomInfoAction::dumpInFile
void dumpInFile()
Definition: PrintGeomInfoAction.cc:430
PrintGeomInfoAction::countNoTouchables
int countNoTouchables()
Definition: PrintGeomInfoAction.cc:239
PrintGeomInfoAction::fileTouch_
std::string fileTouch_
Definition: PrintGeomInfoAction.h:57