From ca4a84596c5b0d099425a027156a9d256b435de4 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 4 May 2023 12:17:50 +0200 Subject: [PATCH 01/14] update isotropic vector algorithm --- src/PrimaryGeneratorAction.cxx | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/PrimaryGeneratorAction.cxx b/src/PrimaryGeneratorAction.cxx index ef498b67..9b8fc845 100644 --- a/src/PrimaryGeneratorAction.cxx +++ b/src/PrimaryGeneratorAction.cxx @@ -570,20 +570,14 @@ void PrimaryGeneratorAction::SetParticlePosition() { } G4ThreeVector PrimaryGeneratorAction::GetIsotropicVector() const { - G4double a, b, c; - G4double n; - do { - a = (G4UniformRand() - 0.5) / 0.5; - b = (G4UniformRand() - 0.5) / 0.5; - c = (G4UniformRand() - 0.5) / 0.5; - n = a * a + b * b + c * c; - } while (n > 1 || n == 0.0); - - n = sqrt(n); - a /= n; - b /= n; - c /= n; - return {a, b, c}; + double u1 = G4UniformRand(); + double u2 = G4UniformRand(); + + double x = TMath::Sqrt(-2 * TMath::Log(u1)) * TMath::Cos(2 * TMath::Pi() * u2); + double y = TMath::Sqrt(-2 * TMath::Log(u1)) * TMath::Sin(2 * TMath::Pi() * u2); + double z = TMath::Sqrt(1 - x * x - y * y); + + return {x, y, z}; } void PrimaryGeneratorAction::GenPositionOnGDMLVolume(double& x, double& y, double& z) { From e527c5ac567a8e5976b22b69faa2c6d403db6a4e Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 4 May 2023 12:43:17 +0200 Subject: [PATCH 02/14] add option to generate isotropic distribution from cone angle --- src/PrimaryGeneratorAction.cxx | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/PrimaryGeneratorAction.cxx b/src/PrimaryGeneratorAction.cxx index 9b8fc845..22e6ca4b 100644 --- a/src/PrimaryGeneratorAction.cxx +++ b/src/PrimaryGeneratorAction.cxx @@ -337,8 +337,8 @@ void PrimaryGeneratorAction::SetParticleDirection(Int_t particleSourceIndex, TRestGeant4Metadata* restG4Metadata = simulationManager->GetRestMetadata(); TRestGeant4ParticleSource* source = restG4Metadata->GetParticleSource(0); - G4ThreeVector direction = {source->GetDirection().X(), source->GetDirection().Y(), - source->GetDirection().Z()}; + const auto sourceDirection = source->GetDirection(); + G4ThreeVector direction = {sourceDirection.X(), sourceDirection.Y(), sourceDirection.Z()}; const string angularDistTypeName = source->GetAngularDistributionType().Data(); const auto angularDistTypeEnum = StringToAngularDistributionTypes(angularDistTypeName); @@ -347,20 +347,16 @@ void PrimaryGeneratorAction::SetParticleDirection(Int_t particleSourceIndex, cout << "DEBUG: Angular distribution: " << angularDistTypeName << endl; } - // generator type - /* Apparently not used - - const auto& primaryGeneratorInfo = restG4Metadata->GetGeant4PrimaryGeneratorInfo(); - -const string& spatialGeneratorTypeName = primaryGeneratorInfo.GetSpatialGeneratorType().Data(); -const auto spatialGeneratorTypeEnum = StringToSpatialGeneratorTypes(spatialGeneratorTypeName); - -const string& spatialGeneratorShapeName = primaryGeneratorInfo.GetSpatialGeneratorShape().Data(); -const auto spatialGeneratorShapeEnum = StringToSpatialGeneratorShapes(spatialGeneratorShapeName); - */ - if (angularDistTypeEnum == AngularDistributionTypes::ISOTROPIC) { - direction = GetIsotropicVector(); + if (source->GetAngularDistributionIsotropicConeHalfAngle() > 0) { + const auto originalDirection = direction; + do { + direction = GetIsotropicVector(); + } while (originalDirection.angle(direction) > + source->GetAngularDistributionIsotropicConeHalfAngle()); + } else { + direction = GetIsotropicVector(); + } } else if (angularDistTypeEnum == AngularDistributionTypes::TH1D) { Double_t angle = 0; Double_t value = G4UniformRand() * fAngularDistributionHistogram->Integral(); From 296fdd9e1480e67fcb1eaaf0472a4b2d560333e3 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 4 May 2023 13:25:53 +0200 Subject: [PATCH 03/14] update isotropic algorithm --- .../ValidateIsotropicWithRange.C | 94 +++++++++++++++++++ src/PrimaryGeneratorAction.cxx | 10 +- 2 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 examples/12.Generators/ValidateIsotropicWithRange.C diff --git a/examples/12.Generators/ValidateIsotropicWithRange.C b/examples/12.Generators/ValidateIsotropicWithRange.C new file mode 100644 index 00000000..3770e080 --- /dev/null +++ b/examples/12.Generators/ValidateIsotropicWithRange.C @@ -0,0 +1,94 @@ +#include + +Int_t ValidateEnergyAndAngularRange(const char* filename) { + cout << "Starting validation for '" << filename << "'" << endl; + + TRestRun run(filename); + + cout << "Run entries: " << run.GetEntries() << endl; + if (run.GetEntries() != 1000000) { + cout << "Bad number of entries: " << run.GetEntries() << endl; + return 2; + } + + auto metadata = (TRestGeant4Metadata*)run.GetMetadataClass("TRestGeant4Metadata"); + TRestGeant4Event* event = run.GetInputEvent(); + TVector3 sourceDirection = metadata->GetParticleSource()->GetDirection(); + cout << "original source direction: (" << sourceDirection.X() << ", " << sourceDirection.Y() << ", " + << sourceDirection.Z() << ")" << endl; + + constexpr double tolerance = 0.1; + + double thetaAverage = 0, thetaMin = TMath::Infinity(), thetaMax = 0; + constexpr double thetaAverageRef = 23.1283, thetaMinRef = 0.0, thetaMaxRef = 55.0; + + double energyPrimaryAverage = 0, energyPrimaryMin = TMath::Infinity(), energyPrimaryMax = 0; + constexpr double energyPrimaryAverageRef = 2915.84, energyPrimaryMinRef = 100, + energyPrimaryMaxRef = 15000.0; + + for (int i = 0; i < run.GetEntries(); i++) { + run.GetEntry(i); + TVector3 direction = event->GetPrimaryEventDirection(); + const auto theta = sourceDirection.Angle(direction) * TMath::RadToDeg(); + + thetaAverage += theta / run.GetEntries(); + if (theta < thetaMin) { + thetaMin = theta; + } + if (theta > thetaMax) { + thetaMax = theta; + } + + Double_t energy = event->GetPrimaryEventEnergy(); + energyPrimaryAverage += energy / run.GetEntries(); + if (energy < energyPrimaryMin) { + energyPrimaryMin = energy; + } + if (energy > energyPrimaryMax) { + energyPrimaryMax = energy; + } + } + + cout << "Average theta (deg): " << thetaAverage << endl; + cout << "Minimum theta (deg): " << thetaMin << endl; + cout << "Maximum theta (deg): " << thetaMax << endl; + + cout << "Average energy (keV): " << energyPrimaryAverage << endl; + cout << "Minimum energy (keV): " << energyPrimaryMin << endl; + cout << "Maximum energy (keV): " << energyPrimaryMax << endl; + + if (TMath::Abs(thetaAverage - thetaAverageRef) / thetaAverageRef > tolerance) { + cout << "The average theta of the distribution is wrong!" << endl; + cout << "thetaAverage (deg): " << thetaAverage << endl; + return 3; + } + if (TMath::Abs(thetaMin - thetaMinRef) / (thetaMinRef + 1) > tolerance) { + cout << "The minimum theta of the distribution is wrong!" << endl; + cout << "thetaMin (deg): " << thetaMin << endl; + return 4; + } + if (TMath::Abs(thetaMax - thetaMaxRef) / thetaMaxRef > tolerance) { + cout << "The maximum theta of the distribution is wrong!" << endl; + cout << "thetaMax (deg): " << thetaMax << endl; + return 5; + } + + if (TMath::Abs(energyPrimaryAverage - energyPrimaryAverageRef) / energyPrimaryAverageRef > tolerance) { + cout << "The average energy of the distribution is wrong!" << endl; + cout << "energyPrimaryAverage (keV): " << energyPrimaryAverage << endl; + return 6; + } + if (TMath::Abs(energyPrimaryMin - energyPrimaryMinRef) / energyPrimaryMinRef > tolerance) { + cout << "The minimum energy of the distribution is wrong!" << endl; + cout << "energyPrimaryMin (keV): " << energyPrimaryMin << endl; + return 7; + } + if (TMath::Abs(energyPrimaryMax - energyPrimaryMaxRef) / energyPrimaryMaxRef > tolerance) { + cout << "The maximum energy of the distribution is wrong!" << endl; + cout << "energyPrimaryMax (keV): " << energyPrimaryMax << endl; + return 8; + } + + cout << "All tests passed! [\033[32mOK\033[0m]\n"; + return 0; +} diff --git a/src/PrimaryGeneratorAction.cxx b/src/PrimaryGeneratorAction.cxx index 22e6ca4b..7528bada 100644 --- a/src/PrimaryGeneratorAction.cxx +++ b/src/PrimaryGeneratorAction.cxx @@ -566,12 +566,12 @@ void PrimaryGeneratorAction::SetParticlePosition() { } G4ThreeVector PrimaryGeneratorAction::GetIsotropicVector() const { - double u1 = G4UniformRand(); - double u2 = G4UniformRand(); + double z = 2 * G4UniformRand() - 1; // random uniform in [-1, 1] + double theta = TMath::Pi() * (2 * G4UniformRand() - 1); // random uniform in [-pi, pi] - double x = TMath::Sqrt(-2 * TMath::Log(u1)) * TMath::Cos(2 * TMath::Pi() * u2); - double y = TMath::Sqrt(-2 * TMath::Log(u1)) * TMath::Sin(2 * TMath::Pi() * u2); - double z = TMath::Sqrt(1 - x * x - y * y); + const double sqrt = TMath::Sqrt(1 - z * z); + double x = TMath::Sin(theta) * sqrt; + double y = TMath::Cos(theta) * sqrt; return {x, y, z}; } From 29a7203fa5754d68e90c252e3e72b1b22319a617 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Thu, 4 May 2023 13:26:26 +0200 Subject: [PATCH 04/14] add cone half angle example --- examples/12.Generators/IsotropicWithRange.rml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 examples/12.Generators/IsotropicWithRange.rml diff --git a/examples/12.Generators/IsotropicWithRange.rml b/examples/12.Generators/IsotropicWithRange.rml new file mode 100644 index 00000000..19dba984 --- /dev/null +++ b/examples/12.Generators/IsotropicWithRange.rml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 28bbebcf7d2f47087911a2883c69a52db03cb277 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 8 Apr 2024 13:37:11 +0200 Subject: [PATCH 05/14] update isotropic sampler --- src/PrimaryGeneratorAction.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/PrimaryGeneratorAction.cxx b/src/PrimaryGeneratorAction.cxx index 2ea8c756..0cc6971d 100644 --- a/src/PrimaryGeneratorAction.cxx +++ b/src/PrimaryGeneratorAction.cxx @@ -623,14 +623,10 @@ void PrimaryGeneratorAction::SetParticlePosition() { } G4ThreeVector PrimaryGeneratorAction::GetIsotropicVector() const { - double z = 2 * G4UniformRand() - 1; // random uniform in [-1, 1] - double theta = TMath::Pi() * (2 * G4UniformRand() - 1); // random uniform in [-pi, pi] + double phi = 2 * M_PI * G4UniformRand(); + double theta = TMath::ACos(1 - 2 * G4UniformRand()); - const double sqrt = TMath::Sqrt(1 - z * z); - double x = TMath::Sin(theta) * sqrt; - double y = TMath::Cos(theta) * sqrt; - - return {x, y, z}; + return {TMath::Sin(theta) * TMath::Cos(phi), TMath::Sin(theta) * TMath::Sin(phi), TMath::Cos(theta)}; } void PrimaryGeneratorAction::GenPositionOnGDMLVolume(double& x, double& y, double& z) { From bee519e5d525d416f07a6faa6820fc248ae83943 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 8 Apr 2024 14:37:05 +0200 Subject: [PATCH 06/14] reference values --- examples/06.IonRecoils/Validate.C | 2 +- examples/08.Alphas/Validate.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/06.IonRecoils/Validate.C b/examples/06.IonRecoils/Validate.C index fb92fac6..1588a5cc 100644 --- a/examples/06.IonRecoils/Validate.C +++ b/examples/06.IonRecoils/Validate.C @@ -16,7 +16,7 @@ Int_t Validate(const char* filename) { const bool isReferenceGeant4Version = geant4Metadata->GetGeant4Version() == "10.4.3"; double averageNumberOfHits = 0; - const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 14417.5 : 11223.0; + const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 11131.5 : 10369.5; const double tolerance = 0.001; for (int i = 0; i < run.GetEntries(); i++) { diff --git a/examples/08.Alphas/Validate.C b/examples/08.Alphas/Validate.C index 8001fc0d..e4d5fc02 100644 --- a/examples/08.Alphas/Validate.C +++ b/examples/08.Alphas/Validate.C @@ -29,7 +29,7 @@ Int_t Validate() { cout << "entry 100, theta: " << thetaSample << ", phi: " << phiSample << endl; cout << "average theta: " << thetaAverage << ", average phi: " << phiAverage << endl; - if (h1->Integral() != 1984) { + if (h1->Integral() != 1926) { cout << "Wrong number of alphas produced at (h1) 1MeV_5um!" << endl; cout << "Histogram contains : " << h1->Integral() << endl; return 10; From af3e31b2c94b2329265d5017b7c134569cf116f2 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 8 Apr 2024 14:42:59 +0200 Subject: [PATCH 07/14] decay --- .github/workflows/validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index a9b11326..6f02fb37 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -245,7 +245,7 @@ jobs: source ${{ env.REST_INSTALL_PATH }}/thisREST.sh cd ${{ env.REST_INSTALL_PATH }}/examples/restG4/07.FullChainDecay/ restG4 fullChain.rml -o Run00001_U238_FullChainDecay.root - restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 15)' + restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 16)' restG4 singleDecay.rml -o Run00002_U238_SingleChainDecay.root restRoot -b -q Validate.C'("Run00002_U238_SingleChainDecay.root", 1)' export REST_ISOTOPE=Be7 From 31559c0111723e17603178c3436ff5a04efb6b28 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 8 Apr 2024 15:01:30 +0200 Subject: [PATCH 08/14] validation --- .github/workflows/validation.yml | 2 +- examples/08.Alphas/Validate.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 6f02fb37..c3af5ab9 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -538,7 +538,7 @@ jobs: source ${{ env.REST_INSTALL_PATH }}/thisREST.sh cd ${{ env.REST_INSTALL_PATH }}/examples/restG4/07.FullChainDecay/ restG4 fullChain.rml -o Run00001_U238_FullChainDecay.root - restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 15)' + restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 16)' restG4 singleDecay.rml -o Run00002_U238_SingleChainDecay.root restRoot -b -q Validate.C'("Run00002_U238_SingleChainDecay.root", 1)' export REST_ISOTOPE=Be7 diff --git a/examples/08.Alphas/Validate.C b/examples/08.Alphas/Validate.C index e4d5fc02..d1fa32b4 100644 --- a/examples/08.Alphas/Validate.C +++ b/examples/08.Alphas/Validate.C @@ -35,7 +35,7 @@ Int_t Validate() { return 10; } - if (h2->Integral() != 7432) { + if (h2->Integral() != 7487) { cout << "Wrong number of alphas produced at (h2) 5MeV_5um!" << endl; cout << "Histogram contains : " << h2->Integral() << endl; return 20; From 49539c7ab5ea7bec7d35a8c70f93bf3ebe6ebba8 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 8 Apr 2024 15:15:41 +0200 Subject: [PATCH 09/14] validation --- .gitlab-ci.yml | 2 +- examples/08.Alphas/Validate.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fd9f153..e43eb6a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -124,7 +124,7 @@ Load REST Libraries: - cd ${CI_PROJECT_DIR}/install/examples/restG4/07.FullChainDecay/ - restG4 fullChain.rml - restG4 singleDecay.rml - - restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 15)' + - restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 16)' - restRoot -b -q Validate.C'("Run00002_U238_SingleChainDecay.root", 1)' - export REST_ISOTOPE="Be7" - restG4 singleDecay.rml diff --git a/examples/08.Alphas/Validate.C b/examples/08.Alphas/Validate.C index d1fa32b4..9035673d 100644 --- a/examples/08.Alphas/Validate.C +++ b/examples/08.Alphas/Validate.C @@ -41,7 +41,7 @@ Int_t Validate() { return 20; } - if (h3->Integral() != 9430) { + if (h3->Integral() != 9432) { cout << "Wrong number of alphas produced at (h3) 5MeV_1um!" << endl; cout << "Histogram contains : " << h3->Integral() << endl; return 30; From 9287fcea7333878e3f257bdc1127df51281e96a7 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Mon, 8 Apr 2024 15:28:27 +0200 Subject: [PATCH 10/14] validation --- examples/08.Alphas/Validate.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/08.Alphas/Validate.C b/examples/08.Alphas/Validate.C index 9035673d..478a0567 100644 --- a/examples/08.Alphas/Validate.C +++ b/examples/08.Alphas/Validate.C @@ -15,7 +15,7 @@ Int_t Validate() { run.GetEntry(100); Double_t thetaSample = analysisTree->GetObservableValue("g4Ana_thetaPrimary"); - constexpr Double_t thetaSampleRef = 2.85884; + constexpr Double_t thetaSampleRef = 2.29387; Double_t phiSample = analysisTree->GetObservableValue("g4Ana_phiPrimary"); constexpr Double_t phiSampleRef = -1.59582; From 49a4cf582bb3e9a50b4bc8c23fd4fc5da67ce14d Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Tue, 9 Apr 2024 10:54:59 +0200 Subject: [PATCH 11/14] alpha validation --- examples/08.Alphas/Validate.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/08.Alphas/Validate.C b/examples/08.Alphas/Validate.C index 478a0567..58e61d63 100644 --- a/examples/08.Alphas/Validate.C +++ b/examples/08.Alphas/Validate.C @@ -24,7 +24,7 @@ Int_t Validate() { constexpr Double_t thetaAverageRef = 1.5767; Double_t phiAverage = analysisTree->GetObservableAverage("g4Ana_phiPrimary"); - constexpr Double_t phiAverageRef = 0.0719113; + constexpr Double_t phiAverageRef = -0.0169888; cout << "entry 100, theta: " << thetaSample << ", phi: " << phiSample << endl; cout << "average theta: " << thetaAverage << ", average phi: " << phiAverage << endl; From 7015095a3a5c7ab391fccddc9bbcd48dc579a8b3 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Tue, 9 Apr 2024 11:18:17 +0200 Subject: [PATCH 12/14] unit tests --- test/src/examples.cxx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/test/src/examples.cxx b/test/src/examples.cxx index fa11e7c7..e49bdb8f 100644 --- a/test/src/examples.cxx +++ b/test/src/examples.cxx @@ -276,7 +276,7 @@ TEST(restG4, Example_07_Decay_FullChain) { gROOT->ProcessLine(TString::Format(".L %s", macro.Data())); // Load macro int error = 0; const int result = - gROOT->ProcessLine(TString::Format("Validate(\"%s\", %d)", options.outputFile.c_str(), 15), &error); + gROOT->ProcessLine(TString::Format("Validate(\"%s\", %d)", options.outputFile.c_str(), 16), &error); EXPECT_EQ(error, 0); EXPECT_EQ(result, 0); @@ -417,6 +417,30 @@ TEST(restG4, Example_12_Generators_EnergyAndAngularCorrelated) { fs::current_path(originalPath); } +TEST(restG4, Example_12_Generators_IsotropicWithRange) { + const auto originalPath = fs::current_path(); + const auto thisExamplePath = examplesPath / "12.Generators"; + fs::current_path(thisExamplePath); + + CommandLineOptions::Options options; + options.rmlFile = "IsotropicWithRange.rml"; + options.outputFile = thisExamplePath / "IsotropicWithRange.root"; + + Application app; + app.Run(options); + + // Run validation macro + const TString macro(thisExamplePath / "ValidateIsotropicWithRange.C"); + gROOT->ProcessLine(TString::Format(".L %s", macro.Data())); // Load macro + int error = 0; + const int result = gROOT->ProcessLine( + TString::Format("ValidateIsotropicWithRange(\"%s\")", options.outputFile.c_str()), &error); + EXPECT_EQ(error, 0); + EXPECT_EQ(result, 0); + + fs::current_path(originalPath); +} + TEST(restG4, Example_13_IAXO_Neutrons) { // cd into example const auto originalPath = fs::current_path(); From eedd787a0e18ec57ea16b9d7bf90d2f438ad14ca Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Tue, 9 Apr 2024 12:04:15 +0200 Subject: [PATCH 13/14] macro name --- examples/12.Generators/ValidateIsotropicWithRange.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/12.Generators/ValidateIsotropicWithRange.C b/examples/12.Generators/ValidateIsotropicWithRange.C index 3770e080..44b872d1 100644 --- a/examples/12.Generators/ValidateIsotropicWithRange.C +++ b/examples/12.Generators/ValidateIsotropicWithRange.C @@ -1,6 +1,6 @@ #include -Int_t ValidateEnergyAndAngularRange(const char* filename) { +Int_t ValidateIsotropicWithRange(const char* filename) { cout << "Starting validation for '" << filename << "'" << endl; TRestRun run(filename); From 6f8030079b7cb26f2cc67a27bbbb8b86f5736e9b Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Tue, 9 Apr 2024 12:11:24 +0200 Subject: [PATCH 14/14] update validation --- examples/12.Generators/ValidateIsotropicWithRange.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/12.Generators/ValidateIsotropicWithRange.C b/examples/12.Generators/ValidateIsotropicWithRange.C index 44b872d1..9fb6c7ae 100644 --- a/examples/12.Generators/ValidateIsotropicWithRange.C +++ b/examples/12.Generators/ValidateIsotropicWithRange.C @@ -20,11 +20,11 @@ Int_t ValidateIsotropicWithRange(const char* filename) { constexpr double tolerance = 0.1; double thetaAverage = 0, thetaMin = TMath::Infinity(), thetaMax = 0; - constexpr double thetaAverageRef = 23.1283, thetaMinRef = 0.0, thetaMaxRef = 55.0; + constexpr double thetaAverageRef = 10.0, thetaMinRef = 0.0, thetaMaxRef = 15.0; double energyPrimaryAverage = 0, energyPrimaryMin = TMath::Infinity(), energyPrimaryMax = 0; - constexpr double energyPrimaryAverageRef = 2915.84, energyPrimaryMinRef = 100, - energyPrimaryMaxRef = 15000.0; + constexpr double energyPrimaryAverageRef = 10000.0, energyPrimaryMinRef = 10000.0, + energyPrimaryMaxRef = 10000.0; for (int i = 0; i < run.GetEntries(); i++) { run.GetEntry(i);