Difference between revisions of "Hall C basic replay structure"

From HallCWiki
Jump to navigationJump to search
 
(14 intermediate revisions by one other user not shown)
Line 8: Line 8:
 
* <code>p</code> or <code>P</code>: SHMS
 
* <code>p</code> or <code>P</code>: SHMS
 
* <code>s</code> or <code>S</code>: SOS
 
* <code>s</code> or <code>S</code>: SOS
 +
 +
=== Tree Names ===
 +
<nowiki>
 +
T:  Main analysis tree
 +
E:  EPICS tree
 +
TSP: SHMS scaler tree
 +
TSH: HMS scaler tree</nowiki>
  
 
== DBASE ==
 
== DBASE ==
Line 14: Line 21:
  
 
Collects all parameter files that are read-in before the replay.
 
Collects all parameter files that are read-in before the replay.
 +
 +
; Define a real value:
 +
#real raddeg
 +
raddeg=3.14159265/180
 +
 +
; Include other files to be read:
 +
#include "PARAM/hcana.param"
 +
#include "PARAM/genflags.param"
 +
...
  
 
=== standard.database ===
 
=== standard.database ===
  
Defines which files are read-in for each run number.
+
Sets the variables with file names which are to be read-in during the replay.
 +
 
 +
; Run number block:
 +
0-99
 +
g_ctp_parm_filename ="DBASE/general.param"
 +
g_ctp_kinematics_filename ="DBASE/standard.kinematics"
 +
g_decode_map_filename ="MAPS/hmschambers.map"
 +
 +
; Single run number:
 +
100
 +
g_ctp_parm_filename ="DBASE/general_for_run_100.param"
 +
g_ctp_kinematics_filename ="DBASE/standard_for_run_100.kinematics"
 +
g_decode_map_filename ="MAPS/hmschambers_for_run_100.map"
  
 
=== standard.kinematics ===
 
=== standard.kinematics ===
  
 
Sets the kinematics variables for each run number.
 
Sets the kinematics variables for each run number.
 +
 +
; Parameters for range of run numbers:
 +
0-99
 +
gpbeam=999
 +
htheta_lab = 999
 +
stheta_lab = 999
 +
 +
; Parameters for specific run number:
 +
100
 +
gpbeam=1000
 +
htheta_lab = 1000
 +
stheta_lab = 1000
  
 
== DEF-files ==
 
== DEF-files ==
Line 28: Line 68:
  
 
Defines which variables or blocks of variables are written to ROOT tree and defines the histograms that are saved in the ROOT file.
 
Defines which variables or blocks of variables are written to ROOT tree and defines the histograms that are saved in the ROOT file.
 +
 +
# Select a variable:
 +
H.dc.1x1.wirenum
 +
 +
# Select a block of variables:
 +
block H.dc.*
 +
 +
# Define a histogram:
 +
TH1F hdc1x1_wm 'HDC 1X1 Wiremap' H.dc.1x1.wirenum 113 0.5 113.5
  
 
=== replay_cuts.def ===
 
=== replay_cuts.def ===
  
Defines cuts for different stages of raw data analysis.
+
Defines cuts for different stages of raw data analysis. Most common blocks are:
 +
* <code>RawDecode</code>
 +
* <code>Decode</code>
 +
* <code>CoarseTracking</code>
 +
* <code>CoarseReconstruct</code>
 +
 
 +
# Start of block:
 +
Block: CoarseTracking
 +
 +
# Variable definition:
 +
# Can use global variables
 +
# or spectrometer specific variables
 +
# or previously defined variables
 +
all_trigs  g.evtyp==1 || g.evtyp==2 || g.evtyp==3
 +
h1hit1      H.dc.1x1.nhit >= 1
 +
 +
# Can use calculations:
 +
hmsDC1PlanesGT  (h1hit1 + h1hit2 + h1hit3 + h1hit4 + h1hit5 + h1hit6 )>=5
 +
 +
# Truthy value for passing an event to the next analysis stage:
 +
# (can also be 1 or 0 for passing all or none)
 +
CoarseTracking_master !Pedestal_event
  
 
== MAPS ==
 
== MAPS ==
Line 38: Line 108:
  
 
Defines the map between detector module channels and replay variables.
 
Defines the map between detector module channels and replay variables.
 +
 +
