40{
42 const G4StepPoint *preStep=aStep->GetPreStepPoint();
43 const G4VPhysicalVolume *preVol=preStep->GetPhysicalVolume();
44 const G4StepPoint *postStep=aStep->GetPostStepPoint();
45 const G4VPhysicalVolume *postVol=postStep->GetPhysicalVolume();
46
47 if (preVol==postVol) { return false; }
48
49 const G4Track *
track(aStep->GetTrack());
50
51
52 int pdgcode = (
track->GetDefinition())?
track->GetDefinition()->GetPDGEncoding():0;
53 if (
track->GetDefinition() == G4Geantino::Definition() ) pdgcode=999;
54 if (
track->GetDefinition() == G4ChargedGeantino::Definition() ) pdgcode=998;
55
56
57 G4ThreeVector
pos=postStep->GetPosition();
58 G4ThreeVector
mom=postStep->GetMomentum();
59
61 {
62
63 const G4TouchableHistory* touchHist = static_cast<const G4TouchableHistory*>(preStep->GetTouchable());
64 const G4AffineTransform trans =
track->GetTouchable()->GetHistory()->GetTopTransform();
65 G4ThreeVector localPos=trans.TransformPoint(pos);
66 G4ThreeVector localMom=
mom;
67 trans.ApplyAxisTransform(localMom);
68 const G4VSolid *shape= touchHist->GetSolid();
69 const G4ThreeVector normal=shape->SurfaceNormal(localPos);
70
71 if(normal.dot(localPos)>=0.) return false;
72 }
73
74
75 const double ener=postStep->GetTotalEnergy();
76
77
78 const double time=postStep->GetGlobalTime();
79
80
81 TrackHelper trHelp(track);
82 const int barcode = trHelp.GetBarcode();
83 const int id = trHelp.GetUniqueID();
84 const int status = trHelp.GetStatus();
85
86
88 status,
89 ener,
90 mom,
91 pos,
92 time,
93 barcode,
94 id,
95 preVol->GetName());
96}
bool AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
time(flags, cells_name, *args, **kw)
const std::string barcode