Difference between revisions of "G2p Replay Guide"

From Hall A Wiki
Jump to: navigation, search
 
Line 13: Line 13:
 
   /w/halla-1/g2p/AnalysisTools/analyzer/          Directory with analyzer, analyzer DB, environment setup.
 
   /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/replay/            Directory with replay scripts.
   /w/halla-1/g2p/AnalysisTools/ReplayTools/       Directory with batch-farm guide, onlineGUI, scripts.
+
   /w/halla-1/g2p/AnalysisTools/batch_farm/       Directory with batch-farm scripts.
  
  
Line 36: Line 36:
 
''  4.2. Required** structure:''
 
''  4.2. Required** structure:''
 
         user_name/replay/        ---  copy to here everything from "/w/halla-1/g2p/AnalysisTools/replay/"
 
         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/"
+
         user_name/batch_farm/   ---  copy to here everything from "/w/halla-1/g2p/AnalysisTools/batch_farm/"
 
                 > cd user_name
 
                 > cd user_name
 
                 > cp -r /w/halla-1/g2p/AnalysisTools/replay/ .
 
                 > cp -r /w/halla-1/g2p/AnalysisTools/replay/ .
                 > cp -r /w/halla-1/g2p/AnalysisTools/ReplayTools/ .
+
                 > cp -r /w/halla-1/g2p/AnalysisTools/batch_farm/ .
 
                     a. make changes to def.h in replay/
 
                     a. make changes to def.h in replay/
 
                         default output is ./Rootfiles, ./ScrachROOTfiles, ./summaryfiles.
 
                         default output is ./Rootfiles, ./ScrachROOTfiles, ./summaryfiles.
 
                         default output directories are found in def.h, change if you'd like.
 
                         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)
 
                     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.
+
         **This structure is required if you will be using 'gofarm' and 'farm_cache' in batch_farm directory
  
 
''  4.3a. Replay run:''
 
''  4.3a. Replay run:''
Line 51: Line 51:
 
       raw file has form:  g2p_#####.dat.**,  where ##### - run number and  ** - suffix (0, 1, 2 ...)
 
       raw file has form:  g2p_#####.dat.**,  where ##### - run number and  ** - suffix (0, 1, 2 ...)
 
       a) you will be asked for run_number
 
       a) you will be asked for run_number
       b) you will be asked for the number of events to analyze
+
       b) you will also be asked for the number of events (enter -1 to analyze all events)
      c) leave blank to analyze all events
+
 
''  4.3b Alternatively Replay can be submitted to Batch Farm (recommended):''
 
''  4.3b Alternatively Replay can be submitted to Batch Farm (recommended):''
       > cd /w/halla-1/g2p/user_name/ReplayTools/batch_farm
+
       > cd /w/halla-1/g2p/user_name/batch_farm
 
       > read batch_farm_guide for instructions.
 
       > read batch_farm_guide for instructions.
  
Line 71: Line 70:
 
'''5. Runs'''
 
'''5. Runs'''
 
   To obtain runs for analysis use farm_cache or farm_cache_single.
 
   To obtain runs for analysis use farm_cache or farm_cache_single.
   > cd /w/halla-1/g2p/user_name/ReplayTools/batch_farm/
+
   > cd /w/halla-1/g2p/user_name/batch_farm/
 
   > read batch_farm_guide for more information.
 
   > read batch_farm_guide for more information.

Latest revision as of 11:22, 21 September 2011

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/batch_farm/        Directory with batch-farm 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/batch_farm/    ---   copy to here everything from "/w/halla-1/g2p/AnalysisTools/batch_farm/"
                > cd user_name
                > cp -r /w/halla-1/g2p/AnalysisTools/replay/ .
                > cp -r /w/halla-1/g2p/AnalysisTools/batch_farm/ .
                    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 if you will be using 'gofarm' and 'farm_cache' in batch_farm directory

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 also be asked for the number of events (enter -1 to analyze all events)

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

     > cd /w/halla-1/g2p/user_name/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.
       --examples--
     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/batch_farm/
  > read batch_farm_guide for more information.