Skeletons

The skeletons can be located in <../skeleton>. These are the “bare bones” (get it?) for what you need to implement a new detector type or model. They are a good place to start to see the bare minimum you need. That is, to get all of RB to work together, it is, unfortunately, required that some functions are called are specific times. The skeletons will show you which of the functions must be called (which can be hard to discern if you are looking at some existing likelihood/model code).

Note

In RockBottom-speak, if you want to add a new array or detector type, this is equivalent to adding a new likelihood.

Developing a new likelihood

If you would like to develop a new likelihood, you will have to create three new files. A new BaseLikelihood, a new LDFLikelihood, and a new TimingLikelihood. Below is a list of steps necessary to carry this out.

  1. Choose a detector name and be consistent. In this example we will use “MyDet”.

  2. Add your detector type to the enum in ./public/rock_bottom/I3RbUltilties.h and also updated by pybinding to include this enum as well

  3. Open ./public/rock_bottom/interface/I3RbLikelihoodBase.h and add DECLARE_WRAPPED(MyDet) to this file

  4. Make a new folder for your detector’s cxx files (ex: ./private/rock_bottom/interface/mydet)

  5. Make your own I3MyDetBaseLikelihood.cxx in this directory (and rename as needed)

  6. Open ./private/rock_bottom/interface/I3RbLikelihoodBase.cxx and…

    1. Add a call ConstructMyDet in I3RbLikelihoodBase::I3RbLikelihoodBase

    2. Add your detector to all the switches. Each function except the constructor should have a switch that points to your function.

  7. Open ./public/rock_bottom/interface/I3RbLDFLikelihood.h and add a DECLARE_WRAPPED(MyDet) call for your detector type

  8. Make your own I3MyDetLDFLikelihood.cxx in your detector’s directory like before

  9. Open ./public/rock_bottom/interface/I3RbTimingLikelihood.h and add a DECLARE_WRAPPED(MyDet) call for your detector type

  10. Make your own I3MyDetTimingLikelihood.cxx in your detector’s directory like before

  11. Actually do all the hard work of coding up your new likelihood

Note

Don’t forget to do a find and replace for Skeleton –> MyDet in these files

Note

If you want cmake to find your new .cxx files, you need to go to your build directory and type in make rebuild_cache.

For more on what you should put into this likelihood or what you are expected to do, see the documentation on the likelihoods.

Developing a new model

The model is a description of exactly how your detector works, in some sense. All of the detector specific knobs should be here and there can be more than one model for a single detector depending on how you want to do the reconstruction. Below is a list of steps necessary to carry out a new model implementation.

  1. Make a new directory for your detector: ./public/rock_bottom/models/mydet and ./private/rock_bottom/models/mydet

  2. Copy the SkeletonSignalModel.h to ./public/rock_bottom/models, replacing “Skeleton” with your model name.

  3. Rename all the functions from “Skeleton” to whatever you model is called

  4. Copy SkeletonSignalModel.cxx to ./private/rock_bottom/models, again with your desired model name

  5. Rename all the functions from “Skeleton” to whatever you model is called

  6. Actually do all the hard work of coding up your new model

  7. Copy the skeleton for the pybindings SkeletonSignalModelPy.cxx to ./private/pybindings and change the names to your signal model name

Note

If you want cmake to find your new .cxx files, you need to go to your build directory and type in make rebuild_cache.