ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrigConf::LVL1ConfigSvc Class Reference

Service storing the LVL1 menu in the DetectorStore. More...

#include <LVL1ConfigSvc.h>

Inheritance diagram for TrigConf::LVL1ConfigSvc:
Collaboration diagram for TrigConf::LVL1ConfigSvc:

Public Member Functions

 LVL1ConfigSvc (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Private Member Functions

StatusCode loadRun3StyleMenu ()
 

Private Attributes

Gaudi::Property< std::string > m_inputType
 
Gaudi::Property< std::string > m_l1FileName
 
Gaudi::Property< std::string > m_hltFileName
 
Gaudi::Property< std::string > m_dbConnection
 
Gaudi::Property< unsigned int > m_smk
 

Detailed Description

Service storing the LVL1 menu in the DetectorStore.

Definition at line 17 of file LVL1ConfigSvc.h.

Constructor & Destructor Documentation

◆ LVL1ConfigSvc()

TrigConf::LVL1ConfigSvc::LVL1ConfigSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 18 of file LVL1ConfigSvc.cxx.

18  :
19  AthService(name, pSvcLocator)
20 {}

Member Function Documentation

◆ initialize()

StatusCode TrigConf::LVL1ConfigSvc::initialize ( )
overridevirtual

Definition at line 70 of file LVL1ConfigSvc.cxx.

71 {
72  // Handle to JobOptionsSvc to retrieve configuration keys
73  if (auto joSvc = serviceLocator()->service<TrigConf::IJobOptionsSvc>("JobOptionsSvc")) {
74  if (joSvc->superMasterKey() > 0) {
75  m_inputType = "DB";
76  m_smk = joSvc->superMasterKey();
77  m_dbConnection = joSvc->server();
78  }
79  }
80  else {
81  ATH_MSG_DEBUG("Did not locate TrigConf::JobOptionsSvc, not running athenaHLT");
82  }
83 
84  ATH_MSG_INFO("Loading L1 trigger menu from:");
86  if (m_inputType == "FILE") {
88  }
89  else if (m_inputType == "DB") {
92  }
93 
95 
96  return StatusCode::SUCCESS;
97 }

◆ loadRun3StyleMenu()

StatusCode TrigConf::LVL1ConfigSvc::loadRun3StyleMenu ( )
private

Definition at line 22 of file LVL1ConfigSvc.cxx.

23 {
24  auto l1menu = std::make_unique<TrigConf::L1Menu>();
25 
26  if (m_inputType == "DB") {
27  // load l1menu
29  dbmenuloader.setLevel(TrigConf::MSGTC::WARNING);
30  ATH_CHECK( dbmenuloader.loadL1Menu(m_smk, *l1menu) );
31 
32  }
33  else if (m_inputType == "FILE") {
34  // json file menu loader
35  TrigConf::JsonFileLoader fileLoader;
37 
38  ATH_CHECK( fileLoader.loadFile(m_l1FileName, *l1menu) );
39 
40  uint32_t smk = m_smk.value();
41  if (!m_hltFileName.empty() && smk == 0u) {
42  auto hltmenu = std::make_unique<TrigConf::HLTMenu>();
43  const bool status = fileLoader.loadFile(m_hltFileName, *hltmenu);
44  if (status) {
45  smk = TrigConf::truncatedHash(*l1menu, *hltmenu);
46  } else {
47  ATH_MSG_DEBUG("No HLT menu created, cannot compute a MC-SMK in this job");
48  }
49  }
50  ATH_MSG_INFO("Setting file-loaded L1 Menu SMK to:" << smk);
51  l1menu->setSMK(smk); // allow assigning a specified or hashed SMK when running from FILE
52 
53 
54  }
55  else {
56  ATH_MSG_ERROR("Unknown input type '" << m_inputType
57  << "'. Allowed values: " << m_inputType.documentation());
58  return StatusCode::FAILURE;
59  }
60 
61  ServiceHandle<StoreGateSvc> detStore("StoreGateSvc/DetectorStore", name());
62  ATH_CHECK(detStore.retrieve());
63  if (detStore->record(std::move(l1menu), "L1TriggerMenu").isSuccess()) {
64  ATH_MSG_INFO("Recorded L1 menu as 'L1TriggerMenu' in detector store");
65  }
66 
67  return StatusCode::SUCCESS;
68 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

Member Data Documentation

◆ m_dbConnection

Gaudi::Property<std::string> TrigConf::LVL1ConfigSvc::m_dbConnection
private
Initial value:
{this, "TriggerDB", "TRIGGERDB",
"DB connection alias, needed if InputType is DB"}

Definition at line 37 of file LVL1ConfigSvc.h.

◆ m_hltFileName

Gaudi::Property<std::string> TrigConf::LVL1ConfigSvc::m_hltFileName
private
Initial value:
{this, "HLTJsonFileName", "",
"file name of HLT json file, needed if InputType is FILE and a hashed SMK needs to be computed"}

Definition at line 34 of file LVL1ConfigSvc.h.

◆ m_inputType

Gaudi::Property<std::string> TrigConf::LVL1ConfigSvc::m_inputType
private
Initial value:
{this, "InputType", "FILE",
"FILE (json file), DB (Trigger DB)"}

Definition at line 28 of file LVL1ConfigSvc.h.

◆ m_l1FileName

Gaudi::Property<std::string> TrigConf::LVL1ConfigSvc::m_l1FileName
private
Initial value:
{this, "L1JsonFileName", "",
"file name of L1 json file, needed if InputType is FILE"}

Definition at line 31 of file LVL1ConfigSvc.h.

◆ m_smk

Gaudi::Property<unsigned int> TrigConf::LVL1ConfigSvc::m_smk
private
Initial value:
{this, "SMK", 0,
"DB smk, needed if InputType is DB"}

Definition at line 40 of file LVL1ConfigSvc.h.


The documentation for this class was generated from the following files:
AthService::AthService
AthService()
TrigConf::LVL1ConfigSvc::m_inputType
Gaudi::Property< std::string > m_inputType
Definition: LVL1ConfigSvc.h:28
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigConf::JsonFileLoader::loadFile
bool loadFile(const std::string &filename, boost::property_tree::ptree &data, const std::string &pathToChild="") const
Load content of json file into a ptree.
Definition: JsonFileLoader.cxx:45
RunEBWeightsComputation.smk
smk
Definition: RunEBWeightsComputation.py:87
TrigConf::LVL1ConfigSvc::m_dbConnection
Gaudi::Property< std::string > m_dbConnection
Definition: LVL1ConfigSvc.h:37
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
TrigConf::LVL1ConfigSvc::m_smk
Gaudi::Property< unsigned int > m_smk
Definition: LVL1ConfigSvc.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigConf::LVL1ConfigSvc::loadRun3StyleMenu
StatusCode loadRun3StyleMenu()
Definition: LVL1ConfigSvc.cxx:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigConf::JsonFileLoader::setLevel
void setLevel(MSGTC::Level lvl)
Definition: JsonFileLoader.h:86
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TrigConf::truncatedHash
uint32_t truncatedHash(const DataStructure &dataStructure)
Function to compute a truncated MD5 hash for a JSON file.
Definition: TrigConfMD5.cxx:23
TrigConf::LVL1ConfigSvc::m_hltFileName
Gaudi::Property< std::string > m_hltFileName
Definition: LVL1ConfigSvc.h:34
TrigConf::LVL1ConfigSvc::m_l1FileName
Gaudi::Property< std::string > m_l1FileName
Definition: LVL1ConfigSvc.h:31
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
merge.status
status
Definition: merge.py:17
TrigConf::JsonFileLoader
Loader of trigger configurations from Json files.
Definition: JsonFileLoader.h:25
TrigConf::TrigDBMenuLoader
Loader of trigger menu configurations from the database.
Definition: TrigDBMenuLoader.h:30
ServiceHandle< StoreGateSvc >
TrigConf::MSGTC::WARNING
@ WARNING
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:26