8 #include "G4TransportationManager.hh"
9 #include "G4Navigator.hh"
10 #include "G4VTouchable.hh"
11 #include "G4TouchableHistory.hh"
21 G4Navigator* theStdNavigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
22 G4Navigator theNavigator;
23 theNavigator.SetWorldVolume(theStdNavigator->GetWorldVolume());
26 std::vector<const GeometricDet*> allSensitiveDets;
28 edm::LogInfo(
"TrackerSimInfoNumbering")<<
" TouchableTo History: got "<<allSensitiveDets.size()<<
" sensitive detectors from TrackerMapDDDtoID.";
30 for ( std::vector<const GeometricDet*>::const_iterator it = allSensitiveDets.begin();
31 it != allSensitiveDets.end();
35 theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(),t.y(),t.z()));
36 G4TouchableHistory *
hist = theNavigator.CreateTouchableHistory();
43 myMap[st] =
nav_type((*it)->navType().begin(),(*it)->navType().end());
59 edm::LogInfo(
"TrackerSimInfoNumbering")<<
" TouchableToHistory: mapped "<<
myDirectMap.size()<<
" detectors to G4.";
62 edm::LogError(
"TrackerSimInfoNumbering")<<
" ERROR: DDD sensitive detectors do not match Geant4 ones.";
86 G4Navigator* theStdNavigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
87 G4Navigator theNavigator;
88 theNavigator.SetWorldVolume(theStdNavigator->GetWorldVolume());
90 theNavigator.LocateGlobalPointAndSetup(G4ThreeVector(t.x(),t.y(),t.z()));
91 G4TouchableHistory*
hist = theNavigator.CreateTouchableHistory();
98 static G4String tobinactive(
"TOBInactive");
101 std::vector<int> debugint;
102 std::vector<std::string> debugstring;
104 int levels = v->GetHistoryDepth();
106 for (
int k=0;
k<=levels;
k++){
107 if (v->GetVolume(
k)->GetLogicalVolume()->GetName() != tobinactive) {
109 std::pair<int,std::string>
110 (v->GetVolume(
k)->GetCopyNo(),
111 v->GetVolume(
k)->GetLogicalVolume()->GetName()));
113 debugint.push_back(v->GetVolume(
k)->GetCopyNo());
114 debugstring.push_back(v->GetVolume(
k)->GetLogicalVolume()->GetName());
120 for(u_int32_t jj=0;jj<debugstring.size();jj++)
LogDebug(
"TrackerSimDebugNumbering")<<
" "<<debugstring[jj];
146 int levels = v->GetHistoryDepth();
148 LogDebug(
"TrackerSimDebugNumbering")<<
" NAME : "<<v->GetVolume()->GetLogicalVolume()->GetName();
149 for (
int k=0;
k<=levels;
k++){
150 LogDebug(
"TrackerSimInfoNumbering") <<
" Hist: "<< v->GetVolume(
k)->GetLogicalVolume()->GetName()<<
151 " Copy "<< v->GetVolume(
k)->GetCopyNo();
DirectMapType myDirectMap
DDFilteredView & getFilteredView(const G4VTouchable &, DDFilteredView &)
nav_type touchableToNavType(const G4VTouchable *)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
bool goTo(const nav_type &)
const GeometricDet * myGeomDet
std::vector< int > nav_type
Nav_Story getNavStory(DDFilteredView &)
Nav_Story touchableToNavStory(const G4VTouchable *)
void dumpG4VPV(const G4VTouchable *)
std::vector< std::pair< int, std::string > > Nav_Story
ConstGeometricDetContainer deepComponents() const
nav_type getNavType(const G4VTouchable &)
const DDTranslation & translation() const
The absolute translation of the current node.
int touchableToInt(const G4VTouchable *)