#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include "art/Framework/Services/Registry/ServiceHandle.h"
#include "dunecore/ArtSupport/ArtServiceHelper.h"
#include "dunecore/DuneInterface/Service/AdcChannelDataCopyService.h"
#include <cassert>
Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 113 of file test_ConfigurableAdcChannelDataCopyService.cxx.
115 int a_MaxConsecutiveFlag = 0;
117 istringstream ssarg(
argv[1]);
121 istringstream ssarg(
argv[1]);
122 ssarg >> a_MaxConsecutiveFlag;
int test_ConfigurableAdcChannelDataCopyService(int a_LogLevel=1, int a_MaxConsecutiveFlag=0)
int test_ConfigurableAdcChannelDataCopyService |
( |
int |
a_LogLevel = 1 , |
|
|
int |
a_MaxConsecutiveFlag = 0 |
|
) |
| |
Definition at line 35 of file test_ConfigurableAdcChannelDataCopyService.cxx.
36 const string myname =
"test_ConfigurableAdcChannelDataCopyService: ";
38 cout << myname <<
"NDEBUG must be off." <<
endl;
41 string line =
"-----------------------------";
43 cout << myname << line <<
endl;
44 cout << myname <<
"Create top-level FCL." <<
endl;
45 std::ostringstream oss;
46 oss <<
"services.AdcChannelDataCopyService: {" <<
endl;
47 oss <<
" service_provider: ConfigurableAdcChannelDataCopyService" <<
endl;
48 oss <<
" LogLevel: " << a_LogLevel <<
endl;
49 oss <<
" CopyChannel: true" <<
endl;
50 oss <<
" CopyPedestal: true" <<
endl;
51 oss <<
" CopySamples: true" <<
endl;
57 const unsigned int nsig = 50;
59 for (
unsigned int isig=0; isig<50; ++isig ) {
60 acd1.
samples.push_back(10+isig);
67 cout << myname << line <<
endl;
68 cout << myname <<
"Check original." <<
endl;
71 assert( acd1.
raw.size() == 0);
73 assert( acd1.
flags.size() == nsig );
74 assert( acd1.
raw.size() == 0 );
75 assert( acd1.
signal.size() == 0 );
76 assert( acd1.
rois.size() == 0 );
77 assert( acd1.
digit ==
nullptr );
78 assert( acd1.
wire ==
nullptr );
82 cout << myname << line <<
endl;
83 cout << myname <<
"Fetch service." <<
endl;
86 cout << myname << line <<
endl;
87 cout << myname <<
"Copy." <<
endl;
89 hcop->
copy(acd1, acd2);
91 cout << myname << line <<
endl;
92 cout << myname <<
"Check copy." <<
endl;
95 assert( acd2.
raw.size() == 0);
97 assert( acd2.
flags.size() == 0 );
98 assert( acd2.
raw.size() == 0 );
99 assert( acd2.
signal.size() == 0 );
100 assert( acd2.
rois.size() == 0 );
101 assert( acd2.
digit ==
nullptr );
102 assert( acd2.
wire ==
nullptr );
106 cout << myname << line <<
endl;
107 cout << myname <<
"Done." <<
endl;
const raw::RawDigit * digit
static void load_services(std::string const &config)
void setChannelInfo(ChannelInfoPtr pchi)
virtual int copy(const AdcChannelData &oldacd, AdcChannelData &newacd) const =0
void line(double t, double *p, double &x, double &y, double &z)
std::vector< AdcSignal > AdcSignalVector
QTextStream & endl(QTextStream &s)