How to use muonic 4

Overview

Munic consist of different parts in the DAQ chain: Data wells and data sinks. The data wells provide/create/acquire data for the DAQ chain, opposed to data sinks which process the data.

Data wells

The job of data wells is to enter data into the muonic DAQ chain. The data can either be acquired from hardware or pre-recorded data. Currently muonic4 provides these data wells:

  1. A DAQ Server, which communicates with the DAQ card and takes live measurements
  2. A reader from file, which reads pre-ecorded data from a file.
  3. A reader from DB, which reads pre-recorded data from a mongoDB instance.

Data sinks

The job of data sinks is to process data generated by a data well. Data sinks are not exclusive, meaning multiple sinks can run simultaneously and process the same data. Currently muonic4 provides these data sinks:

  1. A writer to a file, which saves incoming data to a file.
  2. A writer to DB, which saves incoming data to a mongoDB instance.
  3. A simple client, which simply dumps the incoming data to the terminal.
  4. A Pulse Analyzer, which analyses and prints the pulse times.
  5. A Rate Analyzer, which analyses the count rates.

Start muonic4

In order to run muonic a data sink and at least one data well must be running. To start a data well one of the following commands need to be run before starting a data sink:

  • python3 runServer.py
  • python3 runReaderFromFile.py
  • python3 runReaderFromMongoDB.py

After one of the data well has been started one or multiple data sinks can be started. This can be done by these commands:

  • python3 runPulses.py
  • python3 runRates.py
  • python3 runWriterToFile.py
  • python3 runWriterToMongoDB.py
  • python3 simpleClient.py

How to use muonic (OLD)

start muonic

If you have setup muonic via the provided setup.py script or if you hav put the package somewhere in your PYTHONPATH, simple call from the terminal

muonic [OPTIONS] xy

where xy are two characters which you can choose freely. You will find this two letters occuring in automatically generated files, so that you can identify them.

For help you can call

muonic --help

which gives you also an overview abot the options.

[OPTIONS]

-s
use the simulation mode of muonic (no real data, so no physics behind!). This should only used for testing and developing the software
-d
debug mode. Use it to generate more log messages on the console.
-t sec
change the timewindow for the calculation of the rates. If you expect very low rates, you might consider to change it to larger values.
default is 5 seconds.
-p
automatically write a file with pulsetimes in a non hexadecimal representation
-n
supress any status messages in the output raw data file, might be useful if you want use muonic only for data taking and use another script afterwards for analysis.

Saving files with muonic

All files which are saved by muonic are ASCII files. The filenames are as follows:

Warning

currently all files are saved under $HOME/muonic_data. This directory must exist. If you use the provided setup script, it is created automatically

YYYY-MM-DD_HH-MM-SS_TYPE_MEASUREMENTTME_xy

  • YYYY-MM-DD is the date of the measurement start
  • HH-MM-SS is the GMT time of the measurement start
  • MEASUREMENTTIME if muonic is closed, each file gets is corresponding measurement time (in hours) assigned.
  • xy the two letters which were specified at the start of muonic
  • TYPE might be one of the following:
  • RAW the raw ASCII output of the DAQ card, this is only saved if the ‘Save to file’ button in clicked in the ‘Daq output’ window of muonic
  • R is an automatically saved ASCII file which contains the rate measurement data, this can then be used to plot with e.g. gnuplot later on
  • L specifies a file with times of registered muon decays. This file is automatically saved if a muon decay measurement is started.
  • P stands for a file which contains a non-hex representation of the registered pulses. This file is only save if the -p option is given at the start of muonic

Representation of the pulses:

(69.15291364, [(0.0, 12.5)], [(2.5, 20.0)], [], [])

This is a python-tuple which contains the triggertime of the event and four lists with more tuples. The lists represent the channels (0-3 from left to right) and each tuple stands for a leading and a falling edge of a registered pulse. To get the exact time of the pulse start, one has to add the pulse LE and FE times to the triggertime

Note

