Skip to content
Snippets Groups Projects

Correct Random Number

3 files
+ 6
6
Compare changes
  • Side-by-side
  • Inline

Files

+ 2
3
@@ -19,9 +19,8 @@ void emcal_electrons(){
@@ -19,9 +19,8 @@ void emcal_electrons(){
int events_parsed = 0;
int events_parsed = 0;
GenEvent evt(Units::GEV, Units::MM);
GenEvent evt(Units::GEV, Units::MM);
// Set up random number generators
// Random number pulled from the env variable
std::random_device rd;
std::mt19937 gen( std::stoi(std::getenv("SEED")) );
std::mt19937 gen(rd());
std::uniform_real_distribution<double> uniform_theta(135.0*TMath::DegToRad(),178.0*TMath::DegToRad()); // 135-178[degree]
std::uniform_real_distribution<double> uniform_theta(135.0*TMath::DegToRad(),178.0*TMath::DegToRad()); // 135-178[degree]
std::uniform_real_distribution<double> uniform_phi(0.0,2*TMath::Pi()); // 360[degree]
std::uniform_real_distribution<double> uniform_phi(0.0,2*TMath::Pi()); // 360[degree]
Loading