Difference between revisions of "Pion-LT analysis instructions/adjusting cuts"

From HallCWiki
Jump to navigationJump to search
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
The analysis of the physics data taken in the PionLT experiment is a multi step process -
 +
 +
* First, the raw data is replayed using hcana
 +
* The replay file is then trimmed and cuts are applied using a python script
 +
** '''/home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/scripts/online_pion_physics/pion_prod_analysis_sw.py
 +
* A second python script then creates some plots from the trimmed data file
 +
 +
Rough selection cuts are applied to the data at the replay stage. '''Shift workers should not adjust hcana level cuts unless absolutely neccessary.''' More refined selection cuts are applied using the first python script, information on how to adjust these cuts is provided below.
 +
 
= Adjusting Analysis Cuts in the PionLT Experiment =
 
= Adjusting Analysis Cuts in the PionLT Experiment =
* All cuts are applied on Replay ROOTfile using the "pion_prod_analysis_sw.py" script located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION//scripts/online_pion_physics/.
+
 
** The "pion_prod_analysis_sw.py" script is getting cuts definitions from /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/CUTS files.
+
* The '''pion_prod_analysis_sw.py''' script analyses a replay file and applies selection cuts
** If someone want to change the cut parameters, he has to change cut values in related csv files located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/.
+
* The '''pion_prod_analysis_sw.py''' script gets cut definitions from various files in '''/home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/CUTS/'''
*** Note: Please don't change any cuts values if you don't know about it.
+
* The defined cuts automatically get relevant parameters from .csv files located in '''/home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/'''
 +
** Parameter values are selected based upon run number (which is provided as an argument to the script when running it)
 +
* Typically, a shift worker is only likely to need (or want) to change timing parameters
 +
** '''Cut definitions should only be changed in consultation with a PionLT expert'''
 +
 
 
== Adjusting Cut Parameters ==
 
== Adjusting Cut Parameters ==
* One can adjust the cut parameters as follows:
+
 
 +
* When adjusting any of the parameter files, I '''strongly''' advise that you open the .csv files using libreoffice
 +
** libreoffice /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/Timing_Parameters.csv
 +
** If you edit anything, make sure you '''save the file as a .csv file! '''
 +
* It is unlikely that you will ever need to change any non-timing related parameters
 +
** '''Consult a PionLT expert first if you need to do so'''
 +
 
 +
=== Timing Cuts ===
 +
 
 +
* When opened in libreoffice, the "Timing_Parameters.csv" file looks like -
 +
[[File:Timing_Param_libre.jpeg|700px]]
 +
 
 +
* OR if you didn't take my advice and opened it in emacs, it'll look like this
 +
 
 +
[[File:Timing_Param_emacs.jpeg|700px]]
 +
 
 +
* Suffer through changing the parameters in emacs at your leisure
 +
** Record time lost in this method as UESWD (Unexplained Shift Worker Down)
 +
 
 +
==== Coincidence Time Cuts ====
 +
 
 +
* Incorrectly set timing parameters may cause the wrong coincidence time peak to be selected
 +
* The most likely culprit for any issues is the '''"Pion_Prompt_Peak"''' value
 +
** This should correspond to the prompt peak in the pion coincidence time spectrum
 +
*** See pages 7 and 8 of pdf produced at the end of the run
 +
** '''Bunch_Spacing, Coin_Offset, nWindows''' and '''nSKip''' are all also used to select the prompt and random windows, but '''these should not be adjusted'''
 +
** If the value in the .csv file for the run you're analysing does not match what you're seeing on the pdf, edit the value in the .csv file
 +
* Shown below is an example of an incorrectly set peak position, and a correctly set one as seen in the plots at the top of page 7
 +
 
 +
[[File:CT_PoorlySet.jpeg|700px]]
 +
 
 +
* Here the '''"Pion_Prompt_Peak"''' value was set to 10 in the parameter file
 +
** Because it was set poorly, any physics quantities are garbage
 +
* We see only green peaks (corresponding to the random windows), and no magenta peak (the prompt window)
 +
* From the plot, we can clearly see a large peak at 0 which is the correct prompt peak
 +
* I went back, set '''"Pion_Prompt_Peak"''' to 0 in the csv file for this run and voila, we get the plot below when we reprocess the replay with our two python scripts
 +
 
 +
[[File:CT_WellSet.jpeg|700px]]
 +
 
 +
* Note that now, we have a magenta peak that matches up perfectly with the prompt peak in the coin time spectrum
 +
** Our physics quantities now look great (take my word for it)
 +
* ''' Note that the prompt peak may not be exactly at 0, you should establish the correct pion prompt peak position from the Electron-Pion CTime (with cuts) plot'''
 +
 
 
==== RF Timing Cuts ====
 
==== RF Timing Cuts ====
* If someone wants to change the RF timing cut parameters, he has to change cut values in the "ALL_Kinematics_RFOffsetsTest.csv" file located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/.
 
* The "ALL_Kinematics_RFOffsetsTest.csv" file looks like;
 
      [[File:RF.png|700px]]
 
* Here "Pi" refers to pions, "K" refers to kaons and "p" refers to protons respectively.
 
=== PID ===
 
* If someone wants to change the PID cut parameters, he has to change cut values in the "PID_Parameters.csv" file located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/.
 
* The "PID_Parameters.csv" file looks like;
 
[[File:PID.png|1310px]]
 
* Here "H" refers to HMS and "P" refers to SHMS respectively.
 
=== Acceptance ===
 
* If someone wants to change the Acceptance cut parameters, he has to change cut values in the "Acceptance_Parameters.csv" file located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/.
 
* The "PID_Parameters.csv" file looks like;
 
      [[File:Accept.png|700px]]
 
* Here "H" refers to HMS and "P" refers to SHMS respectively.
 
== Adjusting Cut Definitions ==
 
* One can adjust the cut definitions as follows:
 
=== Timing ===
 
* If someone wants to change the timing cut definitions, he has to change it in "coin_time.cuts" file located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/CUTS/general.
 
* The "coin_time.cuts" file looks like;
 
[[File:time_def.png|1310px]]
 
* Here "CT" refers to Coin Time and "RF" refers to Reference Time respectively.
 
  
=== PID ===
+
The PionLT experiment will be utilising the RFTime variables where possible. For more information on these variables, see [https://hallcweb.jlab.org/DocDB/0011/001129/002/Analysis_Meeting_29_04_21_SK.pdf this talk on the docDB ]
* If someone wants to change the PID cut definitions, he has to change it in "pid.cuts" file located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/CUTS/general.
+
 
* The "pid.cuts" file looks like;
+
* The SHMS RFTime distribution runs between 0 and the Bunch spacing (typically 4.008)
[[File:pid_def.png|900px]]
+
* Without PID cuts, you will likely see a distribution with some overlapping peaks
* Here "H" refers to HMS and "P" refers to SHMS respectively.
+
** The top left plot on page 4 of the physics output plot shows the RF time distribution without PID cuts in red (see plots below)
 +
* Ideally, the largest peak in the distribution should be centred at ~2 (or whatever half the bunch spacing is)
 +
** ''' This offset which centres the peak is set in hcana via standard.kinematics'''
 +
** ''' PionLT experts will adjust this as we go, but if you want to tweak it before the next replay, it is the "SHMS_RF_Offset" entry in standard.kinematics'''
 +
*** You cannot adjust the peak position by changing any parameters in the python scripts
 +
* There are 6 parameters in '''Timing_Parameters.csv''' that are used to define windows in this distribution for pions, kaons and protons
 +
** ''' As a shift worker, you only need to care about the "PiRFLow" and "PiRFHigh" parameters'''
 +
** These control the lower and upper limits of the pion RF cut window
 +
** They should be set to isolate the pion peak as needed, be careful not to cut off any of the distribution
 +
* Shown below is an example of a poorly set window, here the cut was selected to be between 0 and 2
 +
** ''' This cut is removing good pion events, as can be seen in the two lower figures'''
 +
 
 +
[[File:RF_PoorlySet.jpeg|700px]]
 +
 
 +
* A better cut is between 1.4 and 3, with this window set, we don't remove any good physics events
 +
 
 +
[[File:RF_WellSet1.jpeg|700px]]
 +
 
 +
* ''' Note that if you are unsure on what the cut value you should use, you can just set the cut wide open (0 to 4.008)'''
 +
** For pion PID, this should be OK, other PID cuts usually clean up the background sufficiently
 +
* An example of this can be seen below
  
=== Acceptance ===
+
[[File:RF_WideSet.jpeg|700px]]
* If someone wants to change the acceptance cut definitions, he has to change it in "accept.cuts" file located at /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/CUTS/general.
 
* The "accept.cuts" file looks like;
 
    [[File:accept_def.png|900px]]
 
* Here "H" refers to HMS and "P" refers to SHMS respectively.
 

Latest revision as of 19:50, 6 September 2021

The analysis of the physics data taken in the PionLT experiment is a multi step process -

  • First, the raw data is replayed using hcana
  • The replay file is then trimmed and cuts are applied using a python script
    • /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/scripts/online_pion_physics/pion_prod_analysis_sw.py
  • A second python script then creates some plots from the trimmed data file

Rough selection cuts are applied to the data at the replay stage. Shift workers should not adjust hcana level cuts unless absolutely neccessary. More refined selection cuts are applied using the first python script, information on how to adjust these cuts is provided below.

Adjusting Analysis Cuts in the PionLT Experiment

  • The pion_prod_analysis_sw.py script analyses a replay file and applies selection cuts
  • The pion_prod_analysis_sw.py script gets cut definitions from various files in /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/CUTS/
  • The defined cuts automatically get relevant parameters from .csv files located in /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/
    • Parameter values are selected based upon run number (which is provided as an argument to the script when running it)
  • Typically, a shift worker is only likely to need (or want) to change timing parameters
    • Cut definitions should only be changed in consultation with a PionLT expert

Adjusting Cut Parameters

  • When adjusting any of the parameter files, I strongly advise that you open the .csv files using libreoffice
    • libreoffice /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/Timing_Parameters.csv
    • If you edit anything, make sure you save the file as a .csv file!
  • It is unlikely that you will ever need to change any non-timing related parameters
    • Consult a PionLT expert first if you need to do so

Timing Cuts

  • When opened in libreoffice, the "Timing_Parameters.csv" file looks like -

Timing Param libre.jpeg

  • OR if you didn't take my advice and opened it in emacs, it'll look like this

Timing Param emacs.jpeg

  • Suffer through changing the parameters in emacs at your leisure
    • Record time lost in this method as UESWD (Unexplained Shift Worker Down)

Coincidence Time Cuts

  • Incorrectly set timing parameters may cause the wrong coincidence time peak to be selected
  • The most likely culprit for any issues is the "Pion_Prompt_Peak" value
    • This should correspond to the prompt peak in the pion coincidence time spectrum
      • See pages 7 and 8 of pdf produced at the end of the run
    • Bunch_Spacing, Coin_Offset, nWindows and nSKip are all also used to select the prompt and random windows, but these should not be adjusted
    • If the value in the .csv file for the run you're analysing does not match what you're seeing on the pdf, edit the value in the .csv file
  • Shown below is an example of an incorrectly set peak position, and a correctly set one as seen in the plots at the top of page 7

CT PoorlySet.jpeg

  • Here the "Pion_Prompt_Peak" value was set to 10 in the parameter file
    • Because it was set poorly, any physics quantities are garbage
  • We see only green peaks (corresponding to the random windows), and no magenta peak (the prompt window)
  • From the plot, we can clearly see a large peak at 0 which is the correct prompt peak
  • I went back, set "Pion_Prompt_Peak" to 0 in the csv file for this run and voila, we get the plot below when we reprocess the replay with our two python scripts

CT WellSet.jpeg

  • Note that now, we have a magenta peak that matches up perfectly with the prompt peak in the coin time spectrum
    • Our physics quantities now look great (take my word for it)
  • Note that the prompt peak may not be exactly at 0, you should establish the correct pion prompt peak position from the Electron-Pion CTime (with cuts) plot

RF Timing Cuts

The PionLT experiment will be utilising the RFTime variables where possible. For more information on these variables, see this talk on the docDB

  • The SHMS RFTime distribution runs between 0 and the Bunch spacing (typically 4.008)
  • Without PID cuts, you will likely see a distribution with some overlapping peaks
    • The top left plot on page 4 of the physics output plot shows the RF time distribution without PID cuts in red (see plots below)
  • Ideally, the largest peak in the distribution should be centred at ~2 (or whatever half the bunch spacing is)
    • This offset which centres the peak is set in hcana via standard.kinematics
    • PionLT experts will adjust this as we go, but if you want to tweak it before the next replay, it is the "SHMS_RF_Offset" entry in standard.kinematics
      • You cannot adjust the peak position by changing any parameters in the python scripts
  • There are 6 parameters in Timing_Parameters.csv that are used to define windows in this distribution for pions, kaons and protons
    • As a shift worker, you only need to care about the "PiRFLow" and "PiRFHigh" parameters
    • These control the lower and upper limits of the pion RF cut window
    • They should be set to isolate the pion peak as needed, be careful not to cut off any of the distribution
  • Shown below is an example of a poorly set window, here the cut was selected to be between 0 and 2
    • This cut is removing good pion events, as can be seen in the two lower figures

RF PoorlySet.jpeg

  • A better cut is between 1.4 and 3, with this window set, we don't remove any good physics events

RF WellSet1.jpeg

  • Note that if you are unsure on what the cut value you should use, you can just set the cut wide open (0 to 4.008)
    • For pion PID, this should be OK, other PID cuts usually clean up the background sufficiently
  • An example of this can be seen below

RF WideSet.jpeg