ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDecisionMaker.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5*/
6
7/**************************************************************************
8 **
9 ** File: TrigDecisionMaker.h
10 **
11 ** Description: - Algorithm-derived class to run after the Steering
12 ** - Finds the list of defined signatures at initialization
13 ** - For each event:
14 ** * Creates a TriggerDecision object
15 ** * Fills it with the outcome of each defined signature
16 ** * Stores it in StoreGate to be written to ESD/AOD
17 **
18 * @author Nicolas Berger <Nicolas.Berger@cern.ch> - CERN
19 * @author Till Eifert <Till.Eifert@cern.ch> - U. of Geneva, Switzerland
20 * @author Ricardo Goncalo <Jose.Goncalo@cern.ch> - Royal Holloway, U. of London
21 **
22 ** Created: Tue May 09 14:55:56 GMT 2006
23 ** Modified:
24 **
25 **************************************************************************/
26#ifndef TrigDecisionMaker_TrigDecisionMaker_H
27#define TrigDecisionMaker_TrigDecisionMaker_H
28
30
31#include "GaudiKernel/ServiceHandle.h"
32#include "GaudiKernel/ToolHandle.h"
33
39
40#include <vector>
41#include <string>
42#include <atomic>
43
44namespace HLT {
45 class HLTResult;
46}
47
48namespace LVL1CTP {
49 class Lvl1Result;
50}
51
52namespace TrigDec {
53
71 {
72
74 enum TrigLevel {L1=1, L2, EF, HLT};
75
76 public:
77
78 TrigDecisionMaker(const std::string &name, ISvcLocator *pSvcLocator);
79 virtual ~TrigDecisionMaker();
80
81 // IAlgorithm virtual methods to implement
82 virtual StatusCode initialize() override;
83 virtual StatusCode execute(const EventContext& ctx) const override;
84 virtual StatusCode finalize() override;
85
86 ResultStatus getL1Result (const LVL1CTP::Lvl1Result*& result, const EventContext& ctx) const;
87 ResultStatus getHLTResult(const HLT::HLTResult*& result, TrigLevel level, const EventContext& ctx) const;
88
89 private:
90
91 Gaudi::Property<bool> m_doL1{this, "doL1", true, "flag whether or not to consider L1 trigger information"};
92 Gaudi::Property<bool> m_doL2{this, "doL2", true, "flag whether or not to consider L2 trigger information"};
93 Gaudi::Property<bool> m_doEF{this, "doEF", true, "flag whether or not to consider L3 (EF) trigger information"};
94 Gaudi::Property<bool> m_doHLT{this, "doHLT", true, "flag whether or not to consider merged L2EF=HLT trigger information"};
95
96 SG::ReadCondHandleKey<TrigConf::L1BunchGroupSet> m_bgKey{this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"};
97 SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"};
98 SG::WriteHandleKey<TrigDecision> m_trigDecisionKey{this, "TrigDecisionKey", "TrigDecision", "SG key to save the TrigDecision object" };
99 SG::ReadHandleKey<ROIB::RoIBResult> m_l1roibResultKey{this, "L1ROIBResultKey", "RoIBResult", "SK key to retrieve the L1 ROIB result from SG" };
100 SG::ReadHandleKey<LVL1CTP::Lvl1Result> m_l1ResultKey{this, "L1ResultKey", "Lvl1Result", "SK key to retrieve the L1 result from SG" };
101 SG::ReadHandleKey<HLT::HLTResult> m_l2ResultKey{this, "L2ResultKey", "HLTResult_L2", "SK key to retrieve the L2 result from SG" };
102 SG::ReadHandleKey<HLT::HLTResult> m_efResultKey{this, "EFResultKey", "HLTResult_EF", "SK key to retrieve the EF result from SG" };
103 SG::ReadHandleKey<HLT::HLTResult> m_hltResultKey{this, "HLTResultKey", "HLTResult_HLT", " SK key to retrieve the merged HLT result from SG" };
104
105 ToolHandle<HLT::ILvl1ResultAccessTool> m_lvl1Tool{this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"};
106
107 // For statistics
108 mutable std::atomic<unsigned int> m_nEvents;
109 mutable std::atomic<unsigned int> m_l1_error, m_l2_error, m_ef_error, m_hlt_error, m_td_error, m_td_skip;
110 mutable std::atomic<unsigned int> m_l1_notFound, m_l2_notFound, m_ef_notFound, m_hlt_notFound;
111 mutable std::atomic<unsigned int> m_l1_notReq, m_l2_notReq, m_ef_notReq, m_hlt_notReq;
112 mutable std::atomic<unsigned int> m_l1_passed, m_l2_passed, m_ef_passed, m_hlt_passed;
113 };
114}
115
116#endif
An algorithm that can be simultaneously executed in multiple threads.
HLT::HLTResult is sumarising result of trigger decision evaluation (online/offline) It contains basic...
Definition HLTResult.h:51
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
virtual StatusCode finalize() override
std Gaudi finalize method -> print out statistics
SG::ReadHandleKey< ROIB::RoIBResult > m_l1roibResultKey
std::atomic< unsigned int > m_l2_error
SG::ReadHandleKey< HLT::HLTResult > m_l2ResultKey
std::atomic< unsigned int > m_ef_notFound
std::atomic< unsigned int > m_nEvents
statistics: number of processed events
std::atomic< unsigned int > m_td_skip
statistics: error numbers
std::atomic< unsigned int > m_l2_passed
Gaudi::Property< bool > m_doHLT
std::atomic< unsigned int > m_ef_error
virtual StatusCode initialize() override
std Gaudi initialize method -> read-in trigger configuration
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
std::atomic< unsigned int > m_hlt_error
Gaudi::Property< bool > m_doEF
std::atomic< unsigned int > m_hlt_notReq
statistics: number of events where something was not requested
SG::ReadHandleKey< HLT::HLTResult > m_hltResultKey
std::atomic< unsigned int > m_l1_notReq
std::atomic< unsigned int > m_l1_error
virtual StatusCode execute(const EventContext &ctx) const override
std Gaudi execute method -> fill event-wise TrigDecision object, save in SG
TrigDecisionMaker(const std::string &name, ISvcLocator *pSvcLocator)
std Gaudi Algorithm constructor
ResultStatus getHLTResult(const HLT::HLTResult *&result, TrigLevel level, const EventContext &ctx) const
retrieve HLT results (called in execute)
std::atomic< unsigned int > m_hlt_notFound
statistics: number of events where L1, HLT results were not found
std::atomic< unsigned int > m_hlt_passed
statistics: number of events that passed the given trigger lvl
std::atomic< unsigned int > m_l2_notReq
std::atomic< unsigned int > m_ef_notReq
SG::ReadHandleKey< HLT::HLTResult > m_efResultKey
SG::ReadHandleKey< LVL1CTP::Lvl1Result > m_l1ResultKey
Gaudi::Property< bool > m_doL2
SG::WriteHandleKey< TrigDecision > m_trigDecisionKey
std::atomic< unsigned int > m_l1_passed
Gaudi::Property< bool > m_doL1
ToolHandle< HLT::ILvl1ResultAccessTool > m_lvl1Tool
tool to ease the access to the L1 results (RoIs, items, etc)
virtual ~TrigDecisionMaker()
std deconstructor
ResultStatus getL1Result(const LVL1CTP::Lvl1Result *&result, const EventContext &ctx) const
retrieve LVL1 result (called in execute)
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgKey
std::atomic< unsigned int > m_l1_notFound
std::atomic< unsigned int > m_td_error
std::atomic< unsigned int > m_l2_notFound
std::atomic< unsigned int > m_ef_passed
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...