Trigger Root Tree Analysis Utility

Introduction

This utility is the standard offline analysis framework for trigger test data based on the plain Root Tree Analysis. It contains two subpackages under users/Trg/ package in CVS. A current working development version reside at /afs/slac/g/glast/trigger/current, but this development area may be unstable as it is being updated continuously so that it is recommended to check out production tagged versions for private development. The two subpackages:

RTAutil

this is a lower level utility containing basic Root Tree Analysis utilities such as formatted dump of various digis, recon objects and GEM data, GEM event time, ideal geometry etc.

TrgTest

this contains the actual higher level trigger test analyses, all constructed as classes inheriting from the (slightly modified) standard RootTreeAnalysis class.

These packages have standard CMT structures setup to build sharable ROOT libraries. The reasons for going to the ROOT sharable libraries:

This utility is only tested for running on Linux platform (Noric) at SLAC. To work with these utilities, the basic setup needed are just the standard GLAST ground user .cshrc and ROOTSYS and lib paths defined for running ROOT. An example of this is /afs/slac/g/glast/trigger/glast.setup.

Usage and Development through CVS and CMT

CVS Repository 

The code CVS repository reside at the $CVSROOT/users/Trg/[Packagename]  (CVSROOT is /afs/slac/g/glast/ground/cvs on SLAC UNIX). As part of the "users" code, they are not attached to any office release so that you need to check them out and compile yourself for all usage. Because the packages live under users/ subdirectories, some care needs to be taken to not accidentally checkout or tag the whole users package with many people's code (you will regret it!). The general usage of the users packages are explained by Toby's posting. As an example, if you want to develop the TrgTest code, starting from tag v0-01,  under your own release directory myRelease, then the cvs checkout command is:
  cd myRelease
  cmt co -r v0-01 -o users/Trg TrgTest
The -o option indicates the directory offset for the package.  This should make a directory myRelease/TrgTest/v0-01/.  Within the package directory, you typically should have a subdirectory with the same name as the package name which contains the class headers; a subdirectory /src containging the class implementation C++ source files and the /cmt subdirectory containing the build options. The TrgTest pacakge also has a subdirectory /workdir for running applications in ROOT. When you commit the revised version for Trgtest, you should also issue the cvs commit from the directory myRelease/TrgTest/v0-00/ or it subdirectories to only commit code within the package. When you want to tag an updated version, again you should be sitting in myRelease/TrgTest/v0-01/ and using the -rtag recommended by Toby for the packages residing in subdirectories:
  cvs rtag TagName users/Trg/TrgTest
To check the tags, you need to spell out the full package directory offset:
  listtag users/Trg/TrgTest 

CMT Code Build

For packages checked out from CVS, you will work within CMT to build and update them.  The interactive CMT GUI is the recommended tool for doing development. It can be started with the command MRvcmt& after the setup is run. The essense of the CMT operations are introduced in the offline workbookunder the tab: MRvcmt. Upon startup of MRvcmt for the first time you need to configure the paths. From the MRvcmt top menu, select the Options tab then "Cmt Options"  to bring up the the following panel:

 
which is not yet filled. Click the "from CMTPATH file" box and then browse for the /afs/slac/glast/trigger/current/cmtpath-save file. Once located and entered the file, the panel should then be loaded with the contents shown above. Uncheck the "from CMTPATH file" box, then change the top line (highlighted in the picture above) of the paths box to whatever your own current working GLAST release directory, then use the save button (the little floppy symbol on the top right of the panel) to save this configuration to your own release directory as e.g. mycmtpath.  MRvcmt has a cached buffer so that next time you fire up MRvcmt, it will reload the same configuration as last time. With this saved file mycmtpath, you can choose to set the cmtpath file field to this file and check the "from CMTPATH file" box to make sure the configuration will load this file instead next time (this may be useful when developing different things under different releases).

Once done with the CMT configuration options and returned to the MRvcmt main panel. As an example of working in /afs/slac/glast/trigger/current  as the release directory,  and already used cvs to checkout both RTAutil and TrgTest packages, you should see something like this:


 

with the two packages shown under the release directory. If you didn't checkout the packages yet, you can also try the top "packages" menu to check out (package name TrgTest, Offset users/Trg).  You can then click on e.g. TrgTest v0-00  which will set it to be the current working package. For subsequent work of updating and building the selected package, you pretty much only needs to go to the top menu "Dev" tab to do "Make" (may be occassionally "configure" or "clean" in case of new files added or major structural/build option changes). Note that the build process created the platform binary output directory rh9_gcc32, which in particular contains the ROOT sharable library libTrgTest.so. The cmt  subdirectory originally only contains the requirements file, while the Make files are generated by the cmt processing.    

Updating/Adding Code

For editting an existing file, all you need to do is to select the checked out package in your dvelopement release in the MRvcmt Package Tree, then use the Dev menu "Make" to compile the sharable library (may need to clean/configure first if changed lower level .h file). For adding new files, an example to add a new class named MyTest to the TrgTest package:

Most of the trigger test analysis code should be just additional classes within TrgTest. In case there is need to create another package under users/Trg, it needs to follow Toby's posting: You can make the NewPackage/ directory first and creating the various subdirectories as needed. However, if you are copying the sturecture of another package to create this new package, you should watchout: Only keep the original source files which you want to put into cvs in those directories. So various files should NOT be present: e.g. all derived files other than the requirements in /cmt; NewPackage_rootcint.* in /NewPackage subdirectory; /rh9_gcc3  binary directory; any derived files/links in workdir etc. While sitting in the Newpage/ main directory, issue command:
   cvs import users/Trg/NewPackage vender v0          
where the vender is you initials or username, which will create the package NewPackage at $CVSROOT/users/Trg/NewPackage which you can immediately check. In fact it is useful to make a trial send with cvs -n import ... first,  which won't actually send to cvs yet but give you a list of what will be sent (I did mess up once without trying this first).     

Running Examples in the Utility 

Assuming you are a absolute beginner, trying this on SLAC Linux nodes e.g. Noric, the following prerequisits are needed: