Coder Social home page Coder Social logo

dukecevns's Introduction

Simple code to calculate CEvNS rates in various experiments.

Pre-requisites

JSON for Modern C++

JSON for Modern C++ is needed to read experiment configuration files in JSON format. It has been added as a git submodule of dukecevns, and can be automatically fetched with the --recurse-submodules argument for git clone:

git clone --recurse-submodules https://github.com/schol/dukecevns

For an existing dukecevns repository, the submodule can be fetched with the following commands:

cd /path/to/dukecevns
rm -fr json
git pull
git submodule update --init

CERN ROOT

ROOT is needed to compile dukecevns. The Makefile included in dukecevns can be used to compile dukecevns on Linux and MacOS with ROOT installed. For Windows users, a Docker image physino/root that has the latest ROOT installed in Fedora Linux can be used to compile dukecevns. If Docker Desktop has been installed and is running, open a terminal in the folder of dukecevns by highlighting the address bar of the file explorer and typing cmd and return. In the terminal, type

docker-compose run --rm sh

Wait and let Docker do its magic until you see a familiar SHELL prompt showing up:

root@fedora:~/dukecevns $

Now you are in a Docker container running Fedora Linux with ROOT pre-installed in it, where you can simply type make to compile dukecevns as in a real Linux machine.

Optional dependencies

Some calculations rely on additional code hosted in private git repositories, such as

One can run the included bootstrap.sh to grab the required packages automatically:

./bootstrap.sh

Compilation

cd /path/to/dukecevns
# create libDiffSpec_1.0.a
make
# create an executable 'sns_rates' (needs private code)
# done automatically if bootstrap.sh is used
make sns_rates

Usage

cd /path/to/dukecevns
./sns_rates base-name-of-a-file-in-the-folder-named-jsonfiles

Example json files can be found in ORNL GitLab repository COHERENTProposal2018/assumptions/jsonfiles.

The output files are located in a new folder named out.

Experimental setup

"timewindow": {
  "start": 1400.0,
  "end": 7400.0
},

Kate recommends using the convolved flux histogram. The convolved flux histogram is shifted in time; nominal window to use is 1400 to 7400, although that may get optimized if one knows something about the background.

Detector response

"detectorresponse": {
  "efftype": "qc", <- qc: charge (q) collected, it can also be # of PEs, ADCs, etc.
  "efficiencyfile": "none", <- file in eff/ folder
  "stepthresh": 2.0, <- lower energy threshold
  "upperthresh": 6.0, <- upper limit of energy
  "qftype": "poly",
  "qfname": "nai",
  "qcperkeVee": 30.0, <- ionization (or light) yield
  "qcbinning": 1, <- bin width
  "gsname": "none", <- electron-equivalent energy resolution (file in gs/)
  "qcsmearing": "poisson", <- "qcgsname", "gsname" are not needed if this is set
  "qcgsname": "none" <- energy resolution in terms of Qc
},

gs file format

polysqrt means that it's a polynomial in terms of the square root of energy. The second line defines the range, and the third line includes the coefficients of the formula defined here: https://coherent.phy.duke.edu/wiki/Assumptions#NaI_Smearing (private).

If efftype = "qc", qcgsname or qcsmearing should be used. If efftype="eee", gsname should be used. They cannot be mixed.

efficiency file format

Column one: energy, # of PEs, or Qc, etc. Column two: efficiency

qf file format

Row one: energy range Row two: quenching factor

If qftype==poly, the second row contains polynomial coefficients: C0, C1, C2, etc. so that QF = C0 + C1E + C2E^2.

Output

sns_diff_rates_quenched-alliso-*.out

Column one: Energy [MeVee] Column two: Number of events per MeVee

dukecevns's People

Contributors

gvsinev avatar jintonic avatar schol avatar

Watchers

 avatar  avatar  avatar

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.