Distribution_of_TimeDependent_Code

 As I indicated in

 http://drupal.star.bnl.gov/STAR/blog/heppel/2011/mar/28/new-code-led-time-dependence

I have created new classes to characterize the time dependence of FMS gains based on LED puser data.

This note includes instructions and a new psu software release that allows the use of these classes in the batch analysis of run 11 data.

The psu batch analysis code was described in a Feb 11 posting,

http://www.star.bnl.gov/protected/spin/heppelmann/tmp/Steps_analysis.pdf

The package has morphed a bit over time but the big change is the addition of time dependend gain corrections.

 

Getting the new package

 

The new version of the package is linked here. 

It is a tar "*.tar.gz" and builds the directory root12fms

Note: remember to delete the old complied lib. (root12fms/FpdRoot/Fpdchan.so)

and do a "make" to rebuild it!

tar -zxf  root12fms_WithRunDep.tgz
cd root12fms
cd FpdRoot
rm *.so
make
cd ../

 

 

Review of Old batch sequence

To run a condor job to analyse several runs of data, the recommend sequence was to run the MkRun script.

Edit SetFMSEnv and MkRun to point to some runs (including data source path)
below is an excerpt from MkRun
 
These scripts are made to run from within a csh or tcsh shell in which you have sourced the environment file.
 
cd root12fms
source SetFMSEnv
 
---------------from MkRun script--------------------------------
setenv TRIG_ROOT_DATA_SRC "/star/u/heppel/psu/tobiv/Run12/Day080/"
foreach RUN ( 12080001 12080020 } 
 
if (  ! -e files${RUN}/OFile.root ) then
 ./Mkfiles "${RUN}" "11001"&
sleep 60
else
 echo "abort: OFile.root file already present"
endif
 
end
-----------------------end MkRun script-----------------
 
The above lines from MkRun  submit ~100 jobs to condor for each run in the RUN list..
Foreach RUN , a directory root12fms/files${RUN} is created.
When completed  each files${RUN) will have ~100 subdirectories (one per 10k events).
When done each subdirectory will contain a "OFile.root" file and an adcout.root histogram file.
 
The Mkfiles script stays in the background  for each RUN until condor jobs complete.
Finally after condor jobs have completed, the ~100 sub-directory  OFile.root files are combined to produce,  a single "files${RUN}/OFile.root" and  "files${RUN}/adcout.root" histogram file.
 
After this, by hand, we create a fully combined root12fms/OF0.root  file and an associated root12fms/adc.root histobram file tree with the following commands.
 
cd root12fms
rm OF0.root
hadd OF0.root files*/OFiles.root
rm adc.root
hadd adc.root files*/adcout.root
 
The objective until now was to create this OF0.root file that contains the events for this runset.
We may want to delete the root12fms/files12.....or store them in on a scratch disk. They can be very large as can the root12fms/OF0.root file which we must keep.
 
We process this to make an Output.root file for physics with
 
cd root12fms
OneRead OF0.root 92 ./
root -b -q 'CeckJet.C("12xxx","Output.root")'

 

to make a file physics plots file called Jchk12xxx.pdf.

 

Run Sequence for using new time dependent correction code

 

This assumes that you have experience running the above scripts that submit condor jobs.  This section highlites that which  now is changed in the sequence.
 

1) Check the environment variables in root12fms/SetFMSEnv to be sure that you have $FMSCORR set correctly, with a current set of gain corrections from root12fms/fmstxt/. A new environment variable is defined in SetFMSEnv. This variable 

setenv RunDepPath "$FMSTXT/RunDep.root"

is used in various modules through the new code to find the run dependent correction files.

2) There are lots of trigger files on the psu disk in either ~heppel/psu/heppel/Run11/Day...  or in ~heppel/psu/tobiv/Run12/Day...

Edit the root12fms/MkRun  to point to 1 or more runs in one of these trigger source file directories.

2) Also edit the script root12fms/MkLed to point to the files and source directories to be analysed.

The only thing the MkLed is used for is to update the file root12fms/fmstxt/RunDep.root so the LED adc information is added to the file for the given run. This script does not use condor but runs on the local machine.  It runs a short job on each segment file for a run under study and makes an entry in the RunDep.root file. If you want to look at the RunDep.root file in root, be sure to run an initialization script like root12fms/start.C to load the libraries.

3) Run the MkLed script to add entries to RunDep.root.

cd root12fms
MkLed

You don't need to run MkLed if you are running data that is already represented in the root12fms/fmstxt/RunDep.root file.

After you finish this, a root12fms/files120... directory tree is created for each run. You should delete these directories.

4) After the root12fms/fmstxt/RunDep.root file is ready, you can submit the condor jobs as before.

Run the MkRun script

cd root12fms
MkRun >& log & 
 
When this job finishes, all the condor jobs will have been compleded and an OFile.root will be found in each of the directories  files12*/  a the top level.
 
These files should be combined  with
cd root12fms
hadd OF0.root files12*/OFile.root
OneRead OF0.root 92 ./
 
After you have taken the OF0.root file out of the various root12fms/files120... , the files120.... can be deleted.

The resulting file Output.root can be processed to produce physics plots with something like:

root -b -q 'CeckJet.C("12xxx","Output.root")'

to make a file called Jchk12xxx.pdf.

 

There is a lot of new code here and expect bugs.

Steve Heppelmann