Analysis codes: Difference between revisions

From GammaSphere DAQ
Jump to navigation Jump to search
No edit summary
No edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Typical run procedure ==
== Typical run procedure ==
''Original content prior to the 2021 Gammasphere Upgrade Project.''


Traditionally you will have a directory structure as
Traditionally you will have a directory structure as
Line 26: Line 27:
   (cd trackMain; git pull)
   (cd trackMain; git pull)
   (cd trackMain; make -B)
   (cd trackMain; make -B)
 
  (cd gtreceiver; git pull)
  (cd gtreceiver; make -B)


Option2 (manual):
Option2 (manual):
Line 36: Line 38:
   git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git  
   git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git  
   (cd GEBSort; make -B)
   (cd GEBSort; make -B)
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git
  (cd gtreceiver; make -B)
Where, of course, for DGS you do not need the tracking part. It is only shown for completeness


= acquire and sort data =
= Acquire and sort data =


To acquire the data,  cd to the 'data' directory.
To acquire the data,  cd to the 'data' directory.
Line 93: Line 99:
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:


  enabled "1-110"
   dgs_MM      350
   dgs_MM      350
   dgs_PZ      dgs_pz.cal
   dgs_PZ      dgs_pz.cal
Line 113: Line 120:
   dgs_pz 350 141 dgs_pz.cal 1.003
   dgs_pz 350 141 dgs_pz.cal 1.003


where 350 100 are the M and K values you find in the runxx.save file. Specify the values in 10 nsec units. In this case I saw these lines in the .save file:
where 350 141 are the M and K values you find in the runxx.save or runxx.info file. Specify the values in 10 nsec units. In this case I saw these lines in the run_xxx.save or run_xxx.info file:
 
  GLBL:DIG:d_window 0.06 
  GLBL:DIG:k_window 0.20   
  GLBL:DIG:m_window 3.50
  GLBL:DIG:k0_window 0.80
  GLBL:DIG:d3_window 0.20
  GLBL:DIG:raw_data_window 0.32
  ... etc
 
For the K value: sum up all the K and D values! In this case: 0.06+0.20+0.80+0.20 = 1.26 us or 126 in 10 nsec units.
Notice that what is considered the 'K value' also includes the D values (per SZ 6/25/18) as well as a D2 which is fixed at 0.15 (per JTA 6/26/18) and not in the listing above because the user cannot control it. Thus, in total, K in this example is 1.41 us or 141 in 10 ns units. The M value is 3.50 us or 350 in 10 nsec units. The 1.003 is a modification factor that needs to be determined by looking at energy vs baseline spectra.


   caput GLBL:DIG:d_window 0.06 
   Only the GLOBAL m, k and d values matter. Thus, just look at
  caput GLBL:DIG:k_window 0.20   
   the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.
  caput GLBL:DIG:m_window 3.50
  caput GLBL:DIG:k0_window 0.80
  caput GLBL:DIG:d3_window 0.20
   caput GLBL:DIG:raw_data_window 0.32
  caput VME01:SDIG1:k0_window0 0.0
  caput VME01:SDIG1:k0_window1 0.0
  etc


for the K value: sum up all the K and D values, in this case: 0.06+0.20+0.80+0.20 = 1.26 us or 126 in 10 nsec units.
  Do not execute the caput commands in the .save file. For the
Notice that what is considered the K value also includes the D values (per SZ 6/25/18) as well as a D2 which is fixed at 0.15 (per JTA 6/26/18) and
  purpose here, the lines are just information.
not in the listing above because the user cannot set it. Thus, in total, K in this example is 1.41 us or 141 in 10 ns units.
The M value is 3.50 us or 350 in 10 nsec units. The 1.003 is a modification factor that needs to be determined by looking at energy vs baseline spectra.


   you already specified the M value in GEBSort.chat
   you already specified the M value in GEBSort.chat
