How to make root file from FGT cosmic data

Here's how to use the StFgtDaq2RootMaker, which converts the fgt data in the daq file into a root file.

I'll assume your offline/StFgtDevel was checked out into the directory ~/FGT/CVS.  If you need help checking out the code, see this blog.  I'll assume we'll be working in the directory ~/FGT/daq2root/.  If it doesn't exist, do the following

cd ~/FGT
mkdir daq2root

For case of example, I'll assume that you want to convert run 400021, taken Oct 6th at 14:01:23 when quadrants 8, 18, and 7 were on the test stand.  Do the following

cd ~/FGT/daq2root
ln -s ~/FGT/CVS/offline/StFgtDevel/.sl53_gcc432 .
ln -s ~/FGT/CVS/offline/StFgtDevel/StRoot/StFgtPool/StFgtDaq2Root/macros/runDaq2Root.C
starver eval
root4star -b -q runDaq2Root.C'("/star/institutions/mit/FGT_Cosmic_Data/daq/06Oct2011/FGT008_FGT018_FGT007_400021_2011_10_06_14_01_23.sfs","FGT008_FGT018_FGT007_400021_2011_10_06_14_01_23.root")'

You should now have a file "FGT008_FGT018_FGT007_400021_2011_10_06_14_01_23.root" in your directory "~/FGT/CVS".  Enjoy!

Note: to do a different run, you only need to repeat the last step.  Next time you log in, you can skip the "ln -s" steps. There's also a macro in

 ~/FGT/CVS/offline/StFgtDevel/StRoot/StFgtPool/StFgtDaq2Root/macros/readFgtTree.C

which shows an example of how to read the trees.  This macro has not STAR dependencies, and it and the generated root files can be copied to machines elsewhere for analysis.