Root detector

From LWP-Wiki
Jump to: navigation, search

Adding a detector to R3BRoot

As an example of modifications you might want to make, we will discuss how to add your own detector to R3Broot here. We assume you have already written the required source and header files (C++ classes) yourself. We assume the name of the detector is STUPID.

First create the directory /home/p123456/fair_install/R3BRoot/STUPID/, which will contain all your source and header files about the STUPID-detector.
Add this directory to the file /home/p123456/fair_install/R3BRoot/CMakeLists.txt.

Next create the directory /home/p123456/fair_install/R3BRoot/r3bdata/STUPIDData/. This will contain all the source and header-files about the data processing of the STUPID-detector.
Add all the .cxx files from the directory /home/p123456/fair_install/R3BRoot/r3bdata/STUPIDData/ to the list in the file /home/p123456/fair_install/R3BRoot/r3bdata/CMakeLists.txt.
Add the same files to the list in the file /home/p123456/fair_install/R3BRoot/r3bdata/R3BDataLinkDef.h, only without the .cxx extension and with a + sign attached now.

Add the detector to the file /home/p123456/fair_install/R3BRoot/r3bdata/R3BDetectorList.h in both places. Make sure the ordering is consistent.

Add the detector to the file /home/p123456/fair_install/R3BRoot/r3bdata/R3BMCTrack.cxx under Public Method Print, Public Method GetPoint and Public Method SetPoint.

Make sure you use a number that is not used by the other detectors and make sure you use the same number everywhere. If your source- and header-files in the directories /home/p123456/fair_install/R3BRoot/STUPID/ and /home/p123456/fair_install/R3BRoot/r3bdata/STUPIDData/ are correctly written, the compilation should finish without errors and the STUPID-detector should be ready for use now.