CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PrintSensitive Class Reference

#include <PrintSensitive.h>

Inheritance diagram for PrintSensitive:
SimWatcher Observer< const BeginOfRun * >

Public Member Functions

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

Private Member Functions

void dumpTouch (G4VPhysicalVolume *pv, unsigned int leafDepth, bool printIt, std::ostream &out=std::cout)
 
G4VPhysicalVolume * getTopPV ()
 
void update (const BeginOfRun *run) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

G4NavigationHistory fHistory
 
std::string name
 
int nchar
 

Additional Inherited Members

Detailed Description

Definition at line 16 of file PrintSensitive.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file PrintSensitive.cc.

References gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.

15  {
16  name = p.getUntrackedParameter<std::string>("Name", "*");
17  nchar = name.find("*");
18  name.assign(name, 0, nchar);
19  std::cout << "PrintSensitive:: Print position of all Sensitive Touchables: "
20  << " for names (0-" << nchar << ") = " << name << "\n";
21 }
std::string name
PrintSensitive::~PrintSensitive ( )
override

Definition at line 23 of file PrintSensitive.cc.

23 {}

Member Function Documentation

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

Definition at line 30 of file PrintSensitive.cc.

References Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.

30  {
31  if (leafDepth == 0)
32  fHistory.SetFirstEntry(pv);
33  else
34  fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
35 
36  G4ThreeVector globalpoint = fHistory.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0, 0, 0));
37  G4LogicalVolume *lv = pv->GetLogicalVolume();
38 
39  std::string mother = "World";
40  if (pv->GetMotherLogical())
41  mother = pv->GetMotherLogical()->GetName();
42  std::string lvname = lv->GetName();
43  lvname.assign(lvname, 0, nchar);
44  if (lvname == name)
45  printIt = true;
46 
47  if (lv->GetSensitiveDetector() && printIt) {
48  out << leafDepth << " ### VOLUME = " << lv->GetName() << " Copy No " << pv->GetCopyNo() << " in " << mother
49  << " global position of centre " << globalpoint << " (r=" << globalpoint.perp()
50  << ", phi=" << globalpoint.phi() / deg << ")\n";
51  }
52 
53  int NoDaughters = lv->GetNoDaughters();
54  while ((NoDaughters--) > 0) {
55  G4VPhysicalVolume *pvD = lv->GetDaughter(NoDaughters);
56  if (!pvD->IsReplicated())
57  dumpTouch(pvD, leafDepth + 1, printIt, out);
58  }
59 
60  if (leafDepth > 0)
61  fHistory.BackLevel();
62 }
std::string name
G4NavigationHistory fHistory
def pv(vc)
Definition: MetAnalyzer.py:7
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, bool printIt, std::ostream &out=std::cout)
G4VPhysicalVolume * PrintSensitive::getTopPV ( )
private

Definition at line 64 of file PrintSensitive.cc.

64  {
65  return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
66 }
void PrintSensitive::update ( const BeginOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 25 of file PrintSensitive.cc.

References gather_cfg::cout.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.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(), MatrixUtil.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().

25  {
26  G4VPhysicalVolume *theTopPV = getTopPV();
27  dumpTouch(theTopPV, 0, false, std::cout);
28 }
G4VPhysicalVolume * getTopPV()
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, bool printIt, std::ostream &out=std::cout)

Member Data Documentation

G4NavigationHistory PrintSensitive::fHistory
private

Definition at line 29 of file PrintSensitive.h.

std::string PrintSensitive::name
private
int PrintSensitive::nchar
private

Definition at line 28 of file PrintSensitive.h.