Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into nkx111-patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown authored and Unknown committed May 12, 2022
2 parents 31bc7c4 + e481d8a commit eef7105
Show file tree
Hide file tree
Showing 29 changed files with 199 additions and 59 deletions.
4 changes: 3 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ Load REST Libraries:
- restG4 Muon.rml
- geant4-config --version
- restRoot -b -q Validate.C'("Run00111_restG4_MuonsFromPoint_rest.root")'
- restG4 CosmicMuons.rml
- restG4 CosmicMuonsFromWall.rml
- restRoot -b -q ValidateWall.C'("Run00111_restG4_MuonsFromWall_rest.root")'
- restG4 CosmicMuonsFromCircle.rml
- restRoot -b -q ValidateCircle.C'("Run00111_restG4_MuonsFromCircle_rest.root")'

05_PandaXIII:
stage: examples
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake ${CMAKE_MODULE_PAT

if (${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
# this will only be accessed when build restG4 as a standalone package, not when building the framework
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
find_package(REST REQUIRED)
string(FIND ${REST_LIBRARIES} "RestGeant4" REST_GEANT4_FOUND)
If (${REST_GEANT4_FOUND} EQUAL -1)
Expand Down
4 changes: 2 additions & 2 deletions examples/01.NLDBD/NLDBD.rml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="DBDsimulation" title="NLDBD">

<parameter name="gdml_file" value="geometry/mySetupTemplate.gdml"/>
<parameter name="gdmlFile" value="geometry/mySetupTemplate.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="10"/>
<parameter name="nEvents" value="10"/>

///three types of source definition supported:
<generator type="volume" from="gas">
Expand Down
4 changes: 2 additions & 2 deletions examples/02.TREXDM/FullChainFromReadout.rml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

<TRestGeant4Metadata name="restG4 run" title="${REST_ISOTOPE}_readout_surface_1um">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100us"/>

<parameter name="Nevents" value="${REST_NEVENTS}"/>
<parameter name="nEvents" value="${REST_NEVENTS}"/>

<generator type="virtualWall" position="(0,0,158-1.25+0.001)mm" rotation="(0,0,0)" lenX="20cm" lenY="20cm">
<source particle="${REST_ISOTOPE}" excitedLevel="0.0" fullChain="on">
Expand Down
4 changes: 2 additions & 2 deletions examples/03.Fluorescence/electron.rml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="Electron" title="ElectronFluor">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="30000"/>
<parameter name="nEvents" value="30000"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="false"/>

Expand Down
4 changes: 2 additions & 2 deletions examples/03.Fluorescence/gamma.rml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="Fluorescence" title="Fluorescence">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17022000"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="30000"/>
<parameter name="nEvents" value="30000"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="false"/>

Expand Down
76 changes: 76 additions & 0 deletions examples/04.MuonScan/CosmicMuonsFromCircle.rml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<!--
First concept author G. Luzón (16-11-2020) -->

<restG4>

<TRestRun name="CosmicMuonRun" title="A basic muon test with 2 active volumes">
<parameter name="experimentName" value="CosmicMuonScan"/>
<parameter name="readOnly" value="false"/>
<parameter name="runNumber" value="111"/>
<parameter name="runDescription" value=""/>
<parameter name="user" value="${USER}"/>
<parameter name="verboseLevel" value="1"/>
<parameter name="overwrite" value="off"/>
<parameter name="outputFileName" value="Run[fRunNumber]_[fRunType]_[fRunTag]_[fRunUser].root"/>
</TRestRun>

<TRestGeant4Metadata name="restG4 run" title="MuonsFromCircle">

<parameter name="gdmlFile" value="setup.gdml"/>
<parameter name="subEventTimeDelay" value="100us"/>

<parameter name="nEvents" value="1000"/>

<parameter name="saveAllEvents" value="false"/>
<parameter name="printProgress" value="true"/>

<generator type="surface" shape="circle" position="(0,0,50)cm" size="(15,0,0)cm" rotationAngle="0"
rotationAxis="(1,0,0)">
<source particle="mu-" excitedLevel="0.0" fullChain="on">
<energyDist type="TH1D" file="Muons.root" spctName="cosmicmuon"/>
<angularDist type="TH1D" file="CosmicAngles.root" spctName="Theta2" direction="(0,0,-1)"/>
</source>
</generator>

<storage sensitiveVolume="det_dw_01">
<parameter name="energyRange" value="(0,10)" units="GeV"/>
<activeVolume name="det_dw_01" chance="1" maxStepSize="1mm"/>
<activeVolume name="det_up_01" chance="1" maxStepSize="1mm"/>
</storage>
</TRestGeant4Metadata>

<TRestGeant4PhysicsLists name="default" title="First physics list implementation." verboseLevel="warning">
<parameter name="cutForGamma" value="1" units="um"/>
<parameter name="cutForElectron" value="1" units="um"/>
<parameter name="cutForPositron" value="1" units="um"/>

<parameter name="cutForMuon" value="1" units="mm"/>
<parameter name="cutForNeutron" value="1" units="mm"/>
<parameter name="minEnergyRangeProductionCuts" value="1" units="keV"/>
<parameter name="maxEnergyRangeProductionCuts" value="1" units="GeV"/>

<!-- EM Physics lists -->
<physicsList name="G4EmLivermorePhysics"></physicsList>
<!-- <physicsList name="G4EmPenelopePhysics"> </physicsList> -->
<!-- <physicsList name="G4EmStandardPhysics_option3"> </physicsList> -->

<!-- Decay physics lists -->
<physicsList name="G4DecayPhysics"></physicsList>
<physicsList name="G4RadioactiveDecayPhysics"></physicsList>
<physicsList name="G4RadioactiveDecay">
<option name="ICM" value="true"/>
<option name="ARM" value="true"/>
</physicsList>

<!-- Hadron physics lists -->

<physicsList name="G4HadronElasticPhysicsHP"></physicsList>
<physicsList name="G4IonBinaryCascadePhysics"></physicsList>
<physicsList name="G4HadronPhysicsQGSP_BIC_HP"></physicsList>
<physicsList name="G4EmExtraPhysics"></physicsList>

</TRestGeant4PhysicsLists>

</restG4>
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ First concept author G. Luzón (16-11-2020) -->

<TRestGeant4Metadata name="restG4 run" title="MuonsFromWall">

<parameter name="gdml_file" value="setup.gdml"/>
<parameter name="gdmlFile" value="setup.gdml"/>
<parameter name="subEventTimeDelay" value="100us"/>

<parameter name="Nevents" value="1000"/>
<parameter name="nEvents" value="1000"/>

<parameter name="saveAllEvents" value="false"/>
<parameter name="printProgress" value="true"/>
Expand Down
4 changes: 2 additions & 2 deletions examples/04.MuonScan/Muon.rml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</TRestRun>

<TRestGeant4Metadata name="restG4 run" title="MuonsFromPoint" verboseLevel="info">
<parameter name="gdml_file" value="setup.gdml"/>
<parameter name="gdmlFile" value="setup.gdml"/>
<parameter name="subEventTimeDelay" value="100us"/>

<parameter name="Nevents" value="10"/>
<parameter name="nEvents" value="10"/>
<parameter name="saveAllEvents" value="off"/>

<parameter name="seed" value="17021981"/>
Expand Down
62 changes: 62 additions & 0 deletions examples/04.MuonScan/ValidateCircle.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

Int_t ValidateWall(string fname) {
gSystem->Load("/usr/local/rest-for-physics/lib/libRestFramework.so");
gSystem->Load("/usr/local/rest-for-physics/lib/libRestGeant4.so");

TRestRun run(fname);
TRestGeant4Event* event = run.GetInputEvent<TRestGeant4Event>();

if (run.GetRunTag() != "MuonsFromCircle") {
cout << "Run tag : " << run.GetRunTag() << endl;
cout << "The run tag of the basic validation test should be 'MuonsFromCircle'" << endl;
return 4;
}

Double_t rMean = 0;
Double_t rMin = TMath::Infinity();
Double_t rMax = 0;
for (Int_t n = 0; n < run.GetEntries(); n++) {
run.GetEntry(n);
Double_t x = event->GetPrimaryEventOrigin().X();
Double_t y = event->GetPrimaryEventOrigin().Y();

const auto r = TMath::Sqrt(x * x + y * y) / 100; // cm

rMean += r / run.GetEntries();
if (r < rMin) {
rMin = r;
}
if (r > rMax) {
rMax = r;
}
}

if (rMean < 0.8 || rMean > 1.2) {
cout << "The average radius of the distribution is wrong!" << endl;
cout << "R_mean (cm): " << rMean << endl;
return 5;
}

if (rMin > 0.15) {
cout << "The minimum radius of the distribution is wrong!" << endl;
cout << "R_min (cm): " << rMin << endl;
return 6;
}

if (rMax > 1.5 || rMax < 1.35) {
cout << "The maximum radius of the distribution is wrong!" << endl;
cout << "R_max (cm): " << rMax << endl;
return 7;
}

cout << "Run entries: " << run.GetEntries() << endl;
if (run.GetEntries() < 350 || run.GetEntries() > 450) {
cout << "The number of entries is not between 350 and 450!" << endl;
cout << "Number of entries : " << run.GetEntries() << endl;
return 8;
}

cout << "All tests passed! [\033[32mOK\033[0m]\n";

return 0;
}
6 changes: 3 additions & 3 deletions examples/05.PandaXIII/Xe136bb0n.rml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
</TRestRun>

<TRestGeant4Metadata name="restG4 Simulation run" title="Simulation of Xe136bb0n decay from gas.">
<!-- <parameter name="Nevents" value="1000000"/>-->
<parameter name="Nevents" value="500"/>
<parameter name="gdml_file" value="geometry/main.gdml"/>
<!-- <parameter name="nEvents" value="1000000"/>-->
<parameter name="nEvents" value="500"/>
<parameter name="gdmlFile" value="geometry/main.gdml"/>
<parameter name="subEventTimeDelay" value="100us"/>
<parameter name="seed" value="1"/>

Expand Down
4 changes: 2 additions & 2 deletions examples/05.PandaXIII/geometry/Th232_SS_01.rml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

<TRestGeant4Metadata name="restG4 Simulation run" title="Simulation of Th232 decay from vessel.">

<parameter name="Nevents" value="4000000"/>
<parameter name="gdml_file" value="/home/zhoubugao/REST/geometry_bgzou/main.gdml"/>
<parameter name="nEvents" value="4000000"/>
<parameter name="gdmlFile" value="/home/zhoubugao/REST/geometry_bgzou/main.gdml"/>
<parameter name="maxTargetStepSize" value="500" units="um" />
<parameter name="subEventTimeDelay" value="100" units="us" />

Expand Down
4 changes: 2 additions & 2 deletions examples/06.IonRecoils/recoils.rml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="IonRecoil" title="IonRecoil_${REST_ISOTOPE}">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="2"/>
<parameter name="nEvents" value="2"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="false"/>

Expand Down
4 changes: 2 additions & 2 deletions examples/07.FullChainDecay/fullChain.rml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="FullChain" title="FullChain_${REST_ISOTOPE}">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="100"/>
<parameter name="nEvents" value="100"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="false"/>

Expand Down
4 changes: 2 additions & 2 deletions examples/07.FullChainDecay/singleDecay.rml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="SingleChain" title="SingleChain_${REST_ISOTOPE}">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="100"/>
<parameter name="nEvents" value="100"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="false"/>

Expand Down
4 changes: 2 additions & 2 deletions examples/08.Alphas/alphas.rml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="alphas" title="Alphas">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="10000"/>
<parameter name="nEvents" value="10000"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="false"/>

Expand Down
4 changes: 2 additions & 2 deletions examples/09.Pb210_Shield/Pb210.rml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="FullChain" title="Lead_Pb210">

<parameter name="gdml_file" value="geometry/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<!-- The number of events to be simulated is now defined in TRestGeant4Metadata -->
<parameter name="Nevents" value="10000"/>
<parameter name="nEvents" value="10000"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="false"/>

Expand Down
6 changes: 3 additions & 3 deletions examples/10.Geometries/Assembly.rml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ By default REST units are mm, keV and degrees

<TRestGeant4Metadata name="AssemblyGeantino" title="AssemblyGeantino">

<parameter name="gdml_file" value="geometry/iaxo/setup.gdml"/>
<parameter name="gdmlFile" value="geometry/iaxo/setup.gdml"/>
<parameter name="subEventTimeDelay" value="100" units="us"/>

<parameter name="seed" value="17021981"/>

<parameter name="Nevents" value="1000"/>
<parameter name="nEvents" value="1000"/>
<parameter name="registerEmptyTracks" value="false"/>
<parameter name="saveAllEvents" value="true"/>

Expand All @@ -48,7 +48,7 @@ By default REST units are mm, keV and degrees

<storage sensitiveVolume="gasVolume">
<parameter name="energyRange" value="(0,10)" units="GeV"/>
<activeVolume name="Chamber_gas" chance="1" maxStepSize="1mm"/>
<activeVolume name="gasVolume" chance="1" maxStepSize="1mm"/>
</storage>

</TRestGeant4Metadata>
Expand Down
Loading

0 comments on commit eef7105

Please sign in to comment.