muonic package software reference

main package: muonic

muonic.daq muonic.gui muonic.analysis

daq i/o with muonic.daq

Provide a connection to the QNet DAQ cards via python-serial. For software testing and development, (very) dumb DAQ card simulator is available

muonic.daq.DAQProvider

Control the two I/O threads which communicate with the DAQ. If the simulated DAQ is used, there is only one thread.

class muonic.daq.DAQProvider.DAQClient(port, logger=None, root=None)[source]

ZMQ Client site of the DAQ hadling.

data_available()[source]

is new data from daq available

get(*args)[source]

Get something from the daq

put(*args)[source]

Send information to the daq

setup_socket(port)[source]

Setup the ZMQ socket

exception muonic.daq.DAQProvider.DAQIOError[source]
class muonic.daq.DAQProvider.DAQProvider(logger=None, sim=False)[source]

Launch the main part of the GUI and the worker threads. periodicCall and endApplication could reside in the GUI part, but putting them here means that you have all the thread controls in a single place.

data_available()[source]

check if there is new data from daq available

get(*args)[source]

Get something from the daq

put(*args)[source]

Send information to the daq

muonic.daq.DAQConnection

The module provides a class which uses python-serial to open a connection over the usb ports to the daq card. Since on LINUX systems the used usb device ( which is usually /dev/tty0 ) might change during runtime, this is catched automatically by DaqConnection. Therefore a shell script is invoked.

class muonic.daq.DaqConnection.DaqConnection(inqueue, outqueue, logger)[source]
get_port()[source]

check out which device (/dev/tty) is used for DAQ communication

read()[source]

Get data from the DAQ. Read it from the provided Queue.

write()[source]

Put messages from the inqueue which is filled by the DAQ

class muonic.daq.DaqConnection.DaqServer(port, logger)[source]
read()[source]

Get data from the DAQ. Read it from the provided Queue.

serve()[source]
setup_socket(port, adress='127.0.0.1')[source]
write()[source]

Put messages from the inqueue which is filled by the DAQ

muonic.daq.SimDaqConnection

This module provides a dummy class which simulates DAQ I/O which is read from the file “simdaq.txt”. The simulation is only useful if the software-gui should be tested, but no DAQ card is available

Provides a simple DAQ card simulation, so that software can be tested

class muonic.daq.SimDaqConnection.SimDaq(logger, usefile='simdaq.txt', createfakerates=True)[source]

Simulation mode reproduces rates from an file, drwan from a Poisson distribution. This routine will increase the scalars variables using predefined rates Rates are drawn from Poisson distributions

_physics()[source]
cmd_sim(cmd_buffer=None)[source]

Simulate the answer on a command.

inWaiting()[source]

simulate a busy DAQ

readline()[source]

read dummy pulses from the simdaq file till the configured value is reached

write(command)[source]

Trigger a simulated daq response with command

class muonic.daq.SimDaqConnection.SimDaqConnection(inqueue, outqueue, logger)[source]

Basic class which provides the simulated DAQ. It can be started via the DAQ server or if not zmq is available as stand alone locally

read()[source]

Simulate DAQ I/O

class muonic.daq.SimDaqConnection.SimDaqServer(port, logger)[source]

Server site which simulates the DAQ.

read()[source]

Simulate DAQ I/O

serve()[source]
setup_socket(port, adress='127.0.0.1')[source]

setup up the socket for the simulated DAQ server

pyqt4 gui with muonic.gui

This package contains all gui relevant classes like dialogboxes and tabwidgets. Every item in the global menu is utilizes a “Dialog” class. The “Canvas” classes contain plot routines for displaying measurements in the TabWidget.

The gui of the programm, written with PyQt4

muonic.gui.MainWindow

Contains the “main” gui application. It Provides the MainWindow, which initializes the different tabs and draws a menu.

muonic.gui.MuonicWidgets

The functionality of the software

muonic.gui.MuonicDialogs

Provide the dialog fields for user interaction

class muonic.gui.MuonicDialogs.AdvancedDialog(gatewidth=100, timewindow=5.0, status=None, *args)[source]

Set Configuration dialog. Set up the readout interval, gatewidth and whether an DAQ status line should be written.

