Difference between revisions of "GettingStarted hallc replay XEM"

From Xem2
Jump to navigationJump to search
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
===Purpose===
 
===Purpose===
 
The Hall C replay is a database structure used to hold detector calibrations, detector geometry, detector maps, output templates, replay scripts, defined output histograms, run numbers and run information.  You may hear people call this the 'Analyzer' or 'Engine' as the C++ analyzer is based on the earlier ENGINE code written in Fortran.  HCANA itself inherits most classes from the Hall A Analyzer.  The ultimate goal of the hallc_replay_XEM is to tell hcana how to analyze the raw EVIO files generated by the Hall C DAQ and process them into relevant root branches in a CERN ROOT TFile.   
 
The Hall C replay is a database structure used to hold detector calibrations, detector geometry, detector maps, output templates, replay scripts, defined output histograms, run numbers and run information.  You may hear people call this the 'Analyzer' or 'Engine' as the C++ analyzer is based on the earlier ENGINE code written in Fortran.  HCANA itself inherits most classes from the Hall A Analyzer.  The ultimate goal of the hallc_replay_XEM is to tell hcana how to analyze the raw EVIO files generated by the Hall C DAQ and process them into relevant root branches in a CERN ROOT TFile.   
 +
 +
===Location Location Location===
 +
* Review the File Structure at JLab to understand where to save files and perform analysis.
 +
* Your hallc_replay_XEM should be cloned from your GitHub account, which is forked from Casey's hallc_replay_XEM in your c-xem2 group disk:
 +
** <code>/group/c-xem2/$USER/hallc_replay_XEM</code>
 +
<font size="+1"><font color="Red">Never Save larger (>2MB) output root files to the /group/ disk!</font></font>
  
 
===SCRIPT Basics===
 
===SCRIPT Basics===
Line 13: Line 19:
 
* Specialized class objects have been created to include information for the trigger, beam, target quantities, and more.
 
* Specialized class objects have been created to include information for the trigger, beam, target quantities, and more.
  
===Making Your First Replay===
+
===Troubleshooting===
# First follow the instructions to source the XEM2 software.  This sources the current HCANA. 
+
Input file lives on cache, so the file may not be pinned\
# Clone the hallc_replay_XEM into your <code>/group/c-xem2/$USER/</code> directory and cd into it.
+
Script may not run if proper output isn't set (Make spect directories and script type directories)
## Set up symbolic links to the raw INPUT data files:
+
hcana will not run properly if not executed in top level directory of hallc_replay_XEM.
### Spring 2018: <code>ln -s /cache/mss/hallc/spring17/raw/ raw-sp18</code>
+
Using different versions of root than the one used to compile hcana will cause hcana to crash on startup.
### Spring 2019: <code>ln -s /cache/mss/hallc/jpsi-007/raw/ raw-sp19</code>
+
 
### Spring 2022: Not available YET!
+
===NEVER===
## Set up OUTPUT directories
+
NEVER PUT OUTPUT ROOT FILES ON THE GROUP DISK!
### <code>mkdir /volatile/hallc/xem2/$USER/ROOTfiles</code>
 
### <code>mkdir /volatile/hallc/xem2/$USER/REPORT_OUTPUT/SHMS/PRODUCTION</code>
 
### <code>mkdir /volatile/hallc/xem2/$USER/REPORT_OUTPUT/HMS/PRODUCTION</code>
 
### Link the ROOTfiles and REPORT_OUTPUT locations inside your hallc_replay_XEM.
 
# Run hcana in the top directory of hallc_replay_XEM
 
'''Note:''' If you sourced the <code>/group/c-xem2/software/setup</code> file, hcana should run.  If you have not, you will need to make a symlink to the hcana executable.
 
## Run hcana, and when prompted with the root-like command line window, execute the SHMS production replay as explained above.
 
### You can load the SCRIPT first by typing .L path_to_script/the_script.C Typing the script name and pressing tab will tell you the usage <code>(RunNumber, MaxEvent)</code>
 

Latest revision as of 12:32, 1 March 2023

Hall C Replay

Purpose

The Hall C replay is a database structure used to hold detector calibrations, detector geometry, detector maps, output templates, replay scripts, defined output histograms, run numbers and run information. You may hear people call this the 'Analyzer' or 'Engine' as the C++ analyzer is based on the earlier ENGINE code written in Fortran. HCANA itself inherits most classes from the Hall A Analyzer. The ultimate goal of the hallc_replay_XEM is to tell hcana how to analyze the raw EVIO files generated by the Hall C DAQ and process them into relevant root branches in a CERN ROOT TFile.

Location Location Location

  • Review the File Structure at JLab to understand where to save files and perform analysis.
  • Your hallc_replay_XEM should be cloned from your GitHub account, which is forked from Casey's hallc_replay_XEM in your c-xem2 group disk:
    • /group/c-xem2/$USER/hallc_replay_XEM

Never Save larger (>2MB) output root files to the /group/ disk!

SCRIPT Basics

In order to use this structure properly, HCANA must be executed in the top level directory.

  • Scripts can be executed by running hcana and typing '.x ./SCRIPTS/<spectrometer>/<run-type>/script_to_run.C'
    • Inside the scripts you will find the way hcana imports all the detector geometry, maps, and calibrations through the gHcParms, which is a THcParmsList object.
  • The detector map is loaded into the gHcDetectorMap object, which is a THcDetectorMap object.
    • A cratemap is used to relate detector components (Individual DC wires to TDCs, Hodo PMTs to ADCs, etc) so the detectors can use the signals properly.
  • A Spectrometer object is created, and the relevant detectors are added to this spectrometer.
    • The detector geometry and constants are loaded using a DBRequest call in the header of file of each detector class
  • Specialized class objects have been created to include information for the trigger, beam, target quantities, and more.

Troubleshooting

Input file lives on cache, so the file may not be pinned\ Script may not run if proper output isn't set (Make spect directories and script type directories) hcana will not run properly if not executed in top level directory of hallc_replay_XEM. Using different versions of root than the one used to compile hcana will cause hcana to crash on startup.

NEVER

NEVER PUT OUTPUT ROOT FILES ON THE GROUP DISK!