ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | List of all members
JobConfig Struct Reference
Collaboration diagram for JobConfig:

Public Types

enum  Format {
  UNDEF =0x00, DB =0x01, COOL =0x02, XML =0x04,
  JSON =0x08
}
 
enum  ETriggerLevel { LVL1 = 0, HLT = 1, NONE = 2 }
 

Public Member Functions

int parseProgramOptions (int argc, char *argv[])
 
void PrintSetup ()
 
string CheckForCompleteSetup ()
 
void PrintSetup (std::ostream &log, std::ostream &(*lineend)(std::ostream &os))
 
void parseProgramOptions (int argc, char *argv[])
 
unsigned int getKey (unsigned int which)
 
unsigned int getKey2 (unsigned int which)
 

Public Attributes

string cooldb {"COOLONL_TRIGGER/CONDBR2"}
 
unsigned int run {0}
 
unsigned int lb {0}
 
unsigned int lbend {0}
 
bool openended {true}
 
bool fix {false}
 
bool extendedSelection {false}
 
string triggerdb {"TRIGGERDBR2"}
 
int smk {0}
 
int bgsk {0}
 
int l1psk {0}
 
int hltpsk {0}
 
string release {""}
 
bool help {false}
 
int printlevel {-1}
 
MSGTC::Level outputlevel {MSGTC::WARNING}
 
vector< string > error
 
string coolConnection {""}
 
std::vector< std::string > inpar
 
std::vector< std::string > inpar2
 
std::vector< std::string > outpar
 
Format input {UNDEF}
 
Format input2 {UNDEF}
 
unsigned int output {UNDEF}
 
string db {""}
 
string db2 {""}
 
vector< unsigned int > keys
 
vector< unsigned int > keys2
 
string outBase {""}
 
string l1JsonOutFile {"L1Menu.json"}
 
string bgkJsonOutFile {"BunchGroupSet.json"}
 
string l1PSJsonOutFile { "L1PrescalesSet.json" }
 
string hltJsonOutFile { "HLTMenu.json" }
 
string hltPSJsonOutFile { "HLTPrescalesSet.json" }
 
string coolInputConnection { "" }
 
string coolOutputConnection { "" }
 
unsigned int coolOutputRunNr { 0 }
 
bool jo {false}
 
bool fw {false}
 
string logFileName {""}
 
bool merge = { true }
 

Detailed Description

Definition at line 83 of file CoolFix.cxx.

Member Enumeration Documentation

◆ ETriggerLevel

Enumerator
LVL1 
HLT 
NONE 

Definition at line 107 of file ReadWrite.cxx.

107 { LVL1 = 0, HLT = 1, NONE = 2 };

◆ Format

Enumerator
UNDEF 
DB 
COOL 
XML 
JSON 

Definition at line 106 of file ReadWrite.cxx.

106 { UNDEF=0x00, DB=0x01, COOL=0x02, XML=0x04, JSON=0x08 };

Member Function Documentation

◆ CheckForCompleteSetup()

string JobConfig::CheckForCompleteSetup ( )

Definition at line 303 of file ReadWrite.cxx.

303  {
304  if(input==UNDEF)
305  return "Use argument '-i' to specify input source and check that the input is specified correctly";
306  if( input == DB ) {
307  if( db == "" )
308  return "No TriggerDB connection string specified";
309  if( keys.size()==0 )
310  return "No configuration key(s) specified";
311  }
312  if( input2 == DB ) {
313  if( db2 == "" )
314  return "No TriggerDB connection string specified for comparison, use option '--db2'";
315  if( keys2.size()==0 )
316  return "No smk specified for comparison, use option '--dbsmk2'";
317  }
318  return "";
319 }

◆ getKey()

unsigned int JobConfig::getKey ( unsigned int  which)
inline

Definition at line 145 of file ReadWrite.cxx.

145 { return keys.size()>which?keys[which]:0; }

◆ getKey2()

unsigned int JobConfig::getKey2 ( unsigned int  which)
inline

Definition at line 147 of file ReadWrite.cxx.

147 { return keys2.size()>which?keys2[which]:0; }

◆ parseProgramOptions() [1/2]

void JobConfig::parseProgramOptions ( int  argc,
char *  argv[] 
)

Definition at line 116 of file CoolFix.cxx.

