GithubHelp home page GithubHelp logo

sly2j / hipo_tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeffersonlab/hipo_tools

0.0 2.0 0.0 203 KB

Hipo C++ interface and tools for other languages.

CMake 8.19% Makefile 0.07% Fortran 0.15% C++ 89.65% Python 1.83% Dockerfile 0.08% C 0.03%

hipo_tools's Introduction

hipo-tools

Build Status

"Official" C++ based analysis tools for hipo files.

Hipo-file Documentation (external project)

This code was adopted from source code on the jlab CUE /group/clas12/packages/hipo-io.

Installing

Note: These instructions are for Linux. For MacOS, refer to the next subsection.

git clone https://github.com/JeffersonLab/hipo_tools.git
cd hipo_tools && mkdir build
cd build
cmake ../. -DCMAKE_INSTALL_PREFIX=$HOME
make && make install

Installing on MacOS

For some reason XCode does not currently ship with the necessary C++17 filesystem libraries (even though they have been available in LLVM for several versions). As temporary workaround, we suggest to install llvm through Homebrew:

brew install llvm

Homebrew will skip the linking step when you install llvm (as to not screw up your system), so you will have to tell cmake to use the newer version of llvm/clang. The installation instructions for MacOS are:

git clone https://github.com/JeffersonLab/hipo_tools.git
cd hipo_tools && mkdir build
cd build
CXX=/usr/local/opt/llvm/bin/clang++ cmake ../. -DCMAKE_INSTALL_PREFIX=$HOME
make && make install

Some tips

  • Use the latest version of root with the latest compiler (e.g. gcc8)
  • Use C++17 because you have no reason not to!
  • Compile root with "-Droot7:bool=ON -Dcxx17:BOOL=ON"
  • Don't write loops! Use RDataFrame

Converting hipo files

toohip4root

$ toohip4root -h
SYNOPSIS
        toohip4root (<input file> | [-i <input file>]) [-o <output file>] [-f] [-v] [-N <N events>] [-h]

OPTIONS
        -f, --force force the output to overwrite existing files

        -v, --verbose
                    turn on verbose output

        -h, --help  print help

recon2root

A clas12 specific converter to extract the REC::* banks from a hipo file and put them into a root file. Useful for analysis especially if downloading the files to an offsite location or a personal computer.

$ recon2root <input file> [<output file>]

Todo

  • Isolate json parser from converter
  • Create clas12 specific helpers (maybe different repo for clas12 specific json?)
  • Setup CI with test data.
  • Debug build on mac (#7)
  • Test library in external cmake and pkgconfig projects

Install structure:

.
├── bin
│   ├── hipo
│   ├── recon2root
│   └── toohip4root
├── include
│   └── hipo
│       ├── data.h
│       ├── dictionary.h
│       ├── event.h
│       ├── hipoexceptions.h
│       ├── node.h
│       ├── reader.h
│       ├── record.h
│       ├── text.h
│       ├── THipo.h
│       ├── utils.h
│       └── writer.h
├── lib
│   ├── hipo
│   │   ├── HipoToolsConfig.cmake
│   │   ├── HipoToolsConfigVersion.cmake
│   │   ├── HipoToolsTargets.cmake
│   │   └── HipoToolsTargets-noconfig.cmake
│   ├── libhipocpp.so -> libhipocpp.so.0.0.1
│   ├── libhipocpp.so.0.0.1
│   └── libhiporoot.so
└── share
    └── pkgconfig
        └── hipocpp.pc

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.