Podd Analyzer

From PREX Wiki
Revision as of 00:59, 1 February 2020 by Chandabindu (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Using Podd and the counting-mode DAQ is not a normal part of "production". You probably don't need this unless you are an expert on Qsq measurements and such things.

First, here is a good general reference for Podd


Specific information for analyzing PREX HRS counting-mode data is here. The purpose of these analyses are for Optics, measuring Qsq, and background studies.

Instructions on running the Podd analyzer
This file: /adaqfs/home/a-onl/happexsp/prex/README

maintained by R. Michaels, Ye Tian, Chandan Ghosh.  Updated Feb 1, 2020

I. Set up

Type "goprex" on a-onl account on aonl1 or aonl2 to go to the
working directory and set the environment.

We're using the ''official'' (Ole's) analyzer at the moment, but 
with the ParityData class plugin.  

The database is $DB_DIR = ./DB which is a link.  e.g. a link to 
PREXI or PREXII databases.   PREXI is there for test purposes,
while DB_PREXII is linked to DB, which is the current database. 

Our detectors are defined in db_P.dat in the $DB_DIR.
Which variables are written to the root output are defined
in output.def

Input data files are located in the directory:
prexLHRS_*.dat.* for LHRS run
prexRHRS_*.dat.* for RHRS run

Important files for Podd:

db_run.dat -- defines kinematics
db_cratemap.dat -- cratemap.  aprexII map 
onlana.cuts -- cuts file, see Podd documentation
output.def -- output definition, see Podd documentation
rootlogon.C -- loads the libParity_*.so, since the flashadc 
located in different crates, slots for both arms, so we have two libParity_*.so files
for analyzing the data. 
if we want to analyze the LHRS run, we need to load 
if we want to analyze the RHRS run, we need to load

setup.C -- sets up the analyzer (see example below)
show*.C -- various macro examples. (showRight/Leftfadc.C s)
bob.txt -- debug output.  May want to turn off debugging


II. Running the analyzer, type "analyzer"

[a-onl@aonl1]$ goprex
[a-onl@aonl1 prex]$ pwd
[a-onl@aonl1 prex]$ vi rootlogon.C  (gSystem->Load("../ParityData/libParity_LHRS.so"); for LHRS
                                     gSystem->Load("../ParityData/libParity_LHRS.so"); for RHRS) 

[a-onl@aonl1 prex]$ analyzer
  *                                              *
  *            W E L C O M E  to  the            *
  *       H A L L A   C++  A N A L Y Z E R       *
  *                                              *
  *  Release            1.6.6        Apr 25 2019 *
  *  Based on ROOT  6.16/00          Jan 23 2019 *
  *                                              *
  *            For information visit             *
  *        http://hallaweb.jlab.org/podd/        *
  *                                              *
analyzer [0] .x setup.C(runnumber)  //you need to change the nsplit number to handle more than one split file. prexLHRS_runnumber.dat.0, 1, 2......  
analyzer [1] .x macros/show*.C (analysis scripts. 
"showLeftfadc.C" plots fastbus ADC, fastbus TDC,flash ADC, time-over-threshold of flash ADC distributions for all detectors, VDC hit wires and VDC raw time, and S0 and VDC correlation ) 

***prexRHRS/LHRS_*.root -- the root output. They are located in the directory: /chafs1/work1/prex_counting/  


III. Analysis Scripts

A work in progress !

Some scripts which may be useful are in ./macros

detL1.C  detR1.C  showLeftfadc.C    showQsqLeft.C    showRightS0.C      showSieveRight.C
detL2.C  detR2.C  showLeftS0.C      showQsqRight.C   showRightscaler.C  showVarsLeft.C
detL3.C  detR3.C  showLeftscaler.C  showRightfadc.C  showSieveLeft.C    showVarsRight.C
detL5.C  detR5.C

the "det" scripts are to show detectors.  this needs to be done first.
the "Sieve" scripts are for showing sieve slit patterns.  This probably needs some work.
the "scaler" scripts are for looking at scalers.

Some more info, like how to re-analyze PREX-I data (circa 2010) or how to analyze scalers is in the file README_old in the working directory ("goprex")

Notes on how to use the PODD analyzer for PREX Counting Mode Plots

--Find the run number you are interested in analyzing. These are the .dat files whose path is something like: /adaq1/data1/prexLHRS_XXXX.dat.Y or /adaq1/data1/prexRHRS_XXXX.dat.Y where XXXX is your run number, and Y is the file split number.

--Open a terminal window and connect to an aonl machine. The command should look like: ssh -X a-onl@aonl1

--Type goprex to set up the environment.

--Run the analyzer by typing analyzer.

--Use the analyzer to run the setup.C script. This script takes two arguments; the first argument is the run number you'd like to analyze (see step one), the second argument is how many events you'd like to use. The default number of events is -1 which will just use all events in the run. The command should look something like this: .L setup.C (XXXX, YYYYYY)

--Find the rootfile you just created. (Hooray!) These are the .root files whose path is something like: /chafs1/work1/prex_counting/prexLHRS_XXXX_YYYYYY.root or /chafs1/work1/prex_counting/prexRHRS_XXXX_YYYYYY.root where XXXX is the run number and YYYYYY is the number of entries you chose in the last step. (Remember: default is -1, so if no argument was given for entries, YYYYYY will be -1)

--You can now load your rootfile into the analyzer to look at plots or load macros on it. The command to do this should look like: analyzer /chafs1/work1/prex_counting/prexLHRS_XXXX_YYYYYY.root