#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include "dunecore/ArtSupport/DuneToolManager.h"
#include "dunecore/DuneInterface/Tool/IndexRangeTool.h"
#include "TH1F.h"
#include <cassert>
Go to the source code of this file.
Definition at line 31 of file test_VDColdboxChannelRanges.cxx.
32 const string myname =
"checkran: ";
35 if ( chkvalid && ! ran.
isValid() ) {
36 cout << myname <<
"Unable to find range " << sran <<
endl;
39 if ( nexp ) assert( ran.
size() == nexp );
QTextStream & endl(QTextStream &s)
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 151 of file test_VDColdboxChannelRanges.cxx.
152 bool useExistingFcl =
false;
154 string sarg(
argv[1]);
155 if ( sarg ==
"-h" ) {
156 cout <<
"Usage: " <<
argv[0] <<
" [keepFCL] [NSHOW]" <<
endl;
157 cout <<
" keepFCL [false]: If true, existing FCL file is used." <<
endl;
158 cout <<
" NSHOW [64]: Every nshow'th channels will be displayed in log." <<
endl;
161 useExistingFcl = sarg ==
"true" || sarg ==
"1";
int test_VDColdboxChannelRanges(bool useExistingFcl=false)
QTextStream & endl(QTextStream &s)
int test_VDColdboxChannelRanges |
( |
bool |
useExistingFcl = false | ) |
|
Definition at line 45 of file test_VDColdboxChannelRanges.cxx.
46 const string myname =
"test_VDColdboxChannelRanges: ";
48 cout << myname <<
"NDEBUG must be off." <<
endl;
51 string line =
"-----------------------------";
53 cout << myname << line <<
endl;
54 string fclfile =
"test_VDColdboxChannelRanges.fcl";
56 cout << myname <<
"Using existing top-level FCL." <<
endl;
58 cout << myname <<
"Creating top-level FCL." <<
endl;
59 ofstream
fout(fclfile.c_str());
62 fout <<
" tool_type: VDColdboxChannelRanges" <<
endl;
64 fout <<
" GhostRange: [3200, 3392]" <<
endl;
70 cout << myname << line <<
endl;
71 cout << myname <<
"Fetching tool manager." <<
endl;
73 assert ( ptm !=
nullptr );
78 cout << myname << line <<
endl;
79 cout << myname <<
"Fetching tool." <<
endl;
81 assert( cma !=
nullptr );
83 cout << myname << line <<
endl;
84 cout << myname <<
"Check detector." <<
endl;
98 cout << myname << line <<
endl;
99 cout << myname <<
"Check U FEMBs." <<
endl;
101 for (
string sran : {
"femb01u",
"femb02u",
"femb03u",
"femb04u",
"femb05u",
102 "femb06u",
"femb07u",
"femb08u",
"femb09u",
"femb10u",
"femb11u" } ) {
105 cout << myname <<
" Checking " << nchuf <<
" == " << nchu <<
endl;
106 assert( nchuf == nchu );
108 cout << myname << line <<
endl;
109 cout << myname <<
"Check Y FEMBs." <<
endl;
111 for (
string sran : {
"femb01y",
"femb02y",
"femb03y",
"femb04y",
112 "femb11y",
"femb12y",
"femb13y" } ) {
115 cout << myname <<
" Checking " << nchyf <<
" == " << nchy <<
endl;
116 assert( nchyf == nchy );
118 cout << myname << line <<
endl;
119 cout << myname <<
"Check Z FEMBs." <<
endl;
121 for (
string sran : {
"femb04z",
"femb05z",
"femb06z",
"femb07z",
122 "femb08z",
"femb09z",
"femb10z",
"femb11z" } ) {
125 cout << myname <<
" Checking " << nchzf <<
" == " << nchz <<
endl;
126 assert( nchzf == nchz );
128 cout << myname << line <<
endl;
129 cout << myname <<
"Check each FEMB." <<
endl;
131 for (
Index ifmb=1; ifmb<=13; ++ifmb ) {
134 for (
string spla : {
"u",
"y",
"z"} ) {
135 nchf +=
checkran(*cma, sbas + spla, 0,
false);
137 cout <<
"*** " << sbas <<
" count is " << nchf <<
endl;
138 assert( nchf <= 128 );
141 cout << myname <<
"*** FEMB total is " << ntot <<
endl;
142 assert( ntot == 1600 );
144 cout << myname << line <<
endl;
145 cout << myname <<
"Done." <<
endl;
void line(double t, double *p, double &x, double &y, double &z)
Index checkran(const IndexRangeTool &rm, string sran, Index nexp=0, bool chkvalid=true)
std::string to_string(ModuleType const mt)
QTextStream & endl(QTextStream &s)