81 (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
87 G4StepPoint* preStepPoint = step->GetPreStepPoint();
88 G4StepPoint* postStepPoint = step->GetPostStepPoint();
92 ->GetVolume()->GetLogicalVolume();
95 G4Track* track = step->GetTrack();
96 G4int ID = track->GetTrackID();
97 G4String partName = track->GetDefinition()->GetParticleName();
100 G4double PrimaryWeight = 1.;
101 if (partName ==
"gamma" && ID==1) {
102 PrimaryWeight = track->GetWeight();
107 if (volume !=
fPhantom || partName !=
"gamma" || ID!=1)
return;
110 G4int eventNumber = G4RunManager::GetRunManager()
111 ->GetCurrentEvent()->GetEventID();
119 if (postStepPoint->GetProcessDefinedStep() != NULL) {
120 Process = postStepPoint->GetProcessDefinedStep()->GetProcessName();
122 Process =
"UserLimit";
125 G4int ProcIndex = -1;
126 if (Process ==
"Transportation" || Process ==
"CoupledTransportation"
127 || Process ==
"UserLimit") {
130 if (Process ==
"Rayl" || Process ==
"biasWrapper(Rayl)") {
135 if (Process ==
"compt" || Process ==
"biasWrapper(compt)") {
140 if (Process ==
"phot" || Process ==
"biasWrapper(phot)") ProcIndex = 3;
141 if (Process ==
"conv" || Process ==
"biasWrapper(conv)") ProcIndex = 4;
142 if (Process ==
"photonNuclear" ||
143 Process ==
"biasWrapper(photonNuclear)") {
146 if (Process ==
"PowderDiffraction" ||
147 Process ==
"biasWrapper(PowderDiffraction)") {
155 G4ThreeVector mom1 = preStepPoint->GetMomentumDirection();
156 G4ThreeVector mom2 = postStepPoint->GetMomentumDirection();
157 G4double theta = mom1.angle(mom2);
160 G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
162 analysisManager->FillNtupleIColumn(1,0,ProcIndex);
163 analysisManager->FillNtupleDColumn(1,1,
164 preStepPoint->GetKineticEnergy()/CLHEP::keV);
165 analysisManager->FillNtupleDColumn(1,2,theta/CLHEP::deg);
166 analysisManager->FillNtupleDColumn(1,3,track->GetWeight());
167 analysisManager->AddNtupleRow(1);