Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison of cosmic generator with disk #133

Merged
merged 24 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/12.Generators/CosmicGeneratorBenchmarks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

This is a comparison of the new Cosmic Generator vs the old approach of a disk above the detector.

In the old approach most primaries (depending on the size of the disk) never reach the detector, leading to a huge inefficiency.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<restG4>
<globals>
<parameter name="mainDataPath" value=""/>
<parameter name="verboseLevel" value="essential"/>
</globals>

<TRestRun>
<parameter name="experimentName" value="CosmicGenerator"/>
<parameter name="runType" value="simulation"/>
<parameter name="runNumber" value="1"/>
<parameter name="runTag" value="CosmicGenerator"/>
<parameter name="outputFileName" value="CosmicGenerator.root"/>
<parameter name="runDescription" value=""/>
<parameter name="user" value="${USER}"/>
<parameter name="overwrite" value="off"/>
<parameter name="readOnly" value="false"/>
</TRestRun>

<TRestGeant4Metadata>
<parameter name="gdmlFile" value="../../13.IAXO/geometry/setup.gdml"/>
<parameter name="seed" value="137"/>
<parameter name="nRequestedEntries" value="1000000"/>
<parameter name="saveAllEvents" value="false"/>

<generator type="cosmic">
<source use="cosmics" direction="(0,-1,0)" filename="${REST_PATH}/data/distributions/CosmicsCry.root"
particles="muon_minus"/>
</generator>

<detector>
<volume name="gasVolume" sensitive="true" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists>
<parameter name="cutForGamma" value="1" units="mm"/>
<parameter name="cutForElectron" value="1" units="mm"/>
<parameter name="cutForPositron" value="1" units="mm"/>
<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"/>

<physicsList name="G4EmLivermorePhysics">
<option name="pixe" value="false"/>
</physicsList>

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

<physicsList name="G4DecayPhysics"/>
<physicsList name="G4RadioactiveDecayPhysics"/>
<physicsList name="G4RadioactiveDecay">
<option name="ICM" value="true"/>
<option name="ARM" value="true"/>
</physicsList>

<!--
<physicsList name="G4NeutronTrackingCut"/>
-->

</TRestGeant4PhysicsLists>
</restG4>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<restG4>
<globals>
<parameter name="mainDataPath" value=""/>
<parameter name="verboseLevel" value="essential"/>
</globals>

<TRestRun>
<parameter name="experimentName" value="CosmicGenerator"/>
<parameter name="runType" value="simulation"/>
<parameter name="runNumber" value="1"/>
<parameter name="runTag" value="CosmicGenerator"/>
<parameter name="outputFileName" value="CosmicGenerator.root"/>
<parameter name="runDescription" value=""/>
<parameter name="user" value="${USER}"/>
<parameter name="overwrite" value="off"/>
<parameter name="readOnly" value="false"/>
</TRestRun>

<TRestGeant4Metadata>
<parameter name="gdmlFile" value="../geometry/setup.gdml"/>
<parameter name="seed" value="137"/>
<parameter name="nRequestedEntries" value="1000000"/>
<parameter name="saveAllEvents" value="false"/>

<generator type="cosmic">
<source use="cosmics" direction="(0,-1,0)" filename="${REST_PATH}/data/distributions/CosmicsCry.root"
particles="muon_minus"/>
</generator>

<detector>
<volume name="gasVolume" sensitive="true" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists>
<parameter name="cutForGamma" value="1" units="mm"/>
<parameter name="cutForElectron" value="1" units="mm"/>
<parameter name="cutForPositron" value="1" units="mm"/>
<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"/>

<physicsList name="G4EmLivermorePhysics">
<option name="pixe" value="false"/>
</physicsList>

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

<physicsList name="G4DecayPhysics"/>
<physicsList name="G4RadioactiveDecayPhysics"/>
<physicsList name="G4RadioactiveDecay">
<option name="ICM" value="true"/>
<option name="ARM" value="true"/>
</physicsList>

<!--
<physicsList name="G4NeutronTrackingCut"/>
-->

</TRestGeant4PhysicsLists>
</restG4>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<restG4>
<globals>
<parameter name="mainDataPath" value=""/>
<parameter name="verboseLevel" value="essential"/>
</globals>

<TRestRun>
<parameter name="experimentName" value="CosmicGenerator"/>
<parameter name="runType" value="simulation"/>
<parameter name="runNumber" value="1"/>
<parameter name="runTag" value="CosmicGenerator"/>
<parameter name="outputFileName" value="CosmicGenerator.root"/>
<parameter name="runDescription" value=""/>
<parameter name="user" value="${USER}"/>
<parameter name="overwrite" value="off"/>
<parameter name="readOnly" value="false"/>
</TRestRun>

<TRestGeant4Metadata>
<parameter name="gdmlFile" value="../geometry-sphere/setup.gdml"/>
<parameter name="seed" value="137"/>
<parameter name="nRequestedEntries" value="1000000"/>
<parameter name="saveAllEvents" value="false"/>

<generator type="cosmic">
<source use="cosmics" direction="(0,-1,0)" filename="${REST_PATH}/data/distributions/CosmicsCry.root"
particles="muon_minus"/>
</generator>

<detector>
<volume name="gasVolume" sensitive="true" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists>
<parameter name="cutForGamma" value="1" units="mm"/>
<parameter name="cutForElectron" value="1" units="mm"/>
<parameter name="cutForPositron" value="1" units="mm"/>
<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"/>

