5 #include "DD4hep/Filter.h"
6 #include "G4TransportationManager.hh"
7 #include "G4Navigator.hh"
8 #include "G4VTouchable.hh"
9 #include "G4TouchableHistory.hh"
10 #include "G4VSensitiveDetector.hh"
15 : alreadySet_(
false), geomDet_(&det) {}
22 G4Navigator* theStdNavigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
23 G4Navigator theNavigator;
24 theNavigator.SetWorldVolume(theStdNavigator->GetWorldVolume());
26 std::vector<const GeometricDet*> allSensitiveDets;
29 <<
" TouchableTo History: got " << allSensitiveDets.size() <<
" sensitive detectors from GeometricDet.";
31 for (
auto& theSD : allSensitiveDets) {
32 auto const&
t = theSD->translation();
33 theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(
t.x(),
t.y(),
t.z()));
34 G4TouchableHistory*
hist = theNavigator.CreateTouchableHistory();
40 LogDebug(
"TrackerSimDebugNumbering") <<
" INSERTING LV " << hist->GetVolume()->GetLogicalVolume()->GetName()
42 << hist->GetVolume()->GetLogicalVolume()->GetSensitiveDetector()->GetName()
47 <<
" TrackerG4SimHitNumberingScheme: mapped " <<
directMap_.size() <<
" detectors to Geant4.";
49 if (
directMap_.size() != allSensitiveDets.size()) {
50 edm::LogError(
"TrackerSimInfoNumbering") <<
" ERROR: GeomDet sensitive detectors do not match Geant4 ones.";
52 <<
" cannot resolve structure of tracking sensitive detectors";
59 std::vector<int> debugint;
60 std::vector<std::string> debugstring;
62 int levels = v->GetHistoryDepth();
65 if (dd4hep::dd::noNamespace(v->GetVolume(
k)->GetLogicalVolume()->GetName()) !=
"TOBInactive") {
67 std::pair<int, std::string>(v->GetVolume(
k)->GetCopyNo(), v->GetVolume(
k)->GetLogicalVolume()->GetName()));
69 debugint.emplace_back(v->GetVolume(
k)->GetCopyNo());
70 debugstring.emplace_back(v->GetVolume(
k)->GetLogicalVolume()->GetName());
75 LogDebug(
"TrackerSimDebugNumbering") <<
" G4 TrackerG4SimHitNumberingScheme " << debugint.size();
76 for (u_int32_t
jj = 0;
jj < debugstring.size();
jj++)
77 LogDebug(
"TrackerSimDebugNumbering") <<
" " << debugstring[
jj];
97 int levels = v->GetHistoryDepth();
99 LogDebug(
"TrackerSimDebugNumbering") <<
" NAME : " << v->GetVolume()->GetLogicalVolume()->GetName();
101 LogDebug(
"TrackerSimInfoNumbering") <<
" Hist: " << v->GetVolume(
k)->GetLogicalVolume()->GetName() <<
" Copy "
102 << v->GetVolume(
k)->GetCopyNo();
Log< level::Info, true > LogVerbatim
void dumpG4VPV(const G4VTouchable *)
const GeometricDet * geomDet_
Log< level::Error, false > LogError
unsigned int g4ToNumberingScheme(const G4VTouchable *)
std::vector< std::pair< int, std::string > > Nav_Story
TrackerG4SimHitNumberingScheme(const GeometricDet &)
ConstGeometricDetContainer deepComponents() const
void touchToNavStory(const G4VTouchable *, Nav_Story &)