CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CommandLineParser.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 #include <iostream>
3 #include <fstream>
4 #include <iomanip>
5 #include <cstdlib>
6 #include <cassert>
7 
8 #include "TString.h"
9 
12 #include "PhysicsTools/FWLite/interface/dumpSTL.icc"
13 
14 using namespace std;
15 using namespace optutl;
16 
17 const std::string CommandLineParser::kSpaces = " \t";
18 
19 
20 CommandLineParser::CommandLineParser (const string &usage,
21  unsigned int optionsType) :
22  m_argv0(""), m_usageString (usage),
23  m_printOptions (true), m_optionsType (optionsType)
24 {
26  {
27  // Integer options
28  addOption ("totalSections", kInteger,
29  "Total number of sections",
30  0);
31  addOption ("section", kInteger,
32  "This section (from 1..totalSections inclusive)",
33  0);
34  addOption ("maxEvents", kInteger,
35  "Maximum number of events to run over (0 for whole file)",
36  0);
37  addOption ("jobID", kInteger,
38  "jobID given by CRAB,etc. (-1 means append nothing)",
39  -1);
40  addOption ("outputEvery", kInteger,
41  "Output something once every N events (0 for never)",
42  0);
43  // String options
44  addOption ("outputFile", kString,
45  "Output filename",
46  "output.root");
47  addOption ("storePrepend", kString,
48  "Prepend location on files starting with '/store/'");
49  addOption ("tag", kString,
50  "A 'tag' to append to output file (e.g., 'v2', etc.)");
51  // Bool options
52  addOption ("logName", kBool,
53  "Print log name and exit");
54  // String vector options
55  addOption ("inputFiles", kStringVector,
56  "List of input files");
57  addOption ("secondaryInputFiles", kStringVector,
58  "List of secondary input files (a.k.a. two-file-solution");
59  addOption ("orderedSecondaryFiles", kBool,
60  "Are the secondary files ordered?",
61  false );
62  return;
63  }
64  // If we're still here, we have a type I don't understand.
65  cerr << "CommandLineParser() Error: type '" << optionsType
66  << "' is not understood. Aborting." << endl;
67  assert (0);
68 }
69 
70 void
71 CommandLineParser::parseArguments (int argc, char** argv, bool returnArgs)
72 {
73  bool callHelp = false;
74  SVec argsVec;
75  m_argv0 = argv[0];
76  m_fullArgVec.push_back (argv[0]);
77  for (int loop = 1; loop < argc; ++loop)
78  {
79  string arg = argv[loop];
80  m_fullArgVec.push_back (arg);
81  string::size_type where = arg.find_first_of("=");
82  if (string::npos != where)
83  {
84  if ( _setVariableFromString (arg) )
85  {
86  continue;
87  }
89  {
90  continue;
91  }
92  cerr << "Don't understand: " << arg << endl;
93  exit(0);
94  } // tag=value strings
95  else if (arg.at(0) == '-')
96  {
97  string::size_type where = arg.find_first_not_of("-");
98  if (string::npos == where)
99  {
100  // a poorly formed option
101  cerr << "Don't understand: " << arg << endl;
102  exit(0);
103  continue;
104  }
105  lowercaseString (arg);
106  char first = arg.at (where);
107  // Print the values
108  if ('p' == first)
109  {
110  m_printOptions = true;
111  continue;
112  }
113  if ('n' == first)
114  {
115  m_printOptions = false;
116  continue;
117  }
118  // Exit after printing values
119  if ('h' == first)
120  {
121  callHelp = true;
122  continue;
123  }
124  // if we're still here, then we've got a problem.
125  cerr << "Don't understand: " << arg << endl;
126  exit(0);
127  } // -arg strings
128  if (returnArgs)
129  {
130  argsVec.push_back (arg);
131  } else {
132  cerr << "Don't understand: " << arg << endl;
133  exit(0);
134  }
135  } // for loop
136  if (callHelp)
137  {
138  help();
139  }
140 }
141 
142 void
144 {
145  if (m_usageString.length())
146  {
147  cout << m_argv0 << " - " << m_usageString << endl;
148  }
149  cout << "--help - This screen" << endl
150  << "--noPrint - Do not print out all settings" << endl
151  << "--print - Print out all settings" << endl;
153  exit (0);
154 }
155 
156 
157 void
158 CommandLineParser::split (SVec &retval, string line, string match,
159  bool ignoreComments)
160 {
161  if (ignoreComments)
162  {
163  removeComment (line);
164  } // if ignoreComments
165  retval.clear();
166  // find the first non-space
167  string::size_type start1 = line.find_first_not_of (kSpaces);
168  // Is the first non-space character a '#'
169  char firstCh = line[start1];
170  if ('#' == firstCh)
171  {
172  // this line is a comment
173  return;
174  }
175 
176  line += match; // get last word of line
177  string::size_type last = string::npos;
178  string::size_type current = line.find_first_of(match);
179  while (string::npos != current)
180  {
181  string::size_type pos;
182  if (string::npos != last)
183  {
184  pos = last + 1;
185  } else {
186  pos = 0;
187  }
188  string part = line.substr( pos, current - last - 1);
189  // don't bother adding 0 length strings
190  if (part.length())
191  {
192  retval.push_back(part);
193  }
194  last = current;
195  current = line.find_first_of(match, current + 1);
196  } // while we're finding spaces
197 }
198 
199 void
201 {
202  string::size_type location = line.find ("#");
203  if (string::npos != location)
204  {
205  // we've got a comment. Strip it out
206  line = line.substr (0, location - 1);
207  } // if found
208 }
209 
210 void
212 {
213  string::size_type pos = line.find_first_not_of (kSpaces);
214  if (string::npos == pos)
215  {
216  // we don't have anything here at all. Just quit now
217  return;
218  }
219  if (pos)
220  {
221  // We have spaces at the beginning.
222  line = line.substr (pos);
223  }
224  pos = line.find_last_not_of (kSpaces);
225  if (pos + 1 != line.length())
226  {
227  // we've got spaces at the end
228  line = line.substr (0, pos + 1);
229  }
230 }
231 
232 string
233 CommandLineParser::removeEnding (const string &input, const string &ending)
234 {
235  string::size_type position = input.rfind(ending);
236  if (input.length() - ending.length() == position)
237  {
238  // we've got it
239  return input.substr(0, position);
240  }
241  // If we're still here, it wasn't there
242  return input;
243 }
244 
245 void
247  string &command,
248  string &rest)
249 {
250  command = rest = "";
251  string::size_type nonspace = line.find_first_not_of (kSpaces);
252  if (string::npos == nonspace)
253  {
254  // we don't have anything here at all. Just quit now
255  return;
256  }
257  string::size_type space = line.find_first_of (kSpaces, nonspace);
258  if (string::npos == space)
259  {
260  // we only have a command and nothing else
261  command = line.substr (nonspace);
262  return;
263  }
264  command = line.substr (nonspace, space - nonspace);
265  rest = line.substr (space + 1);
267 }
268 
269 
270 void
272 {
273  cout << "------------------------------------------------------------------"
274  << left << endl;
275  // Print the integers next
276  if (m_integerMap.size())
277  {
278  cout << endl << "Integer options:" << endl;
279  }
280  for (SIMapConstIter iter = m_integerMap.begin();
281  m_integerMap.end() != iter;
282  ++iter)
283  {
284  const string &description = m_variableDescriptionMap[ iter->first ];
285  cout << " " << setw(14) << iter->first << " = " << setw(14)
286  << iter->second;
287  if (description.length())
288  {
289  cout << " - " << description;
290  }
291  cout << endl;
292  } // for iter
293 
294  // Print the doubles next
295  if (m_doubleMap.size())
296  {
297  cout << endl << "Double options:" << endl;
298  }
299  for (SDMapConstIter iter = m_doubleMap.begin();
300  m_doubleMap.end() != iter;
301  ++iter)
302  {
303  const string &description = m_variableDescriptionMap[ iter->first ];
304  cout << " " << setw(14) << iter->first << " = " << setw(14)
305  << iter->second;
306  if (description.length())
307  {
308  cout << " - " << description;
309  }
310  cout << endl;
311  } // for iter
312 
313  // Print the bools first
314  if (m_boolMap.size())
315  {
316  cout << endl << "Bool options:" << endl;
317  }
318  for (SBMapConstIter iter = m_boolMap.begin();
319  m_boolMap.end() != iter;
320  ++iter)
321  {
322  const string &description = m_variableDescriptionMap[ iter->first ];
323  cout << " " << setw(14) << iter->first << " = " << setw(14);
324  if (iter->second)
325  {
326  cout << "true";
327  } else {
328  cout << "false";
329  }
330  if (description.length())
331  {
332  cout << " - " << description;
333  }
334  cout << endl;
335  } // for iter
336 
337  // Print the strings next
338  if (m_stringMap.size())
339  {
340  cout << endl << "String options:" << endl;
341  }
342  for (SSMapConstIter iter = m_stringMap.begin();
343  m_stringMap.end() != iter;
344  ++iter)
345  {
346  const string &description = m_variableDescriptionMap[ iter->first ];
347  cout << " " << setw(14) << iter->first << " = ";
348  const string value = "'" + iter->second + "'";
349  cout << setw(14) << "";
350  if (description.length())
351  {
352  cout << " - " << description;
353  }
354  cout << endl << " " << value << endl;
355  } // for iter
356 
357  // Integer Vec
358  if (m_integerVecMap.size())
359  {
360  cout << endl << "Integer Vector options:" << endl;
361  }
362  for (SIVecMapConstIter iter = m_integerVecMap.begin();
363  m_integerVecMap.end() != iter;
364  ++iter)
365  {
366  const string &description = m_variableDescriptionMap[ iter->first ];
367  cout << " " << setw(14) << iter->first << " = ";
368  dumpSTL (iter->second);
369  cout << endl;
370  if (description.length())
371  {
372  cout << " - " << description;
373  }
374  cout << endl;
375  } // for iter
376 
377  // Double Vec
378  if (m_doubleVecMap.size())
379  {
380  cout << endl << "Double Vector options:" << endl;
381  }
382  for (SDVecMapConstIter iter = m_doubleVecMap.begin();
383  m_doubleVecMap.end() != iter;
384  ++iter)
385  {
386  const string &description = m_variableDescriptionMap[ iter->first ];
387  cout << " " << setw(14) << iter->first << " = ";
388  dumpSTL (iter->second);
389  cout << endl;
390  if (description.length())
391  {
392  cout << " - " << description;
393  }
394  cout << endl;
395  } // for iter
396 
397  // String Vec
398  if (m_stringVecMap.size())
399  {
400  cout << endl << "String Vector options:" << endl;
401  } else {
402  cout << endl;
403  }
404  for (SSVecMapConstIter iter = m_stringVecMap.begin();
405  m_stringVecMap.end() != iter;
406  ++iter)
407  {
408  const string &description = m_variableDescriptionMap[ iter->first ];
409  cout << " " << setw(14) << iter->first << " = ";
410  if (description.length())
411  {
412  cout << setw(14) << "" << " - " << description;
413  }
414  cout << endl;
415  dumpSTLeachEndl (iter->second, 8);
416  } // for iter
417 
418  cout << "------------------------------------------------------------------"
419  << right << endl;
420 }
421 
422 bool
424  bool dontOverrideChange,
425  int offset)
426 {
427  string::size_type where = arg.find_first_of("=", offset + 1);
428  string varname = arg.substr (offset, where - offset);
429  string value = arg.substr (where + 1);
430  lowercaseString (varname);
431  // check to make sure this is a valid option
432  SBMapConstIter sbiter = m_variableModifiedMap.find (varname);
433  if (m_variableModifiedMap.end() == sbiter)
434  {
435  // Not found. Not a valid option
436  return false;
437  }
438  // if 'dontOverrideChange' is set, then we are being asked to NOT
439  // change any variables that have already been changed.
440  if (dontOverrideChange && _valueHasBeenModified (varname) )
441  {
442  // don't go any further
443  return true;
444  }
445  // integers
446  SIMapIter integerIter = m_integerMap.find(varname);
447  if (m_integerMap.end() != integerIter)
448  {
449  // we found it
450  // use 'atof' instead of 'atoi' to get scientific notation
451  integerIter->second = (int) atof( value.c_str() );
452  m_variableModifiedMap[varname] = true;
453  return true;
454  }
455  // double
456  SDMapIter doubleIter = m_doubleMap.find(varname);
457  if (m_doubleMap.end() != doubleIter)
458  {
459  // we found it
460  doubleIter->second = atof( value.c_str() );
461  m_variableModifiedMap[varname] = true;
462  return true;
463  }
464  // string
465  SSMapIter stringIter = m_stringMap.find(varname);
466  if (m_stringMap.end() != stringIter)
467  {
468  // we found it
469  stringIter->second = value;
470  m_variableModifiedMap[varname] = true;
471  return true;
472  }
473  // bool
474  SBMapIter boolIter = m_boolMap.find(varname);
475  if (m_boolMap.end() != boolIter)
476  {
477  // we found it
478  boolIter->second = 0 != atoi( value.c_str() );
479  m_variableModifiedMap[varname] = true;
480  return true;
481  }
482  // IntegerVec
483  SIVecMapIter integerVecIter = m_integerVecMap.find(varname);
484  if (m_integerVecMap.end() != integerVecIter)
485  {
486  // we found it
487  SVec words;
488  split (words, value, ",");
489  for (SVecConstIter wordIter = words.begin();
490  words.end() != wordIter;
491  ++wordIter)
492  {
493  integerVecIter->second.push_back( (int) atof( wordIter->c_str() ) );
494  }
495  // we don't want to mark this as modified because we can add
496  // many values to this
497  // m_variableModifiedMap[varname] = true;
498  return true;
499  }
500  // DoubleVec
501  SDVecMapIter doubleVecIter = m_doubleVecMap.find(varname);
502  if (m_doubleVecMap.end() != doubleVecIter)
503  {
504  // we found it
505  SVec words;
506  split (words, value, ",");
507  for (SVecConstIter wordIter = words.begin();
508  words.end() != wordIter;
509  ++wordIter)
510  {
511  doubleVecIter->second.push_back( atof( wordIter->c_str() ) );
512  }
513  // we don't want to mark this as modified because we can add
514  // many values to this
515  // m_variableModifiedMap[varname] = true;
516  return true;
517  }
518  // StringVec
519  SSVecMapIter stringVecIter = m_stringVecMap.find(varname);
520  if (m_stringVecMap.end() != stringVecIter)
521  {
522  // we found it
523  SVec words;
524  split (words, value, ",");
525  for (SVecConstIter wordIter = words.begin();
526  words.end() != wordIter;
527  ++wordIter)
528  {
529  stringVecIter->second.push_back( *wordIter );
530  }
531  // we don't want to mark this as modified because we can add
532  // many values to this
533  // m_variableModifiedMap[varname] = true;
534  return true;
535  }
536  // We didn't find your variable. And we really shouldn't be here
537  // because we should have know that we didn't find your variable.
538  cerr << "CommandLineParser::SetVeriableFromString() Error: "
539  << "Unknown variable and internal fault. Aborting." << endl;
540  assert (0);
541  return false;
542 }
543 
544 bool
546 {
547  ifstream source (filename.c_str(), ios::in);
548  if (! source)
549  {
550  cerr << "file " << filename << "could not be opened" << endl;
551  return false;
552  }
553  string line;
554  while (getline (source, line))
555  {
556  // find the first nonspace
557  string::size_type where = line.find_first_not_of(kSpaces);
558  if (string::npos == where)
559  {
560  // no non-spaces
561  continue;
562  }
563  char first = line.at (where);
564  if ('-' != first)
565  {
566  continue;
567  }
568  where = line.find_first_not_of(kSpaces, where + 1);
569  if (string::npos == where)
570  {
571  // no non-spaces
572  continue;
573  }
574  // Get string starting at first nonspace after '-'. Copy it to
575  // another string without copying any spaces and stopping at the
576  // first '#'.
577  string withspaces = line.substr (where);
578  string nospaces;
579  for (int position = 0;
580  position < (int) withspaces.length();
581  ++position)
582  {
583  char ch = withspaces[position];
584  if ('#' == ch)
585  {
586  // start of a comment
587  break;
588  } else if (' ' == ch || '\t' == ch)
589  {
590  continue;
591  }
592  nospaces += ch;
593  } // for position
594  if (! _setVariableFromString (nospaces, true) )
595  {
596  cerr << "Don't understand line" << endl << line << endl
597  << "in options file '" << filename << "'. Aborting."
598  << endl;
599  exit(0);
600  } // if setting variable failed
601  } // while getline
602  return true;
603 }
604 
605 bool
607 {
608  SVec equalWords;
609  split (equalWords, arg, "=");
610  if (2 != equalWords.size())
611  {
612  return false;
613  }
614  SVec commandWords;
615  split (commandWords, equalWords.at(0), "_");
616  if (2 != commandWords.size())
617  {
618  return false;
619  }
620  string &command = commandWords.at(1);
621  lowercaseString (command);
622  if (command != "load" && command != "clear")
623  {
624  return false;
625  }
626  const string &key = commandWords.at(0);
627  OptionType type = hasOption (key);
629  {
630  cerr << "Command '" << command << "' only works on vectors." << endl;
631  return false;
632  }
633 
635  // Clear //
637  if ("clear" == command)
638  {
639  if (kIntegerVector == type)
640  {
641  integerVector(key).clear();
642  } else if (kDoubleVector == type)
643  {
644  doubleVector(key).clear();
645  } else if (kStringVector == type)
646  {
647  stringVector(key).clear();
648  } else {
649  // If we're here, then I made a coding mistake and want to
650  // know about it.
651  assert (0);
652  }
653  return true;
654  }
655 
657  // Load //
659  const string &filename = equalWords.at(1);
660  ifstream source (filename.c_str(), ios::in);
661  if (! source)
662  {
663  cerr << "file " << filename << "could not be opened" << endl;
664  return false;
665  }
666  string line;
667  while (getline (source, line))
668  {
669  // find the first nonspace
670  string::size_type where = line.find_first_not_of (kSpaces);
671  if (string::npos == where)
672  {
673  // no non-spaces
674  continue;
675  }
676  // get rid of leading spaces
677  line = line.substr (where);
678  // get rid of trailing spaces
679  where = line.find_last_not_of (kSpaces);
680  if (line.length() - 1 != where)
681  {
682  line = line.substr (0, where + 1);
683  }
684  if ('#' == line.at(0))
685  {
686  // this is a comment line, ignore it
687  continue;
688  }
689  if (kIntegerVector == type)
690  {
691  integerVector(key).push_back( (int) atof( line.c_str() ) );
692  } else if (kDoubleVector == type)
693  {
694  doubleVector(key).push_back( atof( line.c_str() ) );
695  } else if (kStringVector == type)
696  {
697  stringVector(key).push_back( line );
698  } else {
699  // If we're here, then I made a coding mistake and want to
700  // know about it.
701  assert (0);
702  }
703  } // while getline
704  return true;
705 
706 }
707 
708 void
710  int section, int totalSections)
711 {
712  // Make sure the segment numbers make sense
713  assert (section > 0 && section <= totalSections);
714 
715  // The Perl code:
716  // my $entries = @list;
717  // my $perSection = int ($entries / $totalSections);
718  // my $extra = $entries % $totalSections;
719  // --$section; # we want 0..n-1 not 1..n
720  // my $start = $perSection * $section;
721  // my $num = $perSection - 1;
722  // if ($section < $extra) {
723  // $start += $section;
724  // ++$num;
725  // } else {
726  // $start += $extra;
727  // };
728  // my $end = $start + $num;
729  int entries = (int) inputList.size();
730  int perSection = entries / totalSections;
731  int extra = entries % totalSections;
732  --section; // we want 0..n-1, not 1..n.
733  int current = perSection * section;
734  int num = perSection - 1;
735  if (section < extra)
736  {
737  current += section;
738  ++num;
739  } else
740  {
741  current += extra;
742  }
743  outputList.clear();
744  // we want to go from 0 to num inclusive, so make sure we have '<='
745  // and not '='
746  for (int loop = current; loop <= current + num; ++loop)
747  {
748  outputList.push_back( inputList.at( loop ) );
749  } // for loop
750 }
751 
752 void
754 {
756  {
757  // nothing to see here, folks
758  return;
759  }
761  // Deal with sections //
763  if ( integerValue ("totalSections") )
764  {
765  // we have a request to break this into sections. First, note
766  // this in the output file
767  tag += Form ("_sec%03d", integerValue ("section"));
768  SVec tempVec;
769  _getSectionFiles ( stringVector ("inputFiles"),
770  tempVec,
771  integerValue ("section"),
772  integerValue ("totalSections") );
773  stringVector ("inputFiles") = tempVec;
774  } // if section requested
775 
777  // Store lfn to pfn //
779  const string &kStorePrepend = stringValue ("storePrepend");
780  if (kStorePrepend.length())
781  {
782  string match = "/store/";
783  int matchLen = match.length();
784  SVec tempVec;
785  SVec &currentFiles = stringVector ("inputFiles");
786  for (SVecConstIter iter = currentFiles.begin();
787  currentFiles.end() != iter;
788  ++iter)
789  {
790  const string &filename = *iter;
791  if ((int) filename.length() > matchLen &&
792  filename.substr(0, matchLen) == match)
793  {
794  tempVec.push_back( kStorePrepend + filename );
795  } else {
796  tempVec.push_back( filename);
797  }
798  }
799  currentFiles = tempVec;
800  } // if storePrepend.
801 
803  // //////////////////////////// //
804  // // Modify output filename // //
805  // //////////////////////////// //
807  string outputFile = stringValue ("outputFile");
808  bool modifyOutputFile = ( outputFile.length() );
809  outputFile = removeEnding (outputFile, ".root");
810  outputFile += tag;
811  if ( integerValue ("maxEvents") )
812  {
813  outputFile += Form ("_maxevt%03d", integerValue ("maxEvents"));
814  }
815  if ( integerValue ("jobID") >= 0)
816  {
817  outputFile += Form ("_jobID%03d", integerValue ("jobID"));
818  }
819  if ( stringValue ("tag").length() )
820  {
821  outputFile += "_" + stringValue ("tag");
822  }
823 
825  // Log File Name, if requested //
827  if ( boolValue ("logName") )
828  {
829  cout << outputFile << ".log" << endl;
830  exit(0);
831  }
832  outputFile += ".root";
833  if (modifyOutputFile)
834  {
835  stringValue ("outputFile") = outputFile;
836  }
837 
838  // finally, if they asked us to print all options, let's do so
839  // after we've modified all variables appropriately
840  if (m_printOptions)
841  {
843  } // if printOptions
844 }
845 
846 // friends
847 ostream& operator<< (ostream& o_stream, const CommandLineParser &rhs)
848 {
849  return o_stream;
850 }
bool _runVariableCommandFromString(const std::string &arg)
type
Definition: HCALResponse.h:21
SIMap::const_iterator SIMapConstIter
void _getSectionFiles(const SVec &inputList, SVec &outputList, int section, int totalSection)
void _finishDefaultOptions(std::string tag="")
bool _setVariablesFromFile(const std::string &filename)
static std::string removeEnding(const std::string &input, const std::string &ending)
SDMap::const_iterator SDMapConstIter
SSMap::iterator SSMapIter
SBMap::iterator SBMapIter
string usage
Definition: geometryDiff.py:6
SIMap::iterator SIMapIter
std::string & stringValue(std::string key)
std::vector< std::string > SVec
void parseArguments(int argc, char **argv, bool allowArgs=false)
static void removeLeadingAndTrailingSpaces(std::string &line)
assert(m_qm.get())
static void split(SVec &retval, std::string line, std::string match=" \t", bool ignoreComments=true)
SBMap::const_iterator SBMapConstIter
SIVecMap::iterator SIVecMapIter
outputList
All other commands ##.
Definition: compareJSON.py:62
int loop
CMSSW
SSVecMap::const_iterator SSVecMapConstIter
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
uint16_t size_type
A arg
Definition: Factorize.h:36
static std::string const input
Definition: EdmProvDump.cc:44
int & integerValue(std::string key)
SSMap::const_iterator SSMapConstIter
static const std::string kSpaces
SIVecMap::const_iterator SIVecMapConstIter
DVec & doubleVector(std::string key)
static void lowercaseString(std::string &arg)
SSVecMap::iterator SSVecMapIter
SDVecMap::iterator SDVecMapIter
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
bool _setVariableFromString(const std::string &arg, bool dontOverrideChange=false, int offset=0)
tuple description
Definition: idDealer.py:66
bool _valueHasBeenModified(const std::string &key)
static void removeComment(std::string &line)
IVec & integerVector(std::string key)
part
Definition: HCALResponse.h:20
tuple argc
Definition: dir2webdir.py:38
SVec & stringVector(std::string key)
static void findCommand(const std::string &line, std::string &command, std::string &rest)
bool & boolValue(std::string key)
static int position[264][3]
Definition: ReadPGInfo.cc:509
void addOption(std::string key, OptionType type, const std::string &description="")
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:145
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
SDMap::iterator SDMapIter
static std::string const source
Definition: EdmProvDump.cc:43
SDVecMap::const_iterator SDVecMapConstIter
SVec::const_iterator SVecConstIter
OptionType hasOption(std::string key)