<physicsList name="G4EmLivermorePhysics">
<option name="pixe" value="false"/>
</physicsList>

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

<physicsList name="G4DecayPhysics"/>
<physicsList name="G4RadioactiveDecayPhysics"/>
<physicsList name="G4RadioactiveDecay">
<option name="ICM" value="true"/>
<option name="ARM" value="true"/>
</physicsList>

<!--
<physicsList name="G4NeutronTrackingCut"/>
-->

</TRestGeant4PhysicsLists>
</restG4>
75 changes: 75 additions & 0 deletions examples/12.Generators/CosmicGeneratorBenchmarks/diskIAXO.rml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<restG4>
<globals>
<parameter name="mainDataPath" value=""/>
<parameter name="verboseLevel" value="essential"/>
</globals>

<TRestRun>
<parameter name="experimentName" value="CosmicGenerator"/>
<parameter name="runType" value="simulation"/>
<parameter name="runNumber" value="1"/>
<parameter name="runTag" value="CosmicGenerator"/>
<parameter name="outputFileName" value="CosmicGenerator.root"/>
<parameter name="runDescription" value=""/>
<parameter name="user" value="${USER}"/>
<parameter name="overwrite" value="off"/>
<parameter name="readOnly" value="false"/>
</TRestRun>

<TRestGeant4Metadata>
<parameter name="gdmlFile" value="../../13.IAXO/geometry/setup.gdml"/>
<parameter name="seed" value="137"/>
<parameter name="nRequestedEntries" value="1000000"/>
<parameter name="saveAllEvents" value="false"/>

<generator type="surface" shape="circle"
position="(0,177.79904,0)cm" size="(1777.9904,0,0)cm"
rotationAngle="90deg" rotationAxis="(1,0,0)">
<source particle="mu-">
<energy type="TH2D" name="muon_minus_energy_zenith"
file="${REST_PATH}/data/distributions/CosmicsCry.root"/>
<angular type="TH2D" name="muon_minus_energy_zenith" direction="(0,-1,0)"
file="${REST_PATH}/data/distributions/CosmicsCry.root" />
</source>
</generator>

<detector>
<volume name="gasVolume" sensitive="true" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists>
<parameter name="cutForGamma" value="1" units="mm"/>
<parameter name="cutForElectron" value="1" units="mm"/>
<parameter name="cutForPositron" value="1" units="mm"/>
<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"/>

<physicsList name="G4EmLivermorePhysics">
<option name="pixe" value="false"/>
</physicsList>

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

<physicsList name="G4DecayPhysics"/>
<physicsList name="G4RadioactiveDecayPhysics"/>
<physicsList name="G4RadioactiveDecay">
<option name="ICM" value="true"/>
<option name="ARM" value="true"/>
</physicsList>

<!--
<physicsList name="G4NeutronTrackingCut"/>
-->

</TRestGeant4PhysicsLists>
</restG4>
76 changes: 76 additions & 0 deletions examples/12.Generators/CosmicGeneratorBenchmarks/diskSimple.rml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<restG4>
<globals>
<parameter name="mainDataPath" value=""/>
<parameter name="verboseLevel" value="essential"/>
</globals>

<TRestRun>
<parameter name="experimentName" value="CosmicGenerator"/>
<parameter name="runType" value="simulation"/>
<parameter name="runNumber" value="1"/>
<parameter name="runTag" value="CosmicGenerator"/>
<parameter name="outputFileName" value="CosmicGenerator.root"/>
<parameter name="runDescription" value=""/>
<parameter name="user" value="${USER}"/>
<parameter name="overwrite" value="off"/>
<parameter name="readOnly" value="false"/>
</TRestRun>

<TRestGeant4Metadata>
<parameter name="gdmlFile" value="../geometry/setup.gdml"/>
<parameter name="seed" value="137"/>
<parameter name="nRequestedEntries" value="1000000"/>
<parameter name="saveAllEvents" value="false"/>

<!-- Use r=radius of the cosmic generator -->
<generator type="surface" shape="circle"
position="(0,173.20508,0)mm" size="(1732.0508,0,0)mm"
rotationAngle="90deg" rotationAxis="(1,0,0)">
<source particle="mu-">
<energy type="TH2D" name="muon_minus_energy_zenith"
file="${REST_PATH}/data/distributions/CosmicsCry.root"/>
<angular type="TH2D" name="muon_minus_energy_zenith" direction="(0,-1,0)"
file="${REST_PATH}/data/distributions/CosmicsCry.root" />
</source>
</generator>

<detector>
<volume name="gasVolume" sensitive="true" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists>
<parameter name="cutForGamma" value="1" units="mm"/>
<parameter name="cutForElectron" value="1" units="mm"/>
<parameter name="cutForPositron" value="1" units="mm"/>
<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"/>

<physicsList name="G4EmLivermorePhysics">
<option name="pixe" value="false"/>
</physicsList>

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

<physicsList name="G4DecayPhysics"/>
<physicsList name="G4RadioactiveDecayPhysics"/>
<physicsList name="G4RadioactiveDecay">
<option name="ICM" value="true"/>
<option name="ARM" value="true"/>
</physicsList>

<!--
<physicsList name="G4NeutronTrackingCut"/>
-->

</TRestGeant4PhysicsLists>
</restG4>
Loading
Loading