18 #include <G4EventManager.hh>
20 #include "G4ThreeVector.hh"
21 #include "G4Geantino.hh"
22 #include "G4ChargedGeantino.hh"
25 #include "CLHEP/Geometry/Transform3D.h"
26 #include "CLHEP/Units/SystemOfUnits.h"
30 : G4VSensitiveDetector(
name )
31 , m_HitCollName( hitCollectionName )
40 if(
auto* eventManger = G4EventManager::GetEventManager()){
49 G4double edep = aStep->GetTotalEnergyDeposit();
55 if(aStep->GetTrack()->GetDefinition()!=G4Geantino::GeantinoDefinition() && aStep->GetTrack()->GetDefinition()!=G4ChargedGeantino::ChargedGeantinoDefinition())
return false;
59 const G4TouchableHistory *myTouch =
dynamic_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
61 G4cout <<
"BLMSensorSD::ProcessHits bad dynamic_cast" << G4endl;
64 int BEcopyNo = myTouch->GetVolume()->GetCopyNo();
67 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
68 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
73 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
74 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
75 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
77 HepGeom::Point3D<double> lP1,lP2;
101 int produced_in_diamond = 0;
102 if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::blmDiamondLog")
103 produced_in_diamond = 1;
104 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::blmModLog")
105 produced_in_diamond = 2;
106 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::blmWallLog")
107 produced_in_diamond = 3;
110 0, 0, myTouch->GetVolume(1)->GetCopyNo()-222, 0, primaren, produced_in_diamond);