Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 25 of file pdChannelRange.cxx.
26 const string myname =
"pdChannelRange: ";
29 string tnameRange =
"channelRanges";
30 string tnameGroup =
"channelGroups";
32 string sdet =
"protodune";
33 while ( iarg < argc ) {
34 string arg =
argv[iarg++];
35 if ( arg[0] ==
'-' ) {
38 }
else if ( arg ==
"-d" ) {
39 if ( iarg < argc ) sdet =
argv[iarg++];
41 cout <<
"ERROR: Invalid flag: " << arg <<
endl;
48 string fclfile = sdet +
"_tools_dune.fcl";
50 cout <<
"Usage: " <<
argv[0] <<
" [-d DET] NAME" <<
endl;
51 cout <<
" Displays the range names group for channel group NAME" <<
endl;
52 cout <<
" or the range for channel range NAME." <<
endl;
53 cout <<
" DET = protodune (default), apa7, iceberg, vdcb or any value for which\n" 54 <<
" DET_tools_dune.fcl provides definitions for\n" 55 <<
" channelRanges and channelGroups." <<
endl;
56 if ( sdet ==
"protodune" ) {
57 cout <<
" Protodune channel group names include:" <<
endl;
58 cout <<
" apas - APAs." <<
endl;
59 cout <<
" tpss - TPC sets." <<
endl;
60 cout <<
" apaus, apavs, apazs, apacs - APA planes with install naming." <<
endl;
61 cout <<
" tppus, tppvs, tppzs, tppcs - APA planes with offline naming." <<
endl;
62 cout <<
" Protodune channel range names include:" <<
endl;
63 cout <<
" apa1 - apa6: APA with APA numbering." <<
endl;
64 cout <<
" tps0 - tps5: APA (TPC set) with offline numbering." <<
endl;
65 cout <<
" apa0u, apa0v, apa0z, apa0c, ..., apa5c: APA plane with install numbering." <<
endl;
66 cout <<
" tpp0u, tpp0v, tpp0z, tpp0c, ..., tpp5c: APA plane with offline numbering." <<
endl;
67 cout <<
" (u and v are induction, z is TPC-side collection, c is cryostat side." <<
endl;
68 cout <<
" femb101u, femb102u, ..., femb620u: FEMB u channels (same for v and x)." <<
endl;
69 }
else if ( sdet ==
"apa7" ) {
70 cout <<
" CERN coldbox channel range names include:" <<
endl;
71 cout <<
" apa7: same as all." <<
endl;
72 cout <<
" apa7u, apa7v, apa7z, apa7c: APA plane." <<
endl;
73 cout <<
" tpp7u, tpp7v, tpp7z, tpp07: APA plane." <<
endl;
74 cout <<
" (u and v are induction, z is TPC-side collection, c is cryostat side." <<
endl;
75 cout <<
" femb701u, femb702u, ..., femb720u: FEMB u channels (same for v and x)." <<
endl;
76 }
else if ( sdet ==
"iceberg" ) {
77 cout <<
" Iceberg channel range names include:" <<
endl;
78 cout <<
" apa: same as all." <<
endl;
79 cout <<
" apau, apav, apaz1, apaz2: APA plane." <<
endl;
80 cout <<
" tppu, tppv, tppz1, apaz2: APA plane." <<
endl;
81 cout <<
" (u and v are induction, z is TPC-side collection, c is cryostat side." <<
endl;
82 cout <<
" femb701u, femb702u, ..., femb720u: FEMB u channels (same for v and x)." <<
endl;
83 cout <<
" apai: Induction channels." <<
endl;
84 cout <<
" apaz or apax: Collection channels." <<
endl;
90 assert ( ptm !=
nullptr );
101 bool exitLoop = crname.size();
103 if ( crname.size() == 0 ) {
104 cout <<
"Group or range name> ";
106 std::getline(cin, crname);
108 if ( crname.size() == 0 || crname ==
"q" )
return 0;
110 if ( pcgt ==
nullptr ) {
111 if ( ! warnGroup++ ) cout <<
"WARNING: Channel group tool not found: " << tnameGroup <<
endl;
113 cg = pcgt->get(crname);
117 }
else if ( pcrt ==
nullptr ) {
118 if ( ! warnRange ) cout <<
"WARNING: Channel range tool not found: " << tnameRange <<
endl;
124 cout <<
"ERROR: " << crname <<
" is not a valid channel group or range." <<
endl;
127 if ( warnGroup && warnRange )
return 1;
128 if ( exitLoop )
return 0;
QTextStream & endl(QTextStream &s)