I am doing a simulation, with a beam and a target, then I collect Muons, mu+ and mu- and looking the creation process they come from Decay, how I can now if from a decay a pairs of Muons is created? like Z->mu+mu-, and then how I can reconstruct the invariant mass of that pairs of Muons?
Hi,
do I understand it correctly that you need to check if mu+ and mu- are secondaries in a certain process? If so, you could use G4Step::GetSecondaryInCurrentStep() e.g. in your stepping action. This gives you a const std::vector<const G4Track*>* with the created secondaries in the step as entries.
You can then loop over the entries and get infos on each secondary, e.g. creation process, kinetic energy etc.
See e.g example extended/hadronic/Hadr03
Hi,
I don’t know much on processes involving Z decays (I am doing simulations with fast neutrons), but you should see in your vector of secondaries a mu+ and mu- . For these, you can then get kinetic energy, momentum, creation process etc so that you should be able to calculate the invariant mass.
Let’s say you call your vector of secondaries “secondary”, then you can do something like:
const std::vector<const G4Track*>* secondary = step->GetSecondaryInCurrentStep();
for(int i=0;i<(*secondary).size();i++){
G4String name = (*secondary)[i]->GetDefinition()->GetParticleName();
G4String process = (*secondary)[i]-> GetCreatorProcess()-> GetProcessName();
}
etc. Look at the G4Track class reference to see more quantities that you can retrieve.
I hope this helps. Maybe there are other possibilities that I don’t know that are more elegant.
I recommend again the Hadr03 example.
Hi,
I never tried to check if two secondaries were created at the same time, but maybe one could do something with G4Track::GetGlobalTime() or so… I mean to check if these times are equal for both muons. But I don’t really know if this works, it is just an idea. Maybe someone else knows more.
Hi,
You should firstly check if ParentTrackID of these two muons are same. That tells they came from the same parent. For the case of electrons, for example, this does not guarantee they were created at the same time (e.g. delta-rays), but for the case of muons, this is quite likely. http://www-geant4.kek.jp/lxr/source/track/include/G4Track.hh#L119
Hope this helps.
No, but at least it tells you they came from the same parent track. Then you may check the particle type of the parent, creator process of these two muons, etc., to see if these muons came from the decay of the same mother. If needed, you may use your UserTrackInformation to store the time and position when and where the track is created (by default, G4Track does not have such information).