Wire-Cell-Tutorial

@wire-cell-tutorial

Wire-Cell Tutorial

Public team

Joined on Jul 22, 2021

  • wcwc cluster wcwc-howto Wire-Cell Software GitHub Class references: The Wire-Cell Toolkit class referecnes generated by Doxygen. Manual: The official Wire-Cell Toolkit Manual. Blog: Latest news on Wire-Cell development. WCP manual: The Wire-Cell prototype manual (unmaintained)
     Like  Bookmark
  • Basic Install Wire-Cell Toolkit Typical workflow Quick Start Explore real data Examine program flow Write a module Simulate tracks
     Like  Bookmark
  • There are several ways to install Wire-Cell Toolkit on your local computer (see, e.g. here). To avoid choice overloading and get you started as quickly as possible, we describe an officially recommended way of installation: using the cvmfs network file system and the singularity container. This way allows you to both develop Wire-Cell by itself and integrate it with other software frameworks such as LArSoft. Install CVMFS CVMFS (CernVM File System) is a utility that mounts remote directories over HTTP. CVMFS provides a simple way to distribute software binaries. Follow Brett's instruction for details of installation. For the lazy ubuntu'ers: sudo apt-get install lsb-release wget https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb sudo dpkg -i cvmfs-release-latest_all.deb sudo apt-get update sudo apt-get install cvmfs cvmfs-config-default
     Like  Bookmark
  • Get data Let's use ProtoDUNE-SP as an example. To look at raw data, you need to setup WCT with LArSoft first. Then, you can copy a data file using ifdh cp -D gsiftp://url/to/raw_data . to your local directory. Note that this requires you have set up the FNAL Kerberos authentication already. Otherwise, you can wget an example (~7GB) raw data file here (gsiftp link of the same file). The raw data file has a special root format that contains larsoft objects. You can check the data structure of an event through the useful eventdump.fcl command: $ lar -n1 --nskip 0 -c eventdump.fcl /path/to/raw_data.root Run signal processing The following command performs Wire-Cell signal processing on the raw data using a fhicl configuration wcls-raw-to-sig.fcl:
     Like  Bookmark
  • Singularity Singularity is a lightweight container that provides an operating-system level virtualization. It is popular in the world of scientific high-performance computing (HPC). Wire-Cell use singularity to provide a virtual scientific linux environment to consistently build the package. During code development, it's important to be always clear if you are working inside your native OS or inside the singularity container. Useful links Official User Guide Short YouTube Basics from Sylabs Jsonnet Jsonnet is a data templating language, pronounced "jay sonnet", not "json net". It is perhaps popularized by the Kubernetes community. Wire-Cell used jsonnet extensively for configurations.
     Like  Bookmark
  • To ensure maintainability and ease collaborative development, we use clang-format to guarantee code merged in wire-cell-toolkit following certain conventions. A .clang-format file is provided in the wire-cell-toolkit repository. clang-format install clang-format Ubuntu: sudo apt install clang-format
     Like  Bookmark
  • Line charge simulation To start with an easy example, let's simulate an ideal-line charge in the protoDUNE-SP TPC. wire-cell -c pgrapher/experiment/pdsp/wct-sim-check.jsonnet The configuration is available here. It is also possible to simulate multiple line charges. For instance, two line charges are simulated in the following example. The charge deposition is set to 2500 electrons per step, and the step length is set to 0.5mm. Therefore, it mimics two MIP tracks with charge deposition of ~5000 e/mm. local cathpier = { tail: wc.point(-113, 585, 409, wc.cm), head: wc.point( 118, 24, 269, wc.cm),
     Like  Bookmark
  • Wire-Cell follows the dataflow programming paradigm that models a program as a directed graph of data flow between operations. The dataflow graph is defined by a top-level jsonnet file. For instance, in the previous "Explore Real Data" example, Wire-Cell executed this jsonnet file to perform the entire signal processing chain on ProtoDUNE-SP raw data. Dump configurations We can visualize the dataflow graph, called pgraph in Wire-Cell, to better understand how the program runs. First, we can dump all the configuration into a single json file jsonnet -V reality=data -V raw_input_label=daq \ -J cfg cfg/pgrapher/experiment/pdsp/Quickstart/raw-to-sig.jsonnet \ -o a.json The output a.json is a huge JSON file that contains all the pgraph and configuration parameters. It may be difficult to read. Certain tools such as jq can be used to parse the JSON file at command line. In the following, we use another tool wirecell-pgraph to visualize the pgraph.
     Like  Bookmark
  • # Write a Module
     Like  Bookmark
  • Depending on your purpose, there are different workflows that you can follow. For details, see Brett's instruction. Initialize a project Pick a new directory for your project: wcdo.sh init wcdo.sh wct wcdo.sh get-image sl7krb wcdo.sh make-project myproj sl7krb $ ./wcdo-myproj.sh
     Like  Bookmark