<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
  <siteinfo>
    <sitename>ATLAS Accelerator In-Flight Beam Program</sitename>
    <dbname>mediawiki_ext_atlasinflight_prod</dbname>
    <base>https://wiki.anl.gov/atlasinflight/Main_Page</base>
    <generator>MediaWiki 1.43.9</generator>
    <case>first-letter</case>
    <namespaces>
      <namespace key="-2" case="first-letter">Media</namespace>
      <namespace key="-1" case="first-letter">Special</namespace>
      <namespace key="0" case="first-letter" />
      <namespace key="1" case="first-letter">Talk</namespace>
      <namespace key="2" case="first-letter">User</namespace>
      <namespace key="3" case="first-letter">User talk</namespace>
      <namespace key="4" case="first-letter">ATLAS Accelerator In-Flight Beam Program</namespace>
      <namespace key="5" case="first-letter">ATLAS Accelerator In-Flight Beam Program talk</namespace>
      <namespace key="6" case="first-letter">File</namespace>
      <namespace key="7" case="first-letter">File talk</namespace>
      <namespace key="8" case="first-letter">MediaWiki</namespace>
      <namespace key="9" case="first-letter">MediaWiki talk</namespace>
      <namespace key="10" case="first-letter">Template</namespace>
      <namespace key="11" case="first-letter">Template talk</namespace>
      <namespace key="12" case="first-letter">Help</namespace>
      <namespace key="13" case="first-letter">Help talk</namespace>
      <namespace key="14" case="first-letter">Category</namespace>
      <namespace key="15" case="first-letter">Category talk</namespace>
    </namespaces>
  </siteinfo>
  <page>
    <title>Main Page</title>
    <ns>0</ns>
    <id>1</id>
    <revision>
      <id>1906</id>
      <parentid>1905</parentid>
      <timestamp>2022-07-18T21:25:50Z</timestamp>
      <contributor>
        <username>Crhoffman</username>
        <id>7</id>
      </contributor>
      <origin>1906</origin>
      <model>wikitext</model>
      <format>text/x-wiki</format>
      <text bytes="6325" sha1="3t6nmpwwxhj5b7g1lnivd55pfcy1nlv" xml:space="preserve">
= Landing Page for the ATLAS In-Flight Beam Wiki =

