Coder Social home page Coder Social logo

analysis-scripts's Introduction

Analysis-Scripts

Collection of analysis scripts I use

Mainz-data-analysis.C

Creates Gaussian and Langau fits of the photoelectron (PE) yield of MOLLER's integrating Cherenkov detectors. Data is handled through the following process:

  • The paths of files to be analyzed are written in a .dat file. The script then opens it and individually analyzes each file
  • Information like mean PE's, sigma, MP of a gaussian fit, and gsigma of said fit are stored in a .txt file for future reference
  • The zero-point of the data is moved to the pedestal peak, and the remaining pedestal is cut from the data (this part has to be done by hand depending on the voltage and gain of the PMT used)
  • A langau fit is performed, followed by a gaussian fit based on langau fit parameters (has to be adjusted by hand)
  • Pngs of the langau and gaussian fitted plots are printed and sent to a user-specified location.

subtraction.C

Functions similarly to Mainz-data-analysis.C, but with a few differences:

  • Designed to subtract one dataset from another after normalizing the distributions
  • Example of use: Data is loaded from two files originating from the same detector with the same electronics setup (voltage, gain, etc), but hitting different regions. Region 1 is some part of the detector (generating a small pulse), whereas region 2 is not hitting the detector (providing a background signal). After normalizing both such that the pedestal peaks on each equal 1, they are subtracted to find the yield of the detector for particles hitting region 1.
  • This was used for signals that could not be easily separated from the background.

HOW TO RUN - Mainz-data-analysis.C

In filemaker.py, enter the range of QDC channels and range of runs to analyze.

  • This script requires you to have created a folder called "runs" to store the files it makes
  • The file it makes should then be pointed to in Mainz-data-analysis.C

The controls for Mainz-data-analysis.C are listed below:

  • In object FitLanGaus()
    • Line 15: Within rfiles(), enter runs/"file made by filemaker.py". This gets the file that was just made
    • Line 17: In Mainz_dat.open(), enter analyzed_data/"same file as above". This file should be .txt instead of .dat however. You should make an "analyzed_data" folder before running this
    • Line 36: Controls the amplification of the PMT gain
    • pedestal: Pedestal of the data is set here. Adjusting this will change the zero-point of the x-axis. New values should be found for each PMT+base and voltage combination. Set this to be at the pedestal peak
    • gainFactor: The gainFactor can be adjusted depending on the analysis method. If gainPMT is not defined, use gainFactor = 1, else use the line above it
    • cut: Removes remaining pedestal data from the plot. Should only be non-zero after finding the pedestal peak
    • run_number: Ajust the channel nummber within its definition to match whatever file you're analyzing
    • fr[0], fr[1]: Controls the fitting ranges for the langau and gaussian fits
    • multi_plot: The plot where data is displayed. In multi_plot->SaveAs(), insert plots/"file made"/, but without any file extensions (.txt, .dat, etc). A "plots" directory should be made before running this
  • In object langaufun()
    • np: Controls how many steps the fit takes when looking over the data. 100 runs quickly and is useful for determining pedestal and cut, but should be between 1000->10000 for more precise fits (once all the parameters are known).

analysis-scripts's People

Contributors

jonmott2u4u avatar

Watchers

 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.