Skip to main content

MadDAQ data analysis

This is a collection of data analysis examples

Python

Data can also be analyzed with python. The philosophy is the same as in C++. There is a MadDAQData class to navigate the data and a MadDAQModule class that contains the data of a given module.

MadDAQData

MadDAQDatawill get all the information abou the run type, etc.

If the daa file comes from a ScanRun, MadDAQData will provide a ScanManager via the scan_managermethod and will tell if this is this kind of run with the has_scan method. In principle, the user does not neet to care about the ScanManager unless there is need of getting information about the number of ScanVariables and their definition.

The most important role of it will help creating the iterators that help navigating the data.

  • MadDAQDatais itself an iterator that will yield all the events of all the modules ordered by time.
  • create_module_ierator(mid) will return an iterator yielding the data from modiel with ID mid.
  • create_iterator_at_time(T, [mod_ids]) will return an iterator that starts iteratinig at the given daq_time. The data will be restricted to the modules given in the list. If the list is empty, all the modules will provide data.
  • create_iterator_at_event(ievt, [mod_ids]) will create an iterator that starts at the given event number.
  • ScanManager is itself an iterator of ScanPoints. Tnis will be retrived via the MadDAQData.scan_managermethod.
  • create_iterator_at_scan_point(ipoint, [mod_ids]) will create an iterator taht gives all the events in that ScanPoint.

An example of use:

# We open here the file
maddaq = MadDAQData(fname)

#  Go through all the envents
for evt in maddaq:
	# evt contains the data of the event.
	...
	analyze the event
	...
	

If we want to analyze the data of a ScanRun:

# We open here the file
maddaq = MadDAQData(fname)

# loop over the scan points
for ipoint, scP in enumerate(maddaq.scan_iter()):
	point_values.append(scP.values[11])
	
	# loop on all the events of the ScanPoint for module mid
	for evt in maddaq.create_iterator_at_scanpoint(ipoint, mid):
		# evt contains the data of the event
		...
		analyze the data
		...
    

MadDAQModule

MadDAQModulecontains all the information relative to a module. The main role of this object is to analyze the module data.

Python examples.

There are a number or examples to read data with Python.

Command line programs

  • getSpectrum to make a very rough analysis and show the energy distribution.
  • show_data to see the raw data in the file.
  • getFileInfo to get information about the data file (date, no. of events, etc.)

fit-utils.py

Some utilities to fit different distributions.

read_data.py

Shows how to iterate on the data

analyze_data.py

Reads all events in a file and tries to fit something.

data_spectral_analysis.py

Makes an spectral analysis of the calibation data.

hold_delay_scan.py

Example of a ScanRun analysis. Thsi particular one to check the signal variation with Hold Delay parameter.

test_channel_scan.py

Analysis of a channel scan.

show_data.py

Useful to spy the data in a file. Also an interesting example of different iterators.

Vdaq data format

Vdaq stores the data using the HDF5 library. The data in the output file is organized in different blocks: +/header +/modules +/scan

The header is described elsewhere.

The header has an attribute with the definition of the run. The run description contains the type of run, the run number the number of events and the time

The header contains 2 groups

/header/modules

This is a list with the module descriptions. They are encoded as 0xnn0tiii with +nn = number of chips +t = data type +iii = module identifier

/header/run_records

Contains the start of run and end of run records.

The module

The module group has one subgroup per module named with the module ID

/modules/iii

where iii is the module ID.

The module group has the data group where the user defined data format resides and the configuration array that contains an array of integers with the configurations values returned by GenModule::write_config(). Finally, there is the pedestal group that contains:

/modules/iii/pedestals/pedestal - the pedestals /modules/iii/pedestals/noise - the noise

The scan

The scan block has two records, one that defines the scan (/scan/def) and the second that tells when Vdaq changed to the new scan point and the values of the variables.

/scan/def/nevt - number of events per scanpoint /scan/def/nvar - number o variables to scan /scan/def/variables - The variable descriptions (type, from, to)

Metadata

Release files for maddaq 0.7.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maddaq 0.7.15
File Size Uploaded Provenance Actions
maddaq-0.7.15.tar.gz 24.6 kB Without provenance Details for maddaq-0.7.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maddaq 0.7.15
File Interpreter ABI Platform Actions
maddaq-0.7.15-py3-none-any.whl Python 3 none any Details for maddaq-0.7.15-py3-none-any.whl

Total release size: 49.7 kB

Release files / maddaq-0.7.15.tar.gz

Download URL maddaq-0.7.15.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
35b50e3d153af3fd4e7851457aae5679aa09be4f1519b3e7eeef796f7928ca0c
BLAKE2b-256 checksum
How to use checksums
210399c9bb9fd0ef71e0f4018207c0cdd16e53db8befba4689041798a5abc528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / maddaq-0.7.15-py3-none-any.whl

Download URL maddaq-0.7.15-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c1caad180bd56447ac3ab181932df7e11971a3c65bdfd506019fc6bc719e1b4
BLAKE2b-256 checksum
How to use checksums
0cdd433a64c89b995bde6f07e7e70f0fe76f0a4f49589970ded8ba8e16d80b72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for maddaq 0.7.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page