Git Product home page Git Product logo

tracker_pyanalysis's Introduction

Tracker_PyAnalysis

Prerequisits:

  • have ROOT and python3 installed
  • On mac: have the DetectorEvent header and lib installed (to read the EUDAQ data files)
    • it is also included in this rep for convenience, under DetectorEvent/ for different dates
  • on the DAQ PC:
    • it is already compiled in work/eudaq/lib/libeudaq_det_event_dict.so

Setup:

  • On mac: Setup ROOT
  • On the DAQ PC it is already setup
  • On mac: export LD_LIBRARY_PATH=$PWD/DetectorEvent/DATEDIR:$LD_LIBRARY_PATH (DATEDIR is the specific date where the lib is valid for)
  • On the DAQ PC: export LD_LIBRARY_PATH=$HOME/work/eudaq/lib:$LD_LIBRARY_PATH
  • put data files somewhere with enough space
    • there's a dir called test_data with example data already
    • the data from eudaq on the DAQ PC it is in: $HOME/work/eudaq/user/stave/misc/run_data/
  • copy the run data file e.g. to the test_data dir (can be whatever you want)
  • change config file as needed (see examples in the conf/ dir)
    • particularly change the path to the input file to wherever you copied it
    • it is assumed that the file name starts with tree_ and ends with RunX.root where X is the EUDAQ run number between 0 and 1000000

Quick start, assuming that the detector is aligned already (but read below...):

  • Must run: python3 noise_analyzer.py -conf conf/config_file_name.txt
  • Then run: python3 serial_analyzer.py -conf conf/config_file_name.txt
  • OR run: python3 multiproc_analyzer.py -conf conf/config_file_name.txt
  • Summarize: python3 postproc_analyzer.py -conf conf/config_file_name.txt
  • Finally, check the event_displays dir

Directories and input business:

  • Once you run any of the scripts listed above (and below), several dirs and files will be created in the same dir where the input file from the config is:
    • a dedicated run dir, e.g. run_0000046 if the EUDAQ run number is 46
    • a subdir for the event displays, e.g. run_0000046/event_displays if the EUDAQ run number is 46
    • an input file will copy placed in run_0000046/ if the EUDAQ run number is 46

Run noise scan:

  • if you want to process only part of the events, set the "nmax2process" parameter as needed
  • to process all events check that the "nmax2process" parameter is larger than what you have in data
  • python3 noise_analyzer.py -conf conf/config_file_name.txt

Run analysis:

  • run noise scan (see above)
  • if you want to process only part of the events, set the "nmax2process" / "nmax2processMP" parameter as needed
  • to process all events check that the "nmax2process" / "nmax2processMP" parameter is larger than what you have in data
  • run analysis serially OR in parallel:
    • python3 serial_analyzer.py -conf conf/config_file_name.txt
    • python3 multiproc_analyzer.py -conf conf/config_file_name.txt
  • look at the histograms in the new root file

Run alignment with cosmics:

  • run noise scan (see above)
  • step 1: python3 multiproc_analyzer.py -conf conf/config_file_name.txt with all misalignment parameters set to 0 in the config file
  • step 2: aligning wrt e.g. ALPIDE_0 or all at once after adjusting the parameters in the config: maxchi2align, axes2align, naligniter.
    • [option A.1] python3 alignment_fitter.py -conf conf/config_file_name.txt -ref ALPIDE_0 or
    • [option A.2] python3 alignment_fitter.py -conf conf/config_file_name.txt
  • step 3: choosing the fit strategy
    • [option B.1] if the axes2align parameter equals to xytheta then the fit will be FULLY-SIMULTANEOUS in 3D
    • [option B.2] if the axes2align parameter equals to xy, xtheta or ytheta then the fit will be SEMI-SIMULTANEOUS in 2D
    • [option B.3] if the axes2align parameter equals to x, y or theta then the fit will be SEQUENTIAL (i.e. non-simultaneous) in 1D
    • Notes:
      • if e.g. -det ALPIDE_0 was used in option A.1 then you need to keep all misalignment parameters of ALPIDE_0 fixed to 0 in the config file always
      • it is advised to use one reference detector and align only the N-1 planes with respect to that with either the sequential or the simultaneous fit
      • if the fit is SEMI-SIMULTANEOUS or SEQUENTIAL, you need to repeat steps 2-5 for all axes (e.g. axes2align=x->axes2align=y->axes2align=theta)
  • step 4: put the non-zero resulting misalignment values in the config file for the relevant detectors
  • step 5: run step 1 again, but with the new (non-zero wherever relevant) misalignment parameters in the config file (from step 3)
  • step 6: check the residuals and the chi2 histograms

Plot some postprocessing histos and fit the residuals:

  • step 1: run the alignment as discussed above
  • step 2: python3 postproc_analyzer.py -conf conf/config_file_name.txt
  • step 3: look at the pdf file created in the dir where the root file is (as listed in the config file)

Run the postprocessing plotting as above but for a few similar runs combined:

  • provide the list of runs in the config file in field named runnums under the MULTIRUN area
  • run step 2 as in the section above, but with the -mult 1 flag enabled:
    • python3 postproc_analyzer.py -conf conf/config_file_name.txt -mult 1
    • the inputfile from the config has to point to one of the runs in the runs list but it will be otherwise not used.
    • the histograms files belonging to the runs in the list will be hadded
      • the histogram file of each run must exist individually in its dedicated dir (see "Run analysis" section)
      • the plotting will be done with the result as an input

tracker_pyanalysis's People

Contributors

noamhod avatar ssdetlab avatar

Watchers

 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.