64 G4LogicalVolume* LogicalVolumeAtDepth = path[depth]->GetLogicalVolume();
66 std::string volName(path[depth]->GetName());
67 if( volName.find(
"volAuxDet") != std::string::npos &&
68 volName.find(
"Sensitive") != std::string::npos){
71 G4Point3D
local(0., 0., 0.);
72 G4Point3D world = DepthToWorld *
local;
73 double worldPos[3] = { world.x() / CLHEP::cm, world.y() / CLHEP::cm, world.z() / CLHEP::cm };
77 fGeo->FindAuxDetSensitiveAtPosition(worldPos, adNum, svNum);
82 MF_LOG_DEBUG(
"AuxDetReadoutGeometry") <<
"found" << path[depth]->GetName()
83 <<
", number " << adNum <<
":" << svNum;
86 (G4SDManager::GetSDMpointer())->AddNewDetector(adReadout);
87 LogicalVolumeAtDepth->SetSensitiveDetector(adReadout);
94 unsigned int deeper = depth+1;
95 if(deeper >= path.size()){
96 throw cet::exception(
"AuxDetReadoutGeometry") <<
"exceeded maximum TGeoNode depth\n";
100 G4int nd = LogicalVolumeAtDepth->GetNoDaughters();
101 for(
int d = 0; d < nd; ++d){
104 path[deeper] = LogicalVolumeAtDepth->GetDaughter(d);
107 G4Transform3D DeeperToMother( path[deeper]->GetObjectRotationValue(),
108 path[deeper]->GetObjectTranslation() );
109 G4Transform3D DeeperToWorld = DepthToWorld * DeeperToMother;
uint32_t fNumSensitiveVol
number of sensitive volumes
art::ServiceHandle< geo::Geometry const > fGeo
Handle to the geometry.
std::string to_string(WindowPattern const &pattern)
void FindAndMakeAuxDetSensitive(std::vector< const G4VPhysicalVolume * > &path, unsigned int depth, G4Transform3D DepthToWorld)