tpctest demo

William A. Love
Last modified: Thu Sep 10 16:17:57 EDT 1998

At the collaboration meeting Torre asked that people make an effort to evaluate ROOT as a tool for STAR data analysis. Yuri and Valery had paved the way by making tools to handle PAMs, Tables and XDF files. The tst.kumac created by Iwona for analysis of data from the Summer 1997 test of the TPC with cosmic rays and laser signals seemed like a good size project to try. Since I had made some ROOT applications that were simple replacements of PAW efforts for the STAR magnet mapping effort, I set out to rewrite tst.kumac as a C++ CINT script. Yuri asked me instead to use his ready made StChain system which was prepared to handle the input of parameters, the calling of the PAMS and the looping through events. I put the tst kumac in shape to work out of the "official" STAR dataset directory structure and Yuri converted it into a package called St_laser_Maker. This had the disadvantage that I was not learning much about how to do this but the advantage that it worked pretty early. That is, it input all the necessary parameters, read some events from one laser data file, and did tracking. I then tried to get it to fill the output ntuple and plot the hits and tracks, working with a pretty black box.

In a short time we had a ROOT version of the tst.kumac that is faster and smaller and produces smaller ntuple files and better event plots. The script is called laser.C but most of the kumac had been moved into compiled code in St_laser_Maker.cxx. Do we know if it gives the same results? I compared ntuples from tst.kumac and laser.C. The code found all the same tracks, but there were discrepancies in the number of hits assigned to the tracks. Then I (re)discovered that the straight tracking routine, tpt_sts, produces inconsistencies in the count of hits on tracks. I remembered that I had decided long ago that there was no future in debugging tpt_sts, but that a better course would be to use the regular tracking, tpt, for these straight tracks, since we want tpt to be efficient for high momentum tracks.

At this point I made a new package, St_tpctest_Maker, and a new script, tpctest.C. If there is any interest in using this code, I recommend this version as being more useful, if less efficient, than the straight line tracking. In its present form the procedure for running it is:

0. Do stardev
(and maybe copy tpctest.C to your directory as you might want to modify it later to change input and output files)
1. Execute Root.exe,
the form of root startup that includes the STAR additions
2. .x load.C
This loads the libraries for the standard chain, including unneeded SVT code.
3. .L tpctest.C
This loads the four macros of the tpctest package.
which must be executed first to load parameters and open the .xdf test data file.
which discards events from the data file. Most of the tpctest data starts with a messed up event buffer, so skip() is a good second command.
which does cluster, hit, and track finding and plots the events. For both macros n defaults to 1.
when you're done, which writes the final ntuple to the disk file.
By editing the tpctest.C file you can change which data file you execute and the name of your output ntuple file. The rest of the control is, at present, locked up in the source code. That needs to be changed but is not as bad as it sounds since the compile cycle is quick and easy. Simply check out StRoot and edit the St_tpctest_Maker source and type makel StChain in the parent directory of StRoot. Some details for those really interested