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.
Choose a detector name and be consistent. In this example we will use “MyDet”.
Add your detector type to the enum in ./public/rock_bottom/I3RbUltilties.h and also updated by pybinding to include this enum as well
Open ./public/rock_bottom/interface/I3RbLikelihoodBase.h and add
DECLARE_WRAPPED(MyDet)
to this fileMake a new folder for your detector’s cxx files (ex: ./private/rock_bottom/interface/mydet)
Make your own
I3MyDetBaseLikelihood.cxx
in this directory (and rename as needed)Open ./private/rock_bottom/interface/I3RbLikelihoodBase.cxx and…
Add a call ConstructMyDet in I3RbLikelihoodBase::I3RbLikelihoodBase
Add your detector to all the switches. Each function except the constructor should have a switch that points to your function.
Open ./public/rock_bottom/interface/I3RbLDFLikelihood.h and add a
DECLARE_WRAPPED(MyDet)
call for your detector typeMake your own I3MyDetLDFLikelihood.cxx in your detector’s directory like before
Open ./public/rock_bottom/interface/I3RbTimingLikelihood.h and add a
DECLARE_WRAPPED(MyDet)
call for your detector typeMake your own I3MyDetTimingLikelihood.cxx in your detector’s directory like before
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.
Make a new directory for your detector: ./public/rock_bottom/models/mydet and ./private/rock_bottom/models/mydet
Copy the SkeletonSignalModel.h to ./public/rock_bottom/models, replacing “Skeleton” with your model name.
Rename all the functions from “Skeleton” to whatever you model is called
Copy SkeletonSignalModel.cxx to ./private/rock_bottom/models, again with your desired model name
Rename all the functions from “Skeleton” to whatever you model is called
Actually do all the hard work of coding up your new model
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
.