CMS 3D CMS Logo

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 () override
 
- 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) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *run) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

bool dd4hep_
 
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_
 
G4VPhysicalVolume * theTopPV_
 

Additional Inherited Members

Detailed Description

Definition at line 23 of file PrintGeomInfoAction.h.

Constructor & Destructor Documentation

◆ PrintGeomInfoAction()

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

Definition at line 33 of file PrintGeomInfoAction.cc.

33  {
34  dumpSummary_ = p.getUntrackedParameter<bool>("DumpSummary", true);
35  dumpLVTree_ = p.getUntrackedParameter<bool>("DumpLVTree", true);
36  dumpLVList_ = p.getUntrackedParameter<bool>("DumpLVList", false);
37  dumpMaterial_ = p.getUntrackedParameter<bool>("DumpMaterial", 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  dd4hep_ = p.getUntrackedParameter<bool>("DD4Hep", false);
47  name_ = p.getUntrackedParameter<std::string>("Name", "*");
48  nchar_ = name_.find("*");
49  name_.assign(name_, 0, nchar_);
50  names_ = p.getUntrackedParameter<std::vector<std::string> >("Names");
51  G4cout << "PrintGeomInfoAction:: initialised for dd4hep " << dd4hep_ << " with verbosity levels:"
52  << " Summary " << dumpSummary_ << " LVTree " << dumpLVTree_ << " LVList " << dumpLVList_ << " Material "
53  << dumpMaterial_ << "\n "
54  << " LV " << dumpLV_ << " Solid " << dumpSolid_ << " Attribs " << dumpAtts_
55  << "\n "
56  << " PV " << dumpPV_ << " Rotation " << dumpRotation_ << " Replica " << dumpReplica_
57  << "\n "
58  << " Touchable " << dumpTouch_ << " for names (0-" << nchar_ << ") = " << name_
59  << "\n "
60  << " Sensitive " << dumpSense_ << " for " << names_.size() << " names:";
61  for (unsigned int i = 0; i < names_.size(); i++)
62  G4cout << " " << names_[i];
63  G4cout << G4endl;
64 }

References dd4hep_, dumpAtts_, dumpLV_, dumpLVList_, dumpLVTree_, dumpMaterial_, dumpPV_, dumpReplica_, dumpRotation_, dumpSense_, dumpSolid_, dumpSummary_, dumpTouch_, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, mps_fire::i, name_, names_, nchar_, AlCaHLTBitMon_ParallelJobs::p, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~PrintGeomInfoAction()

PrintGeomInfoAction::~PrintGeomInfoAction ( )
override

Definition at line 66 of file PrintGeomInfoAction.cc.

66 {}

Member Function Documentation

◆ add1touchable()

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

Definition at line 225 of file PrintGeomInfoAction.cc.

225  {
226  int siz = lv->GetNoDaughters();
227  for (int ii = 0; ii < siz; ii++)
228  add1touchable(lv->GetDaughter(ii)->GetLogicalVolume(), ++nTouch);
229 }

References cuy::ii.

Referenced by countNoTouchables().

◆ countNoTouchables()

int PrintGeomInfoAction::countNoTouchables ( )
private

Definition at line 218 of file PrintGeomInfoAction.cc.

218  {
219  int nTouch = 0;
220  G4LogicalVolume *lv = getTopLV();
221  add1touchable(lv, nTouch);
222  return nTouch;
223 }

References add1touchable(), and getTopLV().

Referenced by dumpSummary().

◆ dumpG4LVLeaf()

void PrintGeomInfoAction::dumpG4LVLeaf ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
unsigned int  count,
std::ostream &  out = std::cout 
)
private

Definition at line 196 of file PrintGeomInfoAction.cc.

