The software was intentionally designed to separate the data input and analysis tools.
Similar to JUNO Offline, two main structures exist: one is named `**algorithm**`, and the other is named `**tool**`. Each of these structures has its own set of rules for definition.
1.`**algorithm**` can accept the input **arguments** and input **data** (only `ROOT` data can be accepted now). The **data** is input as a list written in a text file, **arguments** can be delivered to the `algorithm` by setting in the python script. Besides, the `**algorithm**` can call analysis `tool` to process the data.
2.`**tool**` contains the true analysis algorithm
## Create your own algorithm
Create an algorithm named `ExampleAlg` in `./Analysis`
```bash=
cd Analysis
mkdir ExampleAlg
cd ExampleAlg
mkdir src
mkdir python
mkdir python/ExampleAlg
touch CMakeLists.txt
```
In `python/ExampleAlg/__init__.py`
```python=
import Sniper as sn
sn.loadDll("libExampleAlg.so")
```
In `CMakeLists.txt`
```cmake=
PKG(ExampleAlg
DEPENDS
AnaTool
)
```
An `**algorithm**` is defined as a `c++ class` like
```c++=
// Similar to JUNO Offline, this line will register the algorithm
DECLARE_ALGORITHM(ExampleAlg);
// The *Alg class must inherit from AlgBase
class ExampleAlg : public AlgBase {
public:
// necessary
ExampleAlg(const string&);
virtual ~ExampleAlg();
// initialize, execute, finalize will be called automatically