Hi @mkelsey , thanks. I’m modifying the B1 example and @anna was helping me to do it.
My supervisror wants that the program
- Store the released energy in my two targets both by primary and secondary particles.
- Store the PDG particle ID of the particle releasing energy
- Store the kinetic energy of the particle releasing energy
- Store the directions of the particle releasing energy
- Store PDG particle ID of the particle outgoing the second target
- Store kinetic energy of the particle outgoing the second target
Let’s go step by step and let’s think first about what happens inside the two targets for now.
I think that in the B1 example the accumulating energy is for the event, because in the B1SteppingAction.cc I have the code:
-
For the first target:
if (volume == fScoringVolume) { G4double edepStep = step->GetTotalEnergyDeposit(); fEventAction->AddEdep(edepStep); }
-
For the second target:
else if (volume == fScoringVolume2) {
G4double edepStep2 = step->GetTotalEnergyDeposit();
fEventAction->AddEdep2(edepStep2);
}
then I think that I’m accumulating energy in the full event. Am I wrong?
Given that I need both the released energy by primary and secondary particles in the target, @anna said me to create a first Ntupla to store in the first one the released energy in the first target and in the second one the released energy in the second target.
Here the plots about the PDG, the kinetic energy, momentum and the released energy in the 2 targets:
TARGET 1
Particle ID
Kinetic Energy
Momentum x
Momentum y
Momentum z
Released Energy
TARGET 2
Particle ID
Kinetic Energy
Momentum x
Momentum y
Momentum z
Released energy
Then in the ROOT plots I read that I have 12 particles (i.e 6 e+, 5 photons and 1 e-) in each target. But it looks like to me that it doesn’t fit with the verbosity tracker
verbosity.txt (60.6 KB)
Or not? @anna and @mkelsey what do you think? Are the result fitting with the verbosity tracker or should I fix something?
@anna, last week, wrote me
but
if I move the lines
analysisManager->FillNtupleDColumn(0,5, fEdep);
analysisManager->FillNtupleDColumn(1,5, fEdep2Tar);
In the stepping action, I get 0 GeV released energy!
She also wrote me
but in this way I just store the released energy by prirmary particles (not the released enrergy by primary and secondary)…or not? @anna did I understand wrotng your message?
What I mean is:
If my beam is constituted by five 45GeV e+ and hitting the first target, one of them produce a couple e+e-, I must accumulate both the released energy by the 5 primary e+, and the secondary e+ and e-. Does my code is doing it correctly?