GithubHelp home page GithubHelp logo

jonmott2u4u / moller-intdetectoropticalsim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chandabindu/moller-intdetectoropticalsim

0.0 0.0 1.0 10.48 MB

Geant4 based simulation of the MOLLER thin quartz integrating detector optical properties

CMake 38.84% C++ 47.20% Shell 1.45% C 4.74% Python 7.78%

moller-intdetectoropticalsim's Introduction

#Instructions for running the MakeScanMacros.py and submit.py/sh scripts

MOLLEROpt generates a root file after being fed a macro filled with geometry parameters for the main detector

#TO BUILD

Do mkdir build, cd build, cmake .., and then make -j16 (-j# signifies the # of cores you wish to use)

#TO RUN INDIVIDUAL MACROS

In the build directory, do ./MOLLEROpt, then in the GUI type /control/execute macros/"macro-name". You can also do ./MOLLEROpt "path/macro-name" from the terminal

#TO SUBMIT MULTIPLE MACROS VIA SLURM

This method is for submitting multiple jobs to a computer cluster. It is based on slurm and works on the ifarm

To generate multiple macros, do python2.7 MacroGenerator.py within the build folder. The generated macros will be stored in RingParamScan, and a .dat file "files.dat" will be generated that lists each macro generated as a string

Once the macros are generated, do ./MacroSubmitter.sh. This will submit the macros as jobs to the cluster. The generated root files will be moved to the rootfiles directory upon completion. .rndm files are currently moved by hand

When the root files are complete, you can analyze and plot the data via ExtractScanResults by doing root, .L ExtractScanResults.C and then ExtractScanResults()

ExtractScanResults.C performs a langau fit for each root file. The parameters can be modifed depending on what's needed

#MACROS & SCRIPTS

myRun.mac: Runs a single job on the local device; To run do ./MOLLEROpt "macros/myRun.mac". The GUI is not required

vis.mac: Visualizes the geometry described in vis.mac. To run do ./MOLLEROpt to open the GUI, and from there do /control/execute macros/vis.mac

MacroGenerator.py: Generates a list of macro files that are similar in form to myRun.mac

MacroSubmitter.py: Parses through macros generated by MacroGenerator.py and submits them to the ifarm. It is called by doing ./MacroSubmitter.sh

MacroSubmitter.sh: Calls submit.py

ExtractScanResults.C: Reads files.dat and outputs plots of the PE yield with a langau fit. The plots need to be manually saved and closed, but that can be changed

#IMPORTANT NOTES

The geometry generated has a box between the upper and lower cones of the detector. Its height (controllable in the macros) can be anything greater than 0.0

The energy of the beam is determined using the flux vs. energy spectrum of cosmic muons near sea level. Changing the beam energy from the macros will do nothing

When running MakeScanMacros3.py and submit.py you have to add the output directories for the generated files. The lines to edit are below:

  • MakeScanMacros3.py: text_root += "file-path/build/root_files/root-file"
  • submit.py: outDir = "file-path/build/root_files/"

The following versions of ROOT and G4 are used:

  • ROOT 6.22/08 and beyond, with all required and recommended support programs

The following versions of Geant4 are usable

  • Geant4 10.06.03 -> 11.00.02. Other Geant4 11 versions should work

READOUT

The simulation data is saved in a root file that can be given a unique ID from the macro '/RunAction/SetID'. The root file contains a tree that is not electron event based, but rather based on Cherenkov photon events. So the number of track entries in the tree is much larger than than number of electron events. Various things are recorded, including:

  • 'PMTPhotonEnergy'

  • 'PMTCathodeHitX'

  • 'PMTCathodeHitY'

  • 'PMTWindowReflectionAngle'

  • 'LightGuideTrackHit'

  • 'LightGuidePhotonEnergy'

  • 'LightGuideSteps'

  • 'LightGuideStepLength'

  • 'LightGuideTrackLength'

  • 'LightGuideIncidentPhotonAngle'

  • 'LightGuideReflectionProcess'

  • 'QuartzTrackHit'

  • 'QuartzHitX'

  • 'QuartzHitY'

  • 'QuartzPhotonEnergy'

  • 'QuartzSecondaryPhotonAngle'

  • 'QuartzSteps'

  • 'QuartzStepLength'

  • 'QuartzElectronStepLength'

  • 'QuartzIncidentPhotonAngle'

  • 'QuartzTrackLength'

  • 'QuartzStepNPhotons'

  • 'QuartzPhotonAtExit'

  • 'TotalSteps'

  • 'TotalTrackLength'

One can then, for example, plot:

  • 'tv__tree->Draw("MOLLERDetectorEvent.QuartzTrackLength:MOLLERDetectorEvent.QuartzSteps>>hist5(700,0,700,1600,0,1600)","MOLLERDetectorEvent.LightGuideTrackHit == 1","colz");'

etc.

#DATA

The data folder contains optical properties of multiple materials (reflectivity, refractive index, permitivity, absorption, etc). This data is then organized into a table called OpticalPropertiesInputData.txt

When updating the material properties, you make changes to GenerateOpticalTable.C, do .L GenerateOpticalTable.C, and the run the objects within as needed. For example, when changing the reflectivity of the light guide, you would run FillGuideReflectivity()

After running the objects the table can be updated by doing MakeTable(). Now when you do "make" in the build directory the updated optical table will be placed in build/data

moller-intdetectoropticalsim's People

Contributors

chandabindu avatar jonmott2u4u avatar

Forkers

leynabajaj

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.