 |
ATLAS Offline Software
|
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 237 of file TriggerMenuRW.cxx.
246 if(
cfg.error.size()!=0) {
247 for(
const string &
e:
cfg.error)
253 if(
cfg.inputFiles.size()>0 ) {
256 for (
const std::string &
fn :
cfg.inputFiles) {
259 if(filetype ==
"l1menu") {
262 cout <<
"Loaded L1 menu " <<
l1menu.name() <<
" with " <<
l1menu.size() <<
" items from " <<
fn << endl;
265 }
else if(filetype ==
"hltmenu" ) {
268 cout <<
"Loaded HLT menu " << hltmenu.
name() <<
" with " << hltmenu.
size() <<
" chains from " <<
fn << endl;
270 writeJsonFile(hltmenu,
"HLTMenu",
cfg);
271 }
else if(filetype ==
"l1prescale" ) {
274 cout <<
"Loaded L1 prescales set file " <<
fn <<
" with " << l1pss.
size() <<
" prescales from " <<
fn << endl;
275 writeJsonFile(l1pss,
"L1PrescalesSet",
cfg);
276 }
else if(filetype ==
"hltprescale" ) {
279 cout <<
"Loaded HLT prescales set file " <<
fn <<
" with " << hltpss.
size() <<
" prescales from " <<
fn << endl;
281 writeJsonFile(hltpss,
"HLTPrescalesSet",
cfg);
282 }
else if(filetype ==
"bunchgroupset" ) {
285 cout <<
"Loaded L1 BunchGroup set file " <<
fn <<
" with " << bgs.
sizeNonEmpty() <<
" non-empty bunchgroups from " <<
fn << endl;
287 writeJsonFile(bgs,
"BunchGroupSet",
cfg);
288 }
else if(filetype ==
"joboptions" ) {
291 cout <<
"Loaded job options with " << jo.
getObject(
"properties").
getKeys().size() <<
" properties from " <<
fn << endl;
294 for(
const auto&
alg :
ds.data()) {
295 std::cout <<
alg.first << std::endl;
296 for(
const auto& prop :
alg.second ) {
297 std::cout <<
" " << prop.first <<
" -> " << prop.second.data() << std::endl;
301 writeJsonFile(jo,
"HLTJobOptions",
cfg);
302 }
else if(filetype ==
"hltmonitoringsummary" ) {
305 cout <<
"Loaded HLT monnitoring with " <<
mon.size() <<
" signatures from " <<
fn << endl;
306 mon.printMonConfig(
cfg.detail);
307 writeJsonFile(
mon,
"HLTMonitoring",
cfg);
309 cerr <<
"File " <<
fn <<
" not recognized as being an L1 or HLT menu or prescale set or bunchgroup set" << endl;
314 if(
cfg.smk != 0 && !
cfg.doCtp ) {
319 if(!
cfg.crestDb.empty()) {
320 dbloader.setCrestTrigDB(
cfg.crestDb);
321 dbloader.setCrestConnection(
cfg.crestServer,
cfg.crestApi);
331 cout <<
"Could not load L1 menu. An exception occurred: " << ex.
what() << endl;
334 cout <<
"Loaded L1 menu " <<
l1menu.name() <<
" with " <<
l1menu.size() <<
" items from " <<
cfg.dbalias <<
" with SMK " <<
cfg.smk << endl;
349 cout <<
"Could not load HLT menu. An exception occurred: " << ex.
what() << endl;
352 cout <<
"Loaded HLT menu " << hltmenu.
name() <<
" with " << hltmenu.
size() <<
" chains from " <<
cfg.dbalias <<
" with SMK " <<
cfg.smk << endl;
364 if(!
cfg.crestDb.empty()) {
365 dbloader.setCrestTrigDB(
cfg.crestDb);
366 dbloader.setCrestConnection(
cfg.crestServer,
cfg.crestApi);
373 cout <<
"Could not load HLT job options. An exception occurred: " << ex.
what() << endl;
376 cout <<
"Loaded job options with " << jo.
getObject(
"properties").
getKeys().size() <<
" entries from " <<
cfg.dbalias <<
" with SMK " <<
cfg.smk << endl;
379 for(
const auto&
alg :
ds.data()) {
380 std::cout <<
alg.first << std::endl;
381 for(
const auto& prop :
alg.second ) {
382 std::cout <<
" " << prop.first <<
" -> " << prop.second.data() << std::endl;
393 if(!
cfg.crestDb.empty()) {
394 dbloader.setCrestTrigDB(
cfg.crestDb);
395 dbloader.setCrestConnection(
cfg.crestServer,
cfg.crestApi);
402 cout <<
"Could not load HLT monitoring. An exception occurred: " << ex.
what() << endl;
405 cout <<
"Loaded HLT monitoring with " << hltmon.
size() <<
" signatures rom " <<
cfg.dbalias <<
" with SMK " <<
cfg.smk << endl;
415 if(
cfg.smk != 0 &&
cfg.doCtp ) {
420 }
catch (std::format_error &
e){
421 cout <<
" format_error "<<
e.what()<<
" thrown in TriggerMenuRW.\n";
427 if(
cfg.l1psk != 0 ) {
430 if(!
cfg.crestDb.empty()) {
431 dbloader.setCrestTrigDB(
cfg.crestDb);
432 dbloader.setCrestConnection(
cfg.crestServer,
cfg.crestApi);
439 cout <<
"Could not load L1 prescales. An exception occurred: " << ex.
what() << endl;
442 cout <<
"Loaded L1 prescales set " << l1pss.
name() <<
" with " << l1pss.
size() <<
" prescales from " <<
cfg.dbalias <<
" with L1 PSK " <<
cfg.l1psk << endl;
446 if(
cfg.hltpsk != 0 ) {
449 if(!
cfg.crestDb.empty()) {
450 dbloader.setCrestTrigDB(
cfg.crestDb);
451 dbloader.setCrestConnection(
cfg.crestServer,
cfg.crestApi);
458 cout <<
"Could not load HLT prescales. An exception occurred: " << ex.
what() << endl;
461 cout <<
"Loaded HLT prescales set " << hltpss.
name() <<
" with " << hltpss.
size() <<
" prescales from " <<
cfg.dbalias <<
" with HLT PSK " <<
cfg.hltpsk << endl;
465 if(
cfg.bgsk != 0 ) {
468 if(!
cfg.crestDb.empty()) {
469 dbloader.setCrestTrigDB(
cfg.crestDb);
470 dbloader.setCrestConnection(
cfg.crestServer,
cfg.crestApi);
477 cout <<
"Could not load bunchgroup set. An exception occurred: " << ex.
what() << endl;
480 cout <<
"Loaded L1 bunchgroup set " << bgs.
name() <<
" with " << bgs.
size() <<
" bunchgroups from " <<
cfg.dbalias <<
" with BGSK " <<
cfg.bgsk << endl;
DataStructure getObject(const std::string &pathToChild, bool ignoreIfMissing=false) const
Access to configuration object.
bool loadFile(const std::string &filename, boost::property_tree::ptree &data, const std::string &pathToChild="") const
Load content of json file into a ptree.
std::size_t size() const
Accessor to the number of HLT monitoring chains.
std::vector< std::string > getKeys() const
Access to the keys of an DataStructure which presents a dictionary.
virtual const std::string & name() const final
std::size_t size() const
number of HLT prescales
std::size_t size() const
Accessor to the number of defined bunchgroups.
std::size_t sizeNonEmpty() const
Accessor to the number of non-empty bunchgroups.
std::string getFileType(const std::string &filename) const
Checks the trigger level of a given json file.
Loader of trigger menu configurations from the database.
void printSummary(bool detailed=false) const
print a more or less detailed summary
void printPrescaleSet(bool full) const
Loader of trigger configurations from Json files.
Loader of trigger configurations from Json files.
Base class for Trigger configuration data and wrapper around underlying representation.
HLT monitoring configuration.
void printMonConfig(bool full=false) const
print overview of L1 Menu
std::size_t size() const
number of L1 prescales
virtual const char * what() const noexcept
Loader of trigger configurations from Json files.
Loader of trigger configurations from Json files.
Loader of trigger configurations from Json files.
Loader of trigger configurations from Json files.