Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mc2coda_random.cc File Reference
#include <stdint.h>
#include <cmath>
#include <TRandom2.h>

Go to the source code of this file.

Functions

void GetPedestals (uint32_t *peds, uint32_t Npeds)
 

Variables

static TRandom2 randgen
 
bool NO_PEDESTAL = true
 
bool NO_RANDOM_PEDESTAL = false
 
float MEAN_PEDESTAL = 100.0
 
float SIGMA_COMMON_PEDESTAL = 4.0
 
float SIGMA_INDIVIDUAL_PEDESTAL = 3.0
 

Function Documentation

void GetPedestals ( uint32_t *  peds,
uint32_t  Npeds 
)

Generate a set of pedestal values based on the global variables. Ths will fill in the first Npeds-1 values in "peds" with a pedestal near zero and Npeds-th value will be near the mean pedestal setting. The idea is that the last value delivered will contain the mean pedestal for all channels in the module plus common mode noise. The first set of values will contain individual pedestal fluctuations for each channel. The f250 and f125 will use the one common pedestal to adjust the pulse integral and pulse peak values. For the measured pedestals output in Pulse Pedestal words, the stochastic part is added in as well to represent the inaccuracy of that measurement. Note that this means the actual pedestal value used is not actually written to the output file anywhere.

If the global boolean NO_PEDESTAL is set to true, then all values will be set to zero.

If the global NO_RANDOM_PEDESTAL is set to true, then the first Npeds-1 values will be set to zero and the last value to the mean pedestal (=MEAN_PEDESTAL) with no random variation.

The values MEAN_PEDESTAL, SIGMA_COMMON_PEDESTAL, and SIGMA_INDIVIDUAL_PEDESTAL are used to calculate the values. Random sampling is done from Gaussian's with the specified sigmas.

Definition at line 19 of file mc2coda_random.cc.

References MEAN_PEDESTAL, NO_PEDESTAL, NO_RANDOM_PEDESTAL, randgen, SIGMA_COMMON_PEDESTAL, and SIGMA_INDIVIDUAL_PEDESTAL.

Referenced by fadc125_write_data(), and fadc250_write_data().

Variable Documentation

float MEAN_PEDESTAL = 100.0

Definition at line 10 of file mc2coda_random.cc.

Referenced by GetPedestals().

bool NO_PEDESTAL = true

Definition at line 8 of file mc2coda_random.cc.

Referenced by GetPedestals().

bool NO_RANDOM_PEDESTAL = false

Definition at line 9 of file mc2coda_random.cc.

Referenced by GetPedestals().

TRandom2 randgen
static

Definition at line 7 of file mc2coda_random.cc.

Referenced by GetPedestals().

float SIGMA_COMMON_PEDESTAL = 4.0

Definition at line 11 of file mc2coda_random.cc.

Referenced by GetPedestals().

float SIGMA_INDIVIDUAL_PEDESTAL = 3.0

Definition at line 12 of file mc2coda_random.cc.

Referenced by GetPedestals().