7 #include "G4VPhysicalVolume.hh"
8 #include "G4LogicalVolume.hh"
9 #include "G4NavigationHistory.hh"
10 #include "G4TransportationManager.hh"
24 int dumpTouch(G4VPhysicalVolume *
pv,
unsigned int leafDepth,
bool printIt,
int ns, std::ostream &
out = G4cout);
37 G4cout <<
"PrintSensitive:: Print position of all Sensitive Touchables: "
38 <<
" for names (0-" << nchar_ <<
") = " <<
name_ << G4endl;
44 G4VPhysicalVolume *theTopPV =
getTopPV();
45 int nsens =
dumpTouch(theTopPV, 0,
false, 0, G4cout);
46 G4cout <<
"\nTotal number of sensitive detector volumes for " <<
name_ <<
" is " << nsens << G4endl;
53 fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
56 G4ThreeVector globalpoint =
fHistory.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0, 0, 0));
57 G4LogicalVolume *lv = pv->GetLogicalVolume();
60 if (pv->GetMotherLogical())
61 mother = pv->GetMotherLogical()->GetName();
63 lvname.assign(lvname, 0,
nchar_);
67 if (lv->GetSensitiveDetector() &&
printIt) {
69 out << nsens <<
":" << leafDepth <<
" ### VOLUME = " << lv->GetName() <<
" Copy No " << pv->GetCopyNo() <<
" in "
70 << mother <<
" global position of centre " << globalpoint <<
" (r=" << globalpoint.perp()
71 <<
", phi=" << globalpoint.phi() / CLHEP::deg <<
")\n";
74 int NoDaughters = lv->GetNoDaughters();
75 while ((NoDaughters--) > 0) {
76 G4VPhysicalVolume *pvD = lv->GetDaughter(NoDaughters);
77 if (!pvD->IsReplicated())
78 nsens =
dumpTouch(pvD, leafDepth + 1, printIt, nsens, out);
87 return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_SIMWATCHER(type)
G4NavigationHistory fHistory
PrintSensitive(edm::ParameterSet const &p)
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
G4VPhysicalVolume * getTopPV()
int dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, bool printIt, int ns, std::ostream &out=G4cout)
~PrintSensitive() override
__host__ __device__ void printIt(C *m, const char *prefix="")