44 const string myname =
"test_AcdDigitReader: ";
46 cout << myname <<
"NDEBUG must be off." <<
endl;
49 string line =
"-----------------------------";
51 cout << myname << line <<
endl;
52 string fclfile =
"test_AcdDigitReader.fcl";
53 if ( ! useExistingFcl ) {
54 cout << myname <<
"Creating top-level FCL." <<
endl;
55 ofstream
fout(fclfile.c_str());
58 fout <<
" tool_type: AcdDigitReader" <<
endl;
64 cout << myname <<
"Using existing top-level FCL." <<
endl;
67 cout << myname << line <<
endl;
68 cout << myname <<
"Fetching tool manager." <<
endl;
70 assert ( ptm !=
nullptr );
75 cout << myname << line <<
endl;
76 cout << myname <<
"Fetching tool." <<
endl;
78 assert( prdr !=
nullptr );
80 cout << myname << line <<
endl;
81 cout << myname <<
"Construct test digit." <<
endl;
86 cout << myname << line <<
endl;
87 cout << myname <<
"Extract data from digit." <<
endl;
90 assert( prdr->update(acd) == 0 );
96 cout << myname <<
"Output raw vector size: " << sigs.size() <<
endl;
97 cout << myname <<
"Output prep vector size: " << sigs.size() <<
endl;
98 cout << myname <<
" Output flags size: " << flags.size() <<
endl;
99 cout << myname <<
" Pedestal: " << pedout <<
endl;
100 assert( raw.size() == nsig );
101 assert( chanout == pdig->
Channel() );
105 for (
unsigned int isig=0; isig<nsig; ++isig ) {
106 AdcCount sigin = tdig.sigsin[isig] + tdig.pedestal + 0.1;
108 AdcFlag flag = tdig.expflags[isig];
109 if ( dbg ) cout << isig <<
": " << sigin <<
" --> " << sigout
110 <<
" (flag=" << flag <<
")" <<
endl;
111 if ( flag ==
AdcGood) assert( sigout == sigin );
114 cout << myname << line <<
endl;
115 cout << myname <<
"Done." <<
endl;
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 raw::RawDigit * digit
void line(double t, double *p, double &x, double &y, double &z)
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)