NPS Online analysis (Fall 2023)

From HallCWiki
Jump to: navigation, search

If you have any questions or comments, please email - Yaopeng Zhang yaopeng@jlab.org, or use slack


  • We would like the detector check replay to be done on first 50,000 events of every run, and compare plots with the standard ones in the binder (coming up). In addition, we want physics replay to be done on every run in its entirety.
  • Do not start the full analysis until after the run ends!
  • The standard.kinematics file should update automatically(Now manually updated). If you notice a dramatic change in plots, the background process may have terminated. See the appropriate section below.
  • Shift leaders are asked to keep a running total of the number of e- events; This will help us better estimate when to move to the next setting.

ANALYSIS of coincidence (NPS+HMS) runs (this is the standard setting)

  • ssh cdaq@cdaql2 or cdaq@cdaql3 if you are not logged in already
  • go_analysis_nps
  • ./run_nps_hms_coin.sh [run number] [total number of kilo-event to replay] [number of event in one coda split file] [number of events per job]
    • There are multiple ways to get the number of events! 1. From the DAQ GUI. 2. Use Hall C RCDB https://hallcweb.jlab.org/rcdb/runs/
    • If running with sparsification off (see coda config), the number of events in one coda file is 79100. If running with sparsification on, UPDATE: (10-03-23), now the size per segment changed to 270000 (I think the # of events per segment is changing with sparse on, that means dat.0 won't have the same size as dat.1).
    • Avoid submitting more than 40 jobs at a time, increase the last parameters if there are too many jobs, n
    • The total number of kilo-event to replay should not be bigger than total number of event in the file or you will get an error message and the script will stop. If you do, decrease that input.
    • It is actually easier on the analyzers (the people) if you use the same number of events per job for the 50k and the full replay.
    • Example :
      • ./run_nps_hms_coin.sh 1341 50 79100 5000 ; for 50k replay because this run was taken without sparsification
      • ./run_nps_hms_coin.sh 1341 124 79100 5000 ; for full replay because this run has 124k events total and it was taken without sparsification
      • ./run_nps_hms_coin.sh 1507 360 270000 10000 ; for full replay because this run has 360k events total and was taken with sparsification on
      • ./run_nps_hms_coin.sh 1507 50 270000 10000 ; for the 50k replay because this run was taken with sparsification on.
  • Inputs:
    • COIN coda file : nps_coin_run#.dat.#
  • Outputs (For COIN script ./run_nps_hms_coin.sh)
    • ROOTfiles: ./ROOTFiles/COIN/PRODUCTION/*
    • OnlineGUI PDFs: ./HISTOGRAMS/COIN/PDF/PRODUCTION/*
    • HCANA report output: ./REPORT_OUTPUT/COIN/*
    • Terminal messages: ./REPORT_OUTPUT/COIN/replayreport/*

ANALYSIS of the NPS standalone runs

  • ssh to cdaql1 or cdaql2.
  • ./hcana
  • .x SCRIPTS/NPS/eel108_replay.C(718,50000)

ANALYSIS of NPS optics runs

  • ssh to cdaql1 or cdaql2.
  • go_analysis
  • hcana
  • .x SCRIPTS/NPS/OPTICS/replay_optics_coin_NPS_HMS.C(runNumber, MaxEvent, 1, MaxSegment, FirstSegment)
NOTE The Number of segments can be found with the following command
ls ./raw/nps_coin_<runNumner>.dat.*
Once the replay finishes run the following
  • cd ../USERS/cmorean/
  • hcana
  • .X plotOptics(runNumber, firstEvent, lastEvent)
  • Copy the output PDF to the logbook and tag the entry.

Information for runsheets(From old archive, need to be changed)

  • Tracking efficiency: will appear in emacs window after 50k: "E SING SING FID EFF"
  • Computer live time: will appear in emacs window after 50k: "Pre-scaled PsX HMS/SHMS Computer Live Time", where X is the trigger leg enabled for that run (1,2, or 3).
    • Use the good electron fraction ("good electrons"/50,000) to estimate the total number of good electrons for a given run using the total number of events in that run.

Good electrons.png

  • If you forget to write down the total number CODA events (needed to extrapolate the total number of events) you can find it in the end of run logbook entries ("Event number")
  • The tracking efficiency and computer live time can also be found in MON_OUTPUT/HMS/REPORT/summary_output_xxxx.txt (or the equivalent SHMS directory)

Automated script that writes to database (coming up shortly)

  • This script should always be running, and is typically seen running on the 2nd desktop of the SHMS DAQ.
  • To run, ssh to cdaql1 or cdaql2, type go_analysis and then launch_runinfod
  • This script will need to be restarted any time the cdaql6 machine is power-cycled.
To add the previous run when a run has already started
caput hcSHMSRunInProgress 0 followed by caput hcSHMSRunInProgress 1
Repeat for the HMS if needed.

How to restart autdb script to update the standard_coin.kinematics

  • ssh cdaq@cdaql1
  • go_analysis
  • cd ../autodb/
  • ./bin/launch_runinfod

Carbon Hole Runs

  • See the instructions on the beam checkout page
  • Broad instructions are included below
  • Adjust the prescale settings accordingly, set a target rate of ~1kHz for the HMS 3/4 triggers (PS3)
    • The rates you'll see will depend heavily upon setting, the step above is just to get reasonable rates to disc
  • Once the prescale values are set, start a run
  • When you have 50-100k events, run a HMS 50k
    • Check the HMS Fast Raster page of the output plots, check the hole position. If it looks off, ask MCC to adjust the position.
    • You will need to stop and start a new run when they adjust the position
    • This may take some trial and error to correctly centre the beam
    • You can also try running more than 50k events in the replay if needed (see above)
    • More information is located here

NPS Farm Replays & Skim File Location

  • Location of the full run replay root files:
/cache/hallc/c-nps/analysis/online/replays/
  • Location of the skim run replay root files:
/cache/hallc/c-nps/analysis/online/skim/

Debugging - General

If any of the plots look odd/not as described:

  • The standard.kinematics file should update automatically, but you can double-check that standard.kinematics has been updated and is CORRECT.
  • Watch out for silly typos, e.g. gbeam rather than gpbeam.
  • Note that standard.kinematics affects things you think it really shouldn't! If things look wrong this is absolutely the first thing you should check.
  • Make sure you have the correct particles going into each spectrometer

You should not -

  • Panic
  • Start editing scripts and deleting things without knowing what you are adjusting
  • Delete ANYTHING in the scripts without also leaving a comment explaining what you have deleted or changed

If you cannot run the replay and see things about not being able to get gpbeam, for example, you might need to restart the script that writes to the database.

  • See instructions above for running the launch_runinfod script.