Line 134: Line 143:
After you executed dgs_pz, a d_pz.cmd file was generated. Use that cmd file in gf3 to check the pz spectra. Some might be really bad and dgs_pz might not have been able to find a good PZ value. If that is the case, to get around this problem, you may set the PZ for these detectors to the average value of the ones that had good PZ spectra. You would simply edit the dgs_pz.cal file.
After you executed dgs_pz, a d_pz.cmd file was generated. Use that cmd file in gf3 to check the pz spectra. Some might be really bad and dgs_pz might not have been able to find a good PZ value. If that is the case, to get around this problem, you may set the PZ for these detectors to the average value of the ones that had good PZ spectra. You would simply edit the dgs_pz.cal file.


Now, after the PZ file is generated, remove the energy calibration file if there is one:
Now, after the PZ calibration file is generated,  


   rm dgs_ehi.cal
   run GEBSort again


so that the calibrations defaults to 0 and 1 for offset and gain and sort again 
using the new pz values that were extracted above.
When you resort, the PZ values in dgs_pz.cal are read in and used.
When you resort, the PZ values in dgs_pz.cal are read in and used.
Extract the new clean, uncalibrated, ehi spectra as  
Extract the new clean, uncalibrated, ehi spectra as  


   .x get_ecln.cc
   .x get_eraw.cc


and run the calibration program (you may have to compile)
and run the calibration program (you may have to compile)


   dgs_ecal dgs_ehi.cal 207Bi 600 1.0
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0
  or
  dgs_ecal2 dgs_ehi.cal 207Bi 600 1.0


you can also use "88Y", "60Co" for the source. The calibration in this case will be 1.0keV/ch (last argument).
you can also use "88Y", "60Co" for the source. The calibration in this case will be 1.0keV/ch (last argument).
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.
dgs_ecal2 has been developed lately and may be better at handling difficult peaks. Feel fre to try this new version.


Next when you run GEBSort_nogeb, both the new PZ values in dgs_pz.cal and the gain and offset values in dgs_ehi.cal are read in and used.
Next when you run GEBSort_nogeb, both the new PZ values in dgs_pz.cal and the gain and offset values in dgs_ehi.cal are read in and used.
Take a good look at the spectra. Sometimes the dgs_pz and dgs_ecal programs can be fooled by noise or strange features in the spectra, so a few PZ and ecal parameters might have to be specified by hand.
Take a good look at the spectra. Sometimes the dgs_pz and dgs_ecal programs can be fooled by noise or strange features in the spectra, so a few PZ and ecal parameters might have to be specified by hand.
To extract the calibrated spectra
  .x get_ecln.cc
 


'''The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.'''
'''The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.'''
''Go back to  [[Digital Gammasphere Upgrade Project]]''
''Go back to [[ANL GEBSort and Analysis Codes]]''

Latest revision as of 16:47, October 14, 2021

Typical run procedure

Original content prior to the 2021 Gammasphere Upgrade Project.

Traditionally you will have a directory structure as

 data/  
 GEBSort/  
 LOG_FILES/ 
 Merged/
 ROOT_FILES/

You can make this directory structure in two ways:

Option1 (preferred):

 cd to disk you want to use
 tar -zxvf ~dgs/dgs_template.tgz
 mv template gsfmannn
 cd gsfmannn

where nnn is the run number. You now have a directory with all you should need. To make sure things are up to date, you should

 (cd GEBSort; git pull)
 (cd GEBSort; make -B)
 (cd trackMain; git pull)
 (cd trackMain; make -B)
 (cd gtreceiver; git pull)
 (cd gtreceiver; make -B)

Option2 (manual):

you can checkout the software as

 git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git 
 (cd trackMain; make -B)
 git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git 
 (cd GEBSort; make -B)
 git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git 
 (cd gtreceiver; make -B)

Where, of course, for DGS you do not need the tracking part. It is only shown for completeness

Acquire and sort data

To acquire the data, cd to the 'data' directory. You start and stop the runs as:

 start_run.sh 123
 stop_run.sh

To merge the data from a run, in the same directory, type

 gebmerge.sh 123

That will take the run 123 files in the data directory and make a merged file in the Merged directory and the log file in the LOG_FILES directory

Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are

 bin_none
 bin_dgs
 beta        0.0
 dgs_MM      350
 dgs_PZ      dgs_pz.cal
 dgs_ecal    dgs_ehi.cal

