Skip to content
Snippets Groups Projects
Commit f41944ca authored by fangwx@ihep.ac.cn's avatar fangwx@ihep.ac.cn
Browse files

update GtGunTool with E range

parent eceea761
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,8 @@ from Configurables import GenPrinter ...@@ -63,7 +63,8 @@ from Configurables import GenPrinter
gun = GtGunTool("GtGunTool") gun = GtGunTool("GtGunTool")
gun.Particles = ["gamma","gamma"] gun.Particles = ["gamma","gamma"]
gun.Energies = [10, 10] # GeV gun.EnergyMins= [10, 10] # GeV
gun.EnergyMaxs= [10, 10] # GeV
gun.ThetaMins = [90, 90] # degree gun.ThetaMins = [90, 90] # degree
gun.ThetaMaxs = [90, 90] # degree gun.ThetaMaxs = [90, 90] # degree
gun.PhiMins = [0, 1 ] # degree gun.PhiMins = [0, 1 ] # degree
......
...@@ -16,7 +16,7 @@ GtGunTool::initialize() { ...@@ -16,7 +16,7 @@ GtGunTool::initialize() {
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
if (m_energies.value().size() != m_particles.value().size()) { if (m_energymins.value().size() != m_particles.value().size()) {
error() << "Mismatched energies and particles." << endmsg; error() << "Mismatched energies and particles." << endmsg;
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
...@@ -79,7 +79,7 @@ GtGunTool::mutate(MyHepMC::GenEvent& event) { ...@@ -79,7 +79,7 @@ GtGunTool::mutate(MyHepMC::GenEvent& event) {
} }
} }
double energy = m_energies.value()[i]; double energy = m_energymins.value()[i]==m_energymaxs.value()[i] ? m_energymins.value()[i] : CLHEP::RandFlat::shoot(m_energymins.value()[i], m_energymaxs.value()[i]);
// create the MC particle // create the MC particle
edm4hep::MCParticle mcp = event.m_mc_vec.create(); edm4hep::MCParticle mcp = event.m_mc_vec.create();
......
...@@ -34,7 +34,8 @@ private: ...@@ -34,7 +34,8 @@ private:
Gaudi::Property<std::vector<std::string>> m_particles{this, "Particles"}; Gaudi::Property<std::vector<std::string>> m_particles{this, "Particles"};
Gaudi::Property<std::vector<double>> m_energies{this, "Energies"}; Gaudi::Property<std::vector<double>> m_energymins{this, "EnergyMins"};
Gaudi::Property<std::vector<double>> m_energymaxs{this, "EnergyMaxs"};
Gaudi::Property<std::vector<double>> m_thetamins{this, "ThetaMins"}; Gaudi::Property<std::vector<double>> m_thetamins{this, "ThetaMins"};
Gaudi::Property<std::vector<double>> m_thetamaxs{this, "ThetaMaxs"}; Gaudi::Property<std::vector<double>> m_thetamaxs{this, "ThetaMaxs"};
......
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