10 #include "G4TransportationManager.hh" 11 #include "G4Navigator.hh" 12 #include "G4VTouchable.hh" 13 #include "G4TouchableHistory.hh" 14 #include "G4VSensitiveDetector.hh" 20 : alreadySet(
false), myCompactView(&cpv), myGeomDet(&det) {
30 G4Navigator* theStdNavigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
31 G4Navigator theNavigator;
32 theNavigator.SetWorldVolume(theStdNavigator->GetWorldVolume());
34 std::vector<const GeometricDet*> allSensitiveDets;
37 <<
" TouchableTo History: got "<<allSensitiveDets.size()
38 <<
" sensitive detectors from TrackerMapDDDtoID.";
40 for (
auto & theSD : allSensitiveDets)
43 theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(),t.y(),t.z()));
44 G4TouchableHistory *
hist = theNavigator.CreateTouchableHistory();
48 myMap[st] =
Nav_type(theSD->navType().begin(),theSD->navType().end());
52 <<
" INSERTING LV " <<hist->GetVolume()->GetLogicalVolume()->GetName()
53 <<
" SD: "<<hist->GetVolume()->GetLogicalVolume()->GetSensitiveDetector()->GetName()
54 <<
" Now size is "<<myDirectMap.size();
58 <<
" TrackerG4SimHitNumberingScheme: mapped "<<
myDirectMap.size()<<
" detectors to Geant4.";
62 <<
" ERROR: DDD sensitive detectors do not match Geant4 ones.";
64 <<
" cannot resolve structure of tracking sensitive detectors";
97 G4Navigator* theStdNavigator =
98 G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
99 G4Navigator theNavigator;
100 theNavigator.SetWorldVolume(theStdNavigator->GetWorldVolume());
102 theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(),t.y(),t.z()));
103 G4TouchableHistory*
hist = theNavigator.CreateTouchableHistory();
111 std::vector<int> debugint;
112 std::vector<std::string> debugstring;
114 int levels = v->GetHistoryDepth();
117 if (v->GetVolume(
k)->GetLogicalVolume()->GetName() !=
"TOBInactive") {
118 st.push_back(std::pair<int,std::string>
119 (v->GetVolume(
k)->GetCopyNo(),
120 v->GetVolume(
k)->GetLogicalVolume()->GetName()));
122 debugint.push_back(v->GetVolume(
k)->GetCopyNo());
123 debugstring.push_back(v->GetVolume(
k)->GetLogicalVolume()->GetName());
128 LogDebug(
"TrackerSimDebugNumbering")<<
" G4 TrackerG4SimHitNumberingScheme "<< debugint;
129 for(u_int32_t
jj=0;
jj<debugstring.size();
jj++)
LogDebug(
"TrackerSimDebugNumbering")<<
" "<<debugstring[
jj];
162 int levels = v->GetHistoryDepth();
164 LogDebug(
"TrackerSimDebugNumbering")<<
" NAME : "<<v->GetVolume()->GetLogicalVolume()->GetName();
166 LogDebug(
"TrackerSimInfoNumbering") <<
" Hist: "<< v->GetVolume(
k)->GetLogicalVolume()->GetName()<<
167 " Copy "<< v->GetVolume(
k)->GetCopyNo();
std::vector< int > Nav_type
TrackerG4SimHitNumberingScheme(const DDCompactView &, const GeometricDet &)
Nav_type & touchableToNavType(const G4VTouchable *)
void dumpG4VPV(const G4VTouchable *)
type of data representation of DDCompactView
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
bool goTo(const nav_type &)
~TrackerG4SimHitNumberingScheme()
std::vector< std::pair< int, std::string > > Nav_Story
unsigned int g4ToNumberingScheme(const G4VTouchable *)
Nav_type & getNavType(const G4VTouchable &)
ConstGeometricDetContainer deepComponents() const
void getNavStory(DDFilteredView &, Nav_Story &)
DirectMapType myDirectMap
const DDTranslation & translation() const
The absolute translation of the current node.
const GeometricDet * myGeomDet
const DDFilteredView & getFilteredView(const G4VTouchable &, DDFilteredView &)
void touchToNavStory(const G4VTouchable *, Nav_Story &)