The goal of this wiki is to have access to detector (locations, status, etc.), electronics, hardware, software, targets, and misc, information pertaining to in-flight beam production. The actual data collection and analysis information can be found on the [https://www.phy.anl.gov/elog/INFL001_19O/ ELOG].

= Tools for In-Flight Beam Tuning =

*:[[Detailed Steps for Tuning In-Flight Beams]] (still work in progress)

== Past Beam Delivery List ==
[[ExpList]]

==Proposed directory / data file structure==
New experiments will be placed in ~/experiments/inflXX_zAA (infl12_n16) folder on diag1. Inside folder will have: compass, BoxScore, screenshots, and data directories. BoxScore will be a git repo with current branch = exp name -&gt;infl12_n16. Data will have links to data inside both compass and BoxScore. Data files will have labels (mostly using BoxScore) inflXX__zAA_MonDay_###.root, i.e. infl12_n16_Oct25_0.root
 ~/experiments/inflXX_zAA
                         /compass --&gt; for all things compass
                         /BoxScore --&gt; (github branch)
                         /screenshots --&gt; for any figures
                         /data --&gt; place for data instead of inside BoxScore / compass....

All data and compass will be backed up on diag3. On diag3 there will also be an experiments folder but only the screenshots will be filled most likely.

== Hardware Information ==

=== Computers ===
- raisordaq - main daq computer located in SPS [ubuntu18]
- diag1 - able to run desktop digitizers
- diag3 - interface computer typically located in control / data room
- diag2 - F-wing lab for testing
- raisortab (??) - lattitude tablet for running HV and emulator

=== Digitizers ===
- desktop digitizer 1 [get S/N] 8 - ch 500 MHz
- VX1730S - 16-ch VME w/ 500 MHz 14-bit 2.0Vpp, currently working with raisordaq and VME 80008X
- x2 V1742 - 16-ch VME w/ 3.2 GHz 12-bit 2.5Vpp

=== High Voltage ===
- VX3718 VME Bridge for HV control in VME 8008X crate [raisordaq]
- V6519P VME 6-CH HV w/ +500 V 3mA [raisordaq]
- V6521M VME 6-CH HV w/ +-6 kV 300 uA [raisordaq]
- Desktop HV 4-CH in F-Wing lab works with raisortab only 

=== Preamps ===

- x2 RAISOR 8-ch low-gain mesytec 1 in SPS ??
- x1 4-ch low-gain mestec in SPS
- x32 ch mesytec low gain (for S1 ??) in SPS

=== Misc ===
- x4 fiber optic cables

= BoxScore =

BoxScore is a custom made cpp program for "almost" real-time monitoring. 

github : https://github.com/goluckyryan/RealTimeReading

== program required libaray == 

CAENComm.h  

CAENVMElib.h 

CAENDigitizer.h

cern root

== program arguments == 

 /BoxScore boardID Location &lt;save_file_name&gt;
                      +-- testing 
                      +-- exit 
                      +-- cross 
                      +-- ZD (zero-degree) 
                      +-- XY (Helios target XY) 
                      +-- iso (isomer with Glover Ge detector) 
                      +-- IonCh (IonChamber)

The boardID can be checked by running ''DetectDigitizer''

== program running flow (SOME OF THIS IS OUT OF DATE 11/19) ==

The source code is src/BoxScore.c

# When started, it read the current date and time from the system, and format the default save_file_name. 
# Based on which Location, it will make a ChannelMask and set the dE and E channels.  
# Read the generalSetting.txt 
# Read setting_X.txt for Channel X setting 
# Open digitizer and setting digitizer from the setting 
# Make root file for saving the data and histogram, Make Canvas for display 
# Readout Loop  
##  check keyboard is hit, get keyboard hit
##  if start acquisition
###   retrieve data from the digitizer
###   every 1 sec (the time period can be set at generalSetting.txt), sorting event based on timestamp, and build event
##  if stop acquisition
##  if cut creator is needed, the acquisition will be stop and load the program CutCreator
##  if clear histogram
##  if quit

== Algorithm of event building ==

= Grafana + InfluxDB =

== Current setting on July 2022 ==

When BoxScore is running at '''raisordaq''', it will push the totalRate and (if any) cuts rates to the InfluxDB service at '''raisordaq''' using 

 void WriteToDataBase(TString databaseName, TString seriesName, TString tag, float value){
    TString databaseStr;
    databaseStr.Form("influx -execute \'insert %s,%s value=%f\' -database=%s", seriesName.Data(), tag.Data(), value, databaseName.Data());
    system(databaseStr.Data());
 }

The database is actually '''db'''

The databaseName in Grafana is = '''RAISOR_db'''

The seriesName  = totalRate / cut1 / cut2 .... etc

The tag = exit / cross / ZD

== InfluxDB ==

As of July 2022:

InfluxDB server is hosted on raisordaq

The access port is '''8086''' 

 sudo service influxdb start

 sudo service influxdb status

 http://raisordaq.onenet:8086

The database name in influxdb is just '''db'''

--- OLD ---

InfluxDB server is hosted at diag1. 

InfluxDB server can be access via port 8086.

If the InfluxDB server is not started, it can be started by

 sudo service influxdb start

== Grafana ==

The Grafana server is hosted at diag3. 

The Grafana webpage can be access using any browser

 http://diag3.onenet:3000 

The login user name is admin, password is the same as diag3 login. 

if the server not started (for example, the webpage is not loaded but connection to diag3 is ok.) it can be started by

 sudo service grafana-server start

--

Working to get grafana on new iMAC.

to start grafana as lcladmin

 brew services restart grafana

To access the Grafana Dashboard use port 3000 (and hopefully):

 http://raisormac.onenet:3000

else try 

 http://localhost:3000

both have uname: admin pswrd: longbaseballone

Notes on Install:
Started install with local admin and did NOT get it running 
under ''raisor'' uname

Under lcladmin

 brew install grafana

was successful. The ''grafana.ini'' file is located at 

 /opt/homebrew/etc/grafana

Modified file to change [server] domain=raisormac.onenet.

Should cp some settings from diag3 ini file ??

= Beam Current Integrator = 
== Keithely ==

''/home/phy/raisor/Keithley'' is local initial location of '''keithley6514.py''' file
Also, added to OptSB repo.
To run, connect to USB on front, likely at location ''/dev/ttyUSB0'' then

 python keithley6414.py



= To Do List =
[[ToDo]]</text>
      <sha1>3t6nmpwwxhj5b7g1lnivd55pfcy1nlv</sha1>
    </revision>
  </page>
</mediawiki>
