22 using std::ostringstream;
31 for (
Index icha=0; icha<10; ++icha ) {
32 (*pacm)[icha].setChannelInfo(icha, icha%4);
48 cout <<
"TpcDataTool_update::update: Modifying channel " << acd.
channel() <<
endl;
51 std::vector<int> fembchans(1, fembchan);
53 ret.
setInt(
"fembchan", fembchan);
63 const string myname =
"test_TpcDataTool_default: ";
65 cout << myname <<
"NDEBUG must be off." <<
endl;
68 string line =
"-----------------------------";
71 cout << myname << line <<
endl;
72 cout << myname <<
"Instantiate tool." <<
endl;
76 cout << myname << line <<
endl;
77 cout << myname <<
"Create data." <<
endl;
80 assert( pacm->size() == 0 );
83 assert( pacm->size() == ncha );
88 cout << myname << line <<
endl;
89 cout << myname <<
"Call update." <<
endl;
94 cout << myname << line <<
endl;
95 cout << myname <<
"Call view." <<
endl;
100 cout << myname << line <<
endl;
101 cout << myname <<
"Call update TPC." <<
endl;
106 cout << myname << line <<
endl;
107 cout << myname <<
"Call view TPC." <<
endl;
112 cout << myname << line <<
endl;
113 cout << myname <<
"Test complete." <<
endl;
123 const string myname =
"test_TpcDataTool_update: ";
125 cout << myname <<
"NDEBUG must be off." <<
endl;
128 string line =
"-----------------------------";
131 cout << myname << line <<
endl;
132 cout << myname <<
"Instantiate tool." <<
endl;
136 cout << myname << line <<
endl;
137 cout << myname <<
"Create data." <<
endl;
140 assert( pacm->size() == 0 );
143 assert( pacm->size() == ncha );
146 cout << myname << line <<
endl;
147 cout << myname <<
"Call update TPC." <<
endl;
153 for (
const auto& iacd : *tpd.
getAdcData()[0] ) {
154 Index icha = iacd.first;
156 cout << myname <<
" icha, femb = " << acd.
channel() <<
", " << acd.
fembID() <<
endl;
161 cout << myname << line <<
endl;
162 cout << myname <<
"Call view TPC." <<
endl;
163 for (
auto& iacd : *tpd.
getAdcData()[0] ) iacd.second.setChannelInfo(iacd.second.channel(), 200);
167 for (
const auto& iacd : *tpd.
getAdcData()[0] ) {
168 Index icha = iacd.first;
170 cout << myname <<
" icha, femb = " << acd.
channel() <<
", " << acd.
fembID() <<
endl;
172 assert(acd.
fembID() == 200);
174 cout << myname << line <<
endl;
175 cout << myname <<
"Test complete." <<
endl;
std::shared_ptr< AdcChannelDataMap > AdcDataPtr
void print(std::ostream *pout) const
void setIntVector(Name name, const IntVector &val)
AdcDataVector & getAdcData()
void setChannelInfo(ChannelInfoPtr pchi)
void setInt(Name name, int val)
void line(double t, double *p, double &x, double &y, double &z)
AdcDataPtr createAdcData(bool updateParent=true)
std::map< AdcChannel, AdcChannelData > AdcChannelDataMap
QTextStream & endl(QTextStream &s)