G2p Replay Guide

From Hall A Wiki
Revision as of 13:17, 13 September 2011 by Tbadman (Talk | contribs)

Jump to: navigation, search

G2P REPLAY GUIDE (also available at /w/halla-1/g2p/AnalysisTools/analysis_guide)

How to start:

1. Directory structure

  /w/halla-1/g2p                                  Main g2p working directory
  /w/halla-1/g2p/user_name/                       Directory for each user, have to be created by user
  /w/halla-1/g2p/software/                        Directory with geant4, XercesC, coda, CLHEP etc.
  /w/halla-1/g2p/AnalysisTools/                   Directory with main tools for analysis.
  /w/halla-1/g2p/AnalysisTools/analyzer/          Directory with analyzer, analyzer DB, environment setup.
  /w/halla-1/g2p/AnalysisTools/replay/            Directory with replay scripts.
  /w/halla-1/g2p/AnalysisTools/ReplayTools/       Directory with batch-farm guide, onlineGUI, scripts.

2. Replay scripts.

  Replay scripts will be located in the /replay/ directory as <replay_name>.C.
  *.cdef - define cuts, that will be done on replay level.
  *.odef - define output (tree variables, histograms etc.)

3. Environment setup.

  Environment setup for root and analyzer, for geant4 see geant4 setup.
     > source /w/halla-1/g2p/AnalysisTools/analyzer/sourcethis.csh
     > or add this command to .cshrc at end of file in ~ to permanently setup environment.

4. To start work.

4.1. Create your own directory inside /w/halla-1/g2p/

       > ssh ifarml64
       > cd /w/halla-1/g2p/
       > mkdir user_name

4.2. Required** structure:

       user_name/replay/        ---   copy to here everything from "/w/halla-1/g2p/AnalysisTools/replay/"
       user_name/ReplayTools/   ---   copy to here everything from "/w/halla-1/g2p/AnalysisTools/ReplayTools/"
                > cd user_name
                > cp -r /w/halla-1/g2p/AnalysisTools/replay/ .
                > cp -r /w/halla-1/g2p/AnalysisTools/ReplayTools/ .
                    a. make changes to def.h in replay/
                       default output is ./Rootfiles, ./ScrachROOTfiles, ./summaryfiles.
                       default output directories are found in def.h, change if you'd like.
                    b. make changes in .odef (for different output), in .cdef(for cuts)
       **This structure is required to run gofarm and farm_cache in ReplayTools/batch_farm.

4.3a. Replay run:

     > cd /w/halla-1/g2p/user_name/replay/
     > analyzer <replay_name>.C
     raw file has form:   g2p_#####.dat.**,  where ##### - run number and  ** - suffix (0, 1, 2 ...)
     a) you will be asked for run_number
     b) you will be asked for the number of events to analyze
     c) leave blank to analyze all events

4.3b Alternatively Replay can be submitted to Batch Farm (recommended):

     > cd /w/halla-1/g2p/user_name/ReplayTools/batch_farm
     > read batch_farm_guide for instructions.

You should now have the rootfile in the directory you specified as output (default is /user_name/replay/Rootfiles/).

4.4. Analyze data.

     > cd <output_directory>
     > analyzer g2p_#####_**.root
     ##### - run number,  ** - suffix.
     analyzer[0]> T->Draw("L.s2.la[0]")   ----  Draw L.s2.la[0] variable
     analyzer[0]> T->StartViewer()        ----  Shows Tree structure
     **** Variable definitions are available at http://hallaweb.jlab.org/podd/doc/variables.html ****

5. Runs

  To obtain runs for analysis use farm_cache or farm_cache_single.
  > cd /w/halla-1/g2p/user_name/ReplayTools/batch_farm/
  > read batch_farm_guide for more information.