Difference between revisions of "XEM analysis instructions"

From HallCWiki
Jump to navigationJump to search
 
(15 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
* 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.
 
* 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.
  
== TLDR - Quick Start ==
 
 
===SHMS ANALYSIS===
 
===SHMS ANALYSIS===
*ssh to cdaql1, cdaql3 is currently unavailable.
+
*ssh to cdaql1 or cdaql2. Do not use cdaql3 (currently unavailable).
 
* go_analysis
 
* go_analysis
 
* '''Do a 50k replay for each arm as soon as you get 50k events'''
 
* '''Do a 50k replay for each arm as soon as you get 50k events'''
* ./run_coin_shms.sh
+
* ./run_shms.sh
* ./run_coin_shms.sh
 
 
** Execute the SHMS 50k replay on the latest run
 
** Execute the SHMS 50k replay on the latest run
  
 
===HMS ANALYSIS===
 
===HMS ANALYSIS===
*ssh to cdaql1, cdaql3 is currently unavailable.
+
*ssh to cdaql1 or cdaql2. Do not use cdaql3 (currently unavailable).
 
* go_analysis
 
* go_analysis
 
* '''Do a 50k replay for each arm as soon as you get 50k events'''
 
* '''Do a 50k replay for each arm as soon as you get 50k events'''
* ./run_coin_hms.sh
+
* ./run_hms.sh
 
** Execute the HMS 50k replay on the latest run
 
** Execute the HMS 50k replay on the latest run
  
* Execute the main analysis script '''after the run is over'''
+
===Information for runsheets===
* ./run_xemCOIN.sh
+
* Tracking efficiency: will appear in emacs window after 50k: "E SING SING FID EFF"
** Execute the main analysis script
+
* 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).
** Follow the prompts, provide the required arguments
+
* The HMS and SHMS 50k analysis scripts will give you an estimated number of "good electrons" out of the 50k you just analyzed.
 +
** 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.
 +