116  {
117  std::string currentPar("");
118  std::string listofUnknownParameters = "";
119  uint runargpos(0);
120  for(int i=1; i<argc; i++) {
121  string currInput(argv[i]);
122  int fchar = currInput.find_first_not_of('-');
123  string stripped = currInput.substr(fchar);
124  bool isParam = (fchar!=0); // string starts with a '-', so it is a parameter name
125 
126  if(isParam)
127  if( ! (stripped == "c" || stripped == "cooldb" ||
128  stripped == "r" || stripped == "run" ||
129  stripped == "l" || stripped == "log" ||
130  stripped == "p" || stripped == "print" ||
131  stripped == "f" || stripped == "fix" ||
132  stripped == "e" || stripped == "extended" ||
133  stripped == "triggerdb" ||
134  stripped == "release" ||
135  stripped == "h" || stripped == "help" ||
136  stripped == "v" || stripped == "loglevel") ) {
137  listofUnknownParameters += " " + currInput;
138  continue;
139  }
140 
141  if(isParam) {
142  currentPar = "";
143  if(stripped == "h" || stripped == "help" ) { help = true; continue; }
144  if(stripped == "f" || stripped == "fix") { fix = true; continue; }
145  if(stripped == "e" || stripped == "extended") { extendedSelection = true; continue; }
146  currentPar = stripped;
147  } else {
148  if(currentPar == "c" || currentPar == "cooldb") { cooldb = stripped; currentPar=""; continue; }
149  if(currentPar == "r" || currentPar == "run") {
150  unsigned int val = boost::lexical_cast<unsigned int,string>(stripped);
151  switch(runargpos) {
152  case 0:
153  run = val;
154  break;
155  case 1:
156  lb = val;
157  break;
158  case 2:
159  lbend = val;
160  openended = false;
161  break;
162  }
163  runargpos++;
164  continue;
165  }
166  if(currentPar == "triggerdb") { triggerdb = stripped; continue; }
167  if(currentPar == "release") { release = stripped; continue; }
168  if(currentPar == "p" || currentPar == "print") { printlevel = boost::lexical_cast<int,string>(stripped); currentPar=""; continue; }
169  if(currentPar == "v" || currentPar == "loglevel") {
170  if("NIL" == stripped ) { outputlevel = MSGTC::NIL; }
171  else if("VERBOSE" == stripped ) { outputlevel = MSGTC::VERBOSE; }
172  else if("DEBUG" == stripped ) { outputlevel = MSGTC::DEBUG; }
173  else if("INFO" == stripped ) { outputlevel = MSGTC::INFO; }
174  else if("WARNING" == stripped ) { outputlevel = MSGTC::WARNING; }
175  else if("ERROR" == stripped ) { outputlevel = MSGTC::ERROR; }
176  else if("FATAL" == stripped ) { outputlevel = MSGTC::FATAL; }
177  else if("ALWAYS" == stripped ) { outputlevel = MSGTC::ALWAYS; }
178  else {
179  error.push_back("Unknown output level: " + stripped + ". Must be one of NIL, VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL, ALWAYS");
180  }
181  currentPar="";
182  continue;
183  }
184  }
185  }
186  if(listofUnknownParameters!="")
187  error.push_back("Unknown parameter(s): " + listofUnknownParameters);
188 
189  if(run==0)
190  error.push_back("No run specified, use '--run <run>' option");
191 
192 
193  {
194  string db = cooldb;
195  string dbname = "CONDBR2";
196  size_t slashpos = cooldb.find('/');
197  if(slashpos != string::npos) {
198  db = cooldb.substr(0,slashpos);
199  dbname = cooldb.substr(slashpos+1);
200  }
201  if(db.find('.') != string::npos) {
202  coolConnection = "sqlite://;schema="+db+";dbname=" + dbname;
203  } else {
204  coolConnection = db + "/" + dbname;
205  }
206  }
207 
208  if(help) {
209  printhelp(cout, endl);
210  return 0;
211  }
212  if(error.size()!=0) {
213  for(const string& e: error)
214  cerr << e << endl;
215  printhelp(cout, endl);
216  return 1;
217  }
218 
219  return -1;
220 }

◆ parseProgramOptions() [2/2]

void JobConfig::parseProgramOptions ( int  argc,
char *  argv[] 
)

◆ PrintSetup() [1/2]

void JobConfig::PrintSetup ( )

Definition at line 225 of file CoolFix.cxx.

225  {
226  cout << "========================================" << endl;
227  cout << "JOB SETUP: " << endl;
228  cout << "----------" << endl;
229  cout << " Run : " << run << endl;
230  cout << " LB : " << lb << " - " << lbend << endl;
231  cout << " Cool DB : " << coolConnection << endl;
232  cout << " Trigger database : " << triggerdb << endl;
233  cout << " Fix flag : " << (fix ? "yes" : "no") << endl;
234 
235  if( printlevel>=0)
236  cout << " Print menu detail : " << printlevel << endl;
237  cout << "========================================" << endl;
238 
239 }

◆ PrintSetup() [2/2]

void JobConfig::PrintSetup ( std::ostream &  log,
std::ostream &(*)(std::ostream &os)  lineend 
)

Definition at line 323 of file ReadWrite.cxx.

