7 #include "G4VPhysicalVolume.hh"
8 #include "G4LogicalVolume.hh"
9 #include "G4TransportationManager.hh"
18 std::cout <<
"PrintSensitive:: Print position of all Sensitive Touchables: "
19 <<
" for names (0-" << nchar <<
") = " <<
name <<
"\n";
26 G4VPhysicalVolume * theTopPV =
getTopPV();
31 bool printIt, std::ostream &
out) {
33 if (leafDepth == 0)
fHistory.SetFirstEntry(pv);
34 else fHistory.NewLevel(pv, kNormal, pv->GetCopyNo());
36 G4ThreeVector globalpoint =
fHistory.GetTopTransform().Inverse().
37 TransformPoint(G4ThreeVector(0,0,0));
38 G4LogicalVolume * lv = pv->GetLogicalVolume();
40 std::string mother =
"World";
41 if (pv->GetMotherLogical()) mother = pv->GetMotherLogical()->GetName();
42 std::string lvname = lv->GetName();
43 lvname.assign(lvname,0,
nchar);
44 if (lvname ==
name) printIt =
true;
46 if (lv->GetSensitiveDetector() && printIt) {
47 out << leafDepth <<
" ### VOLUME = " << lv->GetName()
48 <<
" Copy No " << pv->GetCopyNo() <<
" in " << mother
49 <<
" global position of centre " << globalpoint <<
" (r="
50 << globalpoint.perp() <<
", phi=" << globalpoint.phi()/deg
54 int NoDaughters = lv->GetNoDaughters();
55 while ((NoDaughters--)>0) {
56 G4VPhysicalVolume * pvD = lv->GetDaughter(NoDaughters);
57 if (!pvD->IsReplicated())
dumpTouch(pvD, leafDepth+1, printIt, out);
60 if (leafDepth > 0)
fHistory.BackLevel();
64 return G4TransportationManager::GetTransportationManager()
65 ->GetNavigatorForTracking()->GetWorldVolume();
T getUntrackedParameter(std::string const &, T const &) const
G4NavigationHistory fHistory
PrintSensitive(edm::ParameterSet const &p)
G4VPhysicalVolume * getTopPV()
void dumpTouch(G4VPhysicalVolume *pv, unsigned int leafDepth, bool printIt, std::ostream &out=std::cout)
void update(const BeginOfRun *run)
This routine will be called when the appropriate signal arrives.