MPulseGenerator Class Reference
[Readers]
List of all members.
Detailed Description
Pulse generator.
- Author:
- Marco Vignati PulseGenerator can generate pulses with noise in different channels. This allows to have at the same time many channels with different features to test algorithms. Random generation involves time interval between pulses, amplitude, noise and baseline drift. PulseGenerator is able to reproduce the shape dependancy on energy and the amplitude vs baseline relationship. See details in the configuration files description below.
Some material, together with examples can be found here: http://corleone.roma1.infn.it/~vignatim/cuore/generator/
- Config example:
reader PulseGenerator
verbosity = info
enable = true
verbosity = debug
enable = true
RunNumber = 3
MeasurementType = Calibration
EventNumberPrintStep = 500
Seed = 123456
ConfigurationFile = cfg/genconf_${RUN}.txt
BolometersFile = cfg/boloparams_${RUN}.txt
NoiseFile = avg/avgnoise_${DATASET}.root
SpectrumFile = cfg/Spectra_${RUN}.root
GenerateFromEnergy = false
CalibrationFile =
StabilizationFile =
ApolloDAQ = true
RoundToADC = true
UseRK = true
TimeProfilingOn = true
endmod
- Parameters
- RunNumber [ unsigned int = 1]: run number (the generator will add 700000 to it)
- MeasurementType [ string = Calibration]: type of the generated measurement
- EventNumberPrintStep [int = 500]: event number print interval
- Seed [unsigned int = 12345]: seed of the random number generator
- RoundToADC [bool = true]: round samples to the Old-DAQ ADC resolution
- ConfigurationFile [string = GeneratorConfiguration.txt]: configuration file for generation parameters (what the user is expected to modify for his needs) see description below.
- BolometersFile [string = BolometersFile.txt]: file of bolometers parameters (electronics + daq + fit parameters), see description below
- NoiseFile [string = avg_ps.root] if some channel needs noise generation from an input PS, that is fetched from this file
- SpectrumFile [string = spectrum.root] if some channel needs amplitude sampled by an input spectrum, that is fetched from this file
- GenerateFromEnergy [bool = false] generate amplitude from energy distribution that will be then converted into mV through the calibration function and the coefficients contained in the CalibrationFile
- CalibrationFile [string = ""] if GenerateFromEnergy, file containing the calibration function and its coefficents for each channel. This file is the same produced by MCalCoefficients
- StabilizationFile [string = ""] if GenerateFromEnergy, file containing the stabilization parameters.
- Configurationfile:
Example: generate fixed pulses with noise on ch 1 and 2, just noise on ch 2, heater on ch 1. Note that "1000 + ch" refers to the heater on channel "ch".
begin GeneratorConfig
# QMatrix
# 21 13
# ch b_distr b_ref b_d_p2 i a_distr a_d_p1 a_d_p2 t_distr t_d_p1 t_d_p2 n_distr n_d_p1 n_d_p2
1 2 1697.24 -0.0002 3 769.619 0 3 1000 0 1 -1 30
2 2 1636.42 -0.0002 3 842.529 0 3 1000 0 1 -1 30
2 2 1636.42 -0.0002 0 0. 0 3 2005 0 1 -1 30
1001 2 1696.44 -0.0002 3 629.225 0 3 4005 0 1 -1 30
where:
- b_distr: baseline distribution, types are:
- 1. uniform in [b_ref-b_d_p2/2, b_ref+b_d_p2/2]
- 2. slope ( baseline = b_ref + time * b_d_p2 )
- 3. fixed ( baseline = b_ref )
- a_distr: amplitude distribution, types are:
- 0. no pulse generation
- 1. uniform distribution between a_d_p1 and a_d_p2 (mV or keV)
- 2. exponential distribution with average a_d_p1 (mV or keV)
- 3. fixed amplitudes of values a_d_p1 (mV or keV)
- 4. generation from input histogram, needs Spectrum_xx TH1D's int the input file SpectrumFile. note that if the input spectrum is in keV you must use GenerateFromEnergy = true and provide a calibration file to get the correct amplitude in mV.
- t_distr: distribution of time interval between events, types are:
- 1. uniform distribution between t_d_p1 and t_d_p2, both in seconds.
- 2. exponential distribution with average 1/t_d_p1 (this generate a poisson process with rate t_d_p1 (Hz))
- 3. fixed interval at t_d_p1(s)
- n_distr: noise distribution, types are:
- 0. no noise generation
- 1. generation from input Power Spectrum with randomization parameter n_d_p2 (default to 30, do not change it unless you now what you are doing), and average rms n_d_p1(mV), if n_d_p1 < 0 the measured noise RMS is used: this needs NoiseAvgPS_xx QVectors in the input file "NoiseFile",
- 2. white noise with rms n_d_p1(mV)
- 3. sinusoidal noise with amplitude n_d_p1(mV) and frequency n_d_p2(Hz)
- 4. white noise with rms n_d_p1(mV) filtered with the bessel, plus a random noise after the bessel with rms n_d_p2(mV)
- 6. pink noise (1/f) with rms n_d_p1(mV)
- 7. pink noise (1/f) with rms n_d_p1(mV) filtered with the bessel
# end
where:
- ch: channel number
- N: number of samples per generated window
- f_s: sampling frequency (Hz)
- pre_trig: pre trigger region size (s)
- Bes_c: Bessel filter cutoff frequency(Hz)
- VB*Gain: VBias*Gain (mV)
- R_S: work resistance (MOhm)
- R_L: load resistance (GOhm)
- c_p: wires capacity (pF)
- Alpha: ratio between the amplitudes of two decay constants (range: 0-1)
- tau_1: first decay constant (s)
- tau_2: second decay constant (s)
- tau_r: rise time (s)
- Writes
- QRawEvent There is no trigger in the generator, thus the pulse(s) start position is saved in the trigger information (QSampleInfo) of the Event.
- Main Pulse MC truth is saved in the following AuxData:
- PG_Max: Pulse Maximum (mV)
- PG_MaxPos: Pulse Maximum Position (s)
- PG_Energy: Pulse Energy (keV) (if GenerateFromEnergy = true)
- PG_DeltaT: Time since last event on this channel (s)
- PG_Baseline: Baseline value (mV)
- If other pulses are present in the window, the MC truth variables of each of them (except the main pulse) are saved in the following AuxData (QVector):
- PG_OE_Max
- PG_OE_MaxPos
- PG_OE_Energy
- PG_OE_DeltaT
- PG_OE_Time: absolute time (s), the time of the event corresponding to this pulse.
|
Public Member Functions |
| MPulseGenerator (QSequence *s) |
| constructor
|
| ~MPulseGenerator () |
| destructor
|
void | Init () |
QEvent * | Do (QEvent *ev) |
| Doit method is called for each event, getting the event as argument.
|
void | Done () |
| Done method is called after event loop.
|
Private Member Functions |
QMatrix | GetConfig (const std::string &bolometersFile, const std::string &configurationFile) |
Static Private Member Functions |
static bool | ComparePulseGenerator (QPulseGenerator *one, QPulseGenerator *two) |
Private Attributes |
std::vector< QPulseGenerator * > | fChannelGenerators |
int | fSeed |
time_t | fStartTime |
gsl_rng * | fRandomGen |
bool | fRoundToADC |
bool | fGenerateFromEnergy |
bool | fUseRK |
int | fThisRun |
int | fRunNumber |
bool | fApolloDAQ |
double | fADC2mV |
QRunData * | fRunData |
QDbDetector::RunType | fMeasurementType |
QVector | fTimes |
QVector | fDeltaTs |
QVector | fEnergies |
QVector | fAmplitudes |
QVector | fMax |
QVector | fMaxPos |
Member Function Documentation
void MPulseGenerator::Init |
( |
|
) |
[virtual] |
Init method is called before event loop
Implements QReader.
References QBaseModule::Debug(), QPulseGenerator::Dump(), QBaseModule::Error(), QPulseGenerator::Generate(), QPulseGenerator::GenerateFromEnergy(), QBaseModule::GetBool(), QPulseGenerator::GetChannelId(), QBaseModule::GetInt(), QBaseModule::GetString(), QPulseGenerator::NeedAmplitudeHisto(), QPulseGenerator::NeedNoisePS(), QBaseModule::Panic(), QBaseModule::SeqAuxData(), QPulseGenerator::SetAmplitudeHisto(), QPulseGenerator::SetCalibrationFunction(), QPulseGenerator::SetHeaterPosition(), QPulseGenerator::SetNoisePS(), QDbDetector::String2RunType(), and QBaseModule::Warn().
The documentation for this class was generated from the following files:
- /home/cuoresvn/cuore/pkg/modrespfunc/MPulseGenerator.hh
- /home/cuoresvn/cuore/pkg/modrespfunc/MPulseGenerator.cc