323  {
324  log << "========================================" << lineend;
325  log << "JOB SETUP: " << (input==DB?"DB":"COOL");
326  if(output!=UNDEF)
327  log << " --> " << (output==COOL?"COOL":"JSON");
328  log << lineend;
329  log << "----------" << lineend;
330  log << " Input : ";
331  for(const string& s: inpar) log << s << ", ";
332  log << lineend;
333  if( input2 != UNDEF ) {
334  log << " Input for comparison: ";
335  for(const string& s: inpar2) log << s << ", ";
336  log << lineend;
337  }
338  if( output != UNDEF ) {
339  log << " Output : ";
340  if( output&COOL ) {
342  if(coolOutputRunNr==0) { log << ", infinite IOV"; } else { log << ", run nr " << coolOutputRunNr; }
343  }
344  log << lineend;
345  }
346  if( printlevel>=0)
347  log << " Print menu detail : " << printlevel << lineend;
348  log << "========================================" << lineend;
349 
350 }

Member Data Documentation

◆ bgkJsonOutFile

string JobConfig::bgkJsonOutFile {"BunchGroupSet.json"}

Definition at line 119 of file ReadWrite.cxx.

◆ bgsk

int JobConfig::bgsk {0}

Definition at line 96 of file CoolFix.cxx.

◆ coolConnection

string JobConfig::coolConnection {""}

Definition at line 107 of file CoolFix.cxx.

◆ cooldb

string JobConfig::cooldb {"COOLONL_TRIGGER/CONDBR2"}

Definition at line 85 of file CoolFix.cxx.

◆ coolInputConnection

string JobConfig::coolInputConnection { "" }

Definition at line 124 of file ReadWrite.cxx.

◆ coolOutputConnection

string JobConfig::coolOutputConnection { "" }

Definition at line 125 of file ReadWrite.cxx.

◆ coolOutputRunNr

unsigned int JobConfig::coolOutputRunNr { 0 }

Definition at line 126 of file ReadWrite.cxx.

◆ db

string JobConfig::db {""}

Definition at line 114 of file ReadWrite.cxx.

◆ db2

string JobConfig::db2 {""}

Definition at line 114 of file ReadWrite.cxx.

◆ error

vector< string > JobConfig::error

Definition at line 105 of file CoolFix.cxx.

◆ extendedSelection

bool JobConfig::extendedSelection {false}

Definition at line 92 of file CoolFix.cxx.

◆ fix

bool JobConfig::fix {false}

Definition at line 91 of file CoolFix.cxx.

◆ fw

bool JobConfig::fw {false}

Definition at line 133 of file ReadWrite.cxx.

◆ help

bool JobConfig::help {false}

Definition at line 101 of file CoolFix.cxx.

◆ hltJsonOutFile

string JobConfig::hltJsonOutFile { "HLTMenu.json" }

Definition at line 121 of file ReadWrite.cxx.

◆ hltPSJsonOutFile

string JobConfig::hltPSJsonOutFile { "HLTPrescalesSet.json" }

Definition at line 122 of file ReadWrite.cxx.

◆ hltpsk

int JobConfig::hltpsk {0}

Definition at line 98 of file CoolFix.cxx.

◆ inpar

std::vector<std::string> JobConfig::inpar

Definition at line 109 of file ReadWrite.cxx.

◆ inpar2

std::vector<std::string> JobConfig::inpar2

Definition at line 109 of file ReadWrite.cxx.

◆ input

Format JobConfig::input {UNDEF}

Definition at line 111 of file ReadWrite.cxx.

◆ input2

Format JobConfig::input2 {UNDEF}

Definition at line 112 of file ReadWrite.cxx.

◆ jo

bool JobConfig::jo {false}

Definition at line 132 of file ReadWrite.cxx.

◆ keys

vector<unsigned int> JobConfig::keys

Definition at line 115 of file ReadWrite.cxx.

◆ keys2

vector<unsigned int> JobConfig::keys2

Definition at line 115 of file ReadWrite.cxx.

◆ l1JsonOutFile

string JobConfig::l1JsonOutFile {"L1Menu.json"}

Definition at line 118 of file ReadWrite.cxx.

◆ l1PSJsonOutFile

string JobConfig::l1PSJsonOutFile { "L1PrescalesSet.json" }

Definition at line 120 of file ReadWrite.cxx.

◆ l1psk

int JobConfig::l1psk {0}

Definition at line 97 of file CoolFix.cxx.

◆ lb

unsigned int JobConfig::lb {0}

Definition at line 87 of file CoolFix.cxx.

◆ lbend

unsigned int JobConfig::lbend {0}

Definition at line 88 of file CoolFix.cxx.

◆ logFileName

string JobConfig::logFileName {""}

Definition at line 134 of file ReadWrite.cxx.

