34 auto tool =
getGroup(
"TrigHLTMonitor");
52 for(
size_t i = 0; i<isPassed.size(); i++) {
55 L1Events = L1items[i];
67 std::map<std::string,std::string> streams;
68 streams.insert(std::make_pair(
"HLT_AllChains",
"HLT_.*"));
69 streams.insert(std::make_pair(
"HLT_Electrons",
"HLT_[0-9]*e[0-9]+.*"));
70 streams.insert(std::make_pair(
"HLT_Gamma",
"HLT_[0-9]*g[0-9]+.*"));
71 streams.insert(std::make_pair(
"HLT_Muons",
"HLT_[0-9]*mu[0-9]+.*"));
72 streams.insert(std::make_pair(
"HLT_Taus",
"HLT_(tau[0-9]*|trk.*Tau).*"));
73 streams.insert(std::make_pair(
"HLT_MissingET",
"HLT_(t|x)e[0-9]+.*"));
74 streams.insert(std::make_pair(
"HLT_Jets",
"HLT_[0-9]*j[0-9]+.*"));
75 streams.insert(std::make_pair(
"HLT_MinBias",
"HLT_mb.*"));
81 std::vector<int> roiN;
84 std::map<std::string,std::string>::const_iterator strItr;
86 for (strItr=streams.begin();strItr!=streams.end(); ++strItr){
87 std::string signaturename = strItr->first;
88 std::string thisregex = strItr->second;
91 std::string toolname =
"Trig"+signaturename+
"Monitor";
96 std::string histname_raw = signaturename+
"RAW";
97 std::string histname_ps = signaturename+
"PS";
102 std::string histname_eta=signaturename+
"_eta";
103 std::string histname_phi=signaturename+
"_phi";
110 std::string histname_roiN=signaturename+
"RoI_N";
114 ATH_MSG_DEBUG(
"Filling HLT" << signaturename <<
" and RoI information for " << thisregex );
117 const std::vector<std::string> chainNames = group->getListOfTriggers();
120 for(
size_t i=0; i<isPassed.size(); i++) {
122 const std::string& chain = chainNames[i];
133 prescale = c->prescale();
136 ATH_MSG_WARNING(
"No chain found in trigDecTool->ExperimentalAndExpertMethods().getChainConfigurationDetails(" << chain <<
"). Using prescale 0");
140 ATH_MSG_DEBUG(
"HLT_PS: " << chain <<
" has PS = " << prescale);
159 RoI_eta = roi->
eta();
160 RoI_phi = roi->
phi();
182 ATH_MSG_WARNING(
"TrigRoiDescriptorCollection for chain " << chain <<
" is not valid");
207 ATH_MSG_DEBUG(
"Finalizing the TrigHLTMonitorAlgorithm..." );
208 return StatusCode::SUCCESS;
215 StatusCode sc_hltEvents = StatusCode::FAILURE;
216 StatusCode sc_onlineKeys = StatusCode::FAILURE;
217 StatusCode sc_eventKeys = StatusCode::FAILURE;
228 sc_hltEvents = StatusCode::SUCCESS;
231 sc_onlineKeys = StatusCode::SUCCESS;
238 sc_eventKeys = StatusCode::SUCCESS;
248 uint32_t bskeys_1 = 9999; uint32_t bskeys_2 = 9999;
253 auto tool =
getGroup(
"TrigHLTMonitor");
256 if(sc_onlineKeys == StatusCode::SUCCESS) {
257 bskeys_1 = onlineKeys->smk();
258 bskeys_2 = onlineKeys->hltpsk();
259 ATH_MSG_DEBUG(
"TrigConfKeysOnline: SMK = bskeys_1 = " << bskeys_1 <<
", HLTPSK = bskeys_2 = " << bskeys_2);
263 ConfigConsistency_HLT=7;
264 fill(tool,ConfigConsistency_HLT);
267 ATH_MSG_DEBUG(
"No online keys, reverting to default 0: SMK = bskeys_1 = " << bskeys_1 <<
", HLTPSK = bskeys_2 = " << bskeys_2);
272 uint32_t bskeys[] = {bskeys_1, bskeys_2};
275 if(sc_eventKeys == StatusCode::SUCCESS) {
276 dbkeys[0] = eventKeys->smk();
277 dbkeys[1] = eventKeys->hltpsk();
279 ATH_MSG_DEBUG(
"TrigConfKeys: SMK = dbkeys[0] = " << dbkeys[0] <<
", HLTPSK = dbkeys[1] = " << dbkeys[1]);
283 ConfigConsistency_HLT=8;
284 fill(tool,ConfigConsistency_HLT);
287 ATH_MSG_DEBUG(
"No event keys, reverting to default 0: SMK = dbkeys[0] = " << dbkeys[0] <<
", HLTPSK = dbkeys[1] = " << dbkeys[0]);
290 for(
int i = 0; i < 2; ++i) {
291 ATH_MSG_DEBUG(
"i = " << i <<
", dbkeys[" << i <<
"] = " << dbkeys[i] <<
", bskeys[" << i <<
"] = " << bskeys[i]);
293 ConfigConsistency_HLT=3*i+1;
294 fill(tool,ConfigConsistency_HLT);
295 ATH_MSG_DEBUG(
"dbkeys[" << i <<
"] = 0, ConfigConsistency_HLT=" << ConfigConsistency_HLT);
298 ConfigConsistency_HLT=3*i+2;
299 fill(tool,ConfigConsistency_HLT);
300 ATH_MSG_DEBUG(
"bskeys[" << i <<
"] = 0, ConfigConsistency_HLT=" << ConfigConsistency_HLT);
302 if(dbkeys[i]!=bskeys[i]) {
303 ConfigConsistency_HLT=3*i+3;
304 fill(tool,ConfigConsistency_HLT);
305 ATH_MSG_DEBUG(
"dbkeys[" << i <<
"]!=bskeys[" << i <<
"], ConfigConsistency_HLT=" << ConfigConsistency_HLT);
314 HLTEvents = (int)sc_hltEvents.isSuccess();
315 fill(tool,HLTEvents);
317 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
virtual StatusCode initialize() override
initialize
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Tool to tell whether a specific trigger is passed.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual bool isFullscan() const override final
is this a full scan RoI?
virtual double phi() const override final
Methods to retrieve data members.
virtual double eta() const override final
virtual bool isValid() override final
Can the handle be successfully dereferenced?
HLT chain configuration information.
SG::ReadHandleKey< xAOD::TrigConfKeys > m_eventKey
virtual StatusCode initialize() override
initialize
TrigHLTMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
SG::ReadHandleKey< xAOD::TrigConfKeys > m_onlineKey
ServiceHandle< TrigConf::ITrigConfigSvc > m_trigConfigSvc
virtual ~TrigHLTMonitorAlgorithm()
StatusCode fillResultAndConsistencyHistograms(const EventContext &ctx) const
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
std::vector< bool > isPassedForEach(unsigned int condition=TrigDefs::Physics) const
return vector with isPassed decision for each chain
std::vector< std::string > getListOfTriggers() const
FeatureRequestDescriptor & setCondition(const unsigned int condition)
Set the Condition: TrigDefs::Physics - (default), only returns features from paths through the naviga...
FeatureRequestDescriptor & setLinkName(const std::string &navElementLinkKey)
Set the Link Name Key.
FeatureRequestDescriptor & setChainGroup(const std::string &chainGroupName)
Set the desired Chain or Chain Group.
FeatureRequestDescriptor & setRestrictRequestToLeg(const int restrictToLegIndex)
Set to -1 by default, indicating that all legs of multi-leg chains are searched.
Workaround x86 precision issues for FP inequality comparisons.
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Generic monitoring tool for athena components.
const std::string & initialRoIString()
static const unsigned int requireDecision
static const unsigned int Physics
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
void fill(H5::Group &out_file, size_t iterations)