199  {
200  for (unsigned int ii = 0; ii < leafDepth; ii++)
201  out << " ";
202  out << " LV:(" << leafDepth << ") " << lv->GetName() << " (" << count << ")" << G4endl;
203  //--- If a volume is placed n types as daughter of this LV, it should only be counted once
204  std::map<G4LogicalVolume *, unsigned int> lvCount;
205  std::map<G4LogicalVolume *, unsigned int>::const_iterator cite;
206  int siz = lv->GetNoDaughters();
207  for (int ii = 0; ii < siz; ii++) {
208  cite = lvCount.find(lv->GetDaughter(ii)->GetLogicalVolume());
209  if (cite != lvCount.end())
210  lvCount[cite->first] = (cite->second) + 1;
211  else
212  lvCount.insert(std::pair<G4LogicalVolume *, unsigned int>(lv->GetDaughter(ii)->GetLogicalVolume(), 1));
213  }
214  for (cite = lvCount.begin(); cite != lvCount.end(); cite++)
215  dumpG4LVLeaf((cite->first), leafDepth + 1, (cite->second), out);
216 }

References KineDebug3::count(), cuy::ii, and MillePedeFileConverter_cfg::out.

Referenced by dumpG4LVTree().

◆ dumpG4LVList()

void PrintGeomInfoAction::dumpG4LVList ( std::ostream &  out = std::cout)
private

Definition at line 173 of file PrintGeomInfoAction.cc.

173  {
174  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's List " << G4endl;
175  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
176  std::vector<G4LogicalVolume *>::const_iterator lvcite;
177  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
178  out << "LV:" << (*lvcite)->GetName() << "\tMaterial: " << (*lvcite)->GetMaterial()->GetName() << G4endl;
179 }

References MillePedeFileConverter_cfg::out.

Referenced by update().

◆ dumpG4LVTree()

void PrintGeomInfoAction::dumpG4LVTree ( std::ostream &  out = std::cout)
private

Definition at line 181 of file PrintGeomInfoAction.cc.

181  {
182  out << " @@@@@@@@@@@@@@@@ DUMPING G4LogicalVolume's Tree " << G4endl;
183  G4LogicalVolume *lv = getTopLV();
184  dumpG4LVLeaf(lv, 0, 1, out);
185 }

References dumpG4LVLeaf(), getTopLV(), and MillePedeFileConverter_cfg::out.

Referenced by update().

◆ dumpHierarchyLeafPVLV()

void PrintGeomInfoAction::dumpHierarchyLeafPVLV ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 249 of file PrintGeomInfoAction.cc.

249  {
250  //----- Dump this LV
251  dumpLV(lv, leafDepth, out);
252 
253  //----- Get LV daughters from list of PV daughters
254  mmlvpv lvpvDaughters;
255  std::set<G4LogicalVolume *> lvDaughters;
256  int NoDaughters = lv->GetNoDaughters();
257  while ((NoDaughters--) > 0) {
258  G4VPhysicalVolume *pvD = lv->GetDaughter(NoDaughters);
259  lvpvDaughters.insert(mmlvpv::value_type(pvD->GetLogicalVolume(), pvD));
260  lvDaughters.insert(pvD->GetLogicalVolume());
261  }
262 
263  std::set<G4LogicalVolume *>::const_iterator scite;
264  mmlvpv::const_iterator mmcite;
265 
266  //----- Dump daughters PV and LV
267  for (scite = lvDaughters.begin(); scite != lvDaughters.end(); scite++) {
268  std::pair<mmlvpv::iterator, mmlvpv::iterator> mmER = lvpvDaughters.equal_range(*scite);
269  //----- Dump daughters PV of this LV
270  for (mmcite = mmER.first; mmcite != mmER.second; mmcite++)
271  dumpPV((*mmcite).second, leafDepth + 1, out);
272  //----- Dump daughters LV
273  dumpHierarchyLeafPVLV(*scite, leafDepth + 1, out);
274  }
275 }

References dumpLV(), dumpPV(), and MillePedeFileConverter_cfg::out.

Referenced by dumpHierarchyTreePVLV().

◆ dumpHierarchyTreePVLV()

void PrintGeomInfoAction::dumpHierarchyTreePVLV ( std::ostream &  out = std::cout)
private

Definition at line 231 of file PrintGeomInfoAction.cc.

