284 if( ! gConfig.
fix ) {
289 if(fixableFolders.size()==0) {
290 cout << endl <<
"All folders are properly filled. Exiting ..." << endl;
301 set<unsigned int> selectForFixing;
306 cout << endl <<
" 0 ... exit" << endl;
308 for(
const string &
f : fixableFolders) {
309 if(selectForFixing.count(
idx)>0) {
310 cout <<
" * " << ++
idx <<
" ... " <<
f << endl;
312 cout <<
" " << ++
idx <<
" ... " <<
f << endl;
315 cout << endl <<
" a ... select/deselect all" << endl;
316 cout << endl <<
" e ... " << (gConfig.
extendedSelection ?
"disallow" :
"allow") <<
" multiversion folder selection (clears selection)" << endl;
317 cout << endl <<
" f ... fix now" << endl;
318 cout << endl << endl <<
"Select/deselect folder to fix or other option : "; cin >>
selection;
323 bool allSelected = (fixableFolders.size() == selectForFixing.size());
325 selectForFixing.clear();
327 for(
unsigned int selInd = 0; selInd<fixableFolders.size();selInd++)
328 selectForFixing.insert(selInd);
336 selectForFixing.clear();
339 unsigned int selInd = boost::lexical_cast<unsigned int,string>(
selection) - 1;
340 if(selectForFixing.count(selInd)) {
341 selectForFixing.erase(selInd);
343 selectForFixing.insert(selInd);
355 cout << endl <<
"Exiting ..." << endl;
359 if(selectForFixing.empty()) {
360 cout << endl <<
"Nothing selected. Exiting ..." << endl;
364 vector<string> foldersToFix;
365 for(
unsigned int idx=0;
idx!=fixableFolders.size();
idx++) {
366 if(selectForFixing.count(
idx)>0)
367 foldersToFix.push_back(fixableFolders[
idx]);
371 cout << endl <<
"Folders for fixing:";
372 for(
const string &
f : foldersToFix)
378 bool loadL1(
false), loadHLT(
false), loadBGSK(
false), loadL1PSK(
false), loadHLTPSK(
false), saveConfigSource(
false);
379 for(
const string & folderToFix : foldersToFix) {
382 ( folderToFix ==
"/TRIGGER/LVL1/Menu") ||
383 ( folderToFix ==
"/TRIGGER/LVL1/ItemDef") ||
384 ( folderToFix ==
"/TRIGGER/LVL1/Thresholds") ||
385 ( folderToFix ==
"/TRIGGER/LVL1/CTPCoreInputMapping") ||
386 ( folderToFix ==
"/TRIGGER/LVL1/BunchGroupDescription");
389 ( folderToFix ==
"/TRIGGER/HLT/HltConfigKeys") ||
390 ( folderToFix ==
"/TRIGGER/HLT/Menu") ||
391 ( folderToFix ==
"/TRIGGER/HLT/Groups");
394 ( folderToFix ==
"/TRIGGER/LVL1/BunchGroupKey") ||
395 ( folderToFix ==
"/TRIGGER/LVL1/BunchGroupContent") ||
396 ( folderToFix ==
"/TRIGGER/LVL1/BunchGroupDescription");
399 ( folderToFix ==
"/TRIGGER/LVL1/Lvl1ConfigKey") ||
400 ( folderToFix ==
"/TRIGGER/LVL1/Prescales");
403 ( folderToFix ==
"/TRIGGER/HLT/PrescaleKey") ||
404 ( folderToFix ==
"/TRIGGER/HLT/Prescales");
407 ( folderToFix ==
"/TRIGGER/HLT/HltConfigKeys");
412 if( (loadL1 || loadHLT) && gConfig.
smk==0)
415 if( loadBGSK && gConfig.
bgsk==0)
418 if( loadL1PSK && gConfig.
l1psk==0)
421 if( loadHLTPSK && gConfig.
hltpsk==0) {
422 string prompt =
"Please specify HLT Prescaleset key";
424 prompt +=
" (starting at LB " + lexical_cast<string,int>(gConfig.
lb) +
"): ";
431 if( saveConfigSource && gConfig.
release==
"")
446 ctpConfig->setSMK( gConfig.
smk );
447 sm->menuLoader().setEnv(IMenuLoader::CTPOnl);
448 cout << endl << endl <<
"Retrieving Lvl1 CTP configuration" << endl;
449 sm->masterTableLoader().setLevel(gConfig.
outputlevel);
450 sm->masterTableLoader().load(*ctpConfig);
456 cout << endl << endl <<
"Retrieving HLT menu configuration" << endl;
458 hltFrame->setSMK( gConfig.
smk );
459 sm->hltFrameLoader().load(*hltFrame);
465 cout << endl << endl <<
"Retrieving Lvl1 Bunchgroup set configuration" << endl;
467 bgs->setId(gConfig.
bgsk);
468 sm->bunchGroupSetLoader().load(*bgs);
474 cout << endl << endl <<
"Retrieving L1 prescales" << endl;
476 l1pss->setId(gConfig.
l1psk);
477 sm->prescaleSetLoader().load(ctpConfig->ctpVersion(), *l1pss);
483 cout << endl << endl <<
"Retrieving HLT prescales" << endl;
485 hltpss->setId(gConfig.
hltpsk);
486 sm->hltPrescaleSetLoader().load(*hltpss);
499 cout <<
"Writing cool to destination " << gConfig.
coolConnection << endl;
519 for(
const string & folderToFix : foldersToFix) {
520 if( folderToFix ==
"/TRIGGER/LVL1/BunchGroupKey" ||
521 folderToFix ==
"/TRIGGER/LVL1/BunchGroupContent") {
526 if(loadBGSK && doWrite) {
531 for(
const string & folderToFix : foldersToFix) {
532 if( folderToFix ==
"/TRIGGER/LVL1/BunchGroupDescription") {
533 if(ctpConfig && bgs) {
549 for(
const string & folderToFix : foldersToFix) {
550 if( folderToFix ==
"/TRIGGER/LVL1/Lvl1ConfigKey" ||
551 folderToFix ==
"/TRIGGER/LVL1/Prescales") {
556 if(loadL1PSK && doWrite) {
572 for(
const string & folderToFix : foldersToFix) {
573 if( folderToFix ==
"/TRIGGER/HLT/PrescaleKey" ||
574 folderToFix ==
"/TRIGGER/HLT/Prescales") {
579 if(hltpss && doWrite) {
591 for(
const string & folderToFix : foldersToFix) {
592 if( folderToFix ==
"/TRIGGER/LVL1/Menu" ||
593 folderToFix ==
"/TRIGGER/LVL1/ItemDef" ||
594 folderToFix ==
"/TRIGGER/LVL1/Thresholds" ||
595 folderToFix ==
"/TRIGGER/LVL1/CTPCoreInputMapping") {
600 if(ctpConfig && doWrite) {
613 for(
const string & folderToFix : foldersToFix) {
614 if( folderToFix ==
"/TRIGGER/HLT/Menu" ||
615 folderToFix ==
"/TRIGGER/HLT/Groups" ||
616 folderToFix ==
"/TRIGGER/HLT/HltConfigKeys" ) {
622 if(hltFrame && doWrite) {
623 string configSource =
"TRIGGERDBR2," + gConfig.
release +
",AtlasP1HLT";