#include <TrackFastSimSD.h>
Definition at line 23 of file TrackFastSimSD.h.
◆ TrackFastSimSD()
TrackFastSimSD::TrackFastSimSD |
( |
const std::string & |
name, |
|
|
const std::string & |
outputCollectionName, |
|
|
const int |
SD_type = 0 |
|
) |
| |
◆ ~TrackFastSimSD()
TrackFastSimSD::~TrackFastSimSD |
( |
| ) |
|
|
inline |
◆ AddHit()
template<class... Args>
void TrackFastSimSD::AddHit |
( |
Args &&... |
args | ) |
|
|
inline |
Templated method to stuff a single hit into the sensitive detector class.
This could get rather tricky, but the idea is to allow fast simulations to use the very same SD classes as the standard simulation.
Definition at line 38 of file TrackFastSimSD.h.
◆ Initialize()
void TrackFastSimSD::Initialize |
( |
G4HCofThisEvent * |
| ) |
|
|
finaloverride |
◆ ProcessHits()
G4bool TrackFastSimSD::ProcessHits |
( |
G4Step * |
aStep, |
|
|
G4TouchableHistory * |
|
|
) |
| |
|
finaloverride |
Definition at line 35 of file TrackFastSimSD.cxx.
38 const G4StepPoint *preStep=aStep->GetPreStepPoint();
39 const G4VPhysicalVolume *preVol=preStep->GetPhysicalVolume();
40 const G4StepPoint *postStep=aStep->GetPostStepPoint();
41 const G4VPhysicalVolume *postVol=postStep->GetPhysicalVolume();
43 if (preVol==postVol) {
return false; }
45 const G4Track *
track(aStep->GetTrack());
48 int pdgcode = (
track->GetDefinition())?
track->GetDefinition()->GetPDGEncoding():0;
49 if (
track->GetDefinition() == G4Geantino::Definition() ) pdgcode=999;
50 if (
track->GetDefinition() == G4ChargedGeantino::Definition() ) pdgcode=998;
53 G4ThreeVector
pos=postStep->GetPosition();
54 G4ThreeVector
mom=postStep->GetMomentum();
59 const G4TouchableHistory* touchHist = (G4TouchableHistory*)preStep->GetTouchable();
60 const G4AffineTransform trans =
track->GetTouchable()->GetHistory()->GetTopTransform();
61 G4ThreeVector localPos=trans.TransformPoint(
pos);
62 G4ThreeVector localMom=
mom;
63 trans.ApplyAxisTransform(localMom);
64 const G4VSolid *shape= touchHist->GetSolid();
65 const G4ThreeVector normal=shape->SurfaceNormal(localPos);
67 if(normal.dot(localPos)>=0.)
return false;
71 const double ener=postStep->GetTotalEnergy();
74 const double time=postStep->GetGlobalTime();
78 const int barcode = trHelp.GetBarcode();
79 const int id = trHelp.GetUniqueID();
80 const int status = trHelp.GetStatus();
◆ WriteTrack()
void TrackFastSimSD::WriteTrack |
( |
const G4Track * |
track, |
|
|
const bool |
originPos, |
|
|
const bool |
originMom |
|
) |
| |
Definition at line 97 of file TrackFastSimSD.cxx.
99 if (!
track) { G4cout <<
"ERROR: the track pointer was zero" << G4endl;
return; }
101 G4VPhysicalVolume *preVol=
track->GetVolume();
103 const int pdgcode = (
track->GetDefinition())?
track->GetDefinition()->GetPDGEncoding():0;
105 const G4ThreeVector
pos = originPos?
track->GetVertexPosition():
track->GetPosition();
106 const double ener=originMom?(
track->GetVertexKineticEnergy()+
track->GetDynamicParticle()->GetMass()):
track->GetTotalEnergy();
107 G4ThreeVector
mom =
track->GetMomentum();
110 mom =
track->GetVertexMomentumDirection()*mommag;
113 const double time=
track->GetGlobalTime();
115 const int barcode = trHelp.GetBarcode();
116 const int id = trHelp.GetUniqueID();
117 const int status = trHelp.GetStatus();
129 preVol?preVol->GetName():
"Unknown");
◆ m_SD_type
int TrackFastSimSD::m_SD_type |
|
private |
◆ m_trackRecordCollection
The documentation for this class was generated from the following files: