in the uploaded nohup.out, fSectrackID is always 0
but then you compare step->GetTrack()->GetTrackID() == fSectrackID
, probably GetTrackID is never 0?
Hello @weller, I tried to do these prints:
- Printing all e+ produced by gamma->e+e- in the regenerator
for(size_t lp1=0;lp1<(*fSecondary).size(); lp1++){
secondaryParticleName = (*fSecondary)[lp1]->GetDefinition() -> GetParticleName(); // name of the secondary
process = (*fSecondary)[lp1]-> GetCreatorProcess()-> GetProcessName(); // process creating it
fSectrackID = (*fSecondary)[lp1]->GetTrackID(); //track id
fSsecparID = (*fSecondary)[lp1]->GetParentID(); //parent id
volumeName = (*fSecondary)[lp1] -> GetVolume() -> GetName(); // volume where secondary was generated
if (process=="conv" && secondaryParticleName =="e+"){
G4cerr << G4endl;
G4cerr << "Event n°: " << lp1 << G4endl;
G4cerr << "secondaryParticleName: " << (*fSecondary)[lp1]->GetDefinition() -> GetParticleName() << G4endl;
G4cerr << "process: " << (*fSecondary)[lp1]-> GetCreatorProcess()-> GetProcessName() << G4endl;
//G4cerr << "fSectrackID: " << (*fSecondary)[lp1]->GetTrackID() << G4endl;
//G4cerr << "fSsecparID: " << (*fSecondary)[lp1]->GetParentID() << G4endl;
G4cerr << "volumeName: " << (*fSecondary)[lp1] -> GetVolume() -> GetName() << G4endl;
G4cerr << G4endl;
}
and I get several particlesā¦
-
- Printing all e+ produced by gamma->e+e- in the regenerator and outgoing it
for(size_t lp1=0;lp1<(*fSecondary).size(); lp1++){
secondaryParticleName = (*fSecondary)[lp1]->GetDefinition() -> GetParticleName(); // name of the secondary
process = (*fSecondary)[lp1]-> GetCreatorProcess()-> GetProcessName(); // process creating it
fSectrackID = (*fSecondary)[lp1]->GetTrackID(); //track id
fSsecparID = (*fSecondary)[lp1]->GetParentID(); //parent id
volumeName = (*fSecondary)[lp1] -> GetVolume() -> GetName(); // volume where secondary was generated
if (process=="conv" && secondaryParticleName =="e+"){
if(NextVol && ThisVol->GetName()=="Regenerator" && NextVol->GetName()=="World"){
G4cerr << G4endl;
G4cerr << "Event n°: " << lp1 << G4endl;
G4cerr << "secondaryParticleName: " << (*fSecondary)[lp1]->GetDefinition() -> GetParticleName() << G4endl;
G4cerr << "process: " << (*fSecondary)[lp1]-> GetCreatorProcess()-> GetProcessName() << G4endl;
//G4cerr << "fSectrackID: " << (*fSecondary)[lp1]->GetTrackID() << G4endl;
//G4cerr << "fSsecparID: " << (*fSecondary)[lp1]->GetParentID() << G4endl;
G4cerr << "volumeName: " << (*fSecondary)[lp1] -> GetVolume() -> GetName() << G4endl;
G4cerr << G4endl;
}
}
but I donāt get any particleā¦
it looks like that all positrons outgoing the regenerator are produced by other process (i.e. eBrem)ā¦
but itās strangeā¦because in the project there is the idea to regenerate e+ from gamma conversionā¦
in your nohup.out, the very last entry:
G4WT1 > Event n°: 1
G4WT1 > secondaryParticleName: e+
G4WT1 > process: conv
G4WT1 > fSectrackID: 0
G4WT1 > fSsecparID: 588
G4WT1 > volumeName: Regenerator
is that what you are looking for?
Yesh Iām looking for the
process =="conv" && volumeName=="Regenerator"
but
- Simulating 10000 events (instead, in the file that I uploaded I simulated only 100 events)
- I didnāt set selection on fSecparID and fSectrackIDā¦
Correct me if Iām wrong, but isnāt eBrem (Bremsstrahlung) a process where a gamma gets created (by decelleration of a charged particle)?
So maybe only the last process a positron/electron went through before leaving the volume under consideration is eBrem
, but the positron could have originally been created via conv
?
Probably it is highly unlikely for a conv
process to happen very close to the surface (ratio of volume close to and far from the surface?), thatās why you did not encounter at least one of them in your limited number of eventsā¦
Hello @weller
Yes, when an Electron/positron moves near atomic nuclei, it can emits photons.
Obviously, itās possible that a photon produces a positron then it emits photon so I get it as an āeBreamāā¦but how can I know if it was produce by a photon or, for example, by positron of primary beam??
Currently both the beam and secondary particles producded in the targets can reich the regenerarorā¦
So I canāt know if the parent of the eBream is a photon or other particleā¦I tried to add a magnetic field in order to deflect charged particles (i.e. to have only photons reaching the regenerator), but even if I donāt get errors, the simulation doesnāt run Add a magnetic field - #4 by faca87