18 #include "G4ThreeVector.hh"
19 #include "G4Geantino.hh"
20 #include "G4ChargedGeantino.hh"
23 #include "CLHEP/Geometry/Transform3D.h"
24 #include "CLHEP/Units/SystemOfUnits.h"
29 : G4VSensitiveDetector(
name )
30 , m_HitColl( hitCollectionName )
43 G4double edep = aStep->GetTotalEnergyDeposit();
49 if(aStep->GetTrack()->GetDefinition()!=G4Geantino::GeantinoDefinition() && aStep->GetTrack()->GetDefinition()!=G4ChargedGeantino::ChargedGeantinoDefinition())
return false;
53 const G4TouchableHistory *myTouch =
dynamic_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
55 G4cout <<
"BLMSensorSD::ProcessHits bad dynamic_cast" << G4endl;
58 int BEcopyNo = myTouch->GetVolume()->GetCopyNo();
61 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
62 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
67 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
68 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
69 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
71 HepGeom::Point3D<double> lP1,lP2;
95 int produced_in_diamond = 0;
96 if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::blmDiamondLog")
97 produced_in_diamond = 1;
98 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::blmModLog")
99 produced_in_diamond = 2;
100 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::blmWallLog")
101 produced_in_diamond = 3;
104 0, 0, myTouch->GetVolume(1)->GetCopyNo()-222, 0, primaren, produced_in_diamond);