[[File: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 SHMS/HMS 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)
 +
 
 +
===Full analysis===
 +
* The shift crew will not normally perform the full run analysis, but in case you need to, simply do:
 +
* "./run_full_hms.sh <run number>"
 +
* This will by default analyze all events in the run
  
 
== Notes on the 50k Replay ==
 
== Notes on the 50k Replay ==
Line 33: Line 40:
 
* To process a different run number -
 
* To process a different run number -
 
** Provide a run number as an argument, for example, to process run 12384 through the HMS -
 
** Provide a run number as an argument, for example, to process run 12384 through the HMS -
*** ./run_coin_hms.sh 12834
+
*** ./run_hms.sh 12834
 
* To process more events -
 
* To process more events -
 
** Provide the run number and number of events you want to process, for example -
 
** Provide the run number and number of events you want to process, for example -
*** ./run_coin_hms.sh 12834 100000
+
*** ./run_hms.sh 12834 100000
 
** Would process 100k events for run 12834 on the HMS
 
** Would process 100k events for run 12834 on the HMS
 
* '''When processing carbon hole runs, you may wish to run more than 50k events'''
 
* '''When processing carbon hole runs, you may wish to run more than 50k events'''
 +
 +
===Automated script that writes to database===
 +
* 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.
  
 
== Carbon Hole Runs ==  
 
== Carbon Hole Runs ==  
Line 53: Line 68:
 
** You can also try running more than 50k events in the replay if needed (see above)
 
** You can also try running more than 50k events in the replay if needed (see above)
 
** [https://hallcweb.jlab.org/wiki/index.php/Beam_Checkout_Procedures#Target.2FBeam_centering.2C_Raster_calibrations More information is located here]
 
** [https://hallcweb.jlab.org/wiki/index.php/Beam_Checkout_Procedures#Target.2FBeam_centering.2C_Raster_calibrations More information is located here]
 
== Detailed Online Analysis Instructions ==
 
 
* The analysis instructions below assume that you are logged in as cdaq on cdaql2 and are in the folder /home/cdaq/hallc-online/hallc_replay_lt
 
* If are not logged into cdaql2 as cdaq, then from any HCDESK machine, open a terminal and do the following -
 
** ssh cdaql2
 
*** cdaql1 and cdaql3 are also available, try not to use the same machine all the time
 
** go_analysis
 
* This will setup the analysis environment and take you to /home/cdaq/hallc-online/hallc_replay_lt, '''do not type go_analysis as a means to return to that folder'''
 
 
=== Each new kinematic setting ===
 
* Every time you move to a new kinematic setting you must also adjust some things to get the analysis working
 
* You must edit the file ''standard.kinematics'' in the DBASE/COIN subdirectory to add the current kinematic information.
 
* Go to the last block in the file, leave a blank line and then copy and paste the block below itself, '''you must leave a blank line in between each kinematic setting'''
 
* An example of how this should look after you've pasted in the new block can be seen below -
 
[[File:Standard_Kinematics_CopyBlock.jpeg]]
 
* Edit the run number range of the two blocks, use 99999 if the run is ongoing
 
** '''Remember to edit the run number range of the previous block too'''
 
* Next, enter the beam energy determined from the arc measurement, the target mass in amu (available at the top of the file), and the spectrometer angles from the TV.
 
** The HMS angle (htheta) should be entered as '''negative''' and the SHMS angle (ptheta) should be entered as '''positive'''
 
* Next are the central momenta of the HMS and SHMS, followed by the mass of the particle each arm should detect (the leading letter indicates which arm: p = SHMS, h = HMS).
 
** '''The momentum values should ALWAYS be entered as positive values, regardless of the spectrometer polarity'''
 
* Leave the helicity frequency as is
 
* The HMS and SHMS RF offsets are to centre the RF timing distributions
 
** The SHMS offset should be chosen such that pions are centred at 2
 
* The eHadCoinTime_Offset should be chosen such that the coincidence time for pions is centred at 0
 
** Don't worry about setting this precisely immediately, it can be corrected for in subsequent analysis trivially
 
* You can also add a comment line (start the comment line with a hash - #) before the run numbers to explain what the block is for
 
* An example of what this looks like when done correctly can be seen below -
 
[[File:Standard_Kinematics_Good_V2.jpeg]]
 
 
=== After 50,000 events have been taken ===
 
* We run two scripts to check the detectors.
 
* Type ''./run_coin_shms.sh'' to automatically replay the most recent run and launch the online replay GUI.
 
* Type ''./run_coin_hms.sh'' to repeat the process for HMS detectors.
 
* For reference, all histos are saved in the HISTOGRAMS/Analysis/50k subdirectory.  A copy of the scaler report is in REPORT_OUTPUT/Analysis/50k.
 
* Compare with the histograms in the ''golden run binder'', make an elog entry if you notice any major differences
 
** You should also make a log entry if you notice any consistent trends on the plots over your shift
 
 
=== After the run is over ===
 
 
* Once the run ends you need to execute an analysis script.
 
* The script is - '''run_pionLT.sh''' located in /home/cdaq/hallc_online/hallc_replay_lt (you should be in this folder already)
 
* This script '''requires''' three arguments -
 
** Run number - This '''must''' be a positive integer, specify the run you want to analyse
 
** Run type - You must enter '''one''' of - Prod - Lumi - HeePSing -HeePCoin - Optics , the argument is case sensitive
 
** Target - You must enter '''one''' of - LH2 - LD2 - Dummy10cm - Carbon0p5 - Optics1 - Optics2 - CarbonHole , again, the argument is case sensitive
 
* The script will prompt you to re-enter the arguments if anything is not correct, '''hit ctrl+c at any time to exit the script'''
 
* Specify the run type and target as dictated by the run plan
 
* Depending upon the run type specified, the script will call the relevant analysis script, details on the individual scripts are provided in a separate section
 
** run_pionLT.sh will print to screen the path of the script it is trying to execute
 
** Generally, all of the scripts called will execute a replay, and then some subsequent analysis scripts
 
** Once they complete, the script will fill the run list with relevant info, follow the onscreen prompts
 
 
=== XEM Production Script ===
 
 
==== Plots ====
 
 
When a production replay is complete it will output a pdf file to OUTPUT/Analysis/XEM, which contains the following:
 
===== Page 1 - Kinematic Distributions =====
 
===== Page 2 - phi/-t/Q2/W Distributions =====
 
===== Page 3 - Electron-Pion Acceptance Distributions =====
 
===== Page 4 - Electron-Pion Calorimeter Distributions =====
 
===== Page 5 - Electron-Pion RF Distributions =====
 
===== Page 6 - Electron-Pion Aero/HGC/NGC PID Distributions =====
 
===== Page 7 - SHMS HGC vs Aero Cerenkov vs NGC Plots =====
 
===== Page 8 - Electron-Pion Coin Time/Missing Mass Distributions =====
 
===== Page 9 - Electron-Pion Coin Time vs Missing Mass Distributions =====
 
===== Page 10 - Delta vs Beta Distributions =====
 
===== Page 11 - HMS X_fp/Y_fp vs HMS Beta Distributions =====
 
===== Page 12 - SHMS Calorimeter y vs x Distributions =====
 
===== Page 13 - SHMS Dipole Exit yExit vs xExit Distributions =====
 
===== Page 14 - SHMS HGC vs Aero Cerenkov vs NGC projection Plots =====
 
 
==== Debugging ====
 
 
* For information on how to adjust the cuts, see [https://hallcweb.jlab.org/wiki/index.php/Pion-LT_analysis_instructions/adjusting_cuts here]
 
** Physics plots looking odd are likely due to timing cuts not being set correctly
 
* If there are warnings or prompts that files aren't being found, read them and check if they're true
 
** For example if it complains '''/This/Is/My/Path/To/File.txt''' doesn't exist, just do - '''ll /This/Is/My/Path/To/File.txt'''
 
 
=== Luminosity Script ===
 
 
==== Plots ====
 
 
==== Debugging ====
 
 
=== HeeP Singles Script ===
 
 
==== Plots ====
 
 
==== Debugging ====
 
 
=== HeeP Coin Script ===
 
 
==== Plots ====
 
 
==== Debugging ====
 
 
=== Optics Script ===
 
 
==== Plots ====
 
 
==== Debugging ====
 
  
 
=== Debugging - General ===
 
=== Debugging - General ===
  
If any of the plots look odd/not as described, you should -
+
If any of the plots look odd/not as described:
 
 
* Double check that standard.kinematics has been updated and is '''CORRECT''', verify that when you start the replay the values you '''THINK''' it is reading appear in the hcana initiation info dump. See the images below -
 
 
 
[[File:hcana_debugging.png]]
 
[[File:hcana_debugging_2.png]]
 
[[File:hcana_debugging_3.png]]
 
  
 +
* 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.  
 
* 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.
 
* 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.
Line 177: Line 83:
 
* Start editing scripts and deleting things without knowing what you are adjusting
 
* 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
 
* 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.

Latest revision as of 11:04, 4 February 2023

If you have any questions or comments, please email - cmorean@jlab.org, or call cell # on whiteboard

  • 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. 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. 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.

SHMS ANALYSIS

  • ssh to cdaql1 or cdaql2. Do not use cdaql3 (currently unavailable).
  • go_analysis
  • Do a 50k replay for each arm as soon as you get 50k events
  • ./run_shms.sh
    • Execute the SHMS 50k replay on the latest run

HMS ANALYSIS

  • ssh to cdaql1 or cdaql2. Do not use cdaql3 (currently unavailable).
  • go_analysis
  • Do a 50k replay for each arm as soon as you get 50k events
  • ./run_hms.sh
    • Execute the HMS 50k replay on the latest run

Information for runsheets

  • 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).
  • The HMS and SHMS 50k analysis scripts will give you an estimated number of "good electrons" out of the 50k you just analyzed.
    • 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 SHMS/HMS 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)

Full analysis

  • The shift crew will not normally perform the full run analysis, but in case you need to, simply do:
  • "./run_full_hms.sh <run number>"
  • This will by default analyze all events in the run

Notes on the 50k Replay

  • By default, the hms and shms 50k replay scripts process the first 50k events from the most recent .dat file
  • You can run more events or process a different run number if needed by providing different arguments
  • To process a different run number -
    • Provide a run number as an argument, for example, to process run 12384 through the HMS -
      • ./run_hms.sh 12834
  • To process more events -
    • Provide the run number and number of events you want to process, for example -
      • ./run_hms.sh 12834 100000
    • Would process 100k events for run 12834 on the HMS
  • When processing carbon hole runs, you may wish to run more than 50k events

Automated script that writes to database

  • 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.

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 and SHMS 3/4 triggers (PS1 and 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 and SHMS 50k
    • Check the HMS/SHMS 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

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.