Skip to content
Snippets Groups Projects
Commit 1591d3a7 authored by Jihee Kim's avatar Jihee Kim
Browse files

Corrected random number pulled from env variable

parent 4abee179
No related branches found
No related tags found
1 merge request!5Correct Random Number
......@@ -19,9 +19,8 @@ void emcal_electrons(){
int events_parsed = 0;
GenEvent evt(Units::GEV, Units::MM);
// Set up random number generators
std::random_device rd;
std::mt19937 gen(rd());
// Random number pulled from the env variable
std::mt19937 gen( std::stoi(std::getenv("SEED")) );
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]
......
#!/bin/bash
export SEED="1337"
......@@ -20,9 +20,8 @@ void zdc_photons(){
GenEvent evt(Units::GEV, Units::MM);
// Set up random number generators
std::random_device rd;
std::mt19937 gen(rd());
// Random number pulled from the env variable
std::mt19937 gen( std::stoi(std::getenv("SEED")) );
std::uniform_real_distribution<double> uniform_theta(0.0,2.0*TMath::DegToRad()); // 2[degree]
std::uniform_real_distribution<double> uniform_phi(0.0,2.0*TMath::Pi()); // 360[degree]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment