Skip to content

Water world + PMT encapsulation for Visualization purposes #293

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 48 additions & 0 deletions macros/visualizations/vis_encapsulation.mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/rat/db/set DETECTOR experiment "Validation"
/rat/db/set DETECTOR geo_file "Validation/WaterWorld.geo"

/rat/db/set GEO[world] r_max 1000.0
##Option to change the world's material
#/rat/db/set GEO[world] material "air"
/rat/db/set GEO[world] invisible 1

## Define A set of PMTs using PMTINFO_valid_custom as identifier
/rat/db/set PMTINFO_valid_custom x [-300.0,300.0]
/rat/db/set PMTINFO_valid_custom y [-300.0,-300.0]
/rat/db/set PMTINFO_valid_custom z [0.0,0.0]
/rat/db/set PMTINFO_valid_custom dir_x [-1.0,1.0]
/rat/db/set PMTINFO_valid_custom dir_y [0.0,0.0]
/rat/db/set PMTINFO_valid_custom dir_z [0.0,0.0]
/rat/db/set PMTINFO_valid_custom type [0,0]
/rat/db/set PMTINFO_valid_custom noise_rate [100.0,100.]
/rat/db/set PMTINFO_valid_custom efficiency_corr [0.5,0.5]
/rat/db/set PMTINFO_valid_custom afterpulse_fraction [0.0,0.0]

# Load that PMT table into a inner_pmts object
/rat/db/set GEO[inner_pmts] index "inner_pmts"
/rat/db/set GEO[inner_pmts] mother "world"
/rat/db/set GEO[inner_pmts] type "pmtarray"
/rat/db/set GEO[inner_pmts] pmt_model "r7081pe"
/rat/db/set GEO[inner_pmts] pmt_detector_type "idpmt"
/rat/db/set GEO[inner_pmts] sensitive_detector "/mydet/pmt/inner"
/rat/db/set GEO[inner_pmts] pos_table "PMTINFO_valid_custom"
/rat/db/set GEO[inner_pmts] orientation "manual"

## Add ecapsulation to these PMTs
/rat/db/set GEO[inner_pmts] encapsulation 1
/rat/db/set GEO[inner_pmts] encapsulation_model "BUTTON_r7081pe"
/rat/db/set ENCAPSULATION[BUTTON_r7081pe] use_optical_gel 1

/run/initialize

/vis/open OGLSQt
/vis/scene/create
/vis/scene/add/volume
/vis/sceneHandler/attach
/vis/viewer/set/upVector 0.0 0.0 1.0
/vis/viewer/set/viewpointThetaPhi -90 135
/vis/viewer/set/style s
/vis/viewer/flush

## Cut a plane through the detector

12 changes: 12 additions & 0 deletions ratdb/Validation/WaterWorld.geo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
name: "GEO",
index: "world",
valid_begin: [0, 0],
valid_end: [0, 0],
mother: "",
type: "sphere",
r_max: 4500.0,
material: "validwater",
invisible: 0,
}