231  {
232  //dumps in the following order:
233  // 1) a LV with details
234  // 2) list of PVs daughters of this LV with details
235  // 3) list of LVs daughters of this LV and for each go to 1)
236 
237  //----- Get top PV
238  G4LogicalVolume *topLV = getTopLV();
239 
240  //----- Dump this leaf (it will recursively dump all the tree)
241  dumpHierarchyLeafPVLV(topLV, 0, out);
242  dumpPV(theTopPV_, 0, out);
243 
244  //----- Dump the touchables (it will recursively dump all the tree)
245  if (dumpTouch_)
246  dumpTouch(theTopPV_, 0, out);
247 }

References dumpHierarchyLeafPVLV(), dumpPV(), dumpTouch(), dumpTouch_, getTopLV(), MillePedeFileConverter_cfg::out, and theTopPV_.

Referenced by update().

◆ dumpLV()

void PrintGeomInfoAction::dumpLV ( G4LogicalVolume *  lv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 277 of file PrintGeomInfoAction.cc.

277  {
278  std::string spaces = spacesFromLeafDepth(leafDepth);
279 
280  //----- dump name
281  if (dumpLV_) {
282  out << leafDepth << spaces << "$$$ VOLUME = " << lv->GetName() << " Solid: " << lv->GetSolid()->GetName()
283  << " MATERIAL: " << lv->GetMaterial()->GetName() << G4endl;
284  if (dumpSolid_)
285  dumpSolid(lv->GetSolid(), leafDepth, out); //----- dump solid
286 
287  //----- dump LV info
288  //--- material
289  if (dumpAtts_) {
290  //--- Visualisation attributes
291  const G4VisAttributes *fVA = lv->GetVisAttributes();
292  if (fVA != nullptr) {
293  out << spaces << " VISUALISATION ATTRIBUTES: " << G4endl;
294  out << spaces << " IsVisible " << fVA->IsVisible() << G4endl;
295  out << spaces << " IsDaughtersInvisible " << fVA->IsDaughtersInvisible() << G4endl;
296  out << spaces << " Colour " << fVA->GetColour() << G4endl;
297  out << spaces << " LineStyle " << fVA->GetLineStyle() << G4endl;
298  out << spaces << " LineWidth " << fVA->GetLineWidth() << G4endl;
299  out << spaces << " IsForceDrawingStyle " << fVA->IsForceDrawingStyle() << G4endl;
300  out << spaces << " ForcedDrawingStyle " << fVA->GetForcedDrawingStyle() << G4endl;
301  }
302 
303  //--- User Limits
304  G4UserLimits *fUL = lv->GetUserLimits();
305  G4Track dummy;
306  if (fUL != nullptr) {
307  out << spaces << " MaxAllowedStep " << fUL->GetMaxAllowedStep(dummy) << G4endl;
308  out << spaces << " UserMaxTrackLength " << fUL->GetUserMaxTrackLength(dummy) << G4endl;
309  out << spaces << " UserMaxTime " << fUL->GetUserMaxTime(dummy) << G4endl;
310  out << spaces << " UserMinEkine " << fUL->GetUserMinEkine(dummy) << G4endl;
311  out << spaces << " UserMinRange " << fUL->GetUserMinRange(dummy) << G4endl;
312  }
313 
314  //--- other LV info
315  if (lv->GetSensitiveDetector())
316  out << spaces << " IS SENSITIVE DETECTOR " << G4endl;
317  if (lv->GetFieldManager())
318  out << spaces << " FIELD ON " << G4endl;
319 
320  // Pointer (possibly NULL) to optimisation info objects.
321  out << spaces << " Quality for optimisation, average number of voxels to be spent per content "
322  << lv->GetSmartless() << G4endl;
323 
324  // Pointer (possibly NULL) to G4FastSimulationManager object.
325  if (lv->GetFastSimulationManager())
326  out << spaces << " Logical Volume is an envelope for a FastSimulationManager " << G4endl;
327  out << spaces << " Weight used in the event biasing technique = " << lv->GetBiasWeight() << G4endl;
328  }
329  }
330 }

References dumpAtts_, dumpLV_, dumpSolid(), dumpSolid_, MillePedeFileConverter_cfg::out, spacesFromLeafDepth(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dumpHierarchyLeafPVLV().

◆ dumpMaterialList()

void PrintGeomInfoAction::dumpMaterialList ( std::ostream &  out = std::cout)
private

Definition at line 187 of file PrintGeomInfoAction.cc.

187  {
188  out << " @@@@@@@@@@@@@@@@ DUMPING G4Material List ";
189  const G4MaterialTable *matTab = G4Material::GetMaterialTable();
190  out << " with " << matTab->size() << " materials " << G4endl;
191  std::vector<G4Material *>::const_iterator matite;
192  for (matite = matTab->begin(); matite != matTab->end(); matite++)
193  out << "Material: " << (*matite) << G4endl;
194 }

References MillePedeFileConverter_cfg::out.

Referenced by update().

◆ dumpPV()

void PrintGeomInfoAction::dumpPV ( G4VPhysicalVolume *  pv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 332 of file PrintGeomInfoAction.cc.

332  {
333  std::string spaces = spacesFromLeafDepth(leafDepth);
334 
335  //----- PV info
336  if (dumpPV_) {
337  std::string mother = "World";
338  if (pv->GetMotherLogical())
339  mother = pv->GetMotherLogical()->GetName();
340  out << leafDepth << spaces << "### VOLUME = " << pv->GetName() << " Copy No " << pv->GetCopyNo() << " in " << mother
341  << " at " << pv->GetTranslation();
342  }
343  if (!pv->IsReplicated()) {
344  if (dumpPV_) {
345  if (pv->GetRotation() == nullptr)
346  out << " with no rotation" << G4endl;
347  else if (!dumpRotation_)
348  out << " with rotation" << G4endl; //just rotation name
349  else
350  out << " with rotation " << *(pv->GetRotation()) << G4endl;
351  }
352  } else {
353  if (dumpReplica_) {
354  out << spaces << " It is replica: " << G4endl;
355  EAxis axis;
356  int nReplicas;
357  double width;
358  double offset;
359  bool consuming;
360  pv->GetReplicationData(axis, nReplicas, width, offset, consuming);
361  out << spaces << " axis " << axis << G4endl << spaces << " nReplicas " << nReplicas << G4endl;
362  if (pv->GetParameterisation() != nullptr)
363  out << spaces << " It is parameterisation " << G4endl;
364  else
365  out << spaces << " width " << width << G4endl << spaces << " offset " << offset << G4endl << spaces
366  << " consuming" << consuming << G4endl;
367  if (pv->GetParameterisation() != nullptr)
368  out << spaces << " It is parameterisation " << G4endl;
369  }
370  }
371 }

References dumpPV_, dumpReplica_, dumpRotation_, hltrates_dqm_sourceclient-live_cfg::offset, MillePedeFileConverter_cfg::out, MetAnalyzer::pv(), spacesFromLeafDepth(), AlCaHLTBitMon_QueryRunRegistry::string, and ApeEstimator_cff::width.

Referenced by dumpHierarchyLeafPVLV(), and dumpHierarchyTreePVLV().

◆ dumpSolid()

void PrintGeomInfoAction::dumpSolid ( G4VSolid *  sol,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 413 of file PrintGeomInfoAction.cc.

413  {
414  std::string spaces = spacesFromLeafDepth(leafDepth);
415  out << spaces << *(sol) << G4endl;
416 }

References MillePedeFileConverter_cfg::out, spacesFromLeafDepth(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dumpLV().

◆ dumpSummary()

void PrintGeomInfoAction::dumpSummary ( std::ostream &  out = std::cout)
private

Definition at line 150 of file PrintGeomInfoAction.cc.

150  {
151  //---------- Dump number of objects of each class
152  out << " @@@@@@@@@@@@@@@@@@ Dumping G4 geometry objects Summary " << G4endl;
153  if (theTopPV_ == nullptr) {
154  out << " No volume created " << G4endl;
155  return;
156  }
157  out << " @@@ Geometry built inside world volume: " << theTopPV_->GetName() << G4endl;
158  // Get number of solids (< # LV if several LV share a solid)
159  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
160  std::vector<G4LogicalVolume *>::const_iterator lvcite;
161  std::set<G4VSolid *> theSolids;
162  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
163  theSolids.insert((*lvcite)->GetSolid());
164  out << " Number of G4VSolid's: " << theSolids.size() << G4endl;
165  out << " Number of G4LogicalVolume's: " << lvs->size() << G4endl;
166  const G4PhysicalVolumeStore *pvs = G4PhysicalVolumeStore::GetInstance();
167  out << " Number of G4VPhysicalVolume's: " << pvs->size() << G4endl;
168  out << " Number of Touchable's: " << countNoTouchables() << G4endl;
169  const G4MaterialTable *matTab = G4Material::GetMaterialTable();
170  out << " Number of G4Material's: " << matTab->size() << G4endl;
171 }

References countNoTouchables(), MillePedeFileConverter_cfg::out, FSQDQM_cfi::pvs, and theTopPV_.

Referenced by update().

◆ dumpTouch()

void PrintGeomInfoAction::dumpTouch ( G4VPhysicalVolume *  pv,
unsigned int  leafDepth,
std::ostream &  out = std::cout 
)
private

Definition at line 373 of file PrintGeomInfoAction.cc.

373  {
374  std::string spaces = spacesFromLeafDepth(leafDepth);
375  if (leafDepth == 0)
376  fHistory_.SetFirstEntry(pv);
377  else
378  fHistory_.NewLevel(pv, kNormal, pv->GetCopyNo());
379 
380  G4ThreeVector globalpoint = fHistory_.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0, 0, 0));
381  G4LogicalVolume *lv = pv->GetLogicalVolume();
382 
383  std::string mother = "World";
384  if (pv->GetMotherLogical())
385  mother = pv->GetMotherLogical()->GetName();
386  std::string lvname = lv->GetName();
387  lvname.assign(lvname, 0, nchar_);
388  if (lvname == name_)
389  out << leafDepth << spaces << "### VOLUME = " << lv->GetName() << " Copy No " << pv->GetCopyNo() << " in " << mother
390  << " global position of centre " << globalpoint << " (r = " << globalpoint.perp()
391  << ", phi = " << globalpoint.phi() / CLHEP::deg << ")" << G4endl;
392 
393  int NoDaughters = lv->GetNoDaughters();
394  while ((NoDaughters--) > 0) {
395  G4VPhysicalVolume *pvD = lv->GetDaughter(NoDaughters);
396  if (!pvD->IsReplicated())
397  dumpTouch(pvD, leafDepth + 1, out);
398  }
399 
400  if (leafDepth > 0)
401  fHistory_.BackLevel();
402 }

References fHistory_, name_, nchar_, MillePedeFileConverter_cfg::out, MetAnalyzer::pv(), spacesFromLeafDepth(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dumpHierarchyTreePVLV().

◆ getTopLV()

G4LogicalVolume * PrintGeomInfoAction::getTopLV ( )
private

Definition at line 422 of file PrintGeomInfoAction.cc.

422 { return theTopPV_->GetLogicalVolume(); }

References theTopPV_.

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

◆ getTopPV()

G4VPhysicalVolume * PrintGeomInfoAction::getTopPV ( )
private

Definition at line 418 of file PrintGeomInfoAction.cc.

418  {
419  return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
420 }

Referenced by update().

◆ spacesFromLeafDepth()

std::string PrintGeomInfoAction::spacesFromLeafDepth ( unsigned int  leafDepth)
private

Definition at line 404 of file PrintGeomInfoAction.cc.

404  {
405  std::string spaces;
406  unsigned int ii;
407  for (ii = 0; ii < leafDepth; ii++) {
408  spaces += " ";
409  }
410  return spaces;
411 }

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

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

◆ update() [1/2]

void PrintGeomInfoAction::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 68 of file PrintGeomInfoAction.cc.

68  {
69  if (dumpSense_) {
70  if (dd4hep_) {
72  (*job)()->get<IdealGeometryRecord>().get(pDD);
73 
74  G4cout << "PrintGeomInfoAction::Get Printout of Sensitive Volumes "
75  << "for " << names_.size() << " Readout Units" << G4endl;
76  for (unsigned int i = 0; i < names_.size(); i++) {
78  const cms::DDFilter filter("ReadOutName", sd);
79  cms::DDFilteredView fv(*pDD, filter);
80  G4cout << "PrintGeomInfoAction:: Get Filtered view for ReadOutName = " << sd << G4endl;
81 
82  std::string spaces = spacesFromLeafDepth(1);
83 
84  while (fv.firstChild()) {
85  auto tran = fv.translation();
86  std::vector<int> copy = fv.copyNos();
87  auto lvname = fv.name();
88  unsigned int leafDepth = copy.size();
89  G4cout << leafDepth << spaces << "### VOLUME = " << lvname << " Copy No";
90  for (unsigned int k = 0; k < leafDepth; ++k)
91  G4cout << " " << copy[k];
92  G4cout << " Centre at " << tran << " (r = " << tran.Rho() << ", phi = " << tran.phi() / CLHEP::deg << ")"
93  << G4endl;
94  }
95  }
96  } else {
98  (*job)()->get<IdealGeometryRecord>().get(pDD);
99 
100  G4cout << "PrintGeomInfoAction::Get Printout of Sensitive Volumes "
101  << "for " << names_.size() << " Readout Units" << G4endl;
102  for (unsigned int i = 0; i < names_.size(); i++) {
103  std::string attribute = "ReadOutName";
104  std::string sd = names_[i];
106  DDFilteredView fv(*pDD, filter);
107  G4cout << "PrintGeomInfoAction:: Get Filtered view for " << attribute << " = " << sd << G4endl;
108  bool dodet = fv.firstChild();
109 
110  std::string spaces = spacesFromLeafDepth(1);
111 
112  while (dodet) {
113  const DDLogicalPart &log = fv.logicalPart();
114  std::string lvname = log.name().name();
115  DDTranslation tran = fv.translation();
116  std::vector<int> copy = fv.copyNumbers();
117 
118  unsigned int leafDepth = copy.size();
119  G4cout << leafDepth << spaces << "### VOLUME = " << lvname << " Copy No";
120  for (int k = leafDepth - 1; k >= 0; k--)
121  G4cout << " " << copy[k];
122  G4cout << " Centre at " << tran << " (r = " << tran.Rho() << ", phi = " << tran.phi() / CLHEP::deg << ")"
123  << G4endl;
124  dodet = fv.next();
125  }
126  }
127  }
128  }
129 }

References filterCSVwithJSON::copy, cms::DDFilteredView::copyNos(), DDFilteredView::copyNumbers(), dd4hep_, dumpSense_, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), cms::DDFilteredView::firstChild(), ecalTB2006H4_GenSimDigiReco_cfg::G4cout, mps_fire::i, dqmdumpme::k, dqm-mbProfile::log, DDFilteredView::logicalPart(), cms::DDFilteredView::name(), names_, DDFilteredView::next(), sd, spacesFromLeafDepth(), AlCaHLTBitMon_QueryRunRegistry::string, DDFilteredView::translation(), and cms::DDFilteredView::translation().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

◆ update() [2/2]

void PrintGeomInfoAction::update ( const BeginOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 131 of file PrintGeomInfoAction.cc.

131  {
132  theTopPV_ = getTopPV();
133 
134  if (dumpSummary_)
136  if (dumpLVTree_)
138 
139  //---------- Dump list of objects of each class with detail of parameters
140  if (dumpMaterial_)
142  if (dumpLVList_)
144 
145  //---------- Dump LV and PV information
146  if (dumpLV_ || dumpPV_ || dumpTouch_)
148 }

References dumpG4LVList(), dumpG4LVTree(), dumpHierarchyTreePVLV(), dumpLV_, dumpLVList_, dumpLVTree_, dumpMaterial_, dumpMaterialList(), dumpPV_, dumpSummary(), dumpSummary_, dumpTouch_, ecalTB2006H4_GenSimDigiReco_cfg::G4cout, getTopPV(), and theTopPV_.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

Member Data Documentation

◆ dd4hep_

bool PrintGeomInfoAction::dd4hep_
private

Definition at line 52 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

◆ dumpAtts_

bool PrintGeomInfoAction::dumpAtts_
private

Definition at line 50 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), and PrintGeomInfoAction().

◆ dumpLV_

bool PrintGeomInfoAction::dumpLV_
private

Definition at line 50 of file PrintGeomInfoAction.h.

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

◆ dumpLVList_

bool PrintGeomInfoAction::dumpLVList_
private

Definition at line 49 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

◆ dumpLVTree_

bool PrintGeomInfoAction::dumpLVTree_
private

Definition at line 49 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

◆ dumpMaterial_

bool PrintGeomInfoAction::dumpMaterial_
private

Definition at line 49 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

◆ dumpPV_

bool PrintGeomInfoAction::dumpPV_
private

Definition at line 50 of file PrintGeomInfoAction.h.

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

◆ dumpReplica_

bool PrintGeomInfoAction::dumpReplica_
private

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), and PrintGeomInfoAction().

◆ dumpRotation_

bool PrintGeomInfoAction::dumpRotation_
private

Definition at line 51 of file PrintGeomInfoAction.h.

Referenced by dumpPV(), and PrintGeomInfoAction().

◆ dumpSense_

bool PrintGeomInfoAction::dumpSense_
private

Definition at line 52 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

◆ dumpSolid_

bool PrintGeomInfoAction::dumpSolid_
private

Definition at line 50 of file PrintGeomInfoAction.h.

Referenced by dumpLV(), and PrintGeomInfoAction().

◆ dumpSummary_

bool PrintGeomInfoAction::dumpSummary_
private

Definition at line 49 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

◆ dumpTouch_

bool PrintGeomInfoAction::dumpTouch_
private

Definition at line 51 of file PrintGeomInfoAction.h.

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

◆ fHistory_

G4NavigationHistory PrintGeomInfoAction::fHistory_
private

Definition at line 57 of file PrintGeomInfoAction.h.

Referenced by dumpTouch().

◆ name_

std::string PrintGeomInfoAction::name_
private

Definition at line 53 of file PrintGeomInfoAction.h.

Referenced by dumpTouch(), and PrintGeomInfoAction().

◆ names_

std::vector<std::string> PrintGeomInfoAction::names_
private

Definition at line 55 of file PrintGeomInfoAction.h.

Referenced by PrintGeomInfoAction(), and update().

◆ nchar_

int PrintGeomInfoAction::nchar_
private

Definition at line 54 of file PrintGeomInfoAction.h.

Referenced by dumpTouch(), and PrintGeomInfoAction().

◆ theTopPV_

G4VPhysicalVolume* PrintGeomInfoAction::theTopPV_
private

Definition at line 56 of file PrintGeomInfoAction.h.

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

ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
PrintGeomInfoAction::names_
std::vector< std::string > names_
Definition: PrintGeomInfoAction.h:55
mps_fire.i
i
Definition: mps_fire.py:355
mmlvpv
std::multimap< G4LogicalVolume *, G4VPhysicalVolume *, std::less< G4LogicalVolume * > > mmlvpv
Definition: PrintGeomInfoAction.h:19
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
PrintGeomInfoAction::dumpTouch
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:373
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PrintGeomInfoAction::dumpSolid
void dumpSolid(G4VSolid *sol, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:413
PrintGeomInfoAction::getTopPV
G4VPhysicalVolume * getTopPV()
Definition: PrintGeomInfoAction.cc:418
PrintGeomInfoAction::dumpTouch_
bool dumpTouch_
Definition: PrintGeomInfoAction.h:51
PrintGeomInfoAction::dumpPV_
bool dumpPV_
Definition: PrintGeomInfoAction.h:50
PrintGeomInfoAction::dumpG4LVList
void dumpG4LVList(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:173
cms::DDFilteredView
Definition: DDFilteredView.h:65
PrintGeomInfoAction::getTopLV
G4LogicalVolume * getTopLV()
Definition: PrintGeomInfoAction.cc:422
PrintGeomInfoAction::dumpReplica_
bool dumpReplica_
Definition: PrintGeomInfoAction.h:51
PrintGeomInfoAction::add1touchable
void add1touchable(G4LogicalVolume *lv, int &nTouch)
Definition: PrintGeomInfoAction.cc:225
PrintGeomInfoAction::dumpPV
void dumpPV(G4VPhysicalVolume *pv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:332
cms::DDFilter
Definition: DDFilteredView.h:54
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
PrintGeomInfoAction::dd4hep_
bool dd4hep_
Definition: PrintGeomInfoAction.h:52
PrintGeomInfoAction::nchar_
int nchar_
Definition: PrintGeomInfoAction.h:54
PrintGeomInfoAction::dumpLVList_
bool dumpLVList_
Definition: PrintGeomInfoAction.h:49
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
PrintGeomInfoAction::dumpSense_
bool dumpSense_
Definition: PrintGeomInfoAction.h:52
PrintGeomInfoAction::dumpG4LVLeaf
void dumpG4LVLeaf(G4LogicalVolume *lv, unsigned int leafDepth, unsigned int count, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:196
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PrintGeomInfoAction::dumpLV_
bool dumpLV_
Definition: PrintGeomInfoAction.h:50
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
PrintGeomInfoAction::dumpRotation_
bool dumpRotation_
Definition: PrintGeomInfoAction.h:51
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
PrintGeomInfoAction::dumpSolid_
bool dumpSolid_
Definition: PrintGeomInfoAction.h:50
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
PrintGeomInfoAction::dumpLVTree_
bool dumpLVTree_
Definition: PrintGeomInfoAction.h:49
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
PrintGeomInfoAction::dumpSummary_
bool dumpSummary_
Definition: PrintGeomInfoAction.h:49
FSQDQM_cfi.pvs
pvs
Definition: FSQDQM_cfi.py:12
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
PrintGeomInfoAction::dumpMaterial_
bool dumpMaterial_
Definition: PrintGeomInfoAction.h:49
PrintGeomInfoAction::dumpMaterialList
void dumpMaterialList(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:187
PrintGeomInfoAction::dumpHierarchyTreePVLV
void dumpHierarchyTreePVLV(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:231
PrintGeomInfoAction::dumpSummary
void dumpSummary(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:150
DDValue
Definition: DDValue.h:21
PrintGeomInfoAction::dumpLV
void dumpLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:277
PrintGeomInfoAction::fHistory_
G4NavigationHistory fHistory_
Definition: PrintGeomInfoAction.h:57
PrintGeomInfoAction::dumpHierarchyLeafPVLV
void dumpHierarchyLeafPVLV(G4LogicalVolume *lv, unsigned int leafDepth, std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:249
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:404
PrintGeomInfoAction::dumpG4LVTree
void dumpG4LVTree(std::ostream &out=std::cout)
Definition: PrintGeomInfoAction.cc:181
dummy
Definition: DummySelector.h:38
ecalTB2006H4_GenSimDigiReco_cfg.G4cout
G4cout
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:303
PrintGeomInfoAction::name_
std::string name_
Definition: PrintGeomInfoAction.h:53
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
PrintGeomInfoAction::theTopPV_
G4VPhysicalVolume * theTopPV_
Definition: PrintGeomInfoAction.h:56
cuy.ii
ii
Definition: cuy.py:590
PrintGeomInfoAction::dumpAtts_
bool dumpAtts_
Definition: PrintGeomInfoAction.h:50
PrintGeomInfoAction::countNoTouchables
int countNoTouchables()
Definition: PrintGeomInfoAction.cc:218