21 #include "G4ThreeVector.hh"
22 #include "G4Geantino.hh"
23 #include "G4ChargedGeantino.hh"
26 #include "CLHEP/Geometry/Transform3D.h"
27 #include "CLHEP/Units/SystemOfUnits.h"
32 : G4VSensitiveDetector(
name )
33 , m_HitColl( hitCollectionName )
46 G4double edep = aStep->GetTotalEnergyDeposit();
52 if(aStep->GetTrack()->GetDefinition()!=G4Geantino::GeantinoDefinition() && aStep->GetTrack()->GetDefinition()!=G4ChargedGeantino::ChargedGeantinoDefinition())
return false;
56 const G4TouchableHistory *myTouch =
dynamic_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
58 G4cout <<
"BCMSensorSD::ProcessHits bad dynamic_cast" << G4endl;
62 int BEcopyNo = myTouch->GetVolume()->GetCopyNo();
65 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
66 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
71 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
72 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
73 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
75 HepGeom::Point3D<double> lP1,lP2;
85 if(BEcopyNo == 11950 || BEcopyNo == 11951)
99 int produced_in_diamond = 0;
100 if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::bcmDiamondLog")
101 produced_in_diamond = 1;
102 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::bcmModLog")
103 produced_in_diamond = 2;
104 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::bcmWallLog")
105 produced_in_diamond = 3;
108 0, 0, myTouch->GetVolume(1)->GetCopyNo()-951, BEcopyNo - 11950, primaren, produced_in_diamond);