---
# System prepended metadata

title: Clustering Porting

---

# Clustering Porting

## uboone testing setup

src: https://github.com/WireCell/wire-cell-toolkit/tree/apply-pointcloud
cfg: https://github.com/HaiwangYu/wcp-porting-img

get src, something like this
```bash!
git clone git@github.com:WireCell/wire-cell-toolkit.git
cd wire-cell-toolkit
git checkout -b apply-pointcloud remotes/origin/apply-pointcloud
```


configure, assuming env variables following FNAL ups product pattern
```bash=
./wcb configure \
--build-debug="-O2 -ggdb3 -w" \
--with-tbb="$TBB_FQ_DIR" \
--with-jsoncpp="$JSONCPP_FQ_DIR" \
--with-jsonnet-include="$GOJSONNET_FQ_DIR/include" \
--with-jsonnet-lib="$GOJSONNET_FQ_DIR/lib" \
--with-eigen-include="$EIGEN_DIR/include/eigen3/" \
--with-root="$ROOTSYS" \
--with-fftw="$FFTW_FQ_DIR" \
--with-fftw-include="$FFTW_INC" \
--with-fftw-lib="$FFTW_LIBRARY" \
--with-fftwthreads="$FFTW_FQ_DIR" \
--boost-includes="$BOOST_INC" \
--boost-libs="$BOOST_LIB" \
--boost-mt \
--with-hdf5="$HDF5_FQ_DIR" \
--with-h5cpp="$H5CPP_DIR" \
--with-spdlog-include="$SPDLOG_INC" \
--with-spdlog-lib="$SPDLOG_LIB" \
--prefix=$WIRECELL_FQ_DIR
```

install
```bash!
./wcb -p --notests build install
```

set up ``$WIRECELL_PATH`, something like:
```bash!
export WIRECELL_PATH=<path-to-cfg>:<wire-cell-data>
```
`<path-to-cfg>` could be `path-to-<HaiwangYu/wire-cell-toolkit>/cfg`

run, needs [this](https://www.phy.bnl.gov/~yuhw/wcp-porting-img/celltreeOVERLAY.root) ROOT input

```bash!
git clone https://github.com/HaiwangYu/wcp-porting-img.git
cd wcp-porting-img
```

One-pass run:
```bash!
wire-cell -l stdout -L debug -c wct-uboone-full.jsonnet \
--tla-str input="celltreeOVERLAY.root" \
--tla-code entry=0 \
--tla-str bee_dir="data"
```
Seperated imaging/clustering
```bash!
wire-cell -l stdout -L debug -c wct-uboone-img.jsonnet
SPDLOG_LEVEL=debug wire-cell -l stdout -L debug -c wct-uboone-clustering.jsonnet
```

upload to BEE
```bash!
./zip-upload.sh
```
example BEE:
https://www.phy.bnl.gov/twister/bee/set/529c9763-4554-4cfb-8994-9f33396bb15f/event/6501/