51 G4double edep = aStep->GetTotalEnergyDeposit();
57 if(aStep->GetTrack()->GetDefinition()!=G4Geantino::GeantinoDefinition() && aStep->GetTrack()->GetDefinition()!=G4ChargedGeantino::ChargedGeantinoDefinition())
return false;
61 const G4TouchableHistory *myTouch =
dynamic_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
63 G4cout <<
"BCMSensorSD::ProcessHits bad dynamic_cast" << G4endl;
67 int BEcopyNo = myTouch->GetVolume()->GetCopyNo();
70 G4ThreeVector coord1 = aStep->GetPreStepPoint()->GetPosition();
71 G4ThreeVector coord2 = aStep->GetPostStepPoint()->GetPosition();
76 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
77 G4ThreeVector localPosition1 = transformation.TransformPoint(coord1);
78 G4ThreeVector localPosition2 = transformation.TransformPoint(coord2);
80 HepGeom::Point3D<double> lP1,lP2;
90 if(BEcopyNo == 11950 || BEcopyNo == 11951)
95 if(trHelp.IsPrimary())
97 else if(trHelp.IsRegeneratedPrimary())
99 else if(trHelp.IsSecondary())
101 else if(trHelp.IsRegisteredSecondary())
104 int produced_in_diamond = 0;
105 if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::bcmDiamondLog")
106 produced_in_diamond = 1;
107 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::bcmModLog")
108 produced_in_diamond = 2;
109 else if(aStep->GetTrack()->GetLogicalVolumeAtVertex()->GetName() ==
"Pixel::bcmWallLog")
110 produced_in_diamond = 3;
112 m_HitColl->
Emplace(lP1, lP2, edep, aStep->GetPreStepPoint()->GetGlobalTime(), trHelp.GenerateParticleLink(),
113 0, 0, myTouch->GetVolume(1)->GetCopyNo()-951, BEcopyNo - 11950, primaren, produced_in_diamond);