test
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
PrintSensitive Class Reference

#include <PrintSensitive.h>

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

Public Member Functions

 PrintSensitive (edm::ParameterSet const &p)
 
 ~PrintSensitive ()
 
- 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)
 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 16 of file PrintSensitive.cc.

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

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

Definition at line 24 of file PrintSensitive.cc.

24 {}

Member Function Documentation

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

Definition at line 32 of file PrintSensitive.cc.

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

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

Definition at line 65 of file PrintSensitive.cc.

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 26 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().

26  {
27 
28  G4VPhysicalVolume * theTopPV = getTopPV();
29  dumpTouch(theTopPV, 0, false, std::cout);
30 }
G4VPhysicalVolume * getTopPV()
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, bool printIt, std::ostream &out=std::cout)
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

G4NavigationHistory PrintSensitive::fHistory
private

Definition at line 34 of file PrintSensitive.h.

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

Definition at line 33 of file PrintSensitive.h.