37 const string myname =
"TestDigit::ctor: ";
39 cout << myname <<
"Creating raw digit " << idig <<
endl;
42 for (
int i=0; i<10; ++i )
sigsin.push_back(fac*i);
43 for (
int i=10; i>=0; --i )
sigsin.push_back(fac*i);
44 for (
int i=19; i>=0; --i )
sigsin.push_back(-
sigsin[i]);
46 for (
unsigned int ksig = 0; ksig<30; ++ksig ) {
49 for (
unsigned int isig=0; isig<
nsig; ++isig) {
56 unsigned int isig_stucklo = 5;
57 unsigned int isig_stuckhi = 15;
58 for (
unsigned int isig=0; isig<
nsig; ++isig) {
61 if ( sig > 0.0 ) adc =
int(sig+0.5);
62 if ( adc > 4095 ) adc = 4095;
64 if ( isig == isig_stucklo ) adc = adchigh;
65 if ( isig == isig_stuckhi ) adc = adchigh +
lowbits;
66 adcsin.push_back(adc);
68 assert(adcsin.size() ==
nsig);
73 cout << myname <<
" Compressed size: " << dig.
NADC() <<
endl;
74 cout << myname <<
" Uncompressed size: " << dig.
Samples() <<
endl;
76 cout << myname <<
" Channel: " << dig.
Channel() <<
endl;
82 cout << myname <<
"Create the expected flag vector." <<
endl;
84 for (
unsigned int isig=0; isig<
nsig; ++isig) {
float GetPedestal() const
std::vector< AdcCount > AdcCountVector
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
Collection of charge vs time digitized from a single readout channel.
std::vector< AdcFlag > AdcFlagVector
ChannelID_t Channel() const
DAQ channel this raw data was read from.
const AdcFlag AdcUnderflow
const raw::RawDigit * pdig
std::unique_ptr< raw::RawDigit > digitPtr
const AdcFlag AdcOverflow
size_t NADC() const
Number of elements in the compressed ADC sample vector.
const AdcFlag AdcStuckOff
void SetPedestal(float ped, float sigma=1.)
Set pedestal and its RMS (the latter is 0 by default)
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)