
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.anl.gov/wiki_gsdaq/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tlauritsen</id>
	<title>GammaSphere DAQ - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.anl.gov/wiki_gsdaq/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tlauritsen"/>
	<link rel="alternate" type="text/html" href="https://wiki.anl.gov/gsdaq/Special:Contributions/Tlauritsen"/>
	<updated>2026-06-05T13:52:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2432</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2432"/>
		<updated>2022-03-18T16:34:24Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 as user dgs and check whether the server is already running (try ps ax | grep piserver | grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The piserver window will show up. In this window you can control the &#039;environment&#039; of the network booted raspberry pi&#039;s (RPs).&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver, click on the clients on the piserver, then click add. Power off RP your want to add, take out the SD card and power it up again. It should show up with its mac address in the  window - where you can now enable it. Next,  cycle the power of the RP again and it should come up as a client of the piserver. Be aware that it takes a while for the RP to boot up.&lt;br /&gt;
&lt;br /&gt;
. To modify the OS of the RPs, click on software in the piserver, then click on the OS. After that the &#039;shell&#039; is available, click on it. E.g., to run raspi-config you would type&lt;br /&gt;
&lt;br /&gt;
  SUDO_USER=dgs raspi-config&lt;br /&gt;
&lt;br /&gt;
where the first part signifies that we change something in the OS for user rpdgs, the default user we have on the network booted RPs. (For reasons we don&#039;t understand, we cannot use the user name &#039;pi&#039; for a user on these RPs). You shuld not have to use raspi-config on the individual RPs. Note that you are root for the RPs in this shell.&lt;br /&gt;
&lt;br /&gt;
. The network booted RPs cannot see world outside of onenet (not sure why they restrict network access like that). So to, e.g., install a new version of the DGS EPICS softIOC do&lt;br /&gt;
&lt;br /&gt;
  ssh rpdgs@piserver&lt;br /&gt;
  svn export .....&lt;br /&gt;
&lt;br /&gt;
You will be in /home/rpdgs on piserver1 which is the shared home directory for all the RPs. Don&#039;t try to compile etc there. To compile, go to any of the network booted RPs and and do it from there. You only need to do it on one of the RPs because the home diretory is shared.&lt;br /&gt;
&lt;br /&gt;
. Because the RPs share the home directory we have set them up to execute unique setup files based on the IP of the RPs. E.g., on sbxpp the file (in the shared home directory) softIOC.192.168.203.149 is executed. In this file we can start the softIOC with the EPICS databases appropriate for this RP.&lt;br /&gt;
&lt;br /&gt;
. Note that the RPs get their IP from the onenet DHCP server, not from the piserver. Thus, you need to register the RPs using onereg.phy.anl.gov.&lt;br /&gt;
&lt;br /&gt;
. We have not been able to make autologon work on the network booted RPs. Thus to start the softIOC on the RPs you should, from an xterm, ssh into the individual RPs. We will automatically start the softIOC when you ssh in. Before the automtic start of the softIOC, it will check to make sure that a softIOC is not already running. If someone else ssh into the RP, another softIOC will not be started. This system is not unlike when we have to start the softIOC on the DAQs of dgs, dfma, dub1 and xa.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2431</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2431"/>
		<updated>2022-03-18T16:33:36Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 as user dgs and check whether the server is already running (try ps ax | grep piserver | grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The piserver window will show up. In this window you can control the &#039;environment&#039; of the network booted raspberry pi&#039;s (RPs).&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver, click on the clients on the piserver, then click add. Power off RP your want to add, take out the SD card and power it up again. It should show up with its mac address in the  window - where you can now enable it. Next,  cycle the power of the RP again and it should come up as a client of the piserver. Be aware that it takes a while for the RP to boot up.&lt;br /&gt;
&lt;br /&gt;
. To modify the OS of the RPs, click on software in the piserver, then click on the OS. After that the &#039;shell&#039; is available, click on it. E.g., to run raspi-config you would type&lt;br /&gt;
&lt;br /&gt;
  SUDO_USER=dgs raspi-config&lt;br /&gt;
&lt;br /&gt;
where the first part signifies that we change something in the OS for user rpdgs, the default user we have on the network booted RPs. (For reasons we don&#039;t understand, we cannot use the user name &#039;pi&#039; for a user on these RPs). You shuld not have to use raspi-config on the individual RPs. Note that you are root for the RPs in this shell.&lt;br /&gt;
&lt;br /&gt;
. The network booted RPs cannot see world outside of onenet (not sure why they restrict network access like that). So to, e.g., install a new version of the DGS EPICS softIOC do&lt;br /&gt;
&lt;br /&gt;
  ssh rpdgs@piserver&lt;br /&gt;
  svn export .....&lt;br /&gt;
&lt;br /&gt;
You will be in /home/rpdgs on piserver1 which is the shared home directory for all the RPs. Don&#039;t try to compile etc there. To compile, go to any of the network booted RPs and and do it from there. You only need to do it on one of the RPs because the home diretory is shared.&lt;br /&gt;
&lt;br /&gt;
. Because the RPs share the home directory we have set them up to execute unique setup files based on the IP of the RPs. E.g., on sbxpp the file (in the shared home directory) softIOC.192.168.203.149 is executed. In this file we can start the softIOC with the EPICS databases appropriate for this RP.&lt;br /&gt;
&lt;br /&gt;
. Note that the RPs get their IP from the onenet DHCP server, not from the piserver. Thus, you need to register the RPs using onereg.phy.anl.gov.&lt;br /&gt;
&lt;br /&gt;
. We have not been able to make autologon work on the network booted RPs. Thus to start the softIOC on the RPs you should, from an xterm, ssh into the individual RPs. We will automatically start the softIOC when you ssh in. Before the automtic start of the softIOC, it will check to make sure that a softIOC is not already running. If someone else ssh into the RP, another softIOC will not be started. This sustem is not unlike when we have to start the softIOC on the DAQs of dgs, dfma, dub1 and xa.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2430</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2430"/>
		<updated>2022-03-18T16:30:21Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 as user dgs and check whether the server is already running (try ps ax | grep piserver | grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The piserver window will show up. In this window you can control the &#039;environment&#039; of the network booted raspberry pi&#039;s (RPs).&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver, click on the clients on the piserver, then click add. Power off RP your want to add, take out the SD card and power it up again. It should show up with its mac address in the  window - where you can now enable it. Next,  cycle the power of the RP again and it should come up as a client of the piserver. Be aware that it takes a while for the RP to boot up.&lt;br /&gt;
&lt;br /&gt;
. To modify the OS of the RPs, click on software in the piserver, then click on the OS. After that the &#039;shell&#039; is awailable, clck on it. E.g., to run raspi-config you would type&lt;br /&gt;
&lt;br /&gt;
  SUDO_USER=dgs raspi-config&lt;br /&gt;
&lt;br /&gt;
where the first part signifies that we change something in the OS for user rpdgs, the default user we have on the network booted RPs. (For reasons we don&#039;t understand, we cannot use the user name &#039;pi&#039; for a user on these RPs). You shuld not have to use raspi-config on the individual RPs.&lt;br /&gt;
&lt;br /&gt;
. The network booted RPs cannot see world outside of onenet (not sure why they restrict network access like that). So to, e.g., install a new version of the DGS EPICS softIOC do&lt;br /&gt;
&lt;br /&gt;
  ssh rpdgs@piserver&lt;br /&gt;
  svn export .....&lt;br /&gt;
&lt;br /&gt;
You will be in /home/rpdgs on piserver1 which is the shared home directory for all the RPs. Don&#039;t try to compile etc there. To compile, go to any of the network booted RPs and and do it from there. You only need to do it on one of the RPs because the home diretory is shared.&lt;br /&gt;
&lt;br /&gt;
. Because the RPs share the home directory we have set them up to execute unique setup files based on the IP of the RPs. E.g., on sbxpp the file (in the shared home directory) softIOC.192.168.203.149 is executed. In this file we can start the softIOC with the EPICS databases appropriate for this RP.&lt;br /&gt;
&lt;br /&gt;
. Note that the RPs get their IP from the onenet DHCP server, not from the piserver. Thus, you need to register the RPs using onereg.phy.anl.gov.&lt;br /&gt;
&lt;br /&gt;
. We have not been able to make autologon work on the network booted RPs. Thus to start the softIOC on the RPs you should, from an xterm, ssh into the individual RPs. We will automatically start the softIOC when you ssh in. Before the automtic start of the softIOC, it will check to make sure that a softIOC is not already running. If someone else ssh into the RP, another softIOC will not be started. This sustem is not unlike when we have to start the softIOC on the DAQs of dgs, dfma, dub1 and xa.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2429</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2429"/>
		<updated>2022-03-18T16:28:33Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 as user dgs and check whether the server is already running (try ps ax | grep piserver | grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The piserver window will show up. In this window you can control the &#039;environment&#039; of the network booted raspberry pi&#039;s (RPs).&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver, click on the clients on the piserver, then click add. Power off RP your want to add, take out the SD card and power it up again. It should show up with its mac address in the  window - where you can now enable it. Next,  cycle the power of the RP again and it should come up as a client of the piserver. Be aware that it takes a while for the RP to boot up.&lt;br /&gt;
&lt;br /&gt;
. To modify the OS of the RPs, click on software in the piserver, then click on the OS. After that the &#039;shell&#039; is awailable, clck on it. E.g., to run raspi-config you would type&lt;br /&gt;
&lt;br /&gt;
  SUDO_USER=dgs raspi-config&lt;br /&gt;
&lt;br /&gt;
where the first part signifies that we change something in the OS for user rpdgs, the default user we have on the network booted RPs. (For reasons we don&#039;t understand, we cannot use the user name &#039;pi&#039; for a user on these RPs). You shuld not have to use raspi-config on the individual RPs.&lt;br /&gt;
&lt;br /&gt;
. The network booted RPs cannot see world outside of onenet (not sure why they restrict network access like that). So to, e.g., install a new version of the DGS EPICS softIOC do&lt;br /&gt;
&lt;br /&gt;
  ssh rpdgs@piserver&lt;br /&gt;
  svn export .....&lt;br /&gt;
&lt;br /&gt;
You will be in /home/rpdgs on piserver1 which is the shared home directory for all the RPs. Don&#039;t try to compile etc there. To compile, go to any of the network booted RPs and and do it from there. You only need to do it on one of the RPs because the home diretory is shared.&lt;br /&gt;
&lt;br /&gt;
. Because the RPs share the home directory we have set them up to execute unique setup files based on the IP of the RPs. E.g., on sbxpp the file (in the shared home directory) softIOC.192.168.203.149 is executed. In this file we can start the softIOC with the EPICS databases appropriate for this RP.&lt;br /&gt;
&lt;br /&gt;
. Note that the RPs get their IP from the onenet DHCP server, not from the piserver. Thus, you need to register the RPs using onereg.phy.anl.gov.&lt;br /&gt;
&lt;br /&gt;
. We have not been able to make autologon work on the network booted. Thus to start the softIOC on the RPs you should, from an xterm, ssh into the individual RPs. We will automatically start the softIOC when you ssh in. Before the automtic start of the softIOC, it will check to make sure that a softIOC is not already running. If someone else ssh into the RP, another softIOC will not be started.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2428</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2428"/>
		<updated>2022-03-18T16:17:53Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 as user dgs and check whether the server is already running (try ps ax | grep piserver| grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The piserver window will show up. In this window you can control the &#039;environment&#039; of the RPs&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver, click on the clients on the piserver, then click add. Power off RP your want to add, take out the SD card and power it up again. It should show up with its mac address in the  window where you can enable it. now  cycle the power of the RP again and it should come up as a client of the piserver&lt;br /&gt;
&lt;br /&gt;
. To modify the OS of the RPs, click on software in the piserver and then click on the OS. After that the &#039;shell&#039; is awailable. E.g., to run raspi-config you would type&lt;br /&gt;
&lt;br /&gt;
  SUDO_USER=dgs raspi-config&lt;br /&gt;
&lt;br /&gt;
where the first part signifies that we change something in the OS for user rpdgs the default user we have on the network booted RPs. (For reasons we don&#039;t understand, we cannot use the user name &#039;pi&#039; for a user on these RPs). You shuld not use raspi-config on the individual RPs.&lt;br /&gt;
&lt;br /&gt;
. The network booted RPs cannot see world outside of onenet (not sure why they restrict network access like that). So to e.g., install a new version of the DGS EPICS softIOC do&lt;br /&gt;
&lt;br /&gt;
  ssh rpdgs@piserver&lt;br /&gt;
  svn export .....&lt;br /&gt;
&lt;br /&gt;
You will be in /home/rpdgs on piserver1 which is the shared home directory for all the RPs. Don&#039;t try to compile etc there. To compile, go to any of the network booted RPs and and do it from there. You only need to do it on one of the RPs because the home diretory is shared.&lt;br /&gt;
&lt;br /&gt;
. Because the RPs share the home directory we have set them up to execute unique setup files based on the IP of the RPs. E.g., on sbxpp the file (in the shared home directory) softIOC.192.168.203.149 is executed. In this file we can start the softIOC with the EPICS databases appropriate for this RP.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2427</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2427"/>
		<updated>2022-03-18T16:10:29Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 as user dgs and check whether the server is already running (try ps ax | grep piserver| grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The piserver window will show up. In this window you can control the &#039;environment&#039; of the RPs&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver, click on the clients on the piserver, then click add. Power off RP your want to add, take out the SD card and power it up again. It should show up with its mac address in the  window where you can enable it. now  cycle the power of the RP again and it should come up as a client of the piserver&lt;br /&gt;
&lt;br /&gt;
. To modify the OS of the RPs, click on software in the piserver and then click on the OS. After that the &#039;shell&#039; is awailable. E.g., to run raspi-config you would type&lt;br /&gt;
&lt;br /&gt;
  SUDO_USER=dgs raspi-config&lt;br /&gt;
&lt;br /&gt;
where the first part signifies that we change something in the OS for user rpdgs the default user we have on the network booted RPs. (For reasons we don&#039;t understand, we cannot use the user name &#039;pi&#039; for a user on these RPs). You shuld not use raspi-config on the individual RPs.&lt;br /&gt;
&lt;br /&gt;
. The network booted RPs cannot see world outside of onenet (not sure why they restrict network access like that). So to e.g., install a new version of the DGS EPICS softIOC do&lt;br /&gt;
&lt;br /&gt;
  ssh rpdgs@piserver&lt;br /&gt;
  svn export .....&lt;br /&gt;
&lt;br /&gt;
You will be in /home/rpdgs which is the shared home directory for all the RPs. Don&#039;t try to compile there. To compile, go to any of the network booted RPs and and do it from there. You only need to do it on one of the RPs because the home diretory is shared.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2426</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2426"/>
		<updated>2022-03-18T15:22:46Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 and check whether the server is already running (try ps ax | grep piserver| grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
The piserver window will show up. In this window you can control the &#039;environment&#039; of the RPs&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver, click on the clients on the piserver, then click add. Power off RP your want to add, take out the SD card and power it up again. It should show up with its mac address in the  window where you can enable it. now  cycle the power of the RP again and it should come up as a client of the piserver&lt;br /&gt;
&lt;br /&gt;
. To modify the OS of the RPs, click on software in the piserver and then click on the OS. After that the &#039;shell&#039; is awailable. E.g., to run raspi-config you would type&lt;br /&gt;
&lt;br /&gt;
  SUDO_USER=dgs raspi-config&lt;br /&gt;
&lt;br /&gt;
where the first part signifies that we change something in the OS for user rpdgs the default user we have on the network booted RPs. For reasons we don&#039;t understand, we cannot use the user name &#039;pi&#039; for a user on these RPs&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2425</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2425"/>
		<updated>2022-03-17T18:44:05Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 and check whether the server is already running (try ps ax | grep piserver| grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver,&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2424</id>
		<title>Expert Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Expert_Documentation&amp;diff=2424"/>
		<updated>2022-03-17T18:43:23Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== [[ANL Digitizer Firmware for Experts]] ==&lt;br /&gt;
This document presupposes that the reader is already familiar with the overall design of the firmware and associated terminology.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Advanced User Guides]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Go back to [[Digital Gammasphere and the SBX Upgrade]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[ piserver instructions]] ==&lt;br /&gt;
&lt;br /&gt;
. The piserver runs on the Ubuntu machine called piserver1. To start the server: log in on piserver1 and check wheter the server is already running (try ps ax | grep piserver| grep -v grep). If it is not and you want to start it, type&lt;br /&gt;
&lt;br /&gt;
  sudo piserver &amp;amp;&lt;br /&gt;
&lt;br /&gt;
. To add another raspberry pi to be under the control of the piserver,&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2158</id>
		<title>Typical DGS run procedures</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2158"/>
		<updated>2021-08-31T21:13:29Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: /* Calibrations for bin_dgs in GEBSort_nogeb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  dfmadata/  &lt;br /&gt;
  dgsdata/&lt;br /&gt;
  xadata/&lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to /dk/fs2/dgs&lt;br /&gt;
  tar -zxvf dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
This creates the two directories: trackMain and GEBSort. Even though DGS does not&lt;br /&gt;
need the tracking code, it is best to create it and make the links below&lt;br /&gt;
&lt;br /&gt;
  # make links to the crmat files which we keep in trackMain&lt;br /&gt;
  # but are needed here as well for GEBSort&lt;br /&gt;
  #&lt;br /&gt;
  (cd GEBSort; rm GANIL_AGATA_crmat.dat; ln -s ../trackMain/GANIL_AGATA_crmat.dat GANIL_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm GSI_AGATA_crmat.dat; ln -s ../trackMain/GSI_AGATA_crmat.dat GSI_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm crmat.LINUX; ln -s ../trackMain/crmat.LINUX crmat.LINUX)&lt;br /&gt;
&lt;br /&gt;
This option does not create all the directories and script files you need.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directories in individual virtual screens&lt;br /&gt;
and do:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
It is best to do that on another machine to not upset the receivers.&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
If you have the tape-station, you should also add these lines&lt;br /&gt;
&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
  # Parameters for tape station/beta decay&lt;br /&gt;
  # At least one must be enabled for tape &lt;br /&gt;
  # station spectra to be generated.&lt;br /&gt;
  &lt;br /&gt;
  # beta-gamma coincidence window&lt;br /&gt;
  decay_station_bg  -10    40&lt;br /&gt;
  &lt;br /&gt;
  # max time bt gammas in decay station 2D matrices&lt;br /&gt;
  decay_station_ggdt 20&lt;br /&gt;
   &lt;br /&gt;
  # gg decay time gate&lt;br /&gt;
  # the time window in which we see decays vrt to last tape move&lt;br /&gt;
  decay_station_gt1  10    617&lt;br /&gt;
  decay_station_gt2  620   892&lt;br /&gt;
  decay_station_gt3  1000 3000&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A number of extra 1D and 2D spectra will then be produced. If they are&lt;br /&gt;
commented out, only the usual bin_dgs spectra will be produced.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile first)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration (last parameter) will in this case be 1keV/ch.&lt;br /&gt;
The second last parameter specifies the lowest channel the program will search for peaks in to avoid any noise and x-rays at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2150</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2150"/>
		<updated>2020-07-11T16:22:05Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receivers, do the following&lt;br /&gt;
&lt;br /&gt;
 cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
 git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
 make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here is an example of how to run the programs:&lt;br /&gt;
&lt;br /&gt;
       +---- receiver program&lt;br /&gt;
       |        +---- IP/name of IOC to receive from&lt;br /&gt;
       |        |        +---- data file name&lt;br /&gt;
       |        |        |              +---- max size&lt;br /&gt;
       |        |        |              |       +---- GEB ID&lt;br /&gt;
       |        |        |              |       |&lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 (see http://gretina.lbl.gov/tools-etc/gebheaders for the official list of GEB header IDs) , and write the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it (much) easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines. When the size of the file reaches this limit, the file is closed and another file is used.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
The only things the receiver does is to&lt;br /&gt;
&lt;br /&gt;
  get the data from the IOC&lt;br /&gt;
  extract the timestamp from the data&lt;br /&gt;
  extract the lenght of the data&lt;br /&gt;
  extract the board ID&lt;br /&gt;
&lt;br /&gt;
After that, the receiver constructs a GEB header that has this form&lt;br /&gt;
&lt;br /&gt;
  struct gebData {&lt;br /&gt;
    int type; /* type of data following */&lt;br /&gt;
    int length;&lt;br /&gt;
    long long timestamp;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Once constructed, the receiver writes this header to disk followed by the data it received from the IOC. Thus, the data is a series of GEB headers and data, also referred to as the headers and payloads. It is important to recognize that the receiver does not otherwise interpret the data! This makes the receiver simple, universal and fast. Interpretating the date is the task of GEBSort which acts on the data after the merging.&lt;br /&gt;
The data is stored in individual files based in the channel ID. Thus, if four digitizers are serviced by one IOC, four files are opened. This make the merging of the data easier.&lt;br /&gt;
&lt;br /&gt;
These are the fields that the receiver relies on:&lt;br /&gt;
&lt;br /&gt;
  board_id = ((hdr[0] &amp;gt;&amp;gt;= 4) &amp;amp; 0xfff);  bits:4...15&lt;br /&gt;
&lt;br /&gt;
  packet_len = ((hdr[0] &amp;gt;&amp;gt;= 16) &amp;amp; 0x000007ff); bits:16...26&lt;br /&gt;
&lt;br /&gt;
  Geb.timestamp = (unsigned long long int) hdr[1];&lt;br /&gt;
  ulli1 = (unsigned long long int) (hdr[2] &amp;amp; 0x0000ffff);&lt;br /&gt;
  ulli1 = (ulli1 &amp;lt;&amp;lt; 32);&lt;br /&gt;
  Geb.timestamp += ulli1;&lt;br /&gt;
&lt;br /&gt;
In the full data from the IOC that also contains the 0xaaaaaaaa, hdr[0|1|2] would be hdr[1|2|3] &lt;br /&gt;
The board_id is also referred to as the &amp;quot;USER PACKET DATA&amp;quot; field and uniquely identifies the digitizer.&lt;br /&gt;
&lt;br /&gt;
  NOTE: Please use gtReceiver4 for now. &lt;br /&gt;
  gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
To get the GEBMerge program,&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
To get the GEBSort program,&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2126</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2126"/>
		<updated>2020-05-30T16:22:07Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receivers, do the following&lt;br /&gt;
&lt;br /&gt;
 cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
 git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
 make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here is an example of how to run the programs:&lt;br /&gt;
&lt;br /&gt;
       +---- receiver program&lt;br /&gt;
       |        +---- IP/name of IOC to receive from&lt;br /&gt;
       |        |        +---- data file name&lt;br /&gt;
       |        |        |              +---- max size&lt;br /&gt;
       |        |        |              |       +---- GEB ID&lt;br /&gt;
       |        |        |              |       |&lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 (see http://gretina.lbl.gov/tools-etc/gebheaders for the official list of GEB header IDs) , and write the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it (much) easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines. When the size of the file reaches this limit, the file is closed and another file is used.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
The only things the receiver does is to&lt;br /&gt;
&lt;br /&gt;
  get the data from the IOC&lt;br /&gt;
  extract the timestamp from the data&lt;br /&gt;
  extract the lenght of the data&lt;br /&gt;
  extract the board ID&lt;br /&gt;
&lt;br /&gt;
After that, the receiver constructs a GEB header that has this form&lt;br /&gt;
&lt;br /&gt;
  struct gebData {&lt;br /&gt;
    int type; /* type of data following */&lt;br /&gt;
    int length;&lt;br /&gt;
    long long timestamp;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Once constructed, the receiver writes this header to disk followed by the data it received from the IOC. Thus, the data is a series of GEB headers and data, also referred to as the headers and payloads. It is important to recognize that the receiver does not otherwise interpret the data! This makes the receiver simple, universal and fast. Interpretating the date is the task of GEBSort which acts on the data after the merging.&lt;br /&gt;
The data is stored in individual files based in the channel ID. Thus, if four digitizers are serviced by one IOC, four files are opened. This make the merging of the data easier.&lt;br /&gt;
&lt;br /&gt;
These are the fields that the receiver relies on:&lt;br /&gt;
&lt;br /&gt;
  board_id = ((hdr[0] &amp;gt;&amp;gt;= 4) &amp;amp; 0xfff);  bits:4...15&lt;br /&gt;
&lt;br /&gt;
  packet_len = ((hdr[0] &amp;gt;&amp;gt;= 16) &amp;amp; 0x000007ff); bits:16...26&lt;br /&gt;
&lt;br /&gt;
  Geb.timestamp = (unsigned long long int) hdr[1];&lt;br /&gt;
  ulli1 = (unsigned long long int) (hdr[2] &amp;amp; 0x0000ffff);&lt;br /&gt;
  ulli1 = (ulli1 &amp;lt;&amp;lt; 32);&lt;br /&gt;
  Geb.timestamp += ulli1;&lt;br /&gt;
&lt;br /&gt;
In the full data from the IOC that also contains the 0xaaaaaaaa, hdr[0|1|2] would be hdr[1|2|3] &lt;br /&gt;
The board_id is also referred to as the &amp;quot;USER PACKET DATA&amp;quot; field and uniquely identifies the digitizer.&lt;br /&gt;
&lt;br /&gt;
  NOTE: Please use gtReceiver4 for now. &lt;br /&gt;
  gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
To get the GEBSort program,&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2125</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2125"/>
		<updated>2020-05-30T16:10:40Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receivers, do the following&lt;br /&gt;
&lt;br /&gt;
 cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
 git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
 make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here is an example of how to run the programs:&lt;br /&gt;
&lt;br /&gt;
       +---- receiver program&lt;br /&gt;
       |        +---- IP/name of IOC to receive from&lt;br /&gt;
       |        |        +---- data file name&lt;br /&gt;
       |        |        |              +---- max size&lt;br /&gt;
       |        |        |              |       +---- GEB ID&lt;br /&gt;
       |        |        |              |       |&lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 (see http://gretina.lbl.gov/tools-etc/gebheaders for the official list of GEB header IDs) , and write the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it (much) easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines. When the size of the file reaches this limit, the file is closed and another file is used.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
The only things the receiver does is to&lt;br /&gt;
&lt;br /&gt;
  get the data from the IOC&lt;br /&gt;
  extract the timestamp from the data&lt;br /&gt;
  extract the lenght of the data&lt;br /&gt;
  extract the board ID&lt;br /&gt;
&lt;br /&gt;
After that, the receiver constructs a GEB header that has this form&lt;br /&gt;
&lt;br /&gt;
  struct gebData {&lt;br /&gt;
    int type; /* type of data following */&lt;br /&gt;
    int length;&lt;br /&gt;
    long long timestamp;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Once constructed, the receiver writes this header to disk followed by the data it received from the IOC. Thus, the data is a series of GEB headers and data, also referred to as the headers and payloads. It is important to recognize that the receiver does not otherwise interpret the data! This makes the receiver simple, universal and fast. Interpretating the date is the task of GEBSort which acts on the data after the merging.&lt;br /&gt;
The data is stored in individual files based in the channel ID. Thus, if four digitizers are serviced by one IOC, four files are opened. This make the merging of the data easier.&lt;br /&gt;
&lt;br /&gt;
These are the fields that the receiver relies on:&lt;br /&gt;
&lt;br /&gt;
  board_id = ((hdr[0] &amp;gt;&amp;gt;= 4) &amp;amp; 0xfff);&lt;br /&gt;
&lt;br /&gt;
  packet_len = ((tmp &amp;gt;&amp;gt;= 16) &amp;amp; 0x000007ff);&lt;br /&gt;
&lt;br /&gt;
  Geb.timestamp = (unsigned long long int) hdr[1];&lt;br /&gt;
  ulli1 = (unsigned long long int) (hdr[2] &amp;amp; 0x0000ffff);&lt;br /&gt;
  ulli1 = (ulli1 &amp;lt;&amp;lt; 32);&lt;br /&gt;
  Geb.timestamp += ulli1;&lt;br /&gt;
&lt;br /&gt;
The board_id is also referred to as the &amp;quot;USER PACKET DATA&amp;quot; field and uniquely identifies the digitizer.&lt;br /&gt;
&lt;br /&gt;
  NOTE: Please use gtReceiver4 for now. &lt;br /&gt;
  gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
To get the GEBSort program,&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2123</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2123"/>
		<updated>2020-05-22T13:39:17Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receivers, do the following&lt;br /&gt;
&lt;br /&gt;
 cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
 git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
 make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here is an example of how to run the programs:&lt;br /&gt;
&lt;br /&gt;
       +---- receiver program&lt;br /&gt;
       |        +---- IP/name of IOC to receive from&lt;br /&gt;
       |        |        +---- data file name&lt;br /&gt;
       |        |        |              +---- max size&lt;br /&gt;
       |        |        |              |       +---- GEB ID&lt;br /&gt;
       |        |        |              |       |&lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 (see http://gretina.lbl.gov/tools-etc/gebheaders for the official list of GEB header IDs) , and write the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it (much) easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines. When the size of the file reaches this limit, the file is closed and another file is used.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
The only things the receiver does is to&lt;br /&gt;
&lt;br /&gt;
  get the data from the IOC&lt;br /&gt;
  extract the timestamp from the data (header)&lt;br /&gt;
  extract the lenght of the data&lt;br /&gt;
&lt;br /&gt;
After that, the receiver constructs a GEB header that has this form&lt;br /&gt;
&lt;br /&gt;
  struct gebData {&lt;br /&gt;
    int type; /* type of data following */&lt;br /&gt;
    int length;&lt;br /&gt;
    long long timestamp;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Once constructed, the receiver writes this header to disk followed by the data it received from the IOC. Thus, the data is a series of GEB headers and data, also referred to as the headers and payloads. It is important to recognize that the receiver does not otherwise interpret the data! This makes the receiver simple, universal and fast. Interpretating the date is the task of GEBSort which acts on the data after the merging.&lt;br /&gt;
&lt;br /&gt;
  NOTE: Please use gtReceiver4 for now. &lt;br /&gt;
  gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
To get the GEBSort program,&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2122</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2122"/>
		<updated>2020-05-22T13:19:15Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receivers, do the following&lt;br /&gt;
&lt;br /&gt;
 cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
 git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
 make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here is an example of how to run the programs:&lt;br /&gt;
&lt;br /&gt;
       +---- receiver program&lt;br /&gt;
       |        +---- IP/name of IOC to receive from&lt;br /&gt;
       |        |        +---- data file name&lt;br /&gt;
       |        |        |              +---- max size&lt;br /&gt;
       |        |        |              |       +---- GEB ID&lt;br /&gt;
       |        |        |              |       |&lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 (see http://gretina.lbl.gov/tools-etc/gebheaders for the official list of GEB header IDs) , and write the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it (much) easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines. When the size of the file reaches this limit, the file is closed and another file is used.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
The only things the receiver does is to&lt;br /&gt;
&lt;br /&gt;
  get the data from the IOC&lt;br /&gt;
  extract the timestamp from the data (header)&lt;br /&gt;
  extract the lenght of the data&lt;br /&gt;
&lt;br /&gt;
After that, the receiver constructs a GEB header that has this form&lt;br /&gt;
&lt;br /&gt;
  struct gebData {&lt;br /&gt;
    int type; /* type of data following */&lt;br /&gt;
    int length;&lt;br /&gt;
    long long timestamp;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Once constructed, the receiver writes this header to disk followed by the data it received from the IOC. Thus, the data is a series of GEB headers and data, also referred to as the headers and payloads. It is important to recognize that the receiver does not otherwise interpret the data! This makes the receiver simple, universal and fast. Interpretating the date is the task of GEBSort which acts on the data after the merging.&lt;br /&gt;
&lt;br /&gt;
  NOTE: Please use gtReceiver4 for now. &lt;br /&gt;
  gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2121</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2121"/>
		<updated>2020-05-22T13:14:47Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receivers, do the following&lt;br /&gt;
&lt;br /&gt;
 cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
 git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
 make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here are some examples on how to run the programs:&lt;br /&gt;
&lt;br /&gt;
       +---- receiver program&lt;br /&gt;
       |        +---- IP/name of IOC to receive from&lt;br /&gt;
       |        |        +---- data file name&lt;br /&gt;
       |        |        |              +---- max size&lt;br /&gt;
       |        |        |              |       +---- GEB ID&lt;br /&gt;
       |        |        |              |       |&lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 (see http://gretina.lbl.gov/tools-etc/gebheaders for the official list of GEB header IDs) , and write the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it (much) easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines. When the size of the file reaches this limit, the file is closed and another file is used.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
The only things the receiver does is to&lt;br /&gt;
&lt;br /&gt;
  get the data from the IOC&lt;br /&gt;
  extract the timestamp from the data (header)&lt;br /&gt;
  extract the lenght of the data&lt;br /&gt;
&lt;br /&gt;
After that, the receiver constructs a GEB header that has this form&lt;br /&gt;
&lt;br /&gt;
  struct gebData {&lt;br /&gt;
    int type; /* type of data following */&lt;br /&gt;
    int length;&lt;br /&gt;
    long long timestamp;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
Once constructed, the receiver writes this header to disk followed by the data it received from the IOC. Thus, the data is a series of GEB headers and data, also referred to as the headers and payloads.&lt;br /&gt;
&lt;br /&gt;
It is important to recognize that the receiver does not otherwise interpret the data! This makes the receiver simple, universal and fast. Interpretating the date is done in GEBSort after the data is merged.&lt;br /&gt;
&lt;br /&gt;
  NOTE: Please use gtReceiver4 for now. &lt;br /&gt;
  gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2120</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2120"/>
		<updated>2020-05-21T13:23:08Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver4==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receiver, do the following&lt;br /&gt;
&lt;br /&gt;
* cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
  &lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
&lt;br /&gt;
* make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here are some examples on how to run the programs:&lt;br /&gt;
&lt;br /&gt;
       +---- receiver program&lt;br /&gt;
       |        +---- IP/name of IOC to receive from&lt;br /&gt;
       |        |        +---- data file name&lt;br /&gt;
       |        |        |              +---- max size&lt;br /&gt;
       |        |        |              |       +---- GEB ID&lt;br /&gt;
       |        |        |              |       |&lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 as ID, and put the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
NOTE: use gtReceiver4. gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2119</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2119"/>
		<updated>2020-05-21T13:18:56Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver4==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receiver, do the following&lt;br /&gt;
&lt;br /&gt;
* cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
  &lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
&lt;br /&gt;
* make -B&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here are some examples on how to run the programs:&lt;br /&gt;
 &lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
  gtReceiver5 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 as ID, and put the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
NOTE: use gtReceiver4. gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2118</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2118"/>
		<updated>2020-01-22T22:06:47Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part. It is only shown for completeness&lt;br /&gt;
&lt;br /&gt;
= Acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.&lt;br /&gt;
&lt;br /&gt;
  Do not execute the caput commands in the .save file. For the&lt;br /&gt;
  purpose here, the lines are just information.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ calibration file is generated, &lt;br /&gt;
&lt;br /&gt;
  run GEBSort again&lt;br /&gt;
&lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_eraw.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
   or&lt;br /&gt;
   dgs_ecal2 dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
dgs_ecal2 has been developed lately and may be better at handling difficult peaks. Feel fre to try this new version.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To extract the calibrated spectra&lt;br /&gt;
&lt;br /&gt;
  .x get_ecln.cc&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2117</id>
		<title>Typical DGS run procedures</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2117"/>
		<updated>2019-12-09T22:13:48Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  dfmadata/  &lt;br /&gt;
  dgsdata/&lt;br /&gt;
  xadata/&lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to /dk/fs2/dgs&lt;br /&gt;
  tar -zxvf dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
This creates the two directories: trackMain and GEBSort. Even though DGS does not&lt;br /&gt;
need the tracking code, it is best to create it and make the links below&lt;br /&gt;
&lt;br /&gt;
  # make links to the crmat files which we keep in trackMain&lt;br /&gt;
  # but are needed here as well for GEBSort&lt;br /&gt;
  #&lt;br /&gt;
  (cd GEBSort; rm GANIL_AGATA_crmat.dat; ln -s ../trackMain/GANIL_AGATA_crmat.dat GANIL_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm GSI_AGATA_crmat.dat; ln -s ../trackMain/GSI_AGATA_crmat.dat GSI_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm crmat.LINUX; ln -s ../trackMain/crmat.LINUX crmat.LINUX)&lt;br /&gt;
&lt;br /&gt;
This option does not create all the directories and script files you need.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directories in individual virtual screens&lt;br /&gt;
and do:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
It is best to do that on another machine to not upset the receivers.&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
If you have the tape-station, you should also add these lines&lt;br /&gt;
&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
  # Parameters for tape station/beta decay&lt;br /&gt;
  # At least one must be enabled for tape &lt;br /&gt;
  # station spectra to be generated.&lt;br /&gt;
  &lt;br /&gt;
  # beta-gamma coincidence window&lt;br /&gt;
  decay_station_bg  -10    40&lt;br /&gt;
  &lt;br /&gt;
  # max time bt gammas in decay station 2D matrices&lt;br /&gt;
  decay_station_ggdt 20&lt;br /&gt;
   &lt;br /&gt;
  # gg decay time gate&lt;br /&gt;
  # the time window in which we see decays vrt to last tape move&lt;br /&gt;
  decay_station_gt1  10    617&lt;br /&gt;
  decay_station_gt2  620   892&lt;br /&gt;
  decay_station_gt3  1000 3000&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A number of extra 1D and 2D spectra will then be produced. If they are&lt;br /&gt;
commented out, only the usual bin_dgs spectra will be produced.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration will be 1keV/ch.&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2116</id>
		<title>Typical DGS run procedures</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2116"/>
		<updated>2019-12-05T19:15:13Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  dfmadata/  &lt;br /&gt;
  dgsdata/&lt;br /&gt;
  xadata/&lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to /dk/fs2/dgs&lt;br /&gt;
  tar -zxvf dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
This creates the two directories: trackMain and GEBSort. Even though DGS does not&lt;br /&gt;
need the tracking code, it is best to create it and make the links below&lt;br /&gt;
&lt;br /&gt;
  # make links to the crmat files which we keep in trackMain&lt;br /&gt;
  # but are needed here as well for GEBSort&lt;br /&gt;
  #&lt;br /&gt;
  (cd GEBSort; rm GANIL_AGATA_crmat.dat; ln -s ../trackMain/GANIL_AGATA_crmat.dat GANIL_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm GSI_AGATA_crmat.dat; ln -s ../trackMain/GSI_AGATA_crmat.dat GSI_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm crmat.LINUX; ln -s ../trackMain/crmat.LINUX crmat.LINUX)&lt;br /&gt;
&lt;br /&gt;
This option does not create all the directories and script files you need.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directories in individual virtual screens&lt;br /&gt;
and do:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
It is best to do that on another machine to not upset the receivers.&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
If you have the tape-station, you should also add these lines&lt;br /&gt;
&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
  # parameters for tape station / beta decay&lt;br /&gt;
  # One or the other must be enabled for tape &lt;br /&gt;
  # station spectra to be generated.&lt;br /&gt;
    &lt;br /&gt;
  # beta-gamma coincidence window&lt;br /&gt;
  decay_station_bg  -10    40&lt;br /&gt;
  #                  lo    hi&lt;br /&gt;
&lt;br /&gt;
  # gg_decay time gate&lt;br /&gt;
  # the time window in which we see decays vrt to last tape move&lt;br /&gt;
  decay_station_gt  620  1220&lt;br /&gt;
  #                  lo    hi&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
A number of extra 1D and 2D spectra will then be produced. If they are&lt;br /&gt;
commented out, only the usual bin_dgs spectra will be produced.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration will be 1keV/ch.&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2115</id>
		<title>Typical DGS run procedures</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Typical_DGS_run_procedures&amp;diff=2115"/>
		<updated>2019-12-05T18:22:11Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  dfmadata/  &lt;br /&gt;
  dgsdata/&lt;br /&gt;
  xadata/&lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to /dk/fs2/dgs&lt;br /&gt;
  tar -zxvf dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
This creates the two directories: trackMain and GEBSort. Even though DGS does not&lt;br /&gt;
need the tracking code, it is best to create it and make the links below&lt;br /&gt;
&lt;br /&gt;
  # make links to the crmat files which we keep in trackMain&lt;br /&gt;
  # but are needed here as well for GEBSort&lt;br /&gt;
  #&lt;br /&gt;
  (cd GEBSort; rm GANIL_AGATA_crmat.dat; ln -s ../trackMain/GANIL_AGATA_crmat.dat GANIL_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm GSI_AGATA_crmat.dat; ln -s ../trackMain/GSI_AGATA_crmat.dat GSI_AGATA_crmat.dat)&lt;br /&gt;
  (cd GEBSort; rm crmat.LINUX; ln -s ../trackMain/crmat.LINUX crmat.LINUX)&lt;br /&gt;
&lt;br /&gt;
This option does not create all the directories and script files you need.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directories in individual virtual screens&lt;br /&gt;
and do:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
It is best to do that on another machine to not upset the receivers.&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
If you have the tape-station, you should also add these lines&lt;br /&gt;
&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
  # parameters for tape station / beta decay&lt;br /&gt;
  # One or the other must be enabled for tape &lt;br /&gt;
  # station spectra to be generated.&lt;br /&gt;
    &lt;br /&gt;
  # beta-gamma coincidence window&lt;br /&gt;
  decay_station_bg  -10    40&lt;br /&gt;
  #                  lo    hi&lt;br /&gt;
&lt;br /&gt;
  # gg_decay time gate&lt;br /&gt;
  # the time window in which we see decays vrt to last tape move&lt;br /&gt;
  decay_station_gt  620  1220&lt;br /&gt;
  #                  lo    hi&lt;br /&gt;
  #------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration will be 1keV/ch.&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Main_Page&amp;diff=2114</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Main_Page&amp;diff=2114"/>
		<updated>2019-12-05T18:12:11Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
These are the wiki pages for the Digital and the analog Gammasphere Data Acquisition systems (GS DAQs). Procedures for running the DAQs and the data format will be documented here.&lt;br /&gt;
&lt;br /&gt;
The GS DAQ serves the Gammasphere detector array (http://www.phy.anl.gov/gammasphere/), located at the ATLAS accelerator (http://www.phy.anl.gov/atlas), home of the CAlifornium Rare Isotope Breeder Upgrade (CARIBU http://www.phy.anl.gov/atlas/caribu/).&lt;br /&gt;
&lt;br /&gt;
Contact mailto:torben@anl.gov for comments on, and write access to, these wiki pages&lt;br /&gt;
&lt;br /&gt;
==Digital Gammasphere==&lt;br /&gt;
&lt;br /&gt;
o [[intro]]&lt;br /&gt;
&lt;br /&gt;
o [[typical DGS run procedures]]&lt;br /&gt;
&lt;br /&gt;
o [[receivers/GEBMerge/GEBsort]]&lt;br /&gt;
&lt;br /&gt;
o [[computers and networks]]&lt;br /&gt;
&lt;br /&gt;
o [[Raspberry Pi camera use]]&lt;br /&gt;
&lt;br /&gt;
o [[handeling removable disks under ESATA]]&lt;br /&gt;
&lt;br /&gt;
o [[triggers and digitizers]]&lt;br /&gt;
&lt;br /&gt;
o [[Digitizer Tester]]&lt;br /&gt;
&lt;br /&gt;
o [[The DGS/DFMA EPICS Implementation]]&lt;br /&gt;
&lt;br /&gt;
o [[data formats]]&lt;br /&gt;
&lt;br /&gt;
o [[analysis codes]]&lt;br /&gt;
&lt;br /&gt;
o [[list of experimental runs/analysis]]&lt;br /&gt;
&lt;br /&gt;
o [[some problems and their solutions]]&lt;br /&gt;
&lt;br /&gt;
o [[hint and kinks]]&lt;br /&gt;
&lt;br /&gt;
o [[firmware documentation]]&lt;br /&gt;
&lt;br /&gt;
o [[Tim Madden software documentation]]&lt;br /&gt;
&lt;br /&gt;
==Analog Gammasphere==&lt;br /&gt;
&lt;br /&gt;
o [[Analog Gammasphere]]&lt;br /&gt;
&lt;br /&gt;
o [[LN system]]&lt;br /&gt;
&lt;br /&gt;
o [[JohnSandbox]]&lt;br /&gt;
&lt;br /&gt;
==Experts Only==&lt;br /&gt;
&lt;br /&gt;
o [[Building the entire system]]&lt;br /&gt;
&lt;br /&gt;
o [[Linking Systems Together]]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
* [[Attempts at Inventory]]&lt;br /&gt;
* [https://wiki.anl.gov/wiki_gsdaq/images/4/40/MyRIAD_User_Manaual.pdf MyRIAD_User_Manaual]&lt;br /&gt;
* [https://wiki.anl.gov/wiki_gsdaq/images/1/16/MyRIAD_Abridged_User_Notes.pdf MyRIAD_Abridged_User_Notes]&lt;br /&gt;
* [[CrateAndBoardMapping]]&lt;br /&gt;
&lt;br /&gt;
===Digitizer hardware features you probably don&#039;t know about===&lt;br /&gt;
&lt;br /&gt;
* The digitizer has a [[DAC output]].&lt;br /&gt;
* The digitizer has a buffer amplifier that drives a copy of the analog signal going into channel 9 to outputs on the front panel.  This is a simple analog buffer, no shaping, sampling or anything else.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
==contact list==&lt;br /&gt;
&lt;br /&gt;
Mike Carpenter, mailto:carpenter@anl.gov&lt;br /&gt;
&lt;br /&gt;
John Anderson, mailto:jta@anl.gov&lt;br /&gt;
&lt;br /&gt;
Michael Oberling, mailto:moberling@anl.gov&lt;br /&gt;
&lt;br /&gt;
Torben Lauritsen, mailto:torben@anl.gov&lt;br /&gt;
&lt;br /&gt;
Darek Seweryniak, mailto:seweryniak@anl.gov&lt;br /&gt;
&lt;br /&gt;
Pat Copp, mailto:copp@anl.gov&lt;br /&gt;
&lt;br /&gt;
Amel Korichi, mailto:korichi@csnsm.in2p3.fr&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Template:Standard Footer}}&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2086</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2086"/>
		<updated>2019-08-14T19:20:20Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part. It is only shown for completeness&lt;br /&gt;
&lt;br /&gt;
= Acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.&lt;br /&gt;
&lt;br /&gt;
  Do not execute the caput commands in the .save file. For the&lt;br /&gt;
  purpose here, the lines are just information.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ calibration file is generated, &lt;br /&gt;
&lt;br /&gt;
  run GEBSort again&lt;br /&gt;
&lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_eraw.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
   or&lt;br /&gt;
   dgs_ecal2 dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
dgs_ecal2 has been developed lately and may be better at handling difficult peaks. Feel fre to try this new version.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To extract the calibrated spectra&lt;br /&gt;
&lt;br /&gt;
  .x get_ecln.cc&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2085</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2085"/>
		<updated>2019-08-14T16:53:55Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part. It is only shown for completeness&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.&lt;br /&gt;
&lt;br /&gt;
  Do not execute the caput commands in the .save file. For the&lt;br /&gt;
  purpose here, the lines are just information.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ calibration file is generated, &lt;br /&gt;
&lt;br /&gt;
  run GEBSort again&lt;br /&gt;
&lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_eraw.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
   or&lt;br /&gt;
   dgs_ecal2 dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
dgs_ecal2 has been developed lately and may be better at handling difficult peaks. Feel fre to try this new version.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
To extract the calibrated spectra&lt;br /&gt;
&lt;br /&gt;
  .x get_ecln.cc&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2084</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2084"/>
		<updated>2019-08-14T16:48:52Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part. It is only shown for completeness&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.&lt;br /&gt;
&lt;br /&gt;
  Do not execute the caput commands in the .save file. For the&lt;br /&gt;
  purpose here, the lines are just information.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, &lt;br /&gt;
&lt;br /&gt;
  run GEBSort again&lt;br /&gt;
&lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_eraw.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
   or&lt;br /&gt;
   dgs_ecal2 dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
dgs_ecal2 has been developed lately and may be better at handling difficult peaks. Feel fre to try this new version.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2083</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2083"/>
		<updated>2019-08-13T23:15:05Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part. It is only shown for completeness&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
where 350 141 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 run_xxx.save or run_xxx.info file:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.&lt;br /&gt;
&lt;br /&gt;
  Do not execute the caput commands in the .save file. For the&lt;br /&gt;
  purpose here, the lines are just information.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
   or&lt;br /&gt;
   dgs_ecal2 dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
dgs_ecal2 has been developed lately and may be better at handling difficult peaks. Feel fre to try this new version.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2082</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2082"/>
		<updated>2019-08-13T11:44:20Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part. It is only shown for completeness&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
where 350 141 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 run_xxx.save or run_xxx.info file:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.&lt;br /&gt;
&lt;br /&gt;
  Do not execute the caput commands in the .save file. For the&lt;br /&gt;
  purpose here, the lines are just information.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2081</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2081"/>
		<updated>2019-08-13T11:41:29Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
where 350 141 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 run_xxx.save or run_xxx.info file:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing. THIS NEEDS TO BE CONFIRMED.&lt;br /&gt;
&lt;br /&gt;
  On less you know what you are doing, do not execute the caput commands&lt;br /&gt;
  in the .save file. &lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2080</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2080"/>
		<updated>2019-08-13T11:36:55Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
where 350 141 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 run_xxx.save or run_xxx.info file:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2079</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2079"/>
		<updated>2019-08-13T11:35:11Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
where 350 141 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 run_xxx.save file:&lt;br /&gt;
&lt;br /&gt;
  GLBL:DIG:d_window 0.06   &lt;br /&gt;
  GLBL:DIG:k_window 0.20     &lt;br /&gt;
  GLBL:DIG:m_window 3.50&lt;br /&gt;
  GLBL:DIG:k0_window 0.80&lt;br /&gt;
  GLBL:DIG:d3_window 0.20&lt;br /&gt;
  GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  ... etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
Notice that what is considered the &#039;K value&#039; 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.&lt;br /&gt;
&lt;br /&gt;
  Only the GLOBAL m, k and d values matter. Thus, just look at &lt;br /&gt;
  the GLBL: lines in the listing&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2078</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2078"/>
		<updated>2019-08-09T23:16:54Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  enabled &amp;quot;1-110&amp;quot;&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2077</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2077"/>
		<updated>2019-08-05T19:50:56Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  (cd gtreceiver; git pull)&lt;br /&gt;
  (cd gtreceiver; make -B)&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2076</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2076"/>
		<updated>2019-08-05T19:49:50Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
Where, of course, for DGS you do not need the tracking part.&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2075</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2075"/>
		<updated>2019-07-31T17:14:53Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code for DGS use:&lt;br /&gt;
&lt;br /&gt;
  for efficiency, make sure only bin_dgs&lt;br /&gt;
  is enabled in the GEBSort chat file&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2070</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2070"/>
		<updated>2019-05-08T20:15:56Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to the onenet switch (next to it)&lt;br /&gt;
  [connect monitor (HDMI)]&lt;br /&gt;
  [connect keyboard]&lt;br /&gt;
  [the wireless mouse should already be there]&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
The items in [] may not be needed. The pi user password is now the default DGS password, not the default pi one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly.&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser using thes URL:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in. The streamer leaves a lot of files which needs to be removed to make sure the raspberry pi is happy. Do&lt;br /&gt;
&lt;br /&gt;
  rm /dev/shm/*&lt;br /&gt;
&lt;br /&gt;
=Configuration of the raspberry pi to use the streaming software=&lt;br /&gt;
&lt;br /&gt;
There seems to be a nice description at the URL:&lt;br /&gt;
&lt;br /&gt;
  https://pimylifeup.com/raspberry-pi-webcam-server/&lt;br /&gt;
&lt;br /&gt;
though I haven&#039;t tried it. We also have have history log file from when Kalle installed the software.&lt;br /&gt;
&lt;br /&gt;
=Thanks=&lt;br /&gt;
&lt;br /&gt;
Thanx to Kalle for setting up this system&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2069</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2069"/>
		<updated>2019-05-06T19:29:36Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to the onenet switch (next to it)&lt;br /&gt;
  [connect monitor (HDMI)]&lt;br /&gt;
  [connect keyboard]&lt;br /&gt;
  [the wireless mouse should already be there]&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
The items in [] may not be needed. The pi user password is now the default DGS password, not the default pi one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly.&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser using thes URL:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=Configuration of the raspberry pi to use the streaming software=&lt;br /&gt;
&lt;br /&gt;
There seems to be a nice description at the URL:&lt;br /&gt;
&lt;br /&gt;
  https://pimylifeup.com/raspberry-pi-webcam-server/&lt;br /&gt;
&lt;br /&gt;
though I haven&#039;t tried it. We also have have history log file from when Kalle installed the software.&lt;br /&gt;
&lt;br /&gt;
=Thanks=&lt;br /&gt;
&lt;br /&gt;
Thanx to Kalle for setting up this system&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2068</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2068"/>
		<updated>2019-05-06T19:20:17Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to the onenet switch (next to it)&lt;br /&gt;
  [connect monitor (HDMI)]&lt;br /&gt;
  [connect keyboard]&lt;br /&gt;
  [the wireless mouse should already be there]&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
 The pi user password is now the default DGS password, not the default pi one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser using thes URL:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=To configure the raspberry pi to use the streaming software do=&lt;br /&gt;
&lt;br /&gt;
There seems to be a nice description at the URL:&lt;br /&gt;
&lt;br /&gt;
  https://pimylifeup.com/raspberry-pi-webcam-server/&lt;br /&gt;
&lt;br /&gt;
though I haven&#039;t tried it. We also have have history log file from when Kalle installed the software.&lt;br /&gt;
&lt;br /&gt;
=Thanks=&lt;br /&gt;
&lt;br /&gt;
Thanx to Kalle for setting up this system&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2067</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2067"/>
		<updated>2019-05-03T18:54:29Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600 1.0&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration in this case will be 1.0keV/ch (last argument).&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2066</id>
		<title>Receivers/GEBMerge/GEBsort</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Receivers/GEBMerge/GEBsort&amp;diff=2066"/>
		<updated>2019-05-01T18:09:37Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==gtReceiver4==&lt;br /&gt;
&lt;br /&gt;
To take data with the DGS DAQ, you must start a gtReceiverN (N=3..5) program for each of the IOCs that are collecting data. This is usually done from a script which starts all the necessary receivers and controls the run number.&lt;br /&gt;
&lt;br /&gt;
To get the gtReceiverN receiver, do the following&lt;br /&gt;
&lt;br /&gt;
* cd to where you want to compile the gtReceiverN programs&lt;br /&gt;
  &lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/gtreceiver.git&lt;br /&gt;
  &lt;br /&gt;
* make clean&lt;br /&gt;
&lt;br /&gt;
* make&lt;br /&gt;
&lt;br /&gt;
That should generate the gtReceiver4 and gtReceiver5 programs as well as the outdated gtReceiver3 program. gtReciver5 should work just like gtReceiver4; but it buffers the digitizer data and sorts the timestamps before writing the data to disk. Thus, with gtReciver5 you should be able to run in &#039;copy&#039; mode, avoiding using the IOC CPU to do the TS sorting task. Here are some examples on how to run the programs:&lt;br /&gt;
 &lt;br /&gt;
  gtReceiver4 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
  gtReceiver5 ioc1 data_run_001.gtd 2000000000 14&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we are asking gtReceiver4/gtReceiver5 to acquire data from ioc1, use a GEB ID of 14 as ID, and put the data in the file data_run_001.gtd. That will not actually be one file as gtReceiver4/gtReceiver5 splits the data stream into a file for each of the digitizers the IOC serves. That makes it easier to merge and time order the DGS data later. 2000000000 specifies the max size of the files, here keeping them under 2GBytes, so they can be read on all machines.&lt;br /&gt;
&lt;br /&gt;
The gtReceiver4/gtReceiver5 program writes data out in the GRETINA GEBheader/Payload form. This means that the GT GEBMerge and GEBSort programs can be used for DGS data as well as GT data. gtReceiver3 writes data witout GEB headers and should not be used anymore.&lt;br /&gt;
&lt;br /&gt;
NOTE: use gtReceiver4. gtReceiver5 is reported to a have a problem.&lt;br /&gt;
&lt;br /&gt;
==GEBMerge==&lt;br /&gt;
&lt;br /&gt;
GEBMerge allows you to merge all the files that the instances of the gtReceiver4 created during your run. In addition to merging the data, GEBMerge also &#039;&#039;orders&#039;&#039; the merged data based on the timestamps in the GEB header. This merger and time stamp ordering program will work on all kinds of data, as long as the data are in the GT GEB header/Payload format, including data taken with the gtReceiver4 receiver.&lt;br /&gt;
&lt;br /&gt;
You will use the program as&lt;br /&gt;
&lt;br /&gt;
  GEBMerge GEBMerge.chat outfile     file1  file2  file3  file4 .....&lt;br /&gt;
&lt;br /&gt;
where GEBMerge.chat is the file that contains parameters for the merging, such as the buffer size to use. The merged data will be written to &#039;&#039;outfile&#039;&#039; and &#039;&#039;file1  file2  file3  file4 .....&#039;&#039; is the list of files to merge.&lt;br /&gt;
&lt;br /&gt;
GEBMerge is part of the GEBSort package. See the link below for how to get the GEBSort package. gtReceiver4 is specific to DGS; but the GEBSort package can handle many other kinds of data as well. Sometimes you will want to use GEBMerge on GRETINA data as well as the program also time orders the data.&lt;br /&gt;
&lt;br /&gt;
==GEBSort==&lt;br /&gt;
&lt;br /&gt;
GEBSort is a rather general purpose ROOT sorter, that, in addition to being able to read GRETINA data, also can read DGS data acquired by gtReceiver4. This sorter is documented under the GRETINA wiki pages &lt;br /&gt;
&lt;br /&gt;
  [https://wiki.anl.gov/gretina_at_anl/Operations#off-line_sorting_with_GEBSort.2C_to_a_root_file]&lt;br /&gt;
&lt;br /&gt;
==Running GEBMerge and GEBSort in interactive mode==&lt;br /&gt;
&lt;br /&gt;
It is possible to merge data and look at the data on-line. The trick we apply is to not close an input file to GEBMerge or GEBSort right away when no more data is available. Instead, through the instructions&lt;br /&gt;
&lt;br /&gt;
  waitfordata 300&lt;br /&gt;
&lt;br /&gt;
in both the chatfiles of GEBMerge and GEBSort, we instruct the programs to wait 300 seconds, or 5 minutes, before giving up merging or sorting data. Thus, the programs will merge and sort the data as it comes in and you can set GEBSort up to use a map-file to display the data so that you can update/display like we did for GSSort with the analog Gammasphere DAQ. Here is a reminder about how you set up a map-file with GEBSort. First you set up a root session where you will display the data. Keep this root session up.&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  .L GSUtil.cc++&lt;br /&gt;
  sdummyload(200000000)&lt;br /&gt;
&lt;br /&gt;
that will tell you the start map address for the given size of the root map-file, in this case 200000000. Now, specify this map address, in this example: 0x9ef6e000, when you start GEBSort as&lt;br /&gt;
&lt;br /&gt;
  ./GEBSort_nogeb \&lt;br /&gt;
     -input disk merged_data.gtd \&lt;br /&gt;
     -mapfile c1.map 200000000 0x9ef6e000 \&lt;br /&gt;
     -chat GEBSort.chat &lt;br /&gt;
&lt;br /&gt;
where 200000000 is the size of the map file you want and 0x9ef6e000 is the start map addess reported by sdummyload as describes above. Now you can go back into the display root sessiong above and load the mapfile&lt;br /&gt;
&lt;br /&gt;
  sload(&amp;quot;c1.map&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Then you will do the usual:&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
  update()&lt;br /&gt;
  [display]&lt;br /&gt;
&lt;br /&gt;
If the beam goes away for more than 5 minutes you will have to start the GEBMerge and GEBSort programs again (maybe by starting a new run). At the end of a run, you would kill all the receivers (as usual) and then you can&lt;br /&gt;
&lt;br /&gt;
  pkill -9 GEBmerge&lt;br /&gt;
  pkill -9 GEBSort&lt;br /&gt;
&lt;br /&gt;
to stop the programs. In principle, you have now merged the data online and don&#039;t need to do that later.&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2065</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2065"/>
		<updated>2019-04-29T21:01:17Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: /* To boot the raspberry pi up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to the onenet switch (next to it)&lt;br /&gt;
  [connect monitor (HDMI)]&lt;br /&gt;
  [connect keyboard]&lt;br /&gt;
  [the wireless mouse should already be there]&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
 The pi user password is now the default DGS password, not the default pi one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser using thes URL:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=To configure the raspberry pi to use the streaming software do=&lt;br /&gt;
&lt;br /&gt;
  TBD [have history log file]&lt;br /&gt;
&lt;br /&gt;
=Thanks=&lt;br /&gt;
&lt;br /&gt;
Thanx to Kalle for setting up this system&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2064</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2064"/>
		<updated>2019-04-29T21:00:59Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to onenet switch (next to it)&lt;br /&gt;
  [connect monitor (HDMI)]&lt;br /&gt;
  [connect keyboard]&lt;br /&gt;
  [the wireless mouse should already be there]&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
 The pi user password is now the default DGS password, not the default pi one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser using thes URL:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=To configure the raspberry pi to use the streaming software do=&lt;br /&gt;
&lt;br /&gt;
  TBD [have history log file]&lt;br /&gt;
&lt;br /&gt;
=Thanks=&lt;br /&gt;
&lt;br /&gt;
Thanx to Kalle for setting up this system&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2063</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2063"/>
		<updated>2019-04-29T20:59:43Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to onenet switch (next to it)&lt;br /&gt;
  [connect monitor (HDMI)]&lt;br /&gt;
  [connect keyboard]&lt;br /&gt;
  [the wireless mouse should already be there]&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
 The pi user password is now the default DGS password, not the default pi one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser as:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=To configure the raspberry pi to use the streaming software do=&lt;br /&gt;
&lt;br /&gt;
  TBD [have history log file]&lt;br /&gt;
&lt;br /&gt;
=Thanks=&lt;br /&gt;
&lt;br /&gt;
Thanx to Kalle for setting up this system&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2062</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2062"/>
		<updated>2019-04-29T20:59:22Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to onenet switch (next to it)&lt;br /&gt;
  [connect monitor (HDMI)]&lt;br /&gt;
  [connect keyboard]&lt;br /&gt;
  [the wireless mouse should already be there]&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
 The pi user password is now the default DGS password, not the default pi one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser as:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=To configure the raspberry pi to use the streaming software do=&lt;br /&gt;
&lt;br /&gt;
  TBD [have history log file]&lt;br /&gt;
&lt;br /&gt;
=thanks=&lt;br /&gt;
&lt;br /&gt;
Thanx to Kalle for setting up this system&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2061</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2061"/>
		<updated>2019-04-29T17:00:16Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to onenet switch (next to it)&lt;br /&gt;
  connect monitor (HDMI)&lt;br /&gt;
  connect keyboard&lt;br /&gt;
  the wireless mouse should already be there&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
 The pi user password is now the default DGS password, not the default one!!&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser as:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=To configure the raspberry pi to use the streaming software do=&lt;br /&gt;
&lt;br /&gt;
  TBD&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2060</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2060"/>
		<updated>2019-04-29T16:39:15Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=To boot the raspberry pi up=&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to onenet switch (next to it)&lt;br /&gt;
  connect monitor (HDMI)&lt;br /&gt;
  connect keyboard&lt;br /&gt;
  the wireless mouse should already be there&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
Booting it up with the cat6 cable attached, is the easiest way to make sure it comes up on onenet.&lt;br /&gt;
On some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=To use the raspberry pi camera to stream data=&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser as:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
=To configure the raspberry pi to use the streaming software do=&lt;br /&gt;
&lt;br /&gt;
  TBD&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2059</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2059"/>
		<updated>2019-04-29T16:34:54Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
To boot the raspberry pi up,&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to onenet switch (next to it)&lt;br /&gt;
  connect monitor (HDMI)&lt;br /&gt;
  connect keyboard&lt;br /&gt;
  the wireless mouse should already be there&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
on some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use the raspberry pi camera to stream data:&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser as:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
You will have to be on onenet to see the the video stream.&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;br /&gt;
&lt;br /&gt;
To configure the raspberry pi to use the streaming software do&lt;br /&gt;
&lt;br /&gt;
  TBD&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2058</id>
		<title>Raspberry Pi camera use</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Raspberry_Pi_camera_use&amp;diff=2058"/>
		<updated>2019-04-29T16:32:37Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: Created page with &amp;quot; To boot the raspberry pi up,    connect cat6 cable to onenet switch (next to it)   connect monitor (HDMI)   connect keyboard   the wireless mouse should already be there   co...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
To boot the raspberry pi up,&lt;br /&gt;
&lt;br /&gt;
  connect cat6 cable to onenet switch (next to it)&lt;br /&gt;
  connect monitor (HDMI)&lt;br /&gt;
  connect keyboard&lt;br /&gt;
  the wireless mouse should already be there&lt;br /&gt;
  connect the usb power plug&lt;br /&gt;
&lt;br /&gt;
It should then boot up and connect itself to onenet where it will have the IP&lt;br /&gt;
&lt;br /&gt;
   192.168.203.2&lt;br /&gt;
&lt;br /&gt;
on some machines it can also be reached as darekpi02 if DNS is set up properly&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use the raspberry pi camera to stream data:&lt;br /&gt;
&lt;br /&gt;
  sudo service motion stop&lt;br /&gt;
  ./motion -c motion-mmalcam-both.conf&lt;br /&gt;
&lt;br /&gt;
that should start a little webserver so that you can see the live stream from a web browser as:&lt;br /&gt;
&lt;br /&gt;
  http://192.168.203.2:8081&lt;br /&gt;
&lt;br /&gt;
To configure the raspberry pi to use the streaming software do&lt;br /&gt;
&lt;br /&gt;
  TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you want to stop the stream, simply type crtl-c in the window you started the stream in&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Main_Page&amp;diff=2057</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Main_Page&amp;diff=2057"/>
		<updated>2019-04-29T16:22:39Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
These are the wiki pages for the Digital and the analog Gammasphere Data Acquisition systems (GS DAQs). Procedures for running the DAQs and the data format will be documented here.&lt;br /&gt;
&lt;br /&gt;
The GS DAQ serves the Gammasphere detector array (http://www.phy.anl.gov/gammasphere/), located at the ATLAS accelerator (http://www.phy.anl.gov/atlas), home of the CAlifornium Rare Isotope Breeder Upgrade (CARIBU http://www.phy.anl.gov/atlas/caribu/).&lt;br /&gt;
&lt;br /&gt;
Contact mailto:torben@anl.gov for comments on, and write access to, these wiki pages&lt;br /&gt;
&lt;br /&gt;
==Digital Gammasphere==&lt;br /&gt;
&lt;br /&gt;
o [[intro]]&lt;br /&gt;
&lt;br /&gt;
o [[typical DGS run procedures]]&lt;br /&gt;
&lt;br /&gt;
o [[receivers/GEBMerge/GEBsort]]&lt;br /&gt;
&lt;br /&gt;
o [[computers and networks]]&lt;br /&gt;
&lt;br /&gt;
o [[Raspberry Pi camera use]]&lt;br /&gt;
&lt;br /&gt;
o [[handeling removable disks under ESATA]]&lt;br /&gt;
&lt;br /&gt;
o [[triggers and digitizers]]&lt;br /&gt;
&lt;br /&gt;
o [[Digitizer Tester]]&lt;br /&gt;
&lt;br /&gt;
o [[The DGS/DFMA EPICS Implementation]]&lt;br /&gt;
&lt;br /&gt;
o [[data formats]]&lt;br /&gt;
&lt;br /&gt;
o [[analysis codes]]&lt;br /&gt;
&lt;br /&gt;
o [[list of experimental runs/analysis]]&lt;br /&gt;
&lt;br /&gt;
o [[some problems and their solutions]]&lt;br /&gt;
&lt;br /&gt;
o [[hint and kinks]]&lt;br /&gt;
&lt;br /&gt;
o [[firmware documentation]]&lt;br /&gt;
&lt;br /&gt;
o [[Tim Madden software documentation]]&lt;br /&gt;
&lt;br /&gt;
==Analog Gammasphere==&lt;br /&gt;
&lt;br /&gt;
o [[Analog Gammasphere]]&lt;br /&gt;
&lt;br /&gt;
o [[LN system]]&lt;br /&gt;
&lt;br /&gt;
o [[JohnSandbox]]&lt;br /&gt;
&lt;br /&gt;
==Experts Only==&lt;br /&gt;
&lt;br /&gt;
o [[Building the entire system]]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
* [[Attempts at Inventory]]&lt;br /&gt;
* [https://wiki.anl.gov/wiki_gsdaq/images/4/40/MyRIAD_User_Manaual.pdf MyRIAD_User_Manaual]&lt;br /&gt;
* [https://wiki.anl.gov/wiki_gsdaq/images/1/16/MyRIAD_Abridged_User_Notes.pdf MyRIAD_Abridged_User_Notes]&lt;br /&gt;
* [[CrateAndBoardMapping]]&lt;br /&gt;
&lt;br /&gt;
===Digitizer hardware features you probably don&#039;t know about===&lt;br /&gt;
&lt;br /&gt;
* The digitizer has a [[DAC output]].&lt;br /&gt;
* The digitizer has a buffer amplifier that drives a copy of the analog signal going into channel 9 to outputs on the front panel.  This is a simple analog buffer, no shaping, sampling or anything else.&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
==contact list==&lt;br /&gt;
&lt;br /&gt;
Mike Carpenter, mailto:carpenter@anl.gov&lt;br /&gt;
&lt;br /&gt;
John Anderson, mailto:jta@anl.gov&lt;br /&gt;
&lt;br /&gt;
Tim Madden, mailto:tmadden@aps.anl.gov&lt;br /&gt;
&lt;br /&gt;
Michael Oberling, mailto:moberling@anl.gov&lt;br /&gt;
&lt;br /&gt;
Shaofei Zhu, mailto:zhu@phy.anl.gov&lt;br /&gt;
&lt;br /&gt;
Torben Lauritsen, mailto:torben@anl.gov&lt;br /&gt;
&lt;br /&gt;
Calem Hoffman, mailto:crhoffman@phy.anl.gov&lt;br /&gt;
&lt;br /&gt;
mailto:seweryniak@anl.gov&lt;br /&gt;
&lt;br /&gt;
mailto:wilt@phy.anl.gov&lt;br /&gt;
&lt;br /&gt;
mailto:khoo@anl.gov&lt;br /&gt;
&lt;br /&gt;
Robert Janssens, mailto:janssens@anl.gov&lt;br /&gt;
&lt;br /&gt;
mailto:malbers@phy.anl.gov&lt;br /&gt;
&lt;br /&gt;
Amel Korichi, mailto:korichi@csnsm.in2p3.fr&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; &#039;email all&#039; link&lt;br /&gt;
&lt;br /&gt;
mailto:torben@anl.gov,carpenter@anl.gov,jta@anl.gov,tmadden@aps.anl.gov,moberling@anl.gov,zhu@phy.anl.gov,cjc@anl.gov,crhoffman@phy.anl.gov,seweryniak@anl.gov,malcorta@anl.gov,wilt@phy.anl.gov,khoo@anl.gov,janssens@anl.gov,malbers@phy.anl.gov,korichi@csnsm.in2p3.fr&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Template:Standard Footer}}&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
	<entry>
		<id>https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2017</id>
		<title>Analysis codes</title>
		<link rel="alternate" type="text/html" href="https://wiki.anl.gov/wiki_gsdaq/index.php?title=Analysis_codes&amp;diff=2017"/>
		<updated>2019-02-16T20:00:38Z</updated>

		<summary type="html">&lt;p&gt;Tlauritsen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Typical run procedure ==&lt;br /&gt;
&lt;br /&gt;
Traditionally you will have a directory structure as&lt;br /&gt;
&lt;br /&gt;
  data/  &lt;br /&gt;
  GEBSort/  &lt;br /&gt;
  LOG_FILES/ &lt;br /&gt;
  Merged/&lt;br /&gt;
  ROOT_FILES/&lt;br /&gt;
&lt;br /&gt;
You can make this directory structure in two ways:&lt;br /&gt;
&lt;br /&gt;
Option1 (preferred):&lt;br /&gt;
&lt;br /&gt;
  cd to disk you want to use&lt;br /&gt;
  tar -zxvf ~dgs/dgs_template.tgz&lt;br /&gt;
  mv template gsfmannn&lt;br /&gt;
  cd gsfmannn&lt;br /&gt;
&lt;br /&gt;
where nnn is the run number.&lt;br /&gt;
You now have a directory with all you should need. &lt;br /&gt;
To make sure things are up to date, you should&lt;br /&gt;
&lt;br /&gt;
  (cd GEBSort; git pull)&lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
  (cd trackMain; git pull)&lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Option2 (manual):&lt;br /&gt;
&lt;br /&gt;
you can checkout the software as&lt;br /&gt;
&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/trackMain.git &lt;br /&gt;
  (cd trackMain; make -B)&lt;br /&gt;
  git clone https://gitlab.phy.anl.gov/tlauritsen/GEBSort.git &lt;br /&gt;
  (cd GEBSort; make -B)&lt;br /&gt;
&lt;br /&gt;
= acquire and sort data =&lt;br /&gt;
&lt;br /&gt;
To acquire the data,  cd to the &#039;data&#039; directory.&lt;br /&gt;
You start and stop the runs as:&lt;br /&gt;
&lt;br /&gt;
  start_run.sh 123&lt;br /&gt;
  stop_run.sh&lt;br /&gt;
&lt;br /&gt;
To merge the data from a run, in the same directory, type&lt;br /&gt;
&lt;br /&gt;
  gebmerge.sh 123&lt;br /&gt;
&lt;br /&gt;
That will take the run 123 files in the data directory and make a merged file in the &lt;br /&gt;
Merged directory and the log file in the LOG_FILES directory&lt;br /&gt;
&lt;br /&gt;
Before the sort, you should look at the GEBSort.chat file. Lines you may need to change are&lt;br /&gt;
&lt;br /&gt;
  bin_none&lt;br /&gt;
  bin_dgs&lt;br /&gt;
  beta        0.0&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
The cal files are the calibration files. See below for how to generate them.&lt;br /&gt;
&lt;br /&gt;
To sort the data, cd to the GEBSort directory and&lt;br /&gt;
&lt;br /&gt;
  gebsort.sh 123&lt;br /&gt;
&lt;br /&gt;
The root file will be placed in the ROOT_FILES directory as run123.root&lt;br /&gt;
To look at the root file, you would do&lt;br /&gt;
&lt;br /&gt;
  rootn.exe&lt;br /&gt;
  dload(&amp;quot;../ROOT_FILES/run123.root&amp;quot;)&lt;br /&gt;
  ...display...&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
== Calibrations for bin_dgs in GEBSort_nogeb ==&lt;br /&gt;
&lt;br /&gt;
GEBSort_nogeb is the program that can analyze data from DGS, DFMA and GRETINA.&lt;br /&gt;
This is how you set up the code:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
To produce the PZ spectra and 2D [sum2-sum1] vs [sum1] matrices needed to determine the PZ fudge factor (FF)&lt;br /&gt;
you must enable &lt;br /&gt;
&lt;br /&gt;
  #define ALL2DS 1&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
You now specify the PZ and ecal files in the GEBSort.chat file with these lines:&lt;br /&gt;
&lt;br /&gt;
  dgs_MM      350&lt;br /&gt;
  dgs_PZ      dgs_pz.cal&lt;br /&gt;
  dgs_ecal    dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For DGS data, enable bin_dgs in the GEBSort.chat file. &lt;br /&gt;
To find the PZ values to use,&lt;br /&gt;
sort some data from a 207Bi source. Then extract the pz spectra&lt;br /&gt;
in .spe format with the get_pz.cc script&lt;br /&gt;
&lt;br /&gt;
   GEBSort_nogeb ....&lt;br /&gt;
   rootn.exe&lt;br /&gt;
   dload(&amp;quot;bi.root&amp;quot;)&lt;br /&gt;
   .x get_pz.cc&lt;br /&gt;
&lt;br /&gt;
Now run (you may have to compile):&lt;br /&gt;
&lt;br /&gt;
   dgs_pz 350 141 dgs_pz.cal 1.003&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
  caput GLBL:DIG:d_window 0.06   &lt;br /&gt;
  caput GLBL:DIG:k_window 0.20     &lt;br /&gt;
  caput GLBL:DIG:m_window 3.50&lt;br /&gt;
  caput GLBL:DIG:k0_window 0.80&lt;br /&gt;
  caput GLBL:DIG:d3_window 0.20&lt;br /&gt;
  caput GLBL:DIG:raw_data_window 0.32&lt;br /&gt;
  caput VME01:SDIG1:k0_window0 0.0&lt;br /&gt;
  caput VME01:SDIG1:k0_window1 0.0&lt;br /&gt;
  etc&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
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&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
  you already specified the M value in GEBSort.chat&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, after the PZ file is generated, remove the energy calibration file if there is one:&lt;br /&gt;
&lt;br /&gt;
  rm dgs_ehi.cal&lt;br /&gt;
&lt;br /&gt;
so that the calibrations defaults to 0 and 1 for offset and gain and sort again  &lt;br /&gt;
using the new pz values that were extracted above. &lt;br /&gt;
When you resort, the PZ values in dgs_pz.cal are read in and used.&lt;br /&gt;
Extract the new clean, uncalibrated, ehi spectra as &lt;br /&gt;
&lt;br /&gt;
   .x get_ecln.cc&lt;br /&gt;
&lt;br /&gt;
and run the calibration program (you may have to compile)&lt;br /&gt;
&lt;br /&gt;
   dgs_ecal dgs_ehi.cal 207Bi 600&lt;br /&gt;
&lt;br /&gt;
you can also use &amp;quot;88Y&amp;quot;, &amp;quot;60Co&amp;quot; for the source. The calibration will be 1keV/ch.&lt;br /&gt;
The last parameter specifies the lowest channel the program will search for peaks in to avoid any noise at low energies.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The energy processing in bin_dgs follows algorithms that were developed by Shoufei Zhu.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tlauritsen</name></author>
	</entry>
</feed>