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;
92 if(trHelp.IsPrimary())
94 else if(trHelp.IsRegeneratedPrimary())
96 else if(trHelp.IsSecondary())
98 else if(trHelp.IsRegisteredSecondary())
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;
109 m_HitColl->
Emplace(lP1, lP2, edep, aStep->GetPreStepPoint()->GetGlobalTime(), trHelp.GenerateParticleLink(),
110 0, 0, myTouch->GetVolume(1)->GetCopyNo()-222, 0, primaren, produced_in_diamond);