Skip to content
Snippets Groups Projects
Commit bb87094a authored by audrey.chatillon's avatar audrey.chatillon
Browse files

[EventGeneratorIsotropic] back to previous config, keep only flat dist

parent 8b56e13b
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #383906 passed
......@@ -69,9 +69,6 @@ EventGeneratorIsotropic::SourceParameters::SourceParameters(){
m_particle = NULL;
m_direction = 'z' ;
m_SourceProfile = "Gauss" ;
m_DecayLaw = "off";
m_ActivityBq = 1. ;
m_TimeWindow = 1.e-9 ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -131,12 +128,6 @@ void EventGeneratorIsotropic::ReadConfiguration(NPL::InputParser parser){
it->m_SigmaZ=blocks[i]->GetDouble("SigmaZ","mm");
if(blocks[i]->HasToken("Multiplicity"))
it->m_Multiplicity=blocks[i]->GetVectorInt("Multiplicity");
if(blocks[i]->HasToken("DecayLaw"))
it->m_DecayLaw=blocks[i]->GetString("DecayLaw");
if(blocks[i]->HasToken("ActivityBq"))
it->m_ActivityBq=blocks[i]->GetDouble("ActivityBq","Bq");
if(blocks[i]->HasToken("TimeWindow"))
it->m_TimeWindow=blocks[i]->GetDouble("TimeWindow","s");
}
else{
cout << "ERROR: check your input file formatting \033[0m" << endl;
......@@ -165,13 +156,7 @@ void EventGeneratorIsotropic::ReadConfiguration(NPL::InputParser parser){
void EventGeneratorIsotropic::GenerateEvent(G4Event*){
for(auto& par : m_Parameters) {
double delta_t = 0.;
bool DecayOn = true;
for(unsigned int p=0; p<par.m_particleName.size(); p++){
double step_t = 1.e-2 / par.m_ActivityBq; // [s]
if(par.m_DecayLaw=="on"){
par.m_Multiplicity[p] = ((int)(par.m_TimeWindow / step_t) == 0) ? 1 : (int)(50.e-9 / step_t);
}
for(int i=0; i<par.m_Multiplicity[p]; i++){
par.m_particle=NULL;
if(par.m_particle==NULL){
......@@ -185,13 +170,8 @@ void EventGeneratorIsotropic::GenerateEvent(G4Event*){
NPL::Nucleus* N = new NPL::Nucleus(par.m_particleName[p]);
par.m_particle = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIon(N->GetZ(), N->GetA(),par.m_ExcitationEnergy[p]);
delete N;
if(par.m_DecayLaw == "on" && i>0){
delta_t = i*step_t;
DecayOn = !(par.m_DecayLaw == "on" && RandFlat::shoot() > 1.e-2);
}
}
}
if(!DecayOn) continue;
G4double cos_theta_min = cos(par.m_HalfOpenAngleMin);
G4double cos_theta_max = cos(par.m_HalfOpenAngleMax);
G4double cos_theta = cos_theta_min + (cos_theta_max - cos_theta_min) * RandFlat::shoot();
......@@ -249,7 +229,6 @@ void EventGeneratorIsotropic::GenerateEvent(G4Event*){
momentum_x = cos(theta) ;
}
NPS::Particle particle(par.m_particle, theta, particle_energy, G4ThreeVector(momentum_x, momentum_y, momentum_z), G4ThreeVector(x0, y0, z0));
m_ParticleStack->AddParticleToStack(particle);
}
......
......@@ -72,9 +72,6 @@ private: // Source parameter from input file
vector<G4double> m_ExcitationEnergy ; // Excitation energy of the emitted particle
vector<string> m_particleName ;
vector<G4int> m_Multiplicity ;
TString m_DecayLaw ; // [on]: mult follows the decay law controlled by T1/2 [off]: fix mult
G4double m_ActivityBq ; // if m_DecayLaw = "on" gives here the Activity in Bq of the sample
G4double m_TimeWindow ; // DAQ time window during we see the alpha pile-up
};
vector<SourceParameters> m_Parameters ;
ParticleStack* m_ParticleStack ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment