Data model
The ROOT schema and the layer that reads and writes it. See The data model for the conventions these classes assume.
Manage ROOT file of type event : Efield, voltage The main functionnalities of this module is * to synchronize the relevant TTree (tshower , trun) on the same event * provide a numpy container of traces by event, with method get_obj_handling3dtraces() |
|
Which vertical frame a file's |
grand.dataio.run_trees
- class grand.dataio.run_trees.MotherRunTree(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = '', _type: str = '', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>)[source]
Bases:
DataTreeA mother class for classes with Run values
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number, which identifies the entry
- run_number: TTreeScalarDesc
Run number, which identifies the entry
- get_run(run_no)[source]
Readout the TTree entry corresponding to the run
- Parameters:
run_no (int) – Run number.
- Returns:
Bytes read.
- Return type:
- Raises:
LookupError – When the tree has no such run.
- class grand.dataio.run_trees.TRun(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trun', _type: str = 'run', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, run_mode: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, first_event: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, first_event_time: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, last_event: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, last_event_time: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, data_source: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, data_generator: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, data_generator_version: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, event_type: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_version: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, site: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, site_layout: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, origin_geoid: TTreeArrayDesc = <grand.dataio.descriptors.TTreeArrayDesc object>, du_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_geoid: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_xyz: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_type: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_tilt: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_ground_tilt: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_nut: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_feb: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, t_bin_size: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherRunTreeWhat stays the same over a run: the site, the layout and the detection units.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number, which identifies the entry
run_mode (uint32) – Run mode (calibration, test or physics). The values are not yet defined.
first_event (uint32) – Number of the run’s first event.
first_event_time (uint32) – Time of the first event, in Unix seconds
last_event (uint32) – Number of the run’s last event.
last_event_time (uint32) – Time of the last event, in Unix seconds
data_source (str) – Where the data come from:
detector,simorother.data_generator (str) – Name of the program that produced the data.
data_generator_version (str) – Version of the program that produced the data.
event_type (uint32) – Trigger type: 0x1000 for the 10-second trigger, 0x8000 for a random trigger; any other value is a shower trigger.
event_version (uint32) – Version of the DAQ’s event format.
site (str) – Name of the site, such as
DunhuangorXiaodushan.site_layout (str) – Name of the antenna layout, such as
GP300.origin_geoid (array of shape 3, float32) – Origin of the array frame: (latitude in degrees, longitude in degrees, height in meters). du_xyz is relative to it
du_id (std::vector<int>) – Identifier of each detection unit.
du_geoid (std::vector<vector<float>>) – Detector unit (antenna) position: (latitude in degrees, longitude in degrees, height in meters) per DU
du_xyz (std::vector<vector<float>>) – Position of each unit in the array frame, in meters: x north, y west and z up, relative to
origin_geoid.du_type (std::vector<string>) – Antenna type of each unit.
du_tilt (std::vector<vector<float>>) – Tilt of each antenna, as two angles.
du_ground_tilt (std::vector<vector<float>>) – Tilt of the ground at each antenna, as two angles.
du_nut (std::vector<int>) – Identifier of each unit’s nut, the antenna head that holds the low-noise amplifier.
du_feb (std::vector<int>) – Identifier of each unit’s front-end board.
t_bin_size (std::vector<float>, in ns) – Sampling interval of each unit’s traces, in ns: the inverse of the sampling frequency.
See also
grand.geo.coordinates.GRANDCSThe array frame of
du_xyz.grand.dataio.event_trees.TEfieldThe traces of the units it lists.
Examples
Read the site and the antenna layout of a run:
from pathlib import Path import numpy as np import grand from grand.dataio import TRun sample = (Path(grand.__file__).parents[1] / "sim2root/Common/sim_Xiaodushan_20221026_000000_RUN1_CD_ZHAireS_0000") with TRun(str(sample / "run_1_L0_0000.root")) as trun: trun.get_entry(0) print("site %s, origin (lat, lon, height) %s" % (trun.site, np.asarray(trun.origin_geoid))) print("%d antennas; the first at %s m (x north, y west, z up)" % (len(trun.du_id), np.round(np.asarray(trun.du_xyz)[0], 1)))
site Xiaodushan, origin (lat, lon, height) [ 40.99 93.94 1264. ] 49 antennas; the first at [ 866. -5500. -26.8] m (x north, y west, z up)
- run_mode: TTreeScalarDesc
Run mode (calibration, test or physics). The values are not yet defined.
- first_event: TTreeScalarDesc
Number of the run’s first event.
- first_event_time: TTreeScalarDesc
Time of the first event, in Unix seconds
- last_event: TTreeScalarDesc
Number of the run’s last event.
- last_event_time: TTreeScalarDesc
Time of the last event, in Unix seconds
- data_source: StdStringDesc
detector,simorother.- Type:
Where the data come from
- data_generator: StdStringDesc
Name of the program that produced the data.
- data_generator_version: StdStringDesc
Version of the program that produced the data.
- event_type: TTreeScalarDesc
0x1000 for the 10-second trigger, 0x8000 for a random trigger; any other value is a shower trigger.
- Type:
Trigger type
- event_version: TTreeScalarDesc
Version of the DAQ’s event format.
- site: StdStringDesc
Name of the site, such as
DunhuangorXiaodushan.
- site_layout: StdStringDesc
Name of the antenna layout, such as
GP300.
- origin_geoid: TTreeArrayDesc
(latitude in degrees, longitude in degrees, height in meters). du_xyz is relative to it
- Type:
Origin of the array frame
- du_id: StdVectorListDesc
Identifier of each detection unit.
- du_geoid: StdVectorListDesc
(latitude in degrees, longitude in degrees, height in meters) per DU
- Type:
Detector unit (antenna) position
- du_xyz: StdVectorListDesc
x north, y west and z up, relative to
origin_geoid.- Type:
Position of each unit in the array frame, in meters
- du_type: StdVectorListDesc
Antenna type of each unit.
- du_tilt: StdVectorListDesc
Tilt of each antenna, as two angles.
- du_ground_tilt: StdVectorListDesc
Tilt of the ground at each antenna, as two angles.
- du_nut: StdVectorListDesc
Identifier of each unit’s nut, the antenna head that holds the low-noise amplifier.
- du_feb: StdVectorListDesc
Identifier of each unit’s front-end board.
- t_bin_size: StdVectorListDesc
the inverse of the sampling frequency.
- Type:
Sampling interval of each unit’s traces, in ns
- class grand.dataio.run_trees.TRunVoltage(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trunvoltage', _type: str = 'runvoltage', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, digi_ctrl: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, firmware_version: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trace_length: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_sampling_frequency: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_sampling_resolution: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_input_channels: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_enabled_channels: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gain: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_conversion: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, digi_prepost_trig_windows: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, channel_properties_x: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, channel_properties_y: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, channel_properties_z: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, channel_trig_settings_x: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, channel_trig_settings_y: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, channel_trig_settings_z: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherRunTreeSettings of the voltage traces, common to all events of a run.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number, which identifies the entry
digi_ctrl (std::vector<vector<unsigned short>>) – Control parameters - the list of general parameters that can set the mode of operation, select trigger sources and preset the common coincidence read out time window (Digitizer mode parameters in the manual).
firmware_version (std::vector<unsigned short>) – Firmware version
trace_length (std::vector<vector<int>>) – Nominal trace length in units of samples
adc_sampling_frequency (std::vector<unsigned short>) – ADC sampling frequency in MHz
adc_sampling_resolution (std::vector<unsigned short>) – ADC sampling resolution in bits
adc_input_channels (std::vector<unsigned short>) – ADC input channels - > 16 BIT WORD (4*4 BITS) LOWEST IS CHANNEL 1, HIGHEST CHANNEL 4. FOR EACH CHANNEL IN THE EVENT WE HAVE: 0: ADC1, 1: ADC2, 2:ADC3, 3:ADC4 4:FILTERED ADC1, 5:FILTERED ADC 2, 6:FILTERED ADC3, 7:FILTERED ADC4. ToDo: decode this?
adc_enabled_channels (std::vector<unsigned short>) – ADC enabled channels - LOWEST 4 BITS STATE WHICH CHANNEL IS READ OUT ToDo: Decode this?
gain (std::vector<vector<int>>) – Value of the Variable gain amplification on the board
adc_conversion (std::vector<vector<float>>) – Conversion factor from bits to V for ADC
digi_prepost_trig_windows (std::vector<vector<unsigned short>>) – Window parameters - describe Pre Coincidence, Coincidence and Post Coincidence readout windows (Digitizer window parameters in the manual). ToDo: Decode?
channel_properties_x (std::vector<vector<unsigned short>>) – Channel x properties - described in Channel property parameters in the manual. ToDo: Decode?
channel_properties_y (std::vector<vector<unsigned short>>) – Channel y properties - described in Channel property parameters in the manual. ToDo: Decode?
channel_properties_z (std::vector<vector<unsigned short>>) – Channel z properties - described in Channel property parameters in the manual. ToDo: Decode?
channel_trig_settings_x (std::vector<vector<unsigned short>>) – Channel x trigger settings - described in Channel trigger parameters in the manual. ToDo: Decode?
channel_trig_settings_y (std::vector<vector<unsigned short>>) – Channel y trigger settings - described in Channel trigger parameters in the manual. ToDo: Decode?
channel_trig_settings_z (std::vector<vector<unsigned short>>) – Channel z trigger settings - described in Channel trigger parameters in the manual. ToDo: Decode?
- digi_ctrl: StdVectorListDesc
Control parameters - the list of general parameters that can set the mode of operation, select trigger sources and preset the common coincidence read out time window (Digitizer mode parameters in the manual).
- firmware_version: StdVectorListDesc
Firmware version
- trace_length: StdVectorListDesc
Nominal trace length in units of samples
- adc_sampling_frequency: StdVectorListDesc
ADC sampling frequency in MHz
- adc_sampling_resolution: StdVectorListDesc
ADC sampling resolution in bits
- adc_input_channels: StdVectorListDesc
ADC1, 1: ADC2, 2:ADC3, 3:ADC4 4:FILTERED ADC1, 5:FILTERED ADC 2, 6:FILTERED ADC3, 7:FILTERED ADC4. ToDo: decode this?
- Type:
ADC input channels - > 16 BIT WORD (4*4 BITS) LOWEST IS CHANNEL 1, HIGHEST CHANNEL 4. FOR EACH CHANNEL IN THE EVENT WE HAVE
- Type:
0
- adc_enabled_channels: StdVectorListDesc
Decode this?
- Type:
ADC enabled channels - LOWEST 4 BITS STATE WHICH CHANNEL IS READ OUT ToDo
- gain: StdVectorListDesc
Value of the Variable gain amplification on the board
- adc_conversion: StdVectorListDesc
Conversion factor from bits to V for ADC
- digi_prepost_trig_windows: StdVectorListDesc
Decode?
- Type:
Window parameters - describe Pre Coincidence, Coincidence and Post Coincidence readout windows (Digitizer window parameters in the manual). ToDo
- channel_properties_x: StdVectorListDesc
Decode?
- Type:
Channel x properties - described in Channel property parameters in the manual. ToDo
- channel_properties_y: StdVectorListDesc
Decode?
- Type:
Channel y properties - described in Channel property parameters in the manual. ToDo
- channel_properties_z: StdVectorListDesc
Decode?
- Type:
Channel z properties - described in Channel property parameters in the manual. ToDo
- channel_trig_settings_x: StdVectorListDesc
Decode?
- Type:
Channel x trigger settings - described in Channel trigger parameters in the manual. ToDo
- channel_trig_settings_y: StdVectorListDesc
Decode?
- Type:
Channel y trigger settings - described in Channel trigger parameters in the manual. ToDo
- channel_trig_settings_z: StdVectorListDesc
Decode?
- Type:
Channel z trigger settings - described in Channel trigger parameters in the manual. ToDo
- class grand.dataio.run_trees.TRunRawVoltage(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trunrawvoltage', _type: str = 'runrawvoltage', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, trigger_position: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, firmware_version: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_sampling_frequency: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_sampling_resolution: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_input_channels_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_enabled_channels_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, pre_coincidence_window_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, post_coincidence_window_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gain_correction_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, integration_time_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, offset_correction_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, base_maximum_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, base_minimum_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, signal_threshold_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, noise_threshold_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, tper_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, tprev_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, ncmax_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, tcmax_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, qmax_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, ncmin_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, qmin_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, notch_filters_no_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trace_length: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_conversion: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherRunTreeSettings of the raw voltage traces, common to all events of a run.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number, which identifies the entry
trigger_position (std::vector<unsigned short>) – Trigger position in the trace (trigger start = nanoseconds - 2*sample number)
firmware_version (std::vector<unsigned short>) – Firmware version
adc_sampling_frequency (std::vector<unsigned short>) – ADC sampling frequency in MHz
adc_sampling_resolution (std::vector<unsigned short>) – ADC sampling resolution in bits
adc_input_channels_ch (std::vector<vector<unsigned char>>) – ADC input channels for fv2: 0: ADC1, 1: ADC2, 2:ADC3, 3:ADC4, 4:FILTERED ADC1, 5:FILTERED ADC2, 6:FILTERED ADC3, 7:FILTERED ADC4, 15: off
adc_enabled_channels_ch (std::vector<vector<bool>>) – ADC enabled channels - LOWEST 4 BITS STATE WHICH CHANNEL IS READ OUT
pre_coincidence_window_ch (std::vector<vector<unsigned short>>) – Digitizer window parameters - describe Pre Coincidence, Coincidence and Post Coincidence readout windows (Digitizer window parameters in the manual). The unit is samples (to get time, multiply by 2).
post_coincidence_window_ch (std::vector<vector<unsigned short>>) – Digitizer window parameters - describe Pre Coincidence, Coincidence and Post Coincidence readout windows (Digitizer window parameters in the manual). The unit is samples (to get time, multiply by 2).
gain_correction_ch (std::vector<vector<unsigned short>>) – Channel property parameters
integration_time_ch (std::vector<vector<unsigned short>>)
offset_correction_ch (std::vector<vector<unsigned char>>)
base_maximum_ch (std::vector<vector<unsigned short>>)
base_minimum_ch (std::vector<vector<unsigned short>>)
signal_threshold_ch (std::vector<vector<unsigned short>>) – Channel trigger parameters
noise_threshold_ch (std::vector<vector<unsigned short>>)
tper_ch (std::vector<vector<unsigned short>>) – The unit is samples (to get time, multiply by 2)
tprev_ch (std::vector<vector<unsigned short>>)
ncmax_ch (std::vector<vector<unsigned short>>)
tcmax_ch (std::vector<vector<unsigned short>>)
qmax_ch (std::vector<vector<unsigned short>>)
ncmin_ch (std::vector<vector<unsigned short>>)
qmin_ch (std::vector<vector<unsigned short>>)
notch_filters_no_ch (std::vector<vector<unsigned char>>)
trace_length (std::vector<unsigned int>) – Trace length
adc_conversion (std::vector<float>) – ADC to voltage conversion factor
- trigger_position: StdVectorListDesc
Trigger position in the trace (trigger start = nanoseconds - 2*sample number)
- firmware_version: StdVectorListDesc
Firmware version
- adc_sampling_frequency: StdVectorListDesc
ADC sampling frequency in MHz
- adc_sampling_resolution: StdVectorListDesc
ADC sampling resolution in bits
- adc_input_channels_ch: StdVectorListDesc
ADC1, 1: ADC2, 2:ADC3, 3:ADC4, 4:FILTERED ADC1, 5:FILTERED ADC2, 6:FILTERED ADC3, 7:FILTERED ADC4, 15: off
- Type:
ADC input channels for fv2
- Type:
0
- adc_enabled_channels_ch: StdVectorListDesc
ADC enabled channels - LOWEST 4 BITS STATE WHICH CHANNEL IS READ OUT
- pre_coincidence_window_ch: StdVectorListDesc
Digitizer window parameters - describe Pre Coincidence, Coincidence and Post Coincidence readout windows (Digitizer window parameters in the manual). The unit is samples (to get time, multiply by 2).
- post_coincidence_window_ch: StdVectorListDesc
Digitizer window parameters - describe Pre Coincidence, Coincidence and Post Coincidence readout windows (Digitizer window parameters in the manual). The unit is samples (to get time, multiply by 2).
- gain_correction_ch: StdVectorListDesc
Channel property parameters
- integration_time_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- offset_correction_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- base_maximum_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- base_minimum_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- signal_threshold_ch: StdVectorListDesc
Channel trigger parameters
- noise_threshold_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- tper_ch: StdVectorListDesc
The unit is samples (to get time, multiply by 2)
- tprev_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- ncmax_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- tcmax_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- qmax_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- ncmin_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- qmin_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- notch_filters_no_ch: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- trace_length: StdVectorListDesc
Trace length
- adc_conversion: StdVectorListDesc
ADC to voltage conversion factor
- class grand.dataio.run_trees.TRunEfieldSim(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trunefieldsim', _type: str = 'runefieldsim', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, refractivity_model: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, refractivity_model_parameters: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, t_pre: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, t_post: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, site: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, sim_name: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, sim_version: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>)[source]
Bases:
MotherRunTreeSimulation settings of the electric-field traces, common to all events of a run.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number, which identifies the entry
refractivity_model (str) – Name of the atmospheric index of refraction model
refractivity_model_parameters (std::vector<double>) – Parameters of
refractivity_model; their meaning depends on the model (the CoREAS converter writes the placeholder [1, 1, 1])t_pre (float32) – Start of the antenna data window before the trigger, in ns (it can be shorter than the voltage trace, so this can differ from the voltage’s)
t_post (float32) – End of the antenna data window after the trigger, in ns
site (str) – Site for which the efield simulation was done
sim_name (str) – Simulator name (aires/corsika, etc.)
sim_version (str) – Simulator version string
- refractivity_model: StdStringDesc
Name of the atmospheric index of refraction model
- refractivity_model_parameters: StdVectorListDesc
Parameters of
refractivity_model; their meaning depends on the model (the CoREAS converter writes the placeholder [1, 1, 1])
- t_pre: TTreeScalarDesc
Start of the antenna data window before the trigger, in ns (it can be shorter than the voltage trace, so this can differ from the voltage’s)
- t_post: TTreeScalarDesc
End of the antenna data window after the trigger, in ns
- site: StdStringDesc
Site for which the efield simulation was done
- sim_name: StdStringDesc
Simulator name (aires/corsika, etc.)
- sim_version: StdStringDesc
Simulator version string
- class grand.dataio.run_trees.TRunShowerSim(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trunshowersim', _type: str = 'runshowersim', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, rel_thin: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, maximum_weight: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, hadronic_thinning: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, hadronic_thinning_weight: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, lowe_cut_e: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, lowe_cut_gamma: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, lowe_cut_mu: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, lowe_cut_meson: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, lowe_cut_nucleon: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, site: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, sim_name: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, sim_version: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>)[source]
Bases:
MotherRunTreeSimulation settings of the showers, common to all events of a run.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number, which identifies the entry
rel_thin (float32) – relative thinning energy
maximum_weight (float32) – the maximum weight, computed in zhaires as PrimaryEnergy*RelativeThinning*WeightFactor/14.0 (see aires manual section 3.3.6 and 2.3.2) to make it mean the same as Corsika Wmax
hadronic_thinning (float32) – the ratio of energy at wich thining starts in hadrons and electromagnetic particles
hadronic_thinning_weight (float32) – the ratio of electromagnetic to hadronic maximum weights
lowe_cut_e (float32) – low energy cut for electrons (GeV)
lowe_cut_gamma (float32) – low energy cut for gammas (GeV)
lowe_cut_mu (float32) – low energy cut for muons (GeV)
lowe_cut_meson (float32) – low energy cut for mesons (GeV)
lowe_cut_nucleon (float32) – low energy cut for nucleons (GeV)
site (str) – Site for which the shower simulation was done
sim_name (str) – Simulator name (aires/corsika, etc.)
sim_version (str) – Simulator version string
- rel_thin: TTreeScalarDesc
relative thinning energy
- maximum_weight: TTreeScalarDesc
the maximum weight, computed in zhaires as PrimaryEnergy*RelativeThinning*WeightFactor/14.0 (see aires manual section 3.3.6 and 2.3.2) to make it mean the same as Corsika Wmax
- hadronic_thinning: TTreeScalarDesc
the ratio of energy at wich thining starts in hadrons and electromagnetic particles
- hadronic_thinning_weight: TTreeScalarDesc
the ratio of electromagnetic to hadronic maximum weights
- lowe_cut_e: TTreeScalarDesc
low energy cut for electrons (GeV)
- lowe_cut_gamma: TTreeScalarDesc
low energy cut for gammas (GeV)
- lowe_cut_mu: TTreeScalarDesc
low energy cut for muons (GeV)
- lowe_cut_meson: TTreeScalarDesc
low energy cut for mesons (GeV)
- lowe_cut_nucleon: TTreeScalarDesc
low energy cut for nucleons (GeV)
- site: StdStringDesc
Site for which the shower simulation was done
- sim_name: StdStringDesc
Simulator name (aires/corsika, etc.)
- sim_version: StdStringDesc
Simulator version string
- class grand.dataio.run_trees.TRunNoise(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trunnoise', _type: str = 'runnoise', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, gal_noise_map: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, gal_noise_LST: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, gal_noise_sigma: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherRunTreeSettings of the Galactic-noise generation for a run.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number, which identifies the entry
gal_noise_map (str) – Info to retrieve the map of galactic noise
gal_noise_LST (float32) – Local sidereal time, in hours (0 to 24), at which the galactic noise was generated
gal_noise_sigma (std::vector<vector<float>>) – Galactic-noise standard deviation for each arm of each antenna, in µV
- gal_noise_map: StdStringDesc
Info to retrieve the map of galactic noise
- gal_noise_LST: TTreeScalarDesc
Local sidereal time, in hours (0 to 24), at which the galactic noise was generated
- gal_noise_sigma: StdVectorListDesc
Galactic-noise standard deviation for each arm of each antenna, in µV
grand.dataio.event_trees
- class grand.dataio.event_trees.MotherEventTree(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = '', _type: str = '', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>)[source]
Bases:
DataTreeA mother class for classes with Event values
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
- run_number: TTreeScalarDesc
Run number; with the event number it identifies the entry
- event_number: TTreeScalarDesc
Event number, unique within its run
- add_proper_friends()[source]
Add proper friends to this tree
- Returns:
Attaches the run and simulation trees this one needs.
- Return type:
None
- get_event(ev_no, run_no=0)[source]
Readout the TTree entry corresponding to the event and run
- Parameters:
- Returns:
Bytes read.
- Return type:
- Raises:
LookupError – When the tree has no such event.
- has_event(ev_no, run_no=0)[source]
Check if the TTree has an entry with the given event and run number
- fill_entry_list(tree=None)[source]
Fills the entry list from the tree
- Parameters:
tree (ROOT.TTree, optional) – Tree to index; this one by default.
- is_unique_event()[source]
Check if specified run_number/event_number already exist in the tree
- Returns:
True when no
(event, run)pair appears twice.- Return type:
- get_list_of_all_used_dus()[source]
Compiles the list of all detector units used in the events of the tree
- get_dus_indices_in_run(trun)[source]
Gets an array of the indices of DUs of the current event in the TRun tree
- Parameters:
trun (TRun) – The run tree to look the units up in.
- Returns:
Index of each unit of this event within the run unit list, in the event’s order, so that
run_array[indices]lines up with this event’s traces.- Return type:
ndarray
- Raises:
ValueError – If a unit of this event is not in the run.
- class grand.dataio.event_trees.TADC(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'tadc', _type: str = 'adc', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_size: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, t3_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, first_du: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_seconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_nanoseconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_type: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_version: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, du_count: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_seconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_nanoseconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_position: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_flag: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atm_temperature: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atm_pressure: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atm_humidity: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, acceleration_x: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, acceleration_y: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, acceleration_z: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, battery_level: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, firmware_version: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_sampling_frequency: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_sampling_resolution: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_input_channels_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_enabled_channels_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_samples_count_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_ch0_ch1: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_notch0_ch1: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_redch0_ch1: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_ch2_ch3: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_calibration: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_10s: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_external_test_pulse: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_rate: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, clock_tick: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, clock_ticks_per_second: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_offset: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_leap_second: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_status: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_alarms: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_warnings: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_time: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_long: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_lat: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_alt: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_temp: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_auto_reset_timeout: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, force_firmware_reset: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_filter_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_1PPS: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_DAQ: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_ch0_ch1: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_notch0_ch1: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_redch0_ch1: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_ch2_ch3: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_calibration: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_10s: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_trigger_external_test_pulse: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, enable_readout_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, fire_single_test_pulse: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, test_pulse_rate_divider: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, common_coincidence_time: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, selector_readout_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, pre_coincidence_window_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, post_coincidence_window_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gain_correction_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, integration_time_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, offset_correction_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, base_maximum_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, base_minimum_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, signal_threshold_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, noise_threshold_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, tper_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, tprev_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, ncmax_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, tcmax_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, qmax_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, ncmin_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, qmin_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, ioff: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trace_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, pps_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, fpga_temp: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_temp: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, hardware_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_status: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_ddr_storage: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, data_format_version: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adaq_version: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, dudaq_version: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_ch0_ch1_ch2: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_ch0_ch1_notch2: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern_20Hz: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_external_test_pulse_period: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_sec_sun: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_week_num: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_receiver_mode: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_disciplining_mode: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_self_survey: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_minor_alarms: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_gnss_decoding: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_disciplining_activity: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, notch_filters_no_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, nutrig_rhox: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, nutrig_rhoy: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherEventTreeDigitized traces of each event, in ADC counts, with each detection unit’s status and firmware settings.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
event_size (uint32) – Size of the event as recorded by the DAQ.
t3_number (uint32) – Number of the T3 (array-level) trigger that recorded the event.
first_du (uint32) – Identifier of the first unit that triggered.
time_seconds (uint32) – Time of the event’s trigger, in Unix seconds, converted from GPS time.
time_nanoseconds (uint32) – Nanoseconds to add to
time_seconds, for the first unit that triggered.event_type (uint32) – Trigger type: 0x1000 for the 10-second trigger, 0x8000 for a random trigger; any other value is a shower trigger.
event_version (uint32) – Version of the DAQ’s event format.
du_count (uint32) – Number of detection units in the event.
event_id (std::vector<unsigned short>) – Number of the T3 trigger, for each unit.
du_id (std::vector<unsigned short>) – Identifier of each detection unit, in the order of the traces.
du_seconds (std::vector<unsigned int>) – Trigger time of each unit, in Unix seconds.
du_nanoseconds (std::vector<unsigned int>, in ns) – Nanoseconds to add to
du_seconds, for each unit.trigger_position (std::vector<unsigned short>) – Sample of each unit’s trace at which it triggered.
trigger_flag (std::vector<unsigned short>) – Trigger type of each unit, with the codes of
event_type; for simulations with the offline T1 trigger, 1 if the unit passed and 0 if not.atm_temperature (std::vector<unsigned short>) – Atmospheric temperature (read via I2C)
atm_pressure (std::vector<unsigned short>) – Atmospheric pressure
atm_humidity (std::vector<unsigned short>) – Atmospheric humidity
acceleration_x (std::vector<unsigned short>) – Acceleration of the antenna in X
acceleration_y (std::vector<unsigned short>) – Acceleration of the antenna in Y
acceleration_z (std::vector<unsigned short>) – Acceleration of the antenna in Z
battery_level (std::vector<unsigned short>) – Battery voltage
firmware_version (std::vector<unsigned short>) – Firmware version
adc_sampling_frequency (std::vector<unsigned short>) – ADC sampling frequency in MHz
adc_sampling_resolution (std::vector<unsigned short>) – ADC sampling resolution in bits
adc_input_channels_ch (std::vector<vector<unsigned char>>) – ADC input channels
adc_enabled_channels_ch (std::vector<vector<bool>>) – ADC enabled channels
adc_samples_count_ch (std::vector<vector<unsigned short>>) – Number of samples recorded on each channel, for each unit.
trigger_pattern_ch (std::vector<vector<bool>>) – Which channels triggered, for each unit.
trigger_pattern_ch0_ch1 (std::vector<bool>) – Whether the coincidence of channels 0 and 1 triggered the unit.
trigger_pattern_notch0_ch1 (std::vector<bool>) – Whether channel 1 without channel 0 triggered the unit.
trigger_pattern_redch0_ch1 (std::vector<bool>) – Whether the reduced coincidence of channels 0 and 1 triggered the unit.
trigger_pattern_ch2_ch3 (std::vector<bool>) – Whether the coincidence of channels 2 and 3 triggered the unit.
trigger_pattern_calibration (std::vector<bool>) – Whether a calibration trigger recorded the unit.
trigger_pattern_10s (std::vector<bool>) – Whether the 10-second trigger recorded the unit.
trigger_pattern_external_test_pulse (std::vector<bool>) – Whether an external test pulse triggered the unit.
trigger_rate (std::vector<unsigned short>) – Number of triggers each unit recorded in the second before the event.
clock_tick (std::vector<unsigned int>) – Clock tick at which the event was triggered (used to calculate the trigger time)
clock_ticks_per_second (std::vector<unsigned int>) – Clock ticks per second
gps_offset (std::vector<float>) – Offset between the GPS one-pulse-per-second signal and the true second.
gps_leap_second (std::vector<unsigned short>) – GPS leap second
gps_status (std::vector<unsigned short>) – GPS status
gps_alarms (std::vector<unsigned short>) – GPS alarms
gps_warnings (std::vector<unsigned short>) – GPS warnings
gps_time (std::vector<unsigned int>) – GPS time
gps_long (std::vector<unsigned long long>) – Longitude of each unit, as reported by its GPS receiver.
gps_lat (std::vector<unsigned long long>) – Latitude of each unit, as reported by its GPS receiver.
gps_alt (std::vector<unsigned long long>) – Altitude of each unit, as reported by its GPS receiver.
gps_temp (std::vector<unsigned int>) – GPS temperature
enable_auto_reset_timeout (std::vector<bool>) – Digital control register
force_firmware_reset (std::vector<bool>) – Firmware control register: force a reset.
enable_filter_ch (std::vector<vector<bool>>) – Whether each channel’s digital filter is on, for each unit.
enable_1PPS (std::vector<bool>) – Firmware control register: the GPS one-pulse-per-second signal is on.
enable_DAQ (std::vector<bool>) – Firmware control register: data taking is on.
enable_trigger_ch (std::vector<vector<bool>>) – Trigger enable mask register
enable_trigger_ch0_ch1 (std::vector<bool>) – Whether the coincidence of channels 0 and 1 may trigger the unit.
enable_trigger_notch0_ch1 (std::vector<bool>) – Whether channel 1 without channel 0 may trigger the unit.
enable_trigger_redch0_ch1 (std::vector<bool>) – Whether the reduced coincidence of channels 0 and 1 may trigger the unit.
enable_trigger_ch2_ch3 (std::vector<bool>) – Whether the coincidence of channels 2 and 3 may trigger the unit.
enable_trigger_calibration (std::vector<bool>) – Whether calibration triggers are on.
enable_trigger_10s (std::vector<bool>) – Whether the 10-second trigger is on.
enable_trigger_external_test_pulse (std::vector<bool>) – Whether an external test pulse may trigger the unit.
enable_readout_ch (std::vector<vector<bool>>) – Test pulse rate divider and channel readout enable
fire_single_test_pulse (std::vector<bool>) – Firmware control register: fire one test pulse.
test_pulse_rate_divider (std::vector<unsigned char>) – Divider that sets the test-pulse rate.
common_coincidence_time (std::vector<unsigned short>) – Common coincidence readout time window
selector_readout_ch (std::vector<vector<unsigned char>>) – Input selector for readout channel
pre_coincidence_window_ch (std::vector<vector<unsigned short>>) – Readout window before the coincidence, per channel, as set in the unit’s firmware.
post_coincidence_window_ch (std::vector<vector<unsigned short>>) – Readout window after the coincidence, per channel, as set in the unit’s firmware.
gain_correction_ch (std::vector<vector<unsigned short>>) – Gain correction, per channel, as set in the unit’s firmware.
integration_time_ch (std::vector<vector<unsigned short>>) – Integration time, per channel, as set in the unit’s firmware.
offset_correction_ch (std::vector<vector<unsigned char>>) – Offset correction, per channel, as set in the unit’s firmware.
base_maximum_ch (std::vector<vector<unsigned short>>) – Upper limit of the baseline, per channel, as set in the unit’s firmware.
base_minimum_ch (std::vector<vector<unsigned short>>) – Lower limit of the baseline, per channel, as set in the unit’s firmware.
signal_threshold_ch (std::vector<vector<unsigned short>>) – T1 threshold (
th1ingrand.sim.detector.trigger), per channel, as set in the unit’s firmware.noise_threshold_ch (std::vector<vector<unsigned short>>) – T2 threshold (
th2), per channel, as set in the unit’s firmware.tper_ch (std::vector<vector<unsigned short>>) – T1 window length (
t_period), per channel, as set in the unit’s firmware.tprev_ch (std::vector<vector<unsigned short>>) – Quiet time before the T1 crossing (
t_quiet), per channel, as set in the unit’s firmware.ncmax_ch (std::vector<vector<unsigned short>>) – Largest number of T2 crossings (
nc_max), per channel, as set in the unit’s firmware.tcmax_ch (std::vector<vector<unsigned short>>) – Largest separation between T2 crossings (
t_sepmax), per channel, as set in the unit’s firmware.qmax_ch (std::vector<vector<unsigned char>>) – Upper limit of the charge ratio (
q_max), per channel, as set in the unit’s firmware.ncmin_ch (std::vector<vector<unsigned short>>) – Smallest number of T2 crossings (
nc_min), per channel, as set in the unit’s firmware.qmin_ch (std::vector<vector<unsigned char>>) – Lower limit of the charge ratio (
q_min), per channel, as set in the unit’s firmware.ioff (std::vector<unsigned short>) – Offset of the ADC trace, for each unit; its exact meaning is not documented.
trace_ch (std::vector<vector<vector<short>>>) – ADC counts of each unit’s channels 0 to 3: one row per unit, one trace per channel.
pps_id (std::vector<unsigned int>) – PPS-ID
fpga_temp (std::vector<unsigned int>) – FPGA temperature
adc_temp (std::vector<unsigned int>) – ADC temperature
hardware_id (std::vector<unsigned int>) – Hardware ID
trigger_status (std::vector<unsigned short>) – Trigger status
trigger_ddr_storage (std::vector<unsigned short>) – Trigger DDR storage
data_format_version (std::vector<unsigned short>) – Data format version
adaq_version (std::vector<unsigned short>) – ADAQ version
dudaq_version (std::vector<unsigned short>) – DUDAQ version
trigger_pattern_ch0_ch1_ch2 (std::vector<bool>) – Trigger selection: ch0&ch1&ch2
trigger_pattern_ch0_ch1_notch2 (std::vector<bool>) – Trigger selection: ch0&ch1&~ch2
trigger_pattern_20Hz (std::vector<bool>) – Trigger selection: 20 Hz
trigger_external_test_pulse_period (std::vector<int>) – External pulse trigger period
gps_sec_sun (std::vector<unsigned int>) – GPS seconds since Sunday 00:00
gps_week_num (std::vector<unsigned short>) – GPS week number
gps_receiver_mode (std::vector<unsigned char>) – GPS receiver mode
gps_disciplining_mode (std::vector<unsigned char>) – GPS disciplining mode
gps_self_survey (std::vector<unsigned char>) – GPS self-survey progress
gps_minor_alarms (std::vector<unsigned short>) – GPS minor alarms
gps_gnss_decoding (std::vector<unsigned char>) – GPS GNSS decoding
gps_disciplining_activity (std::vector<unsigned short>) – GPS disciplining activity
notch_filters_no_ch (std::vector<vector<unsigned char>>) – Notch filter number
nutrig_rhox (std::vector<unsigned short>) – NUTRIG correlation with X
nutrig_rhoy (std::vector<unsigned short>) – NUTRIG correlation with Y
See also
grand.sim.detector.adc.ADCDigitizes simulated voltages into these traces.
grand.sim.detector.trigger.t1_du_triggersThe T1 trigger on these traces.
- event_size: TTreeScalarDesc
Size of the event as recorded by the DAQ.
- t3_number: TTreeScalarDesc
Number of the T3 (array-level) trigger that recorded the event.
- first_du: TTreeScalarDesc
Identifier of the first unit that triggered.
- time_seconds: TTreeScalarDesc
Time of the event’s trigger, in Unix seconds, converted from GPS time.
- time_nanoseconds: TTreeScalarDesc
Nanoseconds to add to
time_seconds, for the first unit that triggered.
- event_type: TTreeScalarDesc
0x1000 for the 10-second trigger, 0x8000 for a random trigger; any other value is a shower trigger.
- Type:
Trigger type
- event_version: TTreeScalarDesc
Version of the DAQ’s event format.
- du_count: TTreeScalarDesc
Number of detection units in the event.
- event_id: StdVectorListDesc
Number of the T3 trigger, for each unit.
- du_id: StdVectorListDesc
Identifier of each detection unit, in the order of the traces.
- du_seconds: StdVectorListDesc
Trigger time of each unit, in Unix seconds.
- du_nanoseconds: StdVectorListDesc
Nanoseconds to add to
du_seconds, for each unit.
- trigger_position: StdVectorListDesc
Sample of each unit’s trace at which it triggered.
- trigger_flag: StdVectorListDesc
Trigger type of each unit, with the codes of
event_type; for simulations with the offline T1 trigger, 1 if the unit passed and 0 if not.
- atm_temperature: StdVectorListDesc
Atmospheric temperature (read via I2C)
- atm_pressure: StdVectorListDesc
Atmospheric pressure
- atm_humidity: StdVectorListDesc
Atmospheric humidity
- acceleration_x: StdVectorListDesc
Acceleration of the antenna in X
- acceleration_y: StdVectorListDesc
Acceleration of the antenna in Y
- acceleration_z: StdVectorListDesc
Acceleration of the antenna in Z
- battery_level: StdVectorListDesc
Battery voltage
- firmware_version: StdVectorListDesc
Firmware version
- adc_sampling_frequency: StdVectorListDesc
ADC sampling frequency in MHz
- adc_sampling_resolution: StdVectorListDesc
ADC sampling resolution in bits
- adc_input_channels_ch: StdVectorListDesc
ADC input channels
- adc_enabled_channels_ch: StdVectorListDesc
ADC enabled channels
- adc_samples_count_ch: StdVectorListDesc
Number of samples recorded on each channel, for each unit.
- trigger_pattern_ch: StdVectorListDesc
Which channels triggered, for each unit.
- trigger_pattern_ch0_ch1: StdVectorListDesc
Whether the coincidence of channels 0 and 1 triggered the unit.
- trigger_pattern_notch0_ch1: StdVectorListDesc
Whether channel 1 without channel 0 triggered the unit.
- trigger_pattern_redch0_ch1: StdVectorListDesc
Whether the reduced coincidence of channels 0 and 1 triggered the unit.
- trigger_pattern_ch2_ch3: StdVectorListDesc
Whether the coincidence of channels 2 and 3 triggered the unit.
- trigger_pattern_calibration: StdVectorListDesc
Whether a calibration trigger recorded the unit.
- trigger_pattern_10s: StdVectorListDesc
Whether the 10-second trigger recorded the unit.
- trigger_pattern_external_test_pulse: StdVectorListDesc
Whether an external test pulse triggered the unit.
- trigger_rate: StdVectorListDesc
Number of triggers each unit recorded in the second before the event.
- clock_tick: StdVectorListDesc
Clock tick at which the event was triggered (used to calculate the trigger time)
- clock_ticks_per_second: StdVectorListDesc
Clock ticks per second
- gps_offset: StdVectorListDesc
Offset between the GPS one-pulse-per-second signal and the true second.
- gps_leap_second: StdVectorListDesc
GPS leap second
- gps_status: StdVectorListDesc
GPS status
- gps_alarms: StdVectorListDesc
GPS alarms
- gps_warnings: StdVectorListDesc
GPS warnings
- gps_time: StdVectorListDesc
GPS time
- gps_long: StdVectorListDesc
Longitude of each unit, as reported by its GPS receiver.
- gps_lat: StdVectorListDesc
Latitude of each unit, as reported by its GPS receiver.
- gps_alt: StdVectorListDesc
Altitude of each unit, as reported by its GPS receiver.
- gps_temp: StdVectorListDesc
GPS temperature
- enable_auto_reset_timeout: StdVectorListDesc
Digital control register
- force_firmware_reset: StdVectorListDesc
force a reset.
- Type:
Firmware control register
- enable_filter_ch: StdVectorListDesc
Whether each channel’s digital filter is on, for each unit.
- enable_1PPS: StdVectorListDesc
the GPS one-pulse-per-second signal is on.
- Type:
Firmware control register
- enable_DAQ: StdVectorListDesc
data taking is on.
- Type:
Firmware control register
- enable_trigger_ch: StdVectorListDesc
Trigger enable mask register
- enable_trigger_ch0_ch1: StdVectorListDesc
Whether the coincidence of channels 0 and 1 may trigger the unit.
- enable_trigger_notch0_ch1: StdVectorListDesc
Whether channel 1 without channel 0 may trigger the unit.
- enable_trigger_redch0_ch1: StdVectorListDesc
Whether the reduced coincidence of channels 0 and 1 may trigger the unit.
- enable_trigger_ch2_ch3: StdVectorListDesc
Whether the coincidence of channels 2 and 3 may trigger the unit.
- enable_trigger_calibration: StdVectorListDesc
Whether calibration triggers are on.
- enable_trigger_10s: StdVectorListDesc
Whether the 10-second trigger is on.
- enable_trigger_external_test_pulse: StdVectorListDesc
Whether an external test pulse may trigger the unit.
- enable_readout_ch: StdVectorListDesc
Test pulse rate divider and channel readout enable
- fire_single_test_pulse: StdVectorListDesc
fire one test pulse.
- Type:
Firmware control register
- test_pulse_rate_divider: StdVectorListDesc
Divider that sets the test-pulse rate.
- common_coincidence_time: StdVectorListDesc
Common coincidence readout time window
- selector_readout_ch: StdVectorListDesc
Input selector for readout channel
- pre_coincidence_window_ch: StdVectorListDesc
Readout window before the coincidence, per channel, as set in the unit’s firmware.
- post_coincidence_window_ch: StdVectorListDesc
Readout window after the coincidence, per channel, as set in the unit’s firmware.
- gain_correction_ch: StdVectorListDesc
Gain correction, per channel, as set in the unit’s firmware.
- integration_time_ch: StdVectorListDesc
Integration time, per channel, as set in the unit’s firmware.
- offset_correction_ch: StdVectorListDesc
Offset correction, per channel, as set in the unit’s firmware.
- base_maximum_ch: StdVectorListDesc
Upper limit of the baseline, per channel, as set in the unit’s firmware.
- base_minimum_ch: StdVectorListDesc
Lower limit of the baseline, per channel, as set in the unit’s firmware.
- signal_threshold_ch: StdVectorListDesc
T1 threshold (
th1ingrand.sim.detector.trigger), per channel, as set in the unit’s firmware.
- noise_threshold_ch: StdVectorListDesc
T2 threshold (
th2), per channel, as set in the unit’s firmware.
- tper_ch: StdVectorListDesc
T1 window length (
t_period), per channel, as set in the unit’s firmware.
- tprev_ch: StdVectorListDesc
Quiet time before the T1 crossing (
t_quiet), per channel, as set in the unit’s firmware.
- ncmax_ch: StdVectorListDesc
Largest number of T2 crossings (
nc_max), per channel, as set in the unit’s firmware.
- tcmax_ch: StdVectorListDesc
Largest separation between T2 crossings (
t_sepmax), per channel, as set in the unit’s firmware.
- qmax_ch: StdVectorListDesc
Upper limit of the charge ratio (
q_max), per channel, as set in the unit’s firmware.
- ncmin_ch: StdVectorListDesc
Smallest number of T2 crossings (
nc_min), per channel, as set in the unit’s firmware.
- qmin_ch: StdVectorListDesc
Lower limit of the charge ratio (
q_min), per channel, as set in the unit’s firmware.
- ioff: StdVectorListDesc
Offset of the ADC trace, for each unit; its exact meaning is not documented.
- trace_ch: StdVectorListDesc
one row per unit, one trace per channel.
- Type:
ADC counts of each unit’s channels 0 to 3
- pps_id: StdVectorListDesc
PPS-ID
- fpga_temp: StdVectorListDesc
FPGA temperature
- adc_temp: StdVectorListDesc
ADC temperature
- hardware_id: StdVectorListDesc
Hardware ID
- trigger_status: StdVectorListDesc
Trigger status
- trigger_ddr_storage: StdVectorListDesc
Trigger DDR storage
- data_format_version: StdVectorListDesc
Data format version
- adaq_version: StdVectorListDesc
ADAQ version
- dudaq_version: StdVectorListDesc
DUDAQ version
- trigger_pattern_ch0_ch1_ch2: StdVectorListDesc
ch0&ch1&ch2
- Type:
Trigger selection
- trigger_pattern_ch0_ch1_notch2: StdVectorListDesc
ch0&ch1&~ch2
- Type:
Trigger selection
- trigger_pattern_20Hz: StdVectorListDesc
20 Hz
- Type:
Trigger selection
- trigger_external_test_pulse_period: StdVectorListDesc
External pulse trigger period
- gps_sec_sun: StdVectorListDesc
00
- Type:
GPS seconds since Sunday 00
- gps_week_num: StdVectorListDesc
GPS week number
- gps_receiver_mode: StdVectorListDesc
GPS receiver mode
- gps_disciplining_mode: StdVectorListDesc
GPS disciplining mode
- gps_self_survey: StdVectorListDesc
GPS self-survey progress
- gps_minor_alarms: StdVectorListDesc
GPS minor alarms
- gps_gnss_decoding: StdVectorListDesc
GPS GNSS decoding
- gps_disciplining_activity: StdVectorListDesc
GPS disciplining activity
- notch_filters_no_ch: StdVectorListDesc
Notch filter number
- nutrig_rhox: StdVectorListDesc
NUTRIG correlation with X
- nutrig_rhoy: StdVectorListDesc
NUTRIG correlation with Y
- class grand.dataio.event_trees.TRawVoltage(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trawvoltage', _type: str = 'rawvoltage', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_size: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, first_du: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_seconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_nanoseconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, du_count: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, du_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_seconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_nanoseconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_flag: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_position: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atm_temperature: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atm_pressure: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atm_humidity: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_acceleration: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, battery_level: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adc_samples_count_channel: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_pattern: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_rate: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, clock_tick: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, clock_ticks_per_second: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_offset: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_leap_second: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_status: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_alarms: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_warnings: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_time: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_long: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_lat: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_alt: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, gps_temp: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, ioff: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trace_ch: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, nutrig_rhox: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, nutrig_rhoy: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherEventTreeVoltage at the ADC input of each event, converted from
TADCto physical units.- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
event_size (uint32) – Common for the whole event Event size
first_du (uint32) – First detector unit that triggered in the event
time_seconds (uint32) – Unix time corresponding to the GPS seconds of the trigger
time_nanoseconds (uint32) – GPS nanoseconds corresponding to the trigger of the first triggered station
du_count (uint32) – Number of detector units in the event - basically the antennas count
du_id (std::vector<unsigned short>) – Detector unit (antenna) ID
du_seconds (std::vector<unsigned int>) – Unix time of the trigger for this DU
du_nanoseconds (std::vector<unsigned int>, in ns) – Nanoseconds of the trigger for this DU
trigger_flag (std::vector<unsigned short>) – Same as event_type, but event_type could consist of different triggered DUs
trigger_position (std::vector<unsigned short>) – Trigger position in the trace, in samples
atm_temperature (std::vector<float>) – Atmospheric temperature (read via I2C)
atm_pressure (std::vector<float>) – Atmospheric pressure
atm_humidity (std::vector<float>) – Atmospheric humidity
du_acceleration (std::vector<vector<float>>) – Acceleration of the antenna in (x,y,z) in m/s2
battery_level (std::vector<float>) – Battery voltage
adc_samples_count_channel (std::vector<vector<unsigned short>>) – ADC samples callected in channels (0,1,2,3)
trigger_pattern (std::vector<unsigned short>) – Trigger pattern - which of the trigger sources (more than one may be present) fired to actually the trigger the digitizer - explained in the docs. ToDo: Decode this?
trigger_rate (std::vector<unsigned short>) – Trigger rate - the number of triggers recorded in the second preceding the event
clock_tick (std::vector<unsigned int>) – Clock tick at which the event was triggered (used to calculate the trigger time)
clock_ticks_per_second (std::vector<unsigned int>) – Clock ticks per second
gps_offset (std::vector<float>) – GPS offset - offset between the PPS and the real second (in GPS). ToDo: is it already included in the time calculations?
gps_leap_second (std::vector<unsigned short>) – GPS leap second
gps_status (std::vector<unsigned short>) – GPS status
gps_alarms (std::vector<unsigned short>) – GPS alarms
gps_warnings (std::vector<unsigned short>) – GPS warnings
gps_time (std::vector<unsigned int>) – GPS time
gps_long (std::vector<double>) – Longitude
gps_lat (std::vector<double>) – Latitude
gps_alt (std::vector<double>) – Altitude
gps_temp (std::vector<float>) – GPS temperature
ioff (std::vector<unsigned short>) – ?? What is it? Some kind of the adc trace offset?
trace_ch (std::vector<vector<vector<float>>>) – Voltage traces for channels 1,2,3,4 in muV
nutrig_rhox (std::vector<float>) – NUTRIG correlation with X
nutrig_rhoy (std::vector<float>) – NUTRIG correlation with Y
- event_size: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- first_du: TTreeScalarDesc
First detector unit that triggered in the event
- time_seconds: TTreeScalarDesc
Unix time corresponding to the GPS seconds of the trigger
- time_nanoseconds: TTreeScalarDesc
GPS nanoseconds corresponding to the trigger of the first triggered station
- du_count: TTreeScalarDesc
Number of detector units in the event - basically the antennas count
- du_id: StdVectorListDesc
Detector unit (antenna) ID
- du_seconds: StdVectorListDesc
Unix time of the trigger for this DU
- du_nanoseconds: StdVectorListDesc
Nanoseconds of the trigger for this DU
- trigger_flag: StdVectorListDesc
Same as event_type, but event_type could consist of different triggered DUs
- trigger_position: StdVectorListDesc
Trigger position in the trace, in samples
- atm_temperature: StdVectorListDesc
Atmospheric temperature (read via I2C)
- atm_pressure: StdVectorListDesc
Atmospheric pressure
- atm_humidity: StdVectorListDesc
Atmospheric humidity
- du_acceleration: StdVectorListDesc
Acceleration of the antenna in (x,y,z) in m/s2
- battery_level: StdVectorListDesc
Battery voltage
- adc_samples_count_channel: StdVectorListDesc
ADC samples callected in channels (0,1,2,3)
- trigger_pattern: StdVectorListDesc
Decode this?
- Type:
Trigger pattern - which of the trigger sources (more than one may be present) fired to actually the trigger the digitizer - explained in the docs. ToDo
- trigger_rate: StdVectorListDesc
Trigger rate - the number of triggers recorded in the second preceding the event
- clock_tick: StdVectorListDesc
Clock tick at which the event was triggered (used to calculate the trigger time)
- clock_ticks_per_second: StdVectorListDesc
Clock ticks per second
- gps_offset: StdVectorListDesc
is it already included in the time calculations?
- Type:
GPS offset - offset between the PPS and the real second (in GPS). ToDo
- gps_leap_second: StdVectorListDesc
GPS leap second
- gps_status: StdVectorListDesc
GPS status
- gps_alarms: StdVectorListDesc
GPS alarms
- gps_warnings: StdVectorListDesc
GPS warnings
- gps_time: StdVectorListDesc
GPS time
- gps_long: StdVectorListDesc
Longitude
- gps_lat: StdVectorListDesc
Latitude
- gps_alt: StdVectorListDesc
Altitude
- gps_temp: StdVectorListDesc
GPS temperature
- ioff: StdVectorListDesc
?? What is it? Some kind of the adc trace offset?
- trace_ch: StdVectorListDesc
Voltage traces for channels 1,2,3,4 in muV
- nutrig_rhox: StdVectorListDesc
NUTRIG correlation with X
- nutrig_rhoy: StdVectorListDesc
NUTRIG correlation with Y
- class grand.dataio.event_trees.TVoltage(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'tvoltage', _type: str = 'voltage', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, first_du: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_seconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_nanoseconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, du_count: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, du_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_seconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_nanoseconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_flag: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_position: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_acceleration: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_rate: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trace: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, p2p: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, time_max: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, grandlib_version: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>)[source]
Bases:
MotherEventTreeVoltage traces of each event, in µV, as simulated by
Efield2Voltage.- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
first_du (uint32) – Identifier of the first unit that triggered.
time_seconds (uint32) – Time of the event’s trigger, in Unix seconds, converted from GPS time.
time_nanoseconds (uint32) – Nanoseconds to add to
time_seconds, for the first unit that triggered.du_count (uint32) – Number of detection units in the event.
du_id (std::vector<unsigned short>) – Identifier of each detection unit, in the order of the traces.
du_seconds (std::vector<unsigned int>) – Trigger time of each unit, in Unix seconds.
du_nanoseconds (std::vector<unsigned int>, in ns) – Nanoseconds to add to
du_seconds, for each unit.trigger_flag (std::vector<unsigned short>) – Trigger type of each unit, with the codes of
event_type.trigger_position (std::vector<unsigned short>) – Sample of each unit’s trace at which it triggered.
du_acceleration (std::vector<vector<float>>) – Acceleration measured at each unit, as (x, y, z), in m/s².
trigger_rate (std::vector<unsigned short>) – Number of triggers each unit recorded in the second before the event.
trace (std::vector<vector<vector<float>>>) – Voltage at each unit, in µV: one row per unit, holding the X (south-north), Y (east-west) and Z (vertical) arms. A simulated voltage is at the ADC input, or at the antenna terminals when the RF chain is left out.
p2p (std::vector<vector<float>>) – Peak-to-peak amplitude of each arm, for each unit, in µV.
time_max (std::vector<vector<float>>) – Time of the peak of each component, for each unit, in ns.
grandlib_version (str) –
Version of GRANDlib that produced this file.
Written by
Efield2Voltage. The simulated voltage depends on the code as well as on the input: the Galactic-noise level, for example, changed by a factor of \(\sqrt2\) on 7 September 2026. Files written before that date carry no version. It sat at0.1.0.dev0across twenty-seven milestone tags, which would have made the stamp useless; see the note inpyproject.toml.
See also
grand.sim.efield2voltage.Efield2VoltageWrites this tree.
grand.dataio.event_trees.TADCThe digitized traces.
- first_du: TTreeScalarDesc
Identifier of the first unit that triggered.
- time_seconds: TTreeScalarDesc
Time of the event’s trigger, in Unix seconds, converted from GPS time.
- time_nanoseconds: TTreeScalarDesc
Nanoseconds to add to
time_seconds, for the first unit that triggered.
- du_count: TTreeScalarDesc
Number of detection units in the event.
- du_id: StdVectorListDesc
Identifier of each detection unit, in the order of the traces.
- du_seconds: StdVectorListDesc
Trigger time of each unit, in Unix seconds.
- du_nanoseconds: StdVectorListDesc
Nanoseconds to add to
du_seconds, for each unit.
- trigger_flag: StdVectorListDesc
Trigger type of each unit, with the codes of
event_type.
- trigger_position: StdVectorListDesc
Sample of each unit’s trace at which it triggered.
- du_acceleration: StdVectorListDesc
Acceleration measured at each unit, as (x, y, z), in m/s².
- trigger_rate: StdVectorListDesc
Number of triggers each unit recorded in the second before the event.
- trace: StdVectorListDesc
one row per unit, holding the X (south-north), Y (east-west) and Z (vertical) arms. A simulated voltage is at the ADC input, or at the antenna terminals when the RF chain is left out.
- Type:
Voltage at each unit, in µV
- p2p: StdVectorListDesc
Peak-to-peak amplitude of each arm, for each unit, in µV.
- time_max: StdVectorListDesc
Time of the peak of each component, for each unit, in ns.
- grandlib_version: StdStringDesc
Version of GRANDlib that produced this file.
Written by
Efield2Voltage. The simulated voltage depends on the code as well as on the input: the Galactic-noise level, for example, changed by a factor of \(\sqrt2\) on 7 September 2026. Files written before that date carry no version. It sat at0.1.0.dev0across twenty-seven milestone tags, which would have made the stamp useless; see the note inpyproject.toml.
- class grand.dataio.event_trees.TEfield(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'tefield', _type: str = 'efield', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_seconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, time_nanoseconds: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_type: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, du_count: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, du_id: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_seconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_nanoseconds: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trigger_position: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, trace: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, fft_mag: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, fft_phase: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, p2p: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, pol: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, time_max: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherEventTreeElectric-field traces of each event at each detection unit, in µV/m.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
time_seconds (uint32) – Time of the event’s trigger, in Unix seconds, converted from GPS time.
time_nanoseconds (uint32) – Nanoseconds to add to
time_seconds, for the first unit that triggered.event_type (uint32) – Trigger type: 0x1000 for the 10-second trigger, 0x8000 for a random trigger; any other value is a shower trigger.
du_count (uint32) – Number of detection units in the event.
du_id (std::vector<unsigned short>) – Identifier of each detection unit, in the order of the traces.
du_seconds (std::vector<unsigned int>) – Trigger time of each unit, in Unix seconds.
du_nanoseconds (std::vector<unsigned int>, in ns) – Nanoseconds to add to
du_seconds, for each unit.trigger_position (std::vector<unsigned short>) – Sample of each unit’s trace at which it triggered.
trace (std::vector<vector<vector<float>>>) – Electric field at each unit, in µV/m: one row per unit, holding the x, y and z components.
fft_mag (std::vector<vector<vector<float>>>) – Magnitude of the Fourier transform of each component, for each unit.
fft_phase (std::vector<vector<vector<float>>>) – Phase of the Fourier transform of each component, for each unit.
p2p (std::vector<vector<float>>) – Peak-to-peak amplitude of each component, for each unit, in µV/m.
pol (std::vector<vector<float>>) – Polarization of the field at each unit.
time_max (std::vector<vector<float>>) – Time of the peak of each component, for each unit, in ns.
See also
grand.dataio.run_trees.TRunThe positions of the units, by
du_id.grand.sim.efield2voltage.Efield2VoltageTurns these traces into voltages.
Examples
Read the electric-field traces of one event, one row per detection unit:
from pathlib import Path import numpy as np import grand from grand.dataio import TEfield sample = (Path(grand.__file__).parents[1] / "sim2root/Common/sim_Xiaodushan_20221026_000000_RUN1_CD_ZHAireS_0000") with TEfield(str(sample / "efield_1618-13790_L0_0000.root")) as tefield: tefield.get_event(13790, 1) traces = np.asarray(tefield.trace) # (units, 3, samples), µV/m print("%d units, peak %.0f µV/m" % (len(tefield.du_id), np.abs(traces).max()))
44 units, peak 6652 µV/m
- time_seconds: TTreeScalarDesc
Time of the event’s trigger, in Unix seconds, converted from GPS time.
- time_nanoseconds: TTreeScalarDesc
Nanoseconds to add to
time_seconds, for the first unit that triggered.
- event_type: TTreeScalarDesc
0x1000 for the 10-second trigger, 0x8000 for a random trigger; any other value is a shower trigger.
- Type:
Trigger type
- du_count: TTreeScalarDesc
Number of detection units in the event.
- du_id: StdVectorListDesc
Identifier of each detection unit, in the order of the traces.
- du_seconds: StdVectorListDesc
Trigger time of each unit, in Unix seconds.
- du_nanoseconds: StdVectorListDesc
Nanoseconds to add to
du_seconds, for each unit.
- trigger_position: StdVectorListDesc
Sample of each unit’s trace at which it triggered.
- trace: StdVectorListDesc
one row per unit, holding the x, y and z components.
- Type:
Electric field at each unit, in µV/m
- fft_mag: StdVectorListDesc
Magnitude of the Fourier transform of each component, for each unit.
- fft_phase: StdVectorListDesc
Phase of the Fourier transform of each component, for each unit.
- p2p: StdVectorListDesc
Peak-to-peak amplitude of each component, for each unit, in µV/m.
- pol: StdVectorListDesc
Polarization of the field at each unit.
- time_max: StdVectorListDesc
Time of the peak of each component, for each unit, in ns.
- class grand.dataio.event_trees.TShower(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'tshower', _type: str = 'shower', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, primary_type: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, energy_em: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, energy_primary: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, azimuth: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, zenith: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, direction: TTreeArrayDesc = <grand.dataio.descriptors.TTreeArrayDesc object>, shower_core_pos: TTreeArrayDesc = <grand.dataio.descriptors.TTreeArrayDesc object>, atmos_model: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, atmos_model_param: TTreeArrayDesc = <grand.dataio.descriptors.TTreeArrayDesc object>, magnetic_field: TTreeArrayDesc = <grand.dataio.descriptors.TTreeArrayDesc object>, core_alt: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, xmax_grams: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, xmax_pos: TTreeArrayDesc = <grand.dataio.descriptors.TTreeArrayDesc object>, xmax_pos_shc: TTreeArrayDesc = <grand.dataio.descriptors.TTreeArrayDesc object>, core_time_s: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, core_time_ns: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>)[source]
Bases:
MotherEventTreeThe shower of each event: primary, energy, direction, core and shower maximum.
- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
primary_type (str) – Primary particle, as a PDG code written as text, such as
"2212"for a proton.energy_em (float32, in GeV) – Energy in the electromagnetic component of the shower (electrons and positrons), which produces the radio emission, in GeV.
energy_primary (float32, in GeV) – Energy of the primary particle, in GeV.
azimuth (float32, in degrees) – Azimuth of the direction the shower comes from, in degrees, measured from north toward west in the array frame (x north, y west, z up).
zenith (float32, in degrees) – Zenith angle of the direction the shower comes from, in degrees: 0 for a vertical shower, above 90 for an upgoing one.
direction (array of shape 3, float32) – Unit vector along which the shower travels, in the array frame (x north, y west, z up): minus the direction that
zenithandazimuthname, so its z component is negative for a downgoing shower.shower_core_pos (array of shape 3, float32) – Position of the shower core, where the shower axis meets the ground, in meters in the array frame. Not defined for an upgoing shower.
atmos_model (str) – Name of the atmospheric model the simulation used.
atmos_model_param (array of shape 3, float32) – Parameters of the atmospheric model; their meaning depends on the model and the simulation code.
magnetic_field (array of shape 3, float32) – Geomagnetic field the simulation used: inclination and declination in degrees, then the strength in µT. Files from older CoREAS conversions hold the strength in mT or in gauss.
core_alt (float32) – Altitude of the ground at the core, in meters above sea level.
xmax_grams (float32, in g/cm2) – Atmospheric depth of the shower maximum, measured along the shower axis, in g/cm².
xmax_pos (array of shape 3, float32) – Position of the shower maximum, in meters in the array frame, the frame of
du_xyzandshower_core_pos. NaN if unknown.xmax_pos_shc (array of shape 3, float32) – Position of the shower maximum relative to the core, as the simulation gives it.
core_time_s (float64) – Time at which the shower reached the core, in Unix seconds.
core_time_ns (float64) – Nanoseconds to add to
core_time_s.
See also
grand.dataio.event_trees.TShowerSimWhat a simulation adds about the shower.
grand.dataio.event_trees.TEfieldThe electric field of the same event.
Examples
Read the shower of one event:
from pathlib import Path import grand from grand.dataio import TShower sample = (Path(grand.__file__).parents[1] / "sim2root/Common/sim_Xiaodushan_20221026_000000_RUN1_CD_ZHAireS_0000") with TShower(str(sample / "shower_1618-13790_L0_0000.root")) as tshower: print("events (event, run):", tshower.get_list_of_events()) tshower.get_event(13790, 1) print("zenith %.2f deg, azimuth %.2f deg, energy %.3g GeV" % (tshower.zenith, tshower.azimuth, tshower.energy_primary))
events (event, run): [(13790, 1), (1618, 1)] zenith 79.43 deg, azimuth 310.00 deg, energy 3.87e+09 GeV
- primary_type: StdStringDesc
Primary particle, as a PDG code written as text, such as
"2212"for a proton.
- energy_em: TTreeScalarDesc
Energy in the electromagnetic component of the shower (electrons and positrons), which produces the radio emission, in GeV.
- energy_primary: TTreeScalarDesc
Energy of the primary particle, in GeV.
- azimuth: TTreeScalarDesc
Azimuth of the direction the shower comes from, in degrees, measured from north toward west in the array frame (x north, y west, z up).
- zenith: TTreeScalarDesc
0 for a vertical shower, above 90 for an upgoing one.
- Type:
Zenith angle of the direction the shower comes from, in degrees
- direction: TTreeArrayDesc
minus the direction that
zenithandazimuthname, so its z component is negative for a downgoing shower.- Type:
Unit vector along which the shower travels, in the array frame (x north, y west, z up)
- shower_core_pos: TTreeArrayDesc
Position of the shower core, where the shower axis meets the ground, in meters in the array frame. Not defined for an upgoing shower.
- atmos_model: StdStringDesc
Name of the atmospheric model the simulation used.
- atmos_model_param: TTreeArrayDesc
Parameters of the atmospheric model; their meaning depends on the model and the simulation code.
- magnetic_field: TTreeArrayDesc
inclination and declination in degrees, then the strength in µT. Files from older CoREAS conversions hold the strength in mT or in gauss.
- Type:
Geomagnetic field the simulation used
- core_alt: TTreeScalarDesc
Altitude of the ground at the core, in meters above sea level.
- xmax_grams: TTreeScalarDesc
Atmospheric depth of the shower maximum, measured along the shower axis, in g/cm².
- xmax_pos: TTreeArrayDesc
Position of the shower maximum, in meters in the array frame, the frame of
du_xyzandshower_core_pos. NaN if unknown.
- xmax_pos_shc: TTreeArrayDesc
Position of the shower maximum relative to the core, as the simulation gives it.
- core_time_s: TTreeScalarDesc
Time at which the shower reached the core, in Unix seconds.
- core_time_ns: TTreeScalarDesc
Nanoseconds to add to
core_time_s.
- class grand.dataio.event_trees.TShowerSim(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'tshowersim', _type: str = 'showersim', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, input_name: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, event_date: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, rnd_seed: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, primary_inj_point_shc: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, primary_inj_alt_shc: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, primary_inj_dir_shc: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atmos_altitude: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atmos_density: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, atmos_depth: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, hadronic_model: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, low_energy_model: StdStringDesc = <grand.dataio.descriptors.StdStringDesc object>, cpu_time: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, long_depth: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_pd_depth: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_pd_eminus: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_pd_eplus: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_pd_muminus: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_pd_muplus: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_pd_gamma: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_pd_hadron: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_gamma_elow: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_e_elow: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_e_edep: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_mu_elow: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_mu_edep: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_hadron_elow: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_hadron_edep: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, long_neutrino: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, tested_core_positions: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, event_weight: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, tested_cores: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>)[source]
Bases:
MotherEventTreeWhat a simulation records about the shower of each event, beyond
TShower.- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
input_name (str) – File name in the simulator
event_date (uint32) – The date for which we simulate the event (epoch)
rnd_seed (float64) – Random seed
primary_inj_point_shc (std::vector<vector<float>>) – Primary injection point in Shower Coordinates
primary_inj_alt_shc (std::vector<float>) – Primary injection altitude in Shower Coordinates
primary_inj_dir_shc (std::vector<vector<float>>) – Primary injection direction in Shower Coordinates
atmos_altitude (std::vector<vector<float>>) – Table of air density [g/cm3] and vertical depth [g/cm2] versus altitude [m]
atmos_density (std::vector<vector<float>>) – Air density at each altitude of
atmos_altitude, in g/cm3atmos_depth (std::vector<vector<float>>) – Vertical depth at each altitude of
atmos_altitude, in g/cm2hadronic_model (str) – High energy hadronic model (and version) used
low_energy_model (str) – Energy model (and version) used
cpu_time (float32) – Time it took for the sim
long_depth (std::vector<float>) – Slant depth of the observing levels for longitudinal development tables
long_pd_depth (std::vector<float>) – Slant depth of the levels of the particle-number profiles (
long_pd_*), in g/cm2long_pd_eminus (std::vector<float>) – Number of electrons
long_pd_eplus (std::vector<float>) – Number of positrons
long_pd_muminus (std::vector<float>) – Number of muons-
long_pd_muplus (std::vector<float>) – Number of muons+
long_pd_gamma (std::vector<float>) – Number of gammas
long_pd_hadron (std::vector<float>) – Number of pions, kaons, etc.
long_gamma_elow (std::vector<float>) – Energy in low energy gammas
long_e_elow (std::vector<float>) – Energy in low energy e+/e-
long_e_edep (std::vector<float>) – Energy deposited by e+/e-
long_mu_elow (std::vector<float>) – Energy in low energy mu+/mu-
long_mu_edep (std::vector<float>) – Energy deposited by mu+/mu-
long_hadron_elow (std::vector<float>) – Energy in low energy hadrons
long_hadron_edep (std::vector<float>) – Energy deposited by hadrons
long_neutrino (std::vector<float>) – Energy in created neutrinos
tested_core_positions (std::vector<vector<float>>) – Core positions tested for that shower to generate the event (effective area study)
event_weight (uint32) – statistical weight given to the event
tested_cores (std::vector<vector<float>>) – tested core positions
- input_name: StdStringDesc
File name in the simulator
- event_date: TTreeScalarDesc
The date for which we simulate the event (epoch)
- rnd_seed: TTreeScalarDesc
Random seed
- primary_inj_point_shc: StdVectorListDesc
Primary injection point in Shower Coordinates
- primary_inj_alt_shc: StdVectorListDesc
Primary injection altitude in Shower Coordinates
- primary_inj_dir_shc: StdVectorListDesc
Primary injection direction in Shower Coordinates
- atmos_altitude: StdVectorListDesc
Table of air density [g/cm3] and vertical depth [g/cm2] versus altitude [m]
- atmos_density: StdVectorListDesc
Air density at each altitude of
atmos_altitude, in g/cm3
- atmos_depth: StdVectorListDesc
Vertical depth at each altitude of
atmos_altitude, in g/cm2
- hadronic_model: StdStringDesc
High energy hadronic model (and version) used
- low_energy_model: StdStringDesc
Energy model (and version) used
- cpu_time: TTreeScalarDesc
Time it took for the sim
- long_depth: StdVectorListDesc
Slant depth of the observing levels for longitudinal development tables
- long_pd_depth: StdVectorListDesc
Slant depth of the levels of the particle-number profiles (
long_pd_*), in g/cm2
- long_pd_eminus: StdVectorListDesc
Number of electrons
- long_pd_eplus: StdVectorListDesc
Number of positrons
- long_pd_muminus: StdVectorListDesc
Number of muons-
- long_pd_muplus: StdVectorListDesc
Number of muons+
- long_pd_gamma: StdVectorListDesc
Number of gammas
- long_pd_hadron: StdVectorListDesc
Number of pions, kaons, etc.
- long_gamma_elow: StdVectorListDesc
Energy in low energy gammas
- long_e_elow: StdVectorListDesc
Energy in low energy e+/e-
- long_e_edep: StdVectorListDesc
Energy deposited by e+/e-
- long_mu_elow: StdVectorListDesc
Energy in low energy mu+/mu-
- long_mu_edep: StdVectorListDesc
Energy deposited by mu+/mu-
- long_hadron_elow: StdVectorListDesc
Energy in low energy hadrons
- long_hadron_edep: StdVectorListDesc
Energy deposited by hadrons
- long_neutrino: StdVectorListDesc
Energy in created neutrinos
- tested_core_positions: StdVectorListDesc
Core positions tested for that shower to generate the event (effective area study)
- event_weight: TTreeScalarDesc
statistical weight given to the event
- tested_cores: StdVectorListDesc
tested core positions
- class grand.dataio.event_trees.TRecons(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = 'trecons', _type: str = 'recons', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False, run_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, event_number: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, peak_amps: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, peak_time: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, Xants: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, du_count: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, zenith_pwf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, azimuth_pwf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, chi2_pwf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, zenith_swf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, azimuth_swf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, r_xmax: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, t_s: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, Xsource: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, chi2_swf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, distance_source_antenna: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, zenith_adf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, azimuth_adf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, width: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, scaling_factor: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, chi2_adf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, eta: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, omega: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, omega_cr: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, adf_amplitude: StdVectorListDesc = <grand.dataio.descriptors.StdVectorListDesc object>, energy_elm_voltage: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_zenith_adf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_azimuth_adf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_scaling_factor: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_width: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_zenith_swf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_azimuth_swf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_r_xmax: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_t_s: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_zenith_pwf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>, crb_azimuth_pwf: TTreeScalarDesc = <grand.dataio.descriptors.TTreeScalarDesc object>)[source]
Bases:
MotherEventTreeReconstruction results of each event: the fits of
grand.analysis.- Parameters:
is_tchain (bool) – True when the tree reads a chain of files (
TChain) rather than one file.run_number (uint32) – Run number; with the event number it identifies the entry
event_number (uint32) – Event number, unique within its run
peak_amps (std::vector<float>) – Event processing Maximum amplitude of the Hilbert envelope (in ADC counts or µV/m depending on the input)
peak_time (std::vector<float>) – Time corresponding to the peak amplitude (in seconds)
Xants (std::vector<vector<float>>) – Antenna positions in the GRAND detector reference frame (in meters)
du_count (uint32) – Number of triggered antennas
zenith_pwf (float32, in radians) – Plane Wave Fits (PWF) reconstruction outputs The angles and their bounds are in radians: a value in degrees by mistake (85.0) warns, as it lies outside 0 to pi (#206) Shower zenith angle from PWF (in radians) Coordinate system: NWU, origin at layout center, “coming from”
azimuth_pwf (float32, in radians) – Shower azimuth angle from PWF (in radians) Coordinate system: NWU, origin at layout center, “coming from”
chi2_pwf (float32) – Non-reduced (raw) chi² from PWF; NaN if not filled Divide by du_count - 2, the degrees of freedom, to obtain the reduced chi²
zenith_swf (float32, in radians) – Spherical Wave Fits (SWF) Reconstruction outputs polar zenith from SWF (in rad)
azimuth_swf (float32, in radians) – polar azimuth from SWF (in rad)
r_xmax (float32) – Distance between the reconstructed Xsource and the origin = layout center (in meters)
t_s (float32) – Emission time from SWF (in seconds)
Xsource (std::vector<vector<float>>) – Reconstructed shower emission point (Xsource) in GRAND detector frame (in meters) Coordinate system: NWU, origin at layout center
chi2_swf (float32) – Non-reduced (raw) chi² from SWF; NaN if not filled Divide by du_count - 4, the degrees of freedom, to obtain the reduced chi²
distance_source_antenna (std::vector<float>) – Distance between the reconstructed Xsource and each antenna (in meters)
zenith_adf (float32, in radians) – Angular Distribution Function (ADF) Shower zenith angle from ADF (in radians) Coordinate system: NWU, origin at layout center, “coming from”
azimuth_adf (float32, in radians) – Shower azimuth angle from ADF (in radians) Coordinate system: NWU, origin at layout center, “coming from”
width (float32) – Width parameter from ADF fit (delta_omega)
scaling_factor (float32) – Scaling factor A from ADF fit
chi2_adf (float32) – Non-reduced (raw) chi² from ADF; NaN if not filled Divide by du_count - 4, the degrees of freedom, to obtain the reduced chi²
eta (std::vector<float>) – Azimuth angle in the shower plane (in radians)
omega (std::vector<float>) – Angular distance to the shower axis (in radians)
omega_cr (std::vector<float>) – Cherenkov angle (computed using a two emission points toy model) (in radians)
adf_amplitude (std::vector<float>) – Amplitude predicted by the ADF model at each antenna (in ADC counts or µV/m)
energy_elm_voltage (float32) – (Electromagnetic energy in eV, obtained directly from voltage data)
crb_zenith_adf (float32, in radians) – Cramér-Rao (lower) bound (CRB); NaN if not filled (main_DOI.py fills them, main_AOI.py does not) CRB of shower zenith angle from ADF (in radians)
crb_azimuth_adf (float32, in radians) – CRB of shower azimuth angle from ADF (in radians)
crb_scaling_factor (float32) – CRB of scaling factor A from ADF fit
crb_width (float32) – CRB of width parameter from ADF fit (delta_omega)
crb_zenith_swf (float32, in radians) – CRB of shower zenith from SWF (in rad)
crb_azimuth_swf (float32, in radians) – CRB of shower azimuth from SWF (in rad)
crb_r_xmax (float32) – CRB of distance between the reconstructed Xsource and the origin = layout center (in meters)
crb_t_s (float32) – CRB of emission time from SWF (in seconds)
crb_zenith_pwf (float32, in radians) – CRB of shower zenith from PWF (in radians)
crb_azimuth_pwf (float32, in radians) – CRB of shower azimuth from PWF (in radians)
- run_number: TTreeScalarDesc
Run number; with the event number it identifies the entry
- event_number: TTreeScalarDesc
Event number, unique within its run
- peak_amps: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- peak_time: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- Xants: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- du_count: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- zenith_pwf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- azimuth_pwf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- chi2_pwf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- zenith_swf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- azimuth_swf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- r_xmax: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- t_s: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- Xsource: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- chi2_swf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- distance_source_antenna: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- zenith_adf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- azimuth_adf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- width: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- scaling_factor: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- chi2_adf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- eta: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- omega: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- omega_cr: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- adf_amplitude: StdVectorListDesc
A descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- energy_elm_voltage: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_zenith_adf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_azimuth_adf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_scaling_factor: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_width: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_zenith_swf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_azimuth_swf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_r_xmax: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_t_s: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_zenith_pwf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- crb_azimuth_pwf: TTreeScalarDesc
A descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
grand.dataio.data_tree
- grand.dataio.data_tree.grand_tree_list = <grand.dataio.data_tree._TreeRegistry object>
Internal registry of the live tree objects (weak references)
- grand.dataio.data_tree.partial_name(final)[source]
The temporary name an output is written under before it is complete.
Hidden (leading dot), so a DataDirectory scan of the folder never sees it.
- grand.dataio.data_tree.replace_output(partial, final)[source]
Moves a completed output into place, replacing an earlier one.
The earlier file may be open in this process – an input DataDirectory opens every file of its folder – and is closed first, so that nothing reads or writes the replaced file afterwards.
- Parameters:
partial (str) – The completed file, written under
partial_name().final (str) – Where it goes.
- class grand.dataio.data_tree.DataTree(_file: <_ROOTMock name = 'mock.TFile' id='140595425037296'> = None, _file_name: str = None, _tree: <_ROOTMock name = 'mock.TTree' id='140595425041376'> = None, _tree_name: str = '', _type: str = '', _entry_list: list = <factory>, _comment: str = '', _creation_datetime: datetime = None, _modification_history: str = '', _source_datetime: datetime = None, _modification_software: str = '', _modification_software_version: str = '', _analysis_level: int = 0, is_tchain: bool = False)[source]
Bases:
objectMother class for GRAND Tree data classes
Every instance is kept in
grand_tree_listuntilstop_using()is called, so a loop over many files must release each tree, either withtree.stop_using()or by using the tree as a context manager:for path in paths: with TADC(path) as tadc: ...
- mod_setattr(key, value)[source]
Sets an attribute, recording the change in the modification history.
- property tree
The ROOT TTree in which the variables’ values are stored
- Returns:
The underlying ROOT tree.
- Return type:
ROOT.TTree
- property type
The type of the tree
- Returns:
The tree type, as stored in its metadata.
- Return type:
- property file
The ROOT TFile in which the tree is stored
- Returns:
The file this tree lives in.
- Return type:
ROOT.TFile
- property tree_name
The name of the TTree
- property file_name
The file in which the TTree is stored
- Returns:
Path of the file this tree lives in.
- Return type:
- property comment
Comment - if needed, added by user
- Returns:
Free-text comment stored with the tree.
- Return type:
- property creation_datetime
Returns the time the tree was created.
- Returns:
Creation time, as recorded in the file.
- Return type:
datetime
- Parameters:
val (datetime or int) – Creation time to record.
- property modification_history
Modification_history - if needed, added by user
- Returns:
Record of the modifications made to this tree.
- Return type:
- property source_datetime
Unix creation datetime of the source tree; 0 s means no source
- Returns:
Timestamp of the data this tree derives from.
- Return type:
datetime
- property modification_software
The tool used to generate this tree’s values from another tree
- Returns:
Name of the software that last modified the tree.
- Return type:
- property modification_software_version
The tool used to generate this tree’s values from another tree
- Returns:
Version of that software.
- Return type:
- property analysis_level
The analysis level of this tree
- Returns:
How far through the processing chain this data has been taken.
- Return type:
- classmethod get_default_tree_name()[source]
Gets the default name of the tree of the class
- Returns:
The conventional name for this tree class, such as
"trun".- Return type:
- write(*args, close_file=True, overwrite=False, force_close_file=False, **kwargs)[source]
Write the tree to the file
- Parameters:
close_file (bool, optional) – Close the file after writing.
overwrite (bool, optional) – Replace a tree of the same name that the file already holds. Without it, writing into a file that already holds such a tree (other than this one) is refused: to add events to it, open it with this class first,
TShower("file.root"), then fill and write. Other trees in the file are kept either way.force_close_file (bool, optional) – Close the file even if other trees reference it.
- Raises:
FileExistsError – If the file already holds another tree of this name and
overwriteis False.
- add_proper_friends()[source]
Add the proper friend trees to this tree (reimplemented in daughter classes)
- scan(*args)[source]
Print out the values of the specified members of the tree (TTree::Scan() interface)
- get_entry(ev_no)[source]
Read into memory the ev_no entry of the tree
- Parameters:
ev_no (int) – Entry index to load.
- Returns:
Bytes read.
- Return type:
- Raises:
IndexError – When the tree has no entry
ev_no.
- draw(varexp, selection, option='', nentries=<_ROOTMock name='mock.TTree.kMaxEntries' id='140595425045408'>, firstentry=0, delete_temp_histogram=True)[source]
An interface to TTree::Draw(). Allows for drawing specific TTree columns or getting their values with get_vX().
- Parameters:
varexp (str) – Expression to plot, in ROOT syntax.
selection (str, optional) – Cut applied before plotting.
option (str, optional) – ROOT draw option.
nentries (int, optional) – Maximum entries to use.
firstentry (int, optional) – First entry to use.
delete_temp_histogram (bool, optional) – Remove the temporary histogram ROOT creates.
- Returns:
Number of entries drawn.
- Return type:
- get_v1()[source]
Get first vector of results from draw()
- Returns:
First variable of the last
draw().- Return type:
ndarray
- get_v2()[source]
Get second vector of results from draw()
- Returns:
Second variable of the last
draw().- Return type:
ndarray
- get_v3()[source]
Get third vector of results from draw()
- Returns:
Third variable of the last
draw().- Return type:
ndarray
- get_v4()[source]
Get fourth vector of results from draw()
- Returns:
Fourth variable of the last
draw().- Return type:
ndarray
- get_entries()[source]
Return the number of events in the tree
- Returns:
Number of entries in the tree.
- Return type:
- get_number_of_entries()[source]
Return the number of events in the tree
- Returns:
Number of entries in the tree.
- Return type:
- get_number_of_events()[source]
Return the number of events in the tree
- Returns:
Number of entries. Every tree holds one entry per event (or per run), so this is also the number of events.
- Return type:
- add_friend(value, filename='')[source]
Attaches another tree as a ROOT friend, so its branches are readable here.
- set_tree_index(value)[source]
Set the tree index (necessary for working with friends)
- Parameters:
value (str) – Index expression, typically run and event number.
- get_current_file()[source]
Get’s the current TFile the TTree is in
- Returns:
The file currently being read, which differs from
filewhen the tree is a chain spanning several.- Return type:
ROOT.TFile
- create_branches(set_if_exists=True)[source]
Create branches of the TTree based on the class fields
- Parameters:
set_if_exists (bool, optional) – Attach to existing branches rather than failing.
- create_branch_from_field(value, set_branches=False, value_name='')[source]
Create a specific branch of a TTree computing its type from the corresponding class field
- assign_branches()[source]
Assign branches to the instance - without calling it, the instance does not show the values read to the TTree
- assign_metadata()[source]
Assign metadata to the instance - without calling it, the instance does not show the metadata stored in the TTree
- get_entry_with_index(*args, run_no=0, evt_no=0)[source]
Get the event with run_no and evt_no
The arguments are keyword-only: given by position, the run came first, the reverse of
get_event(ev_no, run_no)and of the tuplesget_list_of_events()returns, so a tuple passed through looked up another event.- Parameters:
- Returns:
Bytes read.
- Return type:
- Raises:
LookupError – When no entry has that run and event number.
- print()[source]
Print out the tree scheme
- Returns:
Prints a summary to standard output.
- Return type:
None
- copy_contents(source)[source]
Copy contents of another dataclass instance of similar type to this instance The source has to have some field the same as this tree. For example EventEfieldTree and EventVoltageTree
- Parameters:
source (DataTree) – Tree to copy entries from.
- get_tree_size()[source]
Get the tree size in memory and on disk, similar to what comes from the Print()
- Returns:
Size of the tree on disk, in bytes.
- Return type:
- close_file()[source]
Close the file associated to the tree
The file is closed even if other tree instances still read from it. Every tree object stored in it, this one included, can no longer be used: calling it raises a clear error rather than crashing. To release a tree when you are done with it, prefer
stop_using()or thewithform, which close the file only when no other tree uses it.
- stop_using(close_file=True)[source]
Stop using this instance and release the memory it holds
Every tree instance is kept in the module-level
grand_tree_list, so it is never garbage collected on its own. When reading many files in a loop, callstop_using()on each tree at the end of the loop, or use the tree as a context manager, which calls it on exit:with TADC("file.root") as tadc: for event, run in tadc.get_list_of_events(): tadc.get_event(event, run)
This removes the instance from
grand_tree_listand, if the tree opened its ROOT file itself from a file name, closes that file once no other tree ingrand_tree_listuses it. AROOT.TFilepassed in by the caller (for example byDataFile) is left open. Calling it again does nothing.Do not use the instance after this call: if its file was closed, the underlying TTree is gone and
treeisNone. A tree that was filled but not written is not saved; callwrite()first.The first
fill()reopens an existing file for update, as ROOT writes full baskets while filling. Closing it then rewrites ROOT’s bookkeeping in the file even when nothing is written: its trees are unchanged, but its checksum is not.- Parameters:
close_file (bool, optional) – Close the ROOT file the tree opened, if no other tree uses it. Pass
Falseto only remove the instance fromgrand_tree_list.
grand.dataio.descriptors
- class grand.dataio.descriptors.StdVectorList(vec_type, value=[], sec_vec_type=None)[source]
Bases:
MutableSequenceA python list interface to ROOT’s std::vector
- vec_type
C++ type for the std::vector (eg. “float”, “string”, etc.)
- tolist()[source]
Returns the contents as (nested) Python lists.
- Returns:
The contents; char elements as ints, strings as str.
- Return type:
- class grand.dataio.descriptors.StdVectorListDesc(vec_type, sec_vec_type=None, inner_length=None, minimum=None, maximum=None, positive=False, unit='')[source]
Bases:
objectA descriptor for StdVectorList - makes use of it possible in dataclasses without setting property and setter
- class grand.dataio.descriptors.TTreeScalarDesc(dtype, minimum=None, maximum=None, positive=False, unit='')[source]
Bases:
objectA descriptor for scalars assigned to TTrees as numpy arrays of size 1 - makes use of it possible in dataclasses without setting property and setter
- class grand.dataio.descriptors.TTreeArrayDesc(shape, dtype, component_limits=None)[source]
Bases:
objectA descriptor for numpy arrays stored in TTrees. Ensures the type and converts to array (in case of for eg. list). Makes use of it possible in dataclasses without setting property and setter
- class grand.dataio.descriptors.StdString(value)[source]
Bases:
objectA python string interface to ROOT’s std::string
- class grand.dataio.descriptors.StdStringDesc(value='')[source]
Bases:
objectA descriptor for strings assigned to TTrees as python strings - makes use of it possible in dataclasses without setting property and setter
- grand.dataio.descriptors.chars_to_uint8_array(nested_chars)[source]
Returns nested character vectors as an array of unsigned bytes.
ROOT returns
vector<vector<char>>branches as nested character sequences; this flattens them into the numeric array callers expect.- Parameters:
nested_chars (sequence of sequence) – The nested character data read from a branch.
- Returns:
The same data as
uint8.- Return type:
ndarray
- grand.dataio.descriptors.convert_deepest_lists_to_arrays(data)[source]
Recursively traverse a nested list structure and convert only the deepest lists (which contain non-lists) into numpy arrays.
- Parameters:
data (sequence) – Possibly nested data.
- Returns:
The same structure with its innermost lists replaced by arrays.
- Return type:
- grand.dataio.descriptors.split_2d_arrays_to_rows(data)[source]
Traverse data, and for every 2D numpy array found, replace it with a list of its 1D row arrays.
- Parameters:
data (ndarray) – Two-dimensional array.
- Returns:
One entry per row.
- Return type:
list of ndarray
- grand.dataio.descriptors.fill_stdvectorlist_with_array(target, value)[source]
Fills target from value, converting as the element type requires.
- Parameters:
target (StdVectorList)
replaced. (Vector to fill. Its existing contents are)
value (array_like)
write. (Data to)
grand.dataio.root_files
Manage ROOT file of type event : Efield, voltage The main functionnalities of this module is * to synchronize the relevant TTree (tshower , trun) on the same event * provide a numpy container of traces by event, with method get_obj_handling3dtraces()
- grand.dataio.root_files.get_file_event(f_name)[source]
Event factory.
Returns a reader for an event ROOT file, with
trunandtshowersynchronized on the same event. Which reader depends on the trees the file holds, and there are three, tried in this order:tefieldgives aFileEfield,tvoltageaFileVoltage, andtadcaFileAdc. A file holding none of them raises.- Parameters:
f_name (str) – File to open.
- Returns:
A reader of the appropriate kind for the trees the file holds.
- Return type:
_FileEventBase
- grand.dataio.root_files.get_handling3dtraces(f_name, idx_evt=0)[source]
Return a traces containers from ROOT file <f_name> for event with index <idx_evt>
Handling3dTraces class is the traces containers
- Parameters:
- Returns:
The traces of the current event.
- Return type:
- grand.dataio.root_files.get_simu_parameters(f_name, idx_evt=0)[source]
Return dictionary of simulation parameters
The keys of
_FileEventBase.get_simu_parameters(): values fromTShower(andorigin_geoidfromTRun), plus the derivedFIX_xmax_pos_grandlib,FIX_xmax_posandxmax_frame.
- class grand.dataio.root_files.FileEfield(f_name)[source]
Bases:
_FileEventBaseGoals of the class:
Event type is Efield
- get_obj_handling3dtraces()[source]
Returns the traces as a
Handling3dTraces.- Returns:
The event’s traces, wrapped in the object that provides the plotting and peak-finding helpers.
- Return type:
- class grand.dataio.root_files.FileVoltage(f_name)[source]
Bases:
_FileEventBaseGoals of the class:
Event type is voltage
- get_obj_handling3dtraces()[source]
Returns the traces as a
Handling3dTraces.- Returns:
The event’s traces, wrapped in the object that provides the plotting and peak-finding helpers.
- Return type:
- class grand.dataio.root_files.FileAdc(f_name)[source]
Bases:
_FileEventBaseReader for an ADC event file (
tadc), with its run and shower trees.- get_obj_handling3dtraces()[source]
Returns the traces as a
Handling3dTraces.- Returns:
The event’s traces, wrapped in the object that provides the plotting and peak-finding helpers.
- Return type:
grand.dataio.data_handling
- class grand.dataio.data_handling.DataDirectory(dir_name: str, recursive: bool = False, analysis_level: int = -1, sim2root_structure: bool = True)[source]
Bases:
objectClass holding the information about GRAND data in a directory
See also
grand.aoi.event_list.EventListEvents joined from these trees.
grand.dataio.event_trees.TEfieldOne of the trees it opens.
Examples
Open every tree of a folder, and pick one by type and analysis level:
from pathlib import Path import grand from grand.dataio import DataDirectory sample = (Path(grand.__file__).parents[1] / "sim2root/Common/sim_Xiaodushan_20221026_000000_RUN1_CD_ZHAireS_0000") folder = DataDirectory(str(sample)) tshower = folder.tshower_l0 tshower.get_entry(0) print("primary %s, Xmax %.1f g/cm2" % (tshower.primary_type, tshower.xmax_grams))
primary 2212, Xmax 794.6 g/cm2
- get_list_of_files_handles()[source]
Go through the list of files in the directory and open all of them
- class grand.dataio.data_handling.DataFile(filename)[source]
Bases:
objectClass holding the information about GRAND TTrees in the specified file
- dict_of_trees
Holds all the trees in the file, by tree name
- list_of_trees
Holds the list of trees in the file, but just with maximal level
- tree_instances
List of tree instances
- tree_types
Holds dict of tree types, each containing a dict of tree names with tree meta-data as values
- is_tchain
Does this instace hold a chain of files
- flist
File list in case this is a chain
grand.dataio.protocol
grand.dataio.xmax_frame
Which vertical frame a file’s xmax_pos_shc is in, read from the file.
xmax_pos_shc is Xmax in shower-core coordinates, so its z should be a
height above the ground. Files written before the ZHAireS converter
subtracted the ground altitude – including every sample committed under
sim2root/Common/ – carry the height above sea level instead. Nothing in a file says which it is.
The geometry does. Xmax lies on the shower axis, so the vector from the core
to Xmax points where the shower comes from, which the same tree stores as
zenith and azimuth. In the right frame the two agree; with the ground
altitude still in z they do not. On all twelve committed ZHAireS events
the ground-relative vector matches the stored direction to 0.001 degrees and
the raw one misses by 0.49 to 7.0 degrees.
Readers detect the frame, so files written under either convention, including the DC2 data, read correctly.
- grand.dataio.xmax_frame.TOLERANCE_DEG = 0.05
How closely the core-to-Xmax vector must follow the stored direction, in degrees. Measured agreement is 0.001; the smallest miss is 0.49.
- grand.dataio.xmax_frame.arrival_direction(zenith, azimuth)[source]
Unit vector pointing to where the shower comes from.
- Parameters:
- Returns:
Shape (3,), x North, y West, z Up. Upwards for a downgoing shower.
- Return type:
- grand.dataio.xmax_frame.propagation_direction(zenith, azimuth)[source]
Unit vector along which the shower travels:
-arrival_direction.This is what
tshower.directionstores, and the same vector the ZHAireS converter writes asprimary_inj_dir_shc.- Parameters:
- Returns:
Shape (3,), x North, y West, z Up. Downwards for a downgoing shower.
- Return type:
- grand.dataio.xmax_frame.xmax_above_ground(xmax_pos_shc, zenith, azimuth, ground_altitude)[source]
Returns Xmax in the shower-core frame, whichever frame the file used.
- Parameters:
xmax_pos_shc (array-like, shape (3,)) – As stored, in meters, x North, y West, z Up.
zenith (float) – The shower’s stored direction, in degrees, “comes from”.
azimuth (float) – The shower’s stored direction, in degrees, “comes from”.
ground_altitude (float) – The site’s ground altitude in meters,
origin_geoid[2].
- Returns:
numpy.ndarray – Xmax with
zabove the ground, shape (3,).str –
"ground"if the file already stored it so,"sea-level"if the ground altitude was subtracted here,"undetermined"if neither reading follows the stored direction – then the value is returned as stored, with a warning.
Notes
A shower straight down cannot be told apart: both readings point up. Then, and whenever both match, the stored value is kept as it is.
- grand.dataio.xmax_frame.xmax_in_site_frame(xmax_pos_shc, zenith, azimuth, ground_altitude, shower_core_pos)[source]
Returns Xmax in the site frame, the one
tshower.xmax_posis in.The site frame (the “GRAND detector ref” of the data format) is the frame of
du_xyzandshower_core_pos: x North, y West, z Up, origin atorigin_geoid. Xmax there is its ground-relative shower-core position plus the core position – the pointget_simu_parametersreturns asFIX_xmax_pos.- Parameters:
xmax_pos_shc (array-like, shape (3,)) – As stored, in meters, in either vertical frame.
zenith (float) – The shower’s stored direction, in degrees, “comes from”.
azimuth (float) – The shower’s stored direction, in degrees, “comes from”.
ground_altitude (float) – The ground altitude in meters that a sea-level
zwould carry.shower_core_pos (array-like, shape (3,)) – The core in the site frame, in meters.
- Returns:
numpy.ndarray – Xmax in the site frame, shape (3,). All NaN if
xmax_pos_shcis not finite: a simulation that does not know Xmax says so.str – The frame
xmax_pos_shcwas found in, asxmax_above_ground()reports it;"undetermined"for a non-finite input.