Skip to content

Commit 4084a27

Browse files
committed
update readme
1 parent 2194ef8 commit 4084a27

File tree

2 files changed

+542
-2
lines changed

2 files changed

+542
-2
lines changed

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,65 @@ python setup.py install # or python setup.py develop for development
3131
# the -d option will also generate the input doublets
3232
create_dataset -n 0.01 -p mini1 -d -v
3333

34-
# run the algorithm (add -p to see the results in your browser)
35-
run_qallse -i mini1/event000001000-hits.csv
34+
# run the algorithm
35+
qallse -i mini1/event000001000-hits.csv quickstart
36+
```
37+
38+
### Commandline tools
39+
40+
The main commandline scripts are:
41+
42+
* `create_dataset`: to create datasets from TrackML events.
43+
* `qallse`: run the algorithm.
44+
45+
Other tools are:
46+
47+
* `run_seeding`: generate the initial doublets, you won't need it if you call `create_dataset` with the `-d` option.
48+
* `parse_qbsolv`: this parses a qbsolv logfile (with verbosity>=3) and generates a plot showing the energy of the solution after each main loop.
49+
* `filter_doublets`: this can be used to remove doublets with too many holes from the input doublets.
50+
51+
Each tool comes with a `-h` or `--help` option.
52+
53+
### API
54+
55+
The `examples` directory contains some examples on how to do everything from scripts instead of using the commandline.
56+
57+
Other very useful functions are available in `hepqpr.qallse.cli.func` and pretty self-explanatory.
58+
59+
### Running from an IPython notebook
60+
61+
Just create a conda environment and to install the package using `setup.py` (see [conda doc](https://conda.io/docs/user-guide/tasks/manage-environments.html)).
62+
63+
To get the output of qallse in the notebook, use:
64+
65+
```python
66+
import logging
67+
# turn on logging
68+
logging.basicConfig()
69+
# optional: display the time as well
70+
fmt = logging.Formatter("%(asctime)s.%(msecs)03d %(levelname)s %(name)s: %(message)s", datefmt='%H:%M:%S')
71+
for handler in logging.getLogger().handlers: handler.setFormatter(fmt)
72+
# set the logging level for qallse
73+
logging.getLogger('hepqpr').setLevel(logging.DEBUG)
74+
```
75+
76+
See the notebook example for more information.
77+
78+
### Plotting
79+
80+
You can use `hepqpr.qallse.plotting` for plotting doublets and tracks easily.
81+
82+
__Jupyter__: if you are running in a notebook, you need to tell the module so by calling `set_notebook_mode()`.
83+
84+
The methods take a `DataWrapper` and a list of xplets (an xplet is here a list of hit ids). The argument `dims` lets you define the plane to use (2D or 3D). The default is `xy`.
85+
86+
Typical usage:
87+
88+
```python
89+
precision, recall, missings = dw.compute_score(final_doublets)
90+
iplot_results(dw, final_doublets, missings)
91+
iplot_results(dw, final_doublets, missings, dims=list('zr'))
92+
iplot_result_tracks(dw, final_tracks)
3693
```
3794

3895

0 commit comments

Comments
 (0)