For calculation of the LE and FE pulse times a TMC is used. It seems that for some DAQs cards a TMC bin is 1.25 ns wide, allthough the documentation says something else. The triggertime is calculated using a CPLD which runs in some cards at 25MHz, which gives a binwidth of the CPLD time of 40 ns. Please keep this limited precision in mind when adding CPLD and TMC times.

Performing measurements with muonic

For DAQ setup it is recommended to use the ‘settings’ menu, allthough everything can also be setup via the command line in the DAQ output window (see below.) Muonic translates the chosen settings to the corresponding DAQ commands and sends them to the DAQ. So if you want to change things like the coincidence time window, you have to issue the corresponding DAQ command in the DAQ output window.

Two menu items are of interest here: * Channel Configuration: Enable the channels here and set coincidence settings. A veto channel can also be specified. * .. note:

You have to ensure that the checkboxes for the channels you want to use are checked before you leave this dialogue, otherwise the channel gets deactivated.

Note

The concidence is realized by the DAQ in a way that no specific channels can be given. Instead this is meant as an ‘any’ condition. So ‘twofold’ means that ‘any two of the enabled channels’ must claim signal instead of two specific ones (like 1 and 2).

Warning

Measurements at DESY indicated that the veto feature of the DAQ card might not work properly in all cases.

  • Thresholds: For each channel a threshold (in milliVolts) can be specified. Pulse which are below this threshold are rejected. Use this for electronic noise supression. One can use for the calibration the rates in the muon rates tab.

Note

A proper calibration of the individual channels is the key to a succesfull measurement!

In the first tab a plot of the measured muonrates is displayed. A triggerrate is only shown if a coincidence condition is set. In the block on the right side of the tab, the average rates are displayed since the measurement start. Below you can find the number of counts for the individual channels. On the bottom right side is also the maximum rate of the measurment. The plot and the shown values can be reset by clicking on ‘Restart’. The ‘Stop’ button can be used to temporarily hold the plot to have a better look at it.

Note

You can use the displayed ‘max rate’ at the right bottom to check if anything with the measurement went wrong.

Note

Currently the plot shows only the last 200 seconds. If you want to have a longer timerange, you can use the information which is automatically stored in the ‘R’ file (see above).

A lifetime measurement of muons can be performed here. A histogram of time differences between succeding pulses in the same channel is shown. It can be fit with an exponential by clicking on ‘Fit!’. The fit lifetime is then shown in the above right of the plot, for an estimate on the errors you have to look at the console.

The measurment can be activated with the checkbox. In the following popup window the measurment has to be configured. It depends mainly on the detector you use and influences the quality of the measurment. The signal is accepted if more than one pulse appears in the single pulse channel or if one pulse appears in the single pulse channel and >= 2 pulses appear in the double pulse channel. The coincidence time is set to ?microseconds for this measurement. The signal are vetoed with the veto channel: only events are accepted if no pulse occurs there. If the selfveto is activated it accepts only events if:
  • more than one pulse appears in the single pulse channel and none pulse is measured in the double pulse channel
  • one pulse in the single pulse channel appears and exactly two pulses in the double pulse channel.

Warning

The error of the fit might be wrong!

In this tab the muon velocity can be measured. The measurement can be started with activating the checkbox. In the following popup window it has to be configured.

Warning

The error of the fit might be wrong!

You can have a look at the pulsewidhts in this plot. The height of the pulses is lost during the digitization prozess, so all pulses have the same height here. On the left side is an oscilloscope of the pulsewidths shown and on the right side are the pulsewidths collected in an histogram.

In this tab you can read out the GPS information of the DAQ card. It requires a connected GPS antenna. The information are summarized on the bottom in a text box, from where they can be copied.

The last tab of muonic displays the raw ASCII DAQ data. This can be saved to a file. If the DAQ status messages should be supressed in that file, the option -n should be given at the start of muonic. The edit field can be used to send messages to the DAQ. For an overview over the messages, look here (link not available yet!). To issue such an command periodically, you can use the button ‘Periodic Call’

Note

The two most importand DAQ commands are ‘CD’ (‘counter disable’) and ‘CE’ (‘counter enable’). Pulse information is only given out by the DAQ if the counter is set to enabled. All pulse related features may not work properly if the counter is set to disabled.