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

From HallCWiki
Jump to navigationJump to search
(Restructured instructions, removed some items I don't want shift workers touching)
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:
 
==== Timing Cuts ====
 
* If someone wants to change the 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 ===
+
* When adjusting any of the parameter files, I '''strongly''' advise that you open the .csv files using libreoffice
* 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/.
+
** libreoffice /home/cdaq/hallc-online/hallc_replay_lt/UTIL_PION/DB/PARAM/Timing_Parameters.csv
* The "PID_Parameters.csv" file looks like;
+
** ''' If you edit anything, make sure you save the file as a .csv file! '''
[[File:PID.png|1310px]]
+
* It is unlikely that you will ever need to change any non-timing related parameters
* Here "H" refers to HMS and "P" refers to SHMS respectively.
+
** '''Consult a PionLT expert first if you need to do so'''
=== 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/.
+
=== Timing Cuts ===
* The "PID_Parameters.csv" file looks like;
+
 
      [[File:Accept.png|700px]]
+
* The "Timing_Parameters.csv" file looks like;
* Here "H" refers to HMS and "P" refers to SHMS respectively.
+
      [[File:RF.png|700px]]
== Adjusting Cut Definitions ==
+
 
* One can change the cut definitions as follows:
+
==== Coincidence Time Cuts ====  
=== 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.
+
* Incorrectly set timing parameters may cause the wrong coincidence time peak to be selected
* The "coin_time.cuts" file looks like;
+
* The most likely culprit for any issues is the '''"Pion_Prompt_Peak"''' value
[[File:time_def.png|1310px]]
+
** This should correspond to the prompt peak in the pion coincidence time spectrum
* Here "CT" refers to Coin Time and "RF" refers to Reference Time respectively.
+
** '''Bunch_Spacing, Coin_Offset, nWindows''' and '''nSKip''' are all also used to select the prompt and random windows, but '''these should not be adjusted'''
 +
*** See pages 7 and 8 of pdf produced at the end of the run
 +
** 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'''
  
=== PID ===
+
==== RF Timing Cuts ====
* 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;
 
[[File:pid_def.png|1200px]]
 
* Here "H" refers to HMS and "P" refers to SHMS respectively.
 
  
=== Acceptance ===
+
Coming soon - some instructions on setting the RF timing cut window
* 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.
 

Revision as of 15:31, 31 August 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

  • The "Timing_Parameters.csv" file looks like;
      RF.png

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
    • Bunch_Spacing, Coin_Offset, nWindows and nSKip are all also used to select the prompt and random windows, but these should not be adjusted
      • See pages 7 and 8 of pdf produced at the end of the run
    • 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

Coming soon - some instructions on setting the RF timing cut window