6 #include "G4VPhysicalVolume.hh" 7 #include "G4LogicalVolume.hh" 8 #include "G4TransportationManager.hh" 13 using namespace CLHEP;
17 nchar =
name.find(
"*");
19 std::cout <<
"PrintSensitive:: Print position of all Sensitive Touchables: " 20 <<
" for names (0-" << nchar <<
") = " <<
name <<
"\n";
26 G4VPhysicalVolume *theTopPV = getTopPV();
32 fHistory.SetFirstEntry(pv);
34 fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
36 G4ThreeVector globalpoint = fHistory.GetTopTransform().Inverse().TransformPoint(G4ThreeVector(0, 0, 0));
37 G4LogicalVolume *lv = pv->GetLogicalVolume();
40 if (pv->GetMotherLogical())
41 mother = pv->GetMotherLogical()->GetName();
43 lvname.assign(lvname, 0, nchar);
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";
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);
65 return G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume();
T getUntrackedParameter(std::string const &, T const &) const
PrintSensitive(edm::ParameterSet const &p)
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
G4VPhysicalVolume * getTopPV()
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, bool printIt, std::ostream &out=std::cout)
~PrintSensitive() override