Jsonnet is now a required external dependency.
It is just far too
useful to keep optional and it's a very light-weight package so easy
to build. However, it is not yet added to
inaugural issue). Building it yourself is simple but non-standard.
Follow this guide:
- Get the source and do
- Copy the two header under
include/at some installation path.
- Similarly, copy the two shared libraries to
lib/at some installation path.
- Finally, copy the executable binary
One annoyance with the elaborate configuration which Jsonnet makes
easy is that, for some things, you do not want to constantly edit a
file just to make some small change. In particular, initial input and
final output files are often best given directly on the command line
rather than in some configuration file. Jsonnet also comes to the
rescue here by allowing external parameters to be "injected" into the
configuration using its
For this to work, the author of some configuration calls this function
where they would otherwise type in the value. Then the user must
supply that value on the
wire-cell command line or if compiling the
Jsonnet to JSON via the
An example is in the configuration supporting the new "multi-ductor"
feature (stay tuned for details). One spot it is used can be found in
depos.jsonnet where the input file holding depositions is set. The
jsonnet sets a value for this variable in the
same way: by simply adding a
-V flag. Here is a full example with
some comments to explain:
$ wire-cell \ -V detector=uboone \ # (1) -V depofile=g4tuple-qsn-v1-fixed.json.bz2 \ # (2) -V framefile=uboone.root \ # (3) -c multi/init.jsonnet \ # (4) -c multi/multiductor.jsonnet # (5)
- A variable
detectoris used in various places of the configuration to switch between some global parameters specific to that detector.
- The input
depofileis set. Remember that WCT will look for JSON/Jonnet files in directories given in the
- The output
framefileis set. This will hold all the frames of traces (aka the "event") that get simulated.
- The first of two configuration files that being the list of configurables.
- The "meat" of the configuration.