diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 81de0c9f..51573f1d 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -444,8 +444,25 @@ jobs: mkdir -p ${{ env.REST_FRAMEWORK_SOURCE_DIR }}/build && cd ${{ env.REST_FRAMEWORK_SOURCE_DIR }}/build cmake ../ -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DREST_WELCOME=ON -DREST_G4=ON -DCMAKE_INSTALL_PREFIX=${{ env.REST_PATH }} make -j4 install + - name: Test before + run: | + cat ${{ env.REST_PATH }}/examples/restG4/01.NLDBD/geometry/mySetupTemplate.gdml + find . -name "*.gdml" + - name: Use old materials for reference Geant4 version + run: | + cd ${{ env.REST_PATH }} + pwd + cat ${{ env.REST_PATH }}/examples/restG4/01.NLDBD/geometry/mySetupTemplate.gdml + find . -name "*.gdml" | xargs sed -i 's/https:\/\/rest-for-physics.github.io\/materials\/rest.xml/https:\/\/rest-for-physics.github.io\/materials\/legacy\/v1.4\/rest.xml/g' + cat ${{ env.REST_PATH }}/examples/restG4/01.NLDBD/geometry/mySetupTemplate.gdml + sed -i 's/https:\/\/rest-for-physics.github.io\/materials\/rest.xml/https:\/\/rest-for-physics.github.io\/materials\/legacy\/v1.4\/rest.xml/g' ${{ env.REST_PATH }}/examples/restG4/01.NLDBD/geometry/mySetupTemplate.gdml + cat ${{ env.REST_PATH }}/examples/restG4/01.NLDBD/geometry/mySetupTemplate.gdml + - name: Test after + run: | + cat ${{ env.REST_PATH }}/examples/restG4/01.NLDBD/geometry/mySetupTemplate.gdml + find . -name "*.gdml" - name: Cache framework installation - id: framework-install-restG4-cache-old-Geant4 + id: framework-install-restG4-cache-reference uses: actions/cache@v3 with: path: ${{ env.REST_PATH }} diff --git a/examples/01.NLDBD/Validate.C b/examples/01.NLDBD/Validate.C index ec5c0d50..60552043 100644 --- a/examples/01.NLDBD/Validate.C +++ b/examples/01.NLDBD/Validate.C @@ -57,19 +57,19 @@ Int_t Validate(const char* filename) { double nEvents = run.GetEntries(); double averageTotalEnergy = 0; - const double averageTotalEnergyRef = (!isReferenceGeant4Version) ? 2280.96 : 2221.55; + const double averageTotalEnergyRef = (!isReferenceGeant4Version) ? 2237.02 : 2221.55; double averageSensitiveEnergy = 0; - const double averageSensitiveEnergyRef = (!isReferenceGeant4Version) ? 2280.96 : 2221.55; + const double averageSensitiveEnergyRef = (!isReferenceGeant4Version) ? 2237.02 : 2221.55; double averageNumberOfHits = 0; - const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 5371.17 : 353.2; + const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 5281.31 : 353.2; double averageNumberOfTracks = 0; - const double averageNumberOfTracksRef = (!isReferenceGeant4Version) ? 2300 : 10.83; + const double averageNumberOfTracksRef = (!isReferenceGeant4Version) ? 2277.62 : 10.83; TVector3 averagePosition = {}; - const TVector3 averagePositionRef = (!isReferenceGeant4Version) ? TVector3(-38.8987, 27.5536, 91.3969) + const TVector3 averagePositionRef = (!isReferenceGeant4Version) ? TVector3(-17.4834, -15.4111, -31.5935) : TVector3(-17.8046, -32.5019, -31.8353); const double tolerance = 0.001; diff --git a/examples/01.NLDBD/geometry/mySetupTemplate.gdml b/examples/01.NLDBD/geometry/mySetupTemplate.gdml index 67db22f6..8d9636dc 100644 --- a/examples/01.NLDBD/geometry/mySetupTemplate.gdml +++ b/examples/01.NLDBD/geometry/mySetupTemplate.gdml @@ -3,7 +3,7 @@ - + ]> - + ]> GetMaterialsReference() == "0.0") { + cout << "Materials version was not defined!" << endl; + return 8; + } + TRestGeant4Event* event = run.GetInputEvent(); double nEvents = run.GetEntries(); double averageTotalEnergy = 0; - constexpr double averageTotalEnergyRef = 18.074; + constexpr double averageTotalEnergyRef = 18.3461; double averageSensitiveEnergy = 0; - constexpr double averageSensitiveEnergyRef = 8.99048; + constexpr double averageSensitiveEnergyRef = 8.59475; double averageNumberOfTracks = 0; - constexpr double averageNumberOfTracksRef = 432.763; + constexpr double averageNumberOfTracksRef = 394.381; double averageNumberOfHitsVolume0 = 0; - constexpr double averageNumberOfHitsVolume0Ref = 66.317; + constexpr double averageNumberOfHitsVolume0Ref = 69.092; double averageNumberOfHitsVolume1 = 0; - constexpr double averageNumberOfHitsVolume1Ref = 61.555; + constexpr double averageNumberOfHitsVolume1Ref = 58.31; TVector3 averagePosition = {}; - const TVector3 averagePositionRef = {-0.59902, 0.0256995, 300.385}; + const TVector3 averagePositionRef = {0.338143, -0.291832, 300.517}; constexpr double tolerance = 0.001; @@ -97,7 +102,7 @@ Int_t Validate(const char* filename) { if (TMath::Abs(averageNumberOfTracks - averageNumberOfTracksRef) / averageNumberOfTracksRef > tolerance) { cout << "The average number of tracks does not match the reference value of " << averageNumberOfTracksRef << endl; - return 8; + return 9; } if (TMath::Abs(averageNumberOfHitsVolume0 - averageNumberOfHitsVolume0Ref) / @@ -105,7 +110,7 @@ Int_t Validate(const char* filename) { tolerance) { cout << "The average number of hits in volume 0 does not match the reference value of " << averageNumberOfHitsVolume0Ref << endl; - return 9; + return 10; } if (TMath::Abs(averageNumberOfHitsVolume1 - averageNumberOfHitsVolume1Ref) / @@ -113,27 +118,27 @@ Int_t Validate(const char* filename) { tolerance) { cout << "The average number of hits in volume 1 does not match the reference value of " << averageNumberOfHitsVolume1Ref << endl; - return 10; + return 11; } if (TMath::Abs(averageSensitiveEnergy - averageSensitiveEnergyRef) / averageSensitiveEnergyRef > tolerance) { cout << "The average sensitive volume energy does not match the reference value of " << averageSensitiveEnergyRef << endl; - return 11; + return 12; } if (TMath::Abs(averageTotalEnergy - averageTotalEnergyRef) / averageTotalEnergyRef > tolerance) { cout << "The average total energy does not match the reference value of " << averageTotalEnergyRef << endl; - return 12; + return 13; } if (TMath::Abs(averagePosition.Mag() - averagePositionRef.Mag()) / averagePositionRef.Mag() > tolerance) { cout << "The average position does not match the reference value of " << "(" << averagePositionRef.x() << ", " << averagePositionRef.y() << ", " << averagePositionRef.z() << ") mm" << endl; - return 13; + return 14; } return 0; diff --git a/examples/04.MuonScan/setup.gdml b/examples/04.MuonScan/setup.gdml index d08ecbfd..2dcd3d81 100644 --- a/examples/04.MuonScan/setup.gdml +++ b/examples/04.MuonScan/setup.gdml @@ -3,7 +3,7 @@ - + ]> GetGeant4Version() == "10.4.3"; double averageNumberOfHits = 0; - const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 14413.5 : 11223.0; + const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 14417.5 : 11223.0; const double tolerance = 0.001; for (int i = 0; i < run.GetEntries(); i++) { diff --git a/examples/06.IonRecoils/geometry/setup.gdml b/examples/06.IonRecoils/geometry/setup.gdml index 9cdd9b9c..37ca222b 100644 --- a/examples/06.IonRecoils/geometry/setup.gdml +++ b/examples/06.IonRecoils/geometry/setup.gdml @@ -3,7 +3,7 @@ - + ]> - + ]> GetObservableAverage("g4Ana_phiPrimary"); - constexpr Double_t phiAverageRef = 0.069711; + constexpr Double_t phiAverageRef = 0.0719113; cout << "entry 100, theta: " << thetaSample << ", phi: " << phiSample << endl; cout << "average theta: " << thetaAverage << ", average phi: " << phiAverage << endl; - if (h1->Integral() != 1989) { - cout << "Wrong number of alphas produced at 1MeV_5um!" << endl; + if (h1->Integral() != 1984) { + cout << "Wrong number of alphas produced at (h1) 1MeV_5um!" << endl; cout << "Histogram contains : " << h1->Integral() << endl; return 10; } - if (h2->Integral() != 7422) { - cout << "Wrong number of alphas produced at 5MeV_5um!" << endl; + if (h2->Integral() != 7432) { + cout << "Wrong number of alphas produced at (h2) 5MeV_5um!" << endl; cout << "Histogram contains : " << h2->Integral() << endl; return 20; } - if (h3->Integral() != 9417) { - cout << "Wrong number of alphas produced at 5MeV_1um!" << endl; + if (h3->Integral() != 9430) { + cout << "Wrong number of alphas produced at (h3) 5MeV_1um!" << endl; cout << "Histogram contains : " << h3->Integral() << endl; return 30; } if (TMath::Abs(thetaSample - thetaSampleRef) / thetaSampleRef >= 0.01) { cout << "Wrong theta angle value for entry 100!" << endl; - cout << "Theta value is : " << thetaSample << endl; + cout << "Theta value is : " << thetaSample << " while it should be : " << thetaSampleRef << endl; return 60; } if (TMath::Abs(phiSample - phiSampleRef) / phiSampleRef >= 0.01) { cout << "Wrong phi angle value for entry 100!" << endl; - cout << "Phi value is : " << phiSample << endl; + cout << "Phi value is : " << phiSample << " while it should be : " << phiSampleRef << endl; return 60; } if (TMath::Abs(thetaAverage - thetaAverageRef) / thetaAverageRef >= 0.01) { cout << "Wrong theta angle average!" << endl; - cout << "Theta angle average : " << thetaAverage << " while it should be : " << 1.589 << endl; + cout << "Theta angle average : " << thetaAverage << " while it should be : " << thetaAverageRef + << endl; return 80; } if (TMath::Abs(phiAverage - phiAverageRef) / phiAverageRef >= 0.01) { cout << "Wrong phi angle average!" << endl; - cout << "Phi angle average : " << phiAverage << " while it should be : " << 0.027 << endl; + cout << "Phi angle average : " << phiAverage << " while it should be : " << phiAverageRef << endl; return 90; } diff --git a/examples/08.Alphas/geometry/setup.gdml b/examples/08.Alphas/geometry/setup.gdml index 4d2ea411..ba869571 100644 --- a/examples/08.Alphas/geometry/setup.gdml +++ b/examples/08.Alphas/geometry/setup.gdml @@ -3,7 +3,7 @@ - + ]> - + ]> - + ]> - + ]> - + ]> - + ]>