! Description of the setup:
 +
!HMS:
 +
! HDC_ID=1      TDC
 +
! HSCIN_ID=2    ADC+,ADC-,TDC+,TDC-
 +
 +
! Which crate:
 +
ROC=2
 +
 +
! Which detector (must match with corresponding ID in the description):
 +
detector=1    ! HMS drift chambers
 +
 +
! Caen 1190 modules
 +
! Which slot:
 +
SLOT=5
 +
! chan  plane    wire
 +
    96,      3,      1!    plane U, wire 1, TDC
 +
...
 +
 +
ROC=1
 +
detector=2    ! HMS hodoscope
 +
! flash 250 modules
 +
slot=8
 +
! chan  plane    bar    sig
 +
      0,      1,      1,      0!    plane x1, bar 1, ADC+
 +
...
 +
 +
The <code>ID</code> keywords available with provided detector classes are:
 +
* <code>xAERO</code> -> <code>THcAerogel</code>
 +
* <code>xCAL</code> -> <code>THcShower</code>
 +
* <code>xCER</code> -> <code>THcCherenkov</code>
 +
* <code>xDC</code> -> <code>THcDC</code>
 +
* <code>xSCIN</code> -> <code>THcHodoscope</code>
 +
* <code>RASTER</code> -> <code>THcRaster</code>
 +
where <code>x</code> stands for one of the spectrometer codes.
  
 
== PARAM ==
 
== PARAM ==
Line 43: Line 148:
 
=== detector.param ===
 
=== detector.param ===
  
Sets the values for all the variables that are needed for the analysis of the data from the detector. It is usually broken into multiple files for better overview.
+
Sets the values for all the variables that are needed for the analysis of the data from a specific detector. It is usually broken into multiple files for better overview.
 +
 
 +
; Set a single value:
 +
hscin_1x_size = 8.0
 +
 +
; Can also do calculation:
 +
hscin_1x_zpos = (89.14-11.31)
 +
 +
; Set an array of values:
 +
hhodo_vel_light = 14.0, 14.8, 15.5, 15.8
 +
                  14.0, 14.8, 15.5, 15.8
  
 
== raw ==
 
== raw ==
Line 60: Line 175:
  
 
Here are located the template files for the replay reports.
 
Here are located the template files for the replay reports.
 +
 +
The report is produced from the template, by evaluating the <code>{expressions}</code>:
 +
 +
Report
 +
 +
Value from replay_cuts.def file    : {all_trigs.npasssed}
 +
Detector specific value from array : {H.cher.cerfiredcounter[0]}
 +
Calculated value                  : {h1hit1.npassed/hmsCham1Hits.npassed}
 +
Formatting                        : {HSS1:%15.1f}
  
 
== db_cratemap.dat ==
 
== db_cratemap.dat ==
Line 80: Line 204:
  
 
Sets the run specific variables for each run number.
 
Sets the run specific variables for each run number.
 +
 +
# Timestamp (using JLab time!):
 +
--------[ 2015-01-01 01:00:00 ]
 +
 +
# Parameter values:
 +
ebeam = 6.0

Latest revision as of 09:29, 27 June 2018

This entry provides an overview of the basic replay structure for Hall C, which is available on github.

notation

Usually the first letter of a variable designates the spectrometer it belongs to. The usual notation is:

  • g: global
  • h or H: HMS
  • p or P: SHMS
  • s or S: SOS

Tree Names

T:   Main analysis tree
E:   EPICS tree
TSP: SHMS scaler tree
TSH: HMS scaler tree

DBASE

general.param

Collects all parameter files that are read-in before the replay.

; Define a real value:
#real raddeg
raddeg=3.14159265/180

; Include other files to be read:
#include "PARAM/hcana.param"
#include "PARAM/genflags.param"
...

standard.database

Sets the variables with file names which are to be read-in during the replay.

; Run number block:
0-99
g_ctp_parm_filename ="DBASE/general.param"
g_ctp_kinematics_filename ="DBASE/standard.kinematics"
g_decode_map_filename ="MAPS/hmschambers.map"

; Single run number:
100
g_ctp_parm_filename ="DBASE/general_for_run_100.param"
g_ctp_kinematics_filename ="DBASE/standard_for_run_100.kinematics"
g_decode_map_filename ="MAPS/hmschambers_for_run_100.map"