◆ merge

bool JobConfig::merge = { true }

Definition at line 135 of file ReadWrite.cxx.

◆ openended

bool JobConfig::openended {true}

Definition at line 89 of file CoolFix.cxx.

◆ outBase

string JobConfig::outBase {""}

Definition at line 116 of file ReadWrite.cxx.

◆ outpar

std::vector<std::string> JobConfig::outpar

Definition at line 109 of file ReadWrite.cxx.

◆ output

unsigned int JobConfig::output {UNDEF}

Definition at line 113 of file ReadWrite.cxx.

◆ outputlevel

MSGTC::Level JobConfig::outputlevel {MSGTC::WARNING}

Definition at line 103 of file CoolFix.cxx.

◆ printlevel

int JobConfig::printlevel {-1}

Definition at line 102 of file CoolFix.cxx.

◆ release

string JobConfig::release {""}

Definition at line 99 of file CoolFix.cxx.

◆ run

unsigned int JobConfig::run {0}

Definition at line 86 of file CoolFix.cxx.

◆ smk

int JobConfig::smk {0}

Definition at line 95 of file CoolFix.cxx.

◆ triggerdb

string JobConfig::triggerdb {"TRIGGERDBR2"}

Definition at line 94 of file CoolFix.cxx.


The documentation for this struct was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CaloNoise_fillDB.dbname
dbname
Definition: CaloNoise_fillDB.py:43
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
JobConfig::help
bool help
Definition: CoolFix.cxx:101
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
python.Constants.ERROR
int ERROR
Definition: Control/AthenaCommon/python/Constants.py:18
JobConfig::inpar2
std::vector< std::string > inpar2
Definition: ReadWrite.cxx:109
JobConfig::inpar
std::vector< std::string > inpar
Definition: ReadWrite.cxx:109
JobConfig::lbend
unsigned int lbend
Definition: CoolFix.cxx:88
JobConfig::outputlevel
MSGTC::Level outputlevel
Definition: CoolFix.cxx:103
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
JobConfig::release
string release
Definition: CoolFix.cxx:99
JobConfig::cooldb
string cooldb
Definition: CoolFix.cxx:85
JobConfig::coolOutputConnection
string coolOutputConnection
Definition: ReadWrite.cxx:125
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
JobConfig::DB
@ DB
Definition: ReadWrite.cxx:106
JobConfig::UNDEF
@ UNDEF
Definition: ReadWrite.cxx:106
JobConfig::input
Format input
Definition: ReadWrite.cxx:111
TrigConf::MSGTC::ALWAYS
@ ALWAYS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:29
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:85
JobConfig::input2
Format input2
Definition: ReadWrite.cxx:112
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
JobConfig::fix
bool fix
Definition: CoolFix.cxx:91
JobConfig::extendedSelection
bool extendedSelection
Definition: CoolFix.cxx:92
JobConfig::keys
vector< unsigned int > keys
Definition: ReadWrite.cxx:115
JobConfig::COOL
@ COOL
Definition: ReadWrite.cxx:106
JobConfig::printlevel
int printlevel
Definition: CoolFix.cxx:102
JobConfig::lb
unsigned int lb
Definition: CoolFix.cxx:87
run
Definition: run.py:1
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
JobConfig::openended
bool openended
Definition: CoolFix.cxx:89
JobConfig::coolOutputRunNr
unsigned int coolOutputRunNr
Definition: ReadWrite.cxx:126
python.Constants.WARNING
int WARNING
Definition: Control/AthenaCommon/python/Constants.py:17
python.Utils.unixtools.which
def which(filename, env=os.environ)
UNIX-style which ---------------------------------------------------------—.
Definition: unixtools.py:39
JobConfig::XML
@ XML
Definition: ReadWrite.cxx:106
JobConfig::keys2
vector< unsigned int > keys2
Definition: ReadWrite.cxx:115
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:16
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
DEBUG
#define DEBUG
Definition: page_access.h:11
JobConfig::NONE
@ NONE
Definition: ReadWrite.cxx:107
JobConfig::JSON
@ JSON
Definition: ReadWrite.cxx:106
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
JobConfig::output
unsigned int output
Definition: ReadWrite.cxx:113
JobConfig::triggerdb
string triggerdb
Definition: CoolFix.cxx:94
JobConfig::coolConnection
string coolConnection
Definition: CoolFix.cxx:107
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TrigConf::MSGTC::NIL
@ NIL
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:22
error
Definition: IImpactPoint3dEstimator.h:70
printhelp
void printhelp(std::ostream &o, std::ostream &(*lineend)(std::ostream &os))
Definition: CoolFix.cxx:53
JobConfig::db
string db
Definition: ReadWrite.cxx:114
JobConfig::db2
string db2
Definition: ReadWrite.cxx:114