The cal files are the calibration files. See below for how to generate them.

To sort the data, cd to the GEBSort directory and

 gebsort.sh 123

The root file will be placed in the ROOT_FILES directory as run123.root To look at the root file, you would do

 rootn.exe
 dload("../ROOT_FILES/run123.root")
 ...display...

Calibrations for bin_dgs in GEBSort_nogeb

GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA. This is how you set up the code for DGS use:

 for efficiency, make sure only bin_dgs
 is enabled in the GEBSort chat file

To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF) you must enable

 #define ALL2DS 1

in bin_dgs.c and recompile . We do not always want these spectra as they take up a lot of space, but for now we need them

You now specify the PZ and ecal files in the GEBSort.chat file with these lines:

 enabled "1-110"
 dgs_MM      350
 dgs_PZ      dgs_pz.cal
 dgs_ecal    dgs_ehi.cal

Before you start sorting data, you need to check that the map.dat file is up to date and reflects the array as it is configured.

For DGS data, enable bin_dgs in the GEBSort.chat file. To find the PZ values to use, sort some data from a 207Bi source. Then extract the pz spectra in .spe format with the get_pz.cc script

  GEBSort_nogeb ....
  rootn.exe
  dload("bi.root")
  .x get_pz.cc

Now run (you may have to compile):

  dgs_pz 350 141 dgs_pz.cal 1.003

where 350 141 are the M and K values you find in the runxx.save or runxx.info file. Specify the values in 10 nsec units. In this case I saw these lines in the run_xxx.save or run_xxx.info file:

 GLBL:DIG:d_window 0.06   
 GLBL:DIG:k_window 0.20     
 GLBL:DIG:m_window 3.50
 GLBL:DIG:k0_window 0.80
 GLBL:DIG:d3_window 0.20
 GLBL:DIG:raw_data_window 0.32
 ... etc

For the K value: sum up all the K and D values! In this case: 0.06+0.20+0.80+0.20 = 1.26 us or 126 in 10 nsec units. Notice that what is considered the 'K value' also includes the D values (per SZ 6/25/18) as well as a D2 which is fixed at 0.15 (per JTA 6/26/18) and not in the listing above because the user cannot control it. Thus, in total, K in this example is 1.41 us or 141 in 10 ns units. The M value is 3.50 us or 350 in 10 nsec units. The 1.003 is a modification factor that needs to be determined by looking at energy vs baseline spectra.

 Only the GLOBAL m, k and d values matter. Thus, just look at 
 the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.
 Do not execute the caput commands in the .save file. For the
 purpose here, the lines are just information.
 you already specified the M value in GEBSort.chat

After you executed dgs_pz, a d_pz.cmd file was generated. Use that cmd file in gf3 to check the pz spectra. Some might be really bad and dgs_pz might not have been able to find a good PZ value. If that is the case, to get around this problem, you may set the PZ for these detectors to the average value of the ones that had good PZ spectra. You would simply edit the dgs_pz.cal file.

Now, after the PZ calibration file is generated,

 run GEBSort again

When you resort, the PZ values in dgs_pz.cal are read in and used. Extract the new clean, uncalibrated, ehi spectra as

  .x get_eraw.cc

and run the calibration program (you may have to compile)

  dgs_ecal dgs_ehi.cal 207Bi 600 1.0
  or
  dgs_ecal2 dgs_ehi.cal 207Bi 600 1.0

you can also use "88Y", "60Co" for the source. The calibration in this case will be 1.0keV/ch (last argument). The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies. dgs_ecal2 has been developed lately and may be better at handling difficult peaks. Feel fre to try this new version.

Next when you run GEBSort_nogeb, both the new PZ values in dgs_pz.cal and the gain and offset values in dgs_ehi.cal are read in and used. Take a good look at the spectra. Sometimes the dgs_pz and dgs_ecal programs can be fooled by noise or strange features in the spectra, so a few PZ and ecal parameters might have to be specified by hand.

To extract the calibrated spectra

 .x get_ecln.cc
 

The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.

Go back to Digital Gammasphere Upgrade Project

Go back to ANL GEBSort and Analysis Codes