standard.kinematics

Sets the kinematics variables for each run number.

; Parameters for range of run numbers:
0-99
gpbeam=999
htheta_lab = 999
stheta_lab = 999

; Parameters for specific run number:
100
gpbeam=1000
htheta_lab = 1000
stheta_lab = 1000

DEF-files

replay.def

Defines which variables or blocks of variables are written to ROOT tree and defines the histograms that are saved in the ROOT file.

# Select a variable:
H.dc.1x1.wirenum

# Select a block of variables:
block H.dc.*

# Define a histogram:
TH1F hdc1x1_wm 'HDC 1X1 Wiremap' H.dc.1x1.wirenum 113 0.5 113.5

replay_cuts.def

Defines cuts for different stages of raw data analysis. Most common blocks are:

  • RawDecode
  • Decode
  • CoarseTracking
  • CoarseReconstruct
# Start of block:
Block: CoarseTracking

# Variable definition:
# Can use global variables
# or spectrometer specific variables
# or previously defined variables
all_trigs   g.evtyp==1 || g.evtyp==2 || g.evtyp==3
h1hit1      H.dc.1x1.nhit >= 1

# Can use calculations:
hmsDC1PlanesGT  (h1hit1 + h1hit2 + h1hit3 + h1hit4 + h1hit5 + h1hit6 )>=5

# Truthy value for passing an event to the next analysis stage:
# (can also be 1 or 0 for passing all or none)
CoarseTracking_master !Pedestal_event

MAPS

detector.map

Defines the map between detector module channels and replay variables.

! Description of the setup:
!HMS:
! HDC_ID=1      TDC
! HSCIN_ID=2    ADC+,ADC-,TDC+,TDC-

! Which crate:
ROC=2

! Which detector (must match with corresponding ID in the description):
detector=1    ! HMS drift chambers

! Caen 1190 modules
! Which slot:
SLOT=5
! chan   plane    wire
    96,      3,      1!    plane U, wire 1, TDC
...

ROC=1
detector=2    ! HMS hodoscope
! flash 250 modules
slot=8
! chan   plane     bar     sig
     0,      1,      1,      0!    plane x1, bar 1, ADC+
...

The ID keywords available with provided detector classes are:

  • xAERO -> THcAerogel
  • xCAL -> THcShower
  • xCER -> THcCherenkov
  • xDC -> THcDC
  • xSCIN -> THcHodoscope
  • RASTER -> THcRaster

where x stands for one of the spectrometer codes.

PARAM

detector.param

Sets the values for all the variables that are needed for the analysis of the data from a specific detector. It is usually broken into multiple files for better overview.

; Set a single value:
hscin_1x_size = 8.0

; Can also do calculation:
hscin_1x_zpos = (89.14-11.31)

; Set an array of values:
hhodo_vel_light = 14.0, 14.8, 15.5, 15.8
                  14.0, 14.8, 15.5, 15.8

raw

Here go the raw data files. This is usually just a symbolic link.

ROOTfiles

This is where the ROOT files with variable trees and histograms are saved after the replay.

SCRIPTS

Here are saved the macro files detailing the replay. These macros are run through hcana.

TEMPLATES

Here are located the template files for the replay reports.

The report is produced from the template, by evaluating the {expressions}:

Report

Value from replay_cuts.def file    : {all_trigs.npasssed}
Detector specific value from array : {H.cher.cerfiredcounter[0]}
Calculated value                   : {h1hit1.npassed/hmsCham1Hits.npassed}
Formatting                         : {HSS1:%15.1f}

db_cratemap.dat

Defines a map between crate slots and the detector modules.

  • Old DAQ style syntax:
==== Crate 2 type vme
# slot  model  clear      header        mask  nchan  ndata
     4   1190      1  0x40000004  0xff00001f    128   4096
     5   1190      1  0x40000005  0xff00001f    128   4096
  • Bank decoding DAQ style syntax:
==== Crate 1 type vme Bank Decoding
# slot  model  bank
     4   1190  1190
     5   1190  1190

db_run.dat

Sets the run specific variables for each run number.

# Timestamp (using JLab time!):
--------[ 2015-01-01 01:00:00 ]

# Parameter values:
ebeam = 6.0