35 #include "TrackingAction.hh"
37 #include "DetectorConstruction.hh"
39 #include "EventAction.hh"
40 #include "HistoManager.hh"
72 Run* run =
static_cast<Run*
>(
79 G4bool transmit = ((position.
x() >= fXendAbs) && (vertex.
x() < fXendAbs));
80 G4bool reflect = (position.
x() <= fXstartAbs);
81 G4bool notabsor = (transmit || reflect);
86 if (charge == fPrimaryCharge) flag = 1;
94 G4bool charged = (charge != 0.);
100 if (transmit && charged)
id = 10;
101 else if (transmit && neutral)
id = 20;
102 else if (reflect && charged)
id = 30;
103 else if (reflect && neutral)
id = 40;
112 G4int index = 0;
if (trackID > 1) index = 1;
123 if (transmit && charged)
id = 12;
124 else if (transmit && neutral)
id = 22;
125 else if (reflect && charged)
id = 32;
126 else if (reflect && neutral)
id = 42;
129 G4double theta = std::acos(direction.
x());
131 G4double dteta = analysisManager->GetH1Width(
id);
132 G4double unit = analysisManager->GetH1Unit(
id);
141 analysisManager->FillH1(
id,theta,weight);
148 if (transmit && charged)
id = 11;
149 else if (transmit && neutral)
id = 21;
150 else if (reflect && charged)
id = 31;
151 else if (reflect && neutral)
id = 41;
154 G4double theta = std::acos(direction.
x());
156 G4double dteta = analysisManager->GetH1Width(
id);
157 G4double unit = analysisManager->GetH1Unit(
id);
160 analysisManager->FillH1(
id,theta,weight);
167 if (transmit && charged)
id = 13;
168 else if (transmit && neutral)
id = 23;
169 else if (reflect && charged)
id = 33;
170 else if (reflect && neutral)
id = 43;
173 if (direction.
x() != 0.0) {
174 G4double tet = std::atan(direction.
y()/std::fabs(direction.
x()));
175 analysisManager->FillH1(
id,tet);
178 tet = std::atan(direction.
z()/std::fabs(direction.
x()));
179 analysisManager->FillH1(
id,tet);
187 if (transmit && charged)
id = 14;
192 analysisManager->FillH1(
id, y);
193 analysisManager->FillH1(
id,
z);
194 analysisManager->FillH1(
id+1, r);
201 analysisManager->FillH1(6, xVertex);
202 if (notabsor) analysisManager->FillH1(7, xVertex);
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
void SetReflectFlag(G4int flag)
const G4ThreeVector & GetPosition() const
G4double GetKineticEnergy() const
void PreUserTrackingAction(const G4Track *)
void AddMscProjTheta(G4double theta)
ExG4HbookAnalysisManager G4AnalysisManager
void SetTransmitFlag(G4int flag)
void PostUserTrackingAction(const G4Track *)
const G4ThreeVector & GetVertexPosition() const
static G4RunManager * GetRunManager()
static G4Positron * Positron()
const G4ThreeVector & GetMomentumDirection() const
G4double GetPDGCharge() const
G4Run * GetNonConstCurrentRun() const
void AddEnergyLeak(G4double eleak, G4int index)