R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
neuland_add_random_hitpar.NeulandRandHitParAdder Class Reference

Adding parameters whose values are randomly generated from the original file to the output file. More...

Public Member Functions

 __init__ (self, int module_num)
 Constructor.
 
 set_run_id (self, int val)
 Set the run id in the parameter file.
 
 insert_parameters (self, str original_filepath, str output_filepath)
 Adding the parameters with random values to the output file.
 

Static Public Member Functions

 generate_random_value_with_cos (ParValueSet par, module_id)
 Generating a random value according to the module id and the given random generator parameters.
 

Public Attributes

 effective_speed = ParValueSet.empty()
 Effective speed of light paramter in the scintillation material.
 
 t_sync = ParValueSet.empty()
 Time synchronization paramter.
 
 t_diff = ParValueSet.empty()
 Time offset parameter.
 
 light_attenuation_length = ParValueSet.empty()
 Light attenuation length parameter.
 
 energy_gain = ParValueSet.empty()
 Energy gain parameter of the PMT (Both sides)
 
 pedestal = ParValueSet.empty()
 Pedestal parameter of the PMT (Both sides)
 
 pmt_thresh = ParValueSet.empty()
 PMT threshold parameter (Both sides)
 
 saturation_coefficient = ParValueSet.empty()
 Saturation coefficient of the PMT (Both sides)
 

Detailed Description

Example:

from neuland_add_random_hitpar import NeulandRandHitParAdder as ParAdder
NUMBER_OF_BARS = 1300
par_adder = ParAdder(NUMBER_OF_BARS)
COS_PERIOD = 1000
# Use normal set function
par_adder.effective_speed.set(mode = Mode.COSINE, offset = 10., amp = 5., period = COS_PERIOD, err = 0.5)
par_adder.t_sync.set(mode = Mode.UNIFORM, offset = 15., amp = 5, period = COS_PERIOD, err = 0.5)
# Use alias set_uniform function. The range of the uniform distribution is [-3., 3.]
par_adder.t_diff.set_uniform( offset = 0., amp = 3., err = 0.5)
# Use alias set_cos function
par_adder.light_attenuation_length.set_cos( offset = 0.008, amp = 0.004, period = COS_PERIOD, err = 0.0005)
par_adder.energy_gain.set_cos( offset = 15., amp = 5., period = COS_PERIOD, err = 0.5)
par_adder.pedestal.set_cos( offset = 25., amp = 5., period = COS_PERIOD, err = 0.5)
par_adder.pmt_thresh.set_cos( offset = 0.75, amp = 0.25, period = COS_PERIOD, err = 0.5)
par_adder.saturation_coefficient.set_cos( offset = 0.5, amp = 0.4, period = COS_PERIOD, err = 0.5)
input_filename = "sim.par.root.0"
output_filename = "added_sim.par.root.0"
# Add a new parameter with random values with other paramters from the input file.
# After the call, the output parameter file will be created.
par_adder.insert_parameters(input_filename, output_filename);

Definition at line 96 of file neuland_add_random_hitpar.py.

Constructor & Destructor Documentation

◆ __init__()

neuland_add_random_hitpar.NeulandRandHitParAdder.__init__ ( self,
int module_num )
Parameters
module_numThe number of bars

Definition at line 132 of file neuland_add_random_hitpar.py.

Member Function Documentation

◆ generate_random_value_with_cos()

neuland_add_random_hitpar.NeulandRandHitParAdder.generate_random_value_with_cos ( ParValueSet par,
module_id )
static
Parameters
module_idThe module ID (0-based number) of the bar

Definition at line 169 of file neuland_add_random_hitpar.py.

◆ insert_parameters()

neuland_add_random_hitpar.NeulandRandHitParAdder.insert_parameters ( self,
str original_filepath,
str output_filepath )
Parameters
original_filepathThe original input file to be added
output_filepathThe output file containing the new parameter

Definition at line 255 of file neuland_add_random_hitpar.py.

◆ set_run_id()

neuland_add_random_hitpar.NeulandRandHitParAdder.set_run_id ( self,
int val )
Parameters
valRun id

Definition at line 187 of file neuland_add_random_hitpar.py.

Member Data Documentation

◆ effective_speed

neuland_add_random_hitpar.NeulandRandHitParAdder.effective_speed = ParValueSet.empty()

Definition at line 145 of file neuland_add_random_hitpar.py.

◆ energy_gain

neuland_add_random_hitpar.NeulandRandHitParAdder.energy_gain = ParValueSet.empty()

Definition at line 157 of file neuland_add_random_hitpar.py.

◆ light_attenuation_length

neuland_add_random_hitpar.NeulandRandHitParAdder.light_attenuation_length = ParValueSet.empty()

Definition at line 154 of file neuland_add_random_hitpar.py.

◆ pedestal

neuland_add_random_hitpar.NeulandRandHitParAdder.pedestal = ParValueSet.empty()

Definition at line 160 of file neuland_add_random_hitpar.py.

◆ pmt_thresh

neuland_add_random_hitpar.NeulandRandHitParAdder.pmt_thresh = ParValueSet.empty()

Definition at line 163 of file neuland_add_random_hitpar.py.

◆ saturation_coefficient

neuland_add_random_hitpar.NeulandRandHitParAdder.saturation_coefficient = ParValueSet.empty()

Definition at line 166 of file neuland_add_random_hitpar.py.

◆ t_diff

neuland_add_random_hitpar.NeulandRandHitParAdder.t_diff = ParValueSet.empty()

Definition at line 151 of file neuland_add_random_hitpar.py.

◆ t_sync

neuland_add_random_hitpar.NeulandRandHitParAdder.t_sync = ParValueSet.empty()

Definition at line 148 of file neuland_add_random_hitpar.py.


The documentation for this class was generated from the following file: