Skip to content

Commit

Permalink
basic installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
cbernet committed Feb 6, 2019
1 parent 33d7f1d commit 42f5da0
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 45 deletions.
167 changes: 123 additions & 44 deletions doc/Heppy_-_Installation_Instructions.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,125 @@
# Heppy : Installation Instructions


## Prerequisites

Heppy only depends on python and ROOT (if you intend to read events from a ROOT file), making the installation fairly simple. If you're using heppy in the context of the CMS or FCC software on SLC6, you're all set and you can proceed to the [next section](#environment)

**python 2.x, x>5**

On top of python, you need the following python packages:

* numpy
* scipy
* dill
* gitpython
* pyyaml

To get them, install pip and use it to install these packages.

**ROOT 6, with pyroot support (optional)**

Note that you need to ensure that ROOT was compiled with the same version of python as the one in your PATH.

To check that, do the following:

python
import ROOT

Any error message needs to be taken care of before going further.


## Installation

First [fork](https://help.github.com/articles/fork-a-repo/) the heppy repository on your github account.

Then, [clone](https://help.github.com/articles/cloning-a-repository/) your copy of the heppy repository locally.

Move to the `heppy` directory run the initialization script (to be done everytime you want to use heppy):

source ./init.sh

Check that you can now import heppy:

python
import heppy

heppy can be used to read any type of input file, and in particular:

* text files
* python formats (pickle, hf5, etc)
* ROOT files
* EDM files from the CMS, ILC/CLIC, or FCC experiments

If you only intend to read files readable in python, possibly with additional python libraries, the bare installation is for you.

If you need to read ROOT files, refer to the ROOT-based installation.

If you belong to CMS, ILC/CLIC, or FCC, please refer to the instructions provided by these experiments.


## Basic installation

heppy requires python 2.7.X, and is not compatible with python 3 yet.

You can install this version of python manually, or get it through [Anaconda](https://www.anaconda.com/).

If you choose to use Anaconda, first [download it](https://www.anaconda.com/distribution/) (pick the 2.X version) and install it.

Then, create an environment for heppy:

```
conda create -n heppy python=2.7
conda activate heppy
```

And finally install heppy:

```
pip install heppyfwk
```

To test your installation, you can download the configuration file [text\_example\_cfg.py](https://raw.githubusercontent.com/cbernet/heppy/master/test/text_example_cfg.py) and do

```
heppy Out text_example_cfg.py
```

You should get an output like:

```
starting loop at event 0 to process 100 events.
Component: test_component
dataset_entries: 0
files : ['/var/folders/tf/xx9nk7w1511c4l0xd95pmpdw0002cy/T/tmpQRQ1hO']
isData : False
isEmbed : False
isMC : False
tree_name : None
triggers : None
beginLoop heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1
event 0
Event: 0
{ 'analyzers': [ ( heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1,
True)],
'eventWeight': 1,
'iEv': 0,
'x1': 0,
'x2': 0}
Event: 1
{ 'analyzers': [ ( heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1,
True)],
'eventWeight': 1,
'iEv': 1,
'x1': 1,
'x2': 1}
Event: 2
{ 'analyzers': [ ( heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1,
True)],
'eventWeight': 1,
'iEv': 2,
'x1': 2,
'x2': 4}
Event: 3
{ 'analyzers': [ ( heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1,
True)],
'eventWeight': 1,
'iEv': 3,
'x1': 3,
'x2': 9}
Event: 4
{ 'analyzers': [ ( heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1,
True)],
'eventWeight': 1,
'iEv': 4,
'x1': 4,
'x2': 16}
Analyzer: heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1
class_object : <class 'heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer'>
instance_label : 1
verbose : False
Component: test_component
dataset_entries: 0
files : ['/var/folders/tf/xx9nk7w1511c4l0xd95pmpdw0002cy/T/tmpQRQ1hO']
isData : False
isEmbed : False
isMC : False
tree_name : None
triggers : None
---- TimeReport (all times in ms; first evt is skipped) ----
processed all evts time/proc time/all [%] analyer
--------- -------- --------- --------- ----- -------------
100 100 0.00 0.00 100.0% heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1
--------- -------- --------- --------- -------------
100 100 0.00 0.00 100.0% TOTAL
Counter analyzers :
heppy.analyzers.examples.simple.TextAnalyzer.TextAnalyzer_1 100 1.00 1.0000
number of events processed: 100
(heppy_test_pypi) [~]$ ls Out/test_component/
__cfg_to_run__.py log.txt
component.pck software.yaml
config.pck text_cfg.py
```
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setuptools.setup(
name='heppyfwk',
version='2.0.9',
version='2.0.11',
author='Colin Bernet',
author_email='[email protected]',
description='An event processing framework for High Energy Physics.',
Expand Down

0 comments on commit 42f5da0

Please sign in to comment.