class muonic.gui.MuonicDialogs.ConfigDialog(channelcheckbox_0=True, channelcheckbox_1=True, channelcheckbox_2=True, channelcheckbox_3=True, coincidencecheckbox_0=True, coincidencecheckbox_1=False, coincidencecheckbox_2=False, coincidencecheckbox_3=False, vetocheckbox=False, vetocheckbox_0=False, vetocheckbox_1=False, vetocheckbox_2=False, *args)[source]

Set Channel configuration: veto, coincidence, active channels.

class muonic.gui.MuonicDialogs.DecayConfigDialog(*args)[source]

Settings for the muondecay

class muonic.gui.MuonicDialogs.FitRangeConfigDialog(upperlim=None, lowerlim=None, dimension='', *args)[source]

Dialog to configure the fit range. It shows a dialog to change to upper and lower limit of the fit.

class muonic.gui.MuonicDialogs.HelpDialog(*args)[source]

Shows the help dialog with the DAQ commands.

helptext()[source]

Show this text in the help window

class muonic.gui.MuonicDialogs.MuonicDialog[source]

Base class of all muonic dialogs

createButtonBox(objectname='buttonBox', leftoffset=80, topoffset=900)[source]

Create a custom button for cancel/apply

createCheckGroupBox(label='Single Pulse', objectname='singlecheckbox', radio=False, leftoffset=20, setchecked=None, checkable=False, checkable_set=False, itemlabels=['Chan0', 'Chan1', 'Chan2', 'Chan3'])[source]

Create a group of choices

class muonic.gui.MuonicDialogs.PeriodicCallDialog(*args)[source]

Issue a command periodically

class muonic.gui.MuonicDialogs.ThresholdDialog(thr0, thr1, thr2, thr3, *args)[source]

Set the Thresholds in mV.

class muonic.gui.MuonicDialogs.VelocityConfigDialog(*args)[source]

Dialog to configure the velocity measurement. One has to set the upper and lower channel.

muonic.gui.MuonicPlotCanvases

analyis package muonic.analysis

muonic.analysis.PulseAnalyzer

Transformation of ASCII DAQ data. Combination of Pulses to events, and looking for decaying muons with different trigger condi

Get the absolute timing of the pulses by use of the gps time Calculate also a non hex representation of leading and falling edges of the pulses

class muonic.analysis.PulseAnalyzer.DecayTriggerThorough(logger)[source]

We demand a second pulse in the same channel where the muon got stuck Should operate for a 10mu sec triggerwindow

trigger(triggerpulses, single_channel=2, double_channel=3, veto_channel=4, mindecaytime=0, minsinglepulsewidth=0, maxsinglepulsewidth=12000, mindoublepulsewidth=0, maxdoublepulsewidth=12000)[source]

Trigger on a certain combination of single and doublepulses

class muonic.analysis.PulseAnalyzer.PulseExtractor(pulsefile='', tmc_ticks=1.25, daq_freq=25000000.0)[source]

get the pulses out of a daq line speed is important here

_calculate_edges(line, counter_diff=0)[source]

get the leading and falling edges of the pulses Use counter diff for getting pulse times in subsequent lines of the triggerflag

_get_evt_time(time, correction, trigger_count, onepps)[source]

Get the absolute event time in seconds since day start If gps is not available, only relative eventtime based on counts is returned

_order_and_cleanpulses()[source]

Remove pulses which have a leading edge later in time than a falling edge and do a bit of sorting Remove also single leading or falling edges NEW: We add virtual falling edges!

close_file()[source]
extract(line)[source]

Analyze subsequent lines (one per call) and check if pulses are related to triggers For each new trigger, return the set of pulses which belong to that trigger, otherwise return None

class muonic.analysis.PulseAnalyzer.VelocityTrigger(logger)[source]
trigger(pulses, upperchannel=1, lowerchannel=2)[source]

Timedifference will be calculated t(upperchannel) - t(lowerchannel)

muonic.analysis.fit

Provide a fitting routine

Script for performing a fit to a histogramm of recorded time differences for the use with QNet

muonic.analysis.fit.gaussian_fit(bincontent, binning=(0, 2, 10), fitrange=None)[source]
muonic.analysis.fit.main(bincontent=None, binning=(0, 10, 21), fitrange=None)[source]