19 #include "G4ChargedGeantino.hh"
20 #include <G4EventManager.hh>
21 #include "G4Geantino.hh"
22 #include "G4SDManager.hh"
24 #include "G4ThreeVector.hh"
27 #include "CLHEP/Geometry/Transform3D.h"
28 #include "CLHEP/Units/SystemOfUnits.h"
30 #include <GeoModelKernel/GeoFullPhysVol.h>
31 #include <GeoModelRead/ReadGeoModel.h>
37 : G4VSensitiveDetector(
name )
38 , m_HitCollName( hitCollectionName )
47 if(
auto* eventManger = G4EventManager::GetEventManager()){
58 if (verboseLevel>5) G4cout <<
"Process Hit" << G4endl;
60 G4double edep = aStep->GetTotalEnergyDeposit();
63 if(aStep->GetTrack()->GetDefinition() != G4Geantino::GeantinoDefinition() &&
64 aStep->GetTrack()->GetDefinition() != G4ChargedGeantino::ChargedGeantinoDefinition())
72 const G4TouchableHistory *myTouch =
dynamic_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
74 G4cout <<
"PixelSensorGmxSD::ProcessHits bad dynamic_cast" << G4endl;
78 for (
int i=0;
i<myTouch->GetHistoryDepth();
i++){
79 std::string detname=myTouch->GetVolume(
i)->GetLogicalVolume()->GetName();
80 int copyno=myTouch->GetVolume(
i)->GetCopyNo();
81 G4cout <<
"Volume " <<detname <<
" Copy Nr. " << copyno << G4endl;
87 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
88 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
94 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
95 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
96 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
98 HepGeom::Point3D<double> lP1,lP2;
111 std::string physVolName = myTouch->GetVolume(0)->GetName();
119 aStep->GetPreStepPoint()->GetGlobalTime(),
128 int id = myTouch->GetVolume()->GetCopyNo();
133 aStep->GetPreStepPoint()->GetGlobalTime(),