Git Product home page Git Product logo

soco2root's Introduction

soco2root

soco2root converts event files (*.evt) build by soco2 to *.root files readable by ROOT. The contents are not changed - think of converting a MS Office document to LibreOffice.

The resulting root-files contain a tree called ttree with a single branch events of type SOCO::Event. Each event then contains a vector with all hits belonging to this event.

  • tree
    • event
      • trigger_id
      • timestamp
      • hits (vector)
        • id
        • adc
        • timestamp

Usage

Converting

soco2root:
  -h [ --help ]             Display this help message
  -v [ --version ]          Display the version number
  -t [ --threads ] arg (=1) Number of threads
  -o [ --output-dir ] arg   Output directory. If not set, input file location is used
  --input-files arg         Input files

Example:

$ soco2root -o out -t 20 /path/to/event/files/120Ub.*.evt
Using thread pool with 20 threads.
/path/to/event/files/120Ub.0005.evt -> out/120Ub.0005.root
/path/to/event/files/120Ub.0001.evt -> out/120Ub.0001.root
/path/to/event/files/120Ub.0008.evt -> out/120Ub.0008.root
/path/to/event/files/120Ub.0003.evt -> out/120Ub.0003.root
/path/to/event/files/120Ub.0013.evt -> out/120Ub.0013.root
/path/to/event/files/120Ub.0010.evt -> out/120Ub.0010.root
/path/to/event/files/120Ub.0006.evt -> out/120Ub.0006.root
...

Root Macros

To be available in your root macros, the directory containing libSOCO.rootmap and libSOCO.so has to be added to the environment variable, e.g.:

export LD_LIBRARY_PATH=/path/to/soco2root/build/:$LD_LIBRARY_PATH

A SOCO:Event* can then be set as branch address and iterated over as usual. See examples/ for basic macro examples.

Limitations & Warnings

SOCO2 does NOT actually save calibrated values to the event files, that means you have to implement energy calibration yourself (see examples).

Note: Hit energy values are saved as uint16_t, which

  • can lead to hard-to-track errors when doing math operations due to unsigned math
  • can sometimes lead to strange binning issues when filling histograms
  • may loose resolution when using calibration (i.e calibration to 1 keV per hit.adc value unit)

Installation

Requirements

  • a non-ancient compiler
  • cmake
  • boost (program_options, bind, asio, thread)
  • root6

Building

git clone https://gitlab.ikp.uni-koeln.de/jmayer/soco2root.git
cd soco2root
mkdir build
cd build
cmake ..
make

✌Installing✌

  • executable:
    • add build directory to PATH
    • or move id to a directory which is in your path
    • or call it directly
  • library
    • add build directory to LD_LIBRARY_PATH, see Root Macros

soco2root's People

Contributors

janmayer avatar

Stargazers

5l1v3r1 avatar

Watchers

James Cloos 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.