ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDec::TrigDecisionMaker Class Reference

Note: Legacy class. More...

#include <TrigDecisionMaker.h>

Inheritance diagram for TrigDec::TrigDecisionMaker:
Collaboration diagram for TrigDec::TrigDecisionMaker:

Public Member Functions

 TrigDecisionMaker (const std::string &name, ISvcLocator *pSvcLocator)
 std Gaudi Algorithm constructor
virtual ~TrigDecisionMaker ()
 std deconstructor
virtual StatusCode initialize () override
 std Gaudi initialize method -> read-in trigger configuration
virtual StatusCode execute (const EventContext &ctx) const override
 std Gaudi execute method -> fill event-wise TrigDecision object, save in SG
virtual StatusCode finalize () override
 std Gaudi finalize method -> print out statistics
ResultStatus getL1Result (const LVL1CTP::Lvl1Result *&result, const EventContext &ctx) const
 retrieve LVL1 result (called in execute)
ResultStatus getHLTResult (const HLT::HLTResult *&result, TrigLevel level, const EventContext &ctx) const
 retrieve HLT results (called in execute)
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum  ResultStatus {
  Unknown , OK , NotRequested , NotFound ,
  SGError , ProcError
}
enum  TrigLevel { L1 =1 , L2 , EF , HLT }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< bool > m_doL1 {this, "doL1", true, "flag whether or not to consider L1 trigger information"}
Gaudi::Property< bool > m_doL2 {this, "doL2", true, "flag whether or not to consider L2 trigger information"}
Gaudi::Property< bool > m_doEF {this, "doEF", true, "flag whether or not to consider L3 (EF) trigger information"}
Gaudi::Property< bool > m_doHLT {this, "doHLT", true, "flag whether or not to consider merged L2EF=HLT trigger information"}
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSetm_bgKey {this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"}
SG::ReadHandleKey< TrigConf::HLTMenum_HLTMenuKey {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"}
SG::WriteHandleKey< TrigDecisionm_trigDecisionKey {this, "TrigDecisionKey", "TrigDecision", "SG key to save the TrigDecision object" }
SG::ReadHandleKey< ROIB::RoIBResultm_l1roibResultKey {this, "L1ROIBResultKey", "RoIBResult", "SK key to retrieve the L1 ROIB result from SG" }
SG::ReadHandleKey< LVL1CTP::Lvl1Resultm_l1ResultKey {this, "L1ResultKey", "Lvl1Result", "SK key to retrieve the L1 result from SG" }
SG::ReadHandleKey< HLT::HLTResultm_l2ResultKey {this, "L2ResultKey", "HLTResult_L2", "SK key to retrieve the L2 result from SG" }
SG::ReadHandleKey< HLT::HLTResultm_efResultKey {this, "EFResultKey", "HLTResult_EF", "SK key to retrieve the EF result from SG" }
SG::ReadHandleKey< HLT::HLTResultm_hltResultKey {this, "HLTResultKey", "HLTResult_HLT", " SK key to retrieve the merged HLT result from SG" }
ToolHandle< HLT::ILvl1ResultAccessToolm_lvl1Tool {this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"}
 tool to ease the access to the L1 results (RoIs, items, etc)
std::atomic< unsigned int > m_nEvents
 statistics: number of processed events
std::atomic< unsigned int > m_l1_error
std::atomic< unsigned int > m_l2_error
std::atomic< unsigned int > m_ef_error
std::atomic< unsigned int > m_hlt_error
std::atomic< unsigned int > m_td_error
std::atomic< unsigned int > m_td_skip
 statistics: error numbers
std::atomic< unsigned int > m_l1_notFound
std::atomic< unsigned int > m_l2_notFound
std::atomic< unsigned int > m_ef_notFound
std::atomic< unsigned int > m_hlt_notFound
 statistics: number of events where L1, HLT results were not found
std::atomic< unsigned int > m_l1_notReq
std::atomic< unsigned int > m_l2_notReq
std::atomic< unsigned int > m_ef_notReq
std::atomic< unsigned int > m_hlt_notReq
 statistics: number of events where something was not requested
std::atomic< unsigned int > m_l1_passed
std::atomic< unsigned int > m_l2_passed
std::atomic< unsigned int > m_ef_passed
std::atomic< unsigned int > m_hlt_passed
 statistics: number of events that passed the given trigger lvl
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Note: Legacy class.

Used to process Run 1 and Run 2 RAW data.

  • Algorithm-derived class to run after the Steering
  • Finds the list of defined signatures at initialization
  • For each event:
    • Creates a TriggerDecision object
    • Fills it with the outcome of each defined signature
    • Stores it in StoreGate to be written to ESD/AOD
See also
TrigDecisionMakerMT
Author
Nicolas Berger Nicol.nosp@m.as.B.nosp@m.erger.nosp@m.@cer.nosp@m.n.ch - CERN
Till Eifert Till..nosp@m.Eife.nosp@m.rt@ce.nosp@m.rn.c.nosp@m.h - U. of Geneva, Switzerland
Ricardo Goncalo Jose..nosp@m.Gonc.nosp@m.alo@c.nosp@m.ern..nosp@m.ch - Royal Holloway, U. of London
Tomasz Bold Tomas.nosp@m.z.Bo.nosp@m.ld@ce.nosp@m.rn.c.nosp@m.h - UC Irvine - AGH-UST Krakow

Definition at line 70 of file TrigDecisionMaker.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ ResultStatus

◆ TrigLevel

Constructor & Destructor Documentation

◆ TrigDecisionMaker()

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

std Gaudi Algorithm constructor

Definition at line 35 of file TrigDecisionMaker.cxx.

36 : AthReentrantAlgorithm(name, pSvcLocator),
37 m_nEvents(0),
39 m_hlt_error(0),
40 m_td_error(0), m_td_skip(0),
44 m_hlt_notReq(0),
47{
48}
std::atomic< unsigned int > m_l2_error
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
std::atomic< unsigned int > m_ef_error
std::atomic< unsigned int > m_hlt_error
std::atomic< unsigned int > m_hlt_notReq
statistics: number of events where something was not requested
std::atomic< unsigned int > m_l1_notReq
std::atomic< unsigned int > m_l1_error
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
std::atomic< unsigned int > m_l1_passed
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

◆ ~TrigDecisionMaker()

TrigDecisionMaker::~TrigDecisionMaker ( )
virtual

std deconstructor

Definition at line 51 of file TrigDecisionMaker.cxx.

51{}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TrigDecisionMaker::execute ( const EventContext & ctx) const
overridevirtual

std Gaudi execute method -> fill event-wise TrigDecision object, save in SG

Definition at line 140 of file TrigDecisionMaker.cxx.

141{
142 // increment event counter
143 m_nEvents++;
144
145 // Retrieve the results
146 const LVL1CTP::Lvl1Result* l1Result = 0;
147 const HLT::HLTResult* l2Result = 0;
148 const HLT::HLTResult* efResult = 0;
149 const HLT::HLTResult* hltResult = 0;
150
151 ResultStatus l1Stat = getL1Result(l1Result, ctx);
152 if (!l1Result) {
153 if (l1Stat == NotRequested ) m_l1_notReq++;
154 else if (l1Stat == SGError || l1Stat == ProcError) m_l1_error++;
155 else if (l1Stat == NotFound) m_l1_notFound++;
156 }
157 else if (l1Result->isAccepted()) m_l1_passed++;
158
159 ResultStatus l2Stat = getHLTResult(l2Result, L2, ctx);
160 if (!l2Result) {
161 if (l2Stat == NotRequested ) m_l2_notReq++;
162 else if (l2Stat == SGError || l2Stat == ProcError) m_l2_error++;
163 else if (l2Stat == NotFound) m_l2_notFound++;
164 }
165 else if (l2Result->isAccepted()) m_l2_passed++;
166
167 ResultStatus efStat = getHLTResult(efResult, EF, ctx);
168 if (!efResult) {
169 if (efStat == NotRequested ) m_ef_notReq++;
170 else if (efStat == SGError || efStat == ProcError) m_ef_error++;
171 else if (efStat == NotFound) m_ef_notFound++;
172 }
173 else if (efResult->isAccepted()) m_ef_passed++;
174
175
176 ResultStatus hltStat = getHLTResult(hltResult, HLT, ctx);
177 if (!hltResult) {
178 if (hltStat == NotRequested ) m_hlt_notReq++;
179 else if (hltStat == SGError || hltStat == ProcError) m_hlt_error++;
180 else if (hltStat == NotFound) m_hlt_notFound++;
181 }
182 else if (hltResult->isAccepted()) m_hlt_passed++;
183
184
185 if (!l1Result && !l2Result && !efResult && !hltResult) {
186 ATH_MSG_ERROR ("The whole trigger seems off for this event (no L1/L2/EF/HLT results) - no TrigDecision produced");
187 m_td_skip++;
188 return StatusCode::SUCCESS;
189 }
190
191 std::unique_ptr<TrigDecision> trigDec = std::make_unique<TrigDecision>();
192
193 SG::ReadHandle<TrigConf::HLTMenu> hltMenu(m_HLTMenuKey, ctx);
194 ATH_CHECK( hltMenu.isValid() );
195 trigDec->m_configMasterKey = hltMenu->smk();
196
197 if (l1Result) trigDec->m_l1_result = *l1Result;
198 if (l2Result) trigDec->m_l2_result = *l2Result;
199 if (efResult) trigDec->m_ef_result = *efResult;
200 if (hltResult){
201 trigDec->m_ef_result = *hltResult;//store the merged result into ef_result to propagate with getEFResult
202 }
203
204 // get the bunch crossing id
205 ATH_MSG_DEBUG ( "Run " << ctx.eventID().run_number()
206 << "; Event " << ctx.eventID().event_number()
207 << "; BC-ID " << ctx.eventID().bunch_crossing_id() ) ;
208 SG::ReadCondHandle<TrigConf::L1BunchGroupSet> bgkey(m_bgKey, ctx);
209 ATH_CHECK(bgkey.isValid());
210 const TrigConf::L1BunchGroupSet* l1bgs = *bgkey;
211 if (l1bgs) {
212 // We currently only support 8 bits/bunchgroups (ATR-24030)
213 trigDec->m_bgCode = static_cast<char>(l1bgs->bgPattern(ctx.eventID().bunch_crossing_id()));
214 }
215 else {
216 ATH_MSG_WARNING("Could not read " << m_bgKey);
217 }
218
219 SG::WriteHandle<TrigDecision> writeHandle{m_trigDecisionKey, ctx};
220 if (writeHandle.record(std::move(trigDec)).isFailure()) {
221 ATH_MSG_ERROR ( "Failed to record TrigDecision to StoreGate with key "
222 << m_trigDecisionKey << "!" ) ;
223
224 m_td_error++;
225 return StatusCode::FAILURE;
226 }
227
228 ATH_MSG_DEBUG ( "Recorded TrigDecision to StoreGate with key = "
229 << m_trigDecisionKey << "." ) ;
230
231
232 return StatusCode::SUCCESS;
233}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool isAccepted() const
gets HLT decision
Definition HLTResult.h:131
bool isAccepted() const
final LVL1 decision && isConfigured
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
bgPattern_t bgPattern(size_t bcid) const
Return word with bit-pattern of fired bunchgroups for given bcid.
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
ResultStatus getHLTResult(const HLT::HLTResult *&result, TrigLevel level, const EventContext &ctx) const
retrieve HLT results (called in execute)
SG::WriteHandleKey< TrigDecision > m_trigDecisionKey
ResultStatus getL1Result(const LVL1CTP::Lvl1Result *&result, const EventContext &ctx) const
retrieve LVL1 result (called in execute)
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgKey

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode TrigDecisionMaker::finalize ( )
overridevirtual

std Gaudi finalize method -> print out statistics

Definition at line 105 of file TrigDecisionMaker.cxx.

106{
107 // print out stats: use also to do regression tests
108 ATH_MSG_DEBUG ("=============================================" ) ;
109 ATH_MSG_DEBUG ("REGTEST Run summary:" ) ;
110 ATH_MSG_DEBUG ("REGTEST Events processed : " << m_nEvents ) ;
111
112 ATH_MSG_DEBUG ("REGTEST Level 1 : passed = " << m_l1_passed ) ;
113 ATH_MSG_DEBUG ("REGTEST Level 1 : not found = " << m_l1_notFound ) ;
114 ATH_MSG_DEBUG ("REGTEST Level 1 : not requested = " << m_l1_notReq ) ;
115 ATH_MSG_DEBUG ("REGTEST Level 1 : SG errors = " << m_l1_error ) ;
116
117 ATH_MSG_DEBUG ("REGTEST Level 2 : passed = " << m_l2_passed ) ;
118 ATH_MSG_DEBUG ("REGTEST Level 2 : not found = " << m_l2_notFound ) ;
119 ATH_MSG_DEBUG ("REGTEST Level 2 : not requested = " << m_l2_notReq ) ;
120 ATH_MSG_DEBUG ("REGTEST Level 2 : SG errors = " << m_l2_error ) ;
121
122 ATH_MSG_DEBUG ("REGTEST EvFilter : passed = " << m_ef_passed ) ;
123 ATH_MSG_DEBUG ("REGTEST EvFilter : not found = " << m_ef_notFound ) ;
124 ATH_MSG_DEBUG ("REGTEST EvFilter : not requested = " << m_ef_notReq ) ;
125 ATH_MSG_DEBUG ("REGTEST EvFilter : SG errors = " << m_ef_error ) ;
126
127 ATH_MSG_DEBUG ("REGTEST HLT : passed = " << m_hlt_passed ) ;
128 ATH_MSG_DEBUG ("REGTEST HLT : not found = " << m_hlt_notFound ) ;
129 ATH_MSG_DEBUG ("REGTEST HLT : not requested = " << m_hlt_notReq ) ;
130 ATH_MSG_DEBUG ("REGTEST HLT : SG errors = " << m_hlt_error ) ;
131
132 ATH_MSG_DEBUG ("REGTEST TrigDecision not written : " << m_td_skip ) ;
133 ATH_MSG_DEBUG ("REGTEST SG errors in storing TD : " << m_td_error ) ;
134 ATH_MSG_DEBUG ("=============================================" ) ;
135
136 return StatusCode::SUCCESS;
137}

◆ getHLTResult()

TrigDecisionMaker::ResultStatus TrigDecisionMaker::getHLTResult ( const HLT::HLTResult *& result,
TrigLevel level,
const EventContext & ctx ) const

retrieve HLT results (called in execute)

Definition at line 279 of file TrigDecisionMaker.cxx.

281{
282 result = 0;
283
284 if (level != L2 && level != EF && level != HLT) {
285 ATH_MSG_ERROR ("Level must be either L2 or EF or HLT in getHLTResult!");
286 return Unknown;
287 }
288
289 if ((level == L2 && !m_doL2) || (level == EF && !m_doEF) || (level == HLT && !m_doHLT)) return NotRequested;
290
291 const SG::ReadHandleKey<HLT::HLTResult>& key = (level == L2 ? m_l2ResultKey : (level == EF) ? m_efResultKey : m_hltResultKey);
292
293 SG::ReadHandle<HLT::HLTResult> hltRH{key, ctx};
294
295 if (!hltRH.isValid()) {
296 ATH_MSG_ERROR ( "Error retrieving HLTResult from StoreGate" ) ;
297 result = nullptr;
298 return SGError;
299 }
300
301 result = hltRH.cptr();
302
303 ATH_MSG_DEBUG ( "Got HLTResult from StoreGate with key " << key ) ;
304
305 return OK;
306}
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
SG::ReadHandleKey< HLT::HLTResult > m_l2ResultKey
Gaudi::Property< bool > m_doHLT
Gaudi::Property< bool > m_doEF
SG::ReadHandleKey< HLT::HLTResult > m_hltResultKey
SG::ReadHandleKey< HLT::HLTResult > m_efResultKey
Gaudi::Property< bool > m_doL2

◆ getL1Result()

TrigDecisionMaker::ResultStatus TrigDecisionMaker::getL1Result ( const LVL1CTP::Lvl1Result *& result,
const EventContext & ctx ) const

retrieve LVL1 result (called in execute)

Definition at line 235 of file TrigDecisionMaker.cxx.

236{
237 result = 0;
238 if (!m_doL1) return NotRequested;
239
240 if (!m_l1ResultKey.empty())
241 {
242 SG::ReadHandle<LVL1CTP::Lvl1Result> l1RH{m_l1ResultKey, ctx};
243 if (l1RH.isValid()) {
244 result = l1RH.cptr();
245 return OK;
246 }
247 else
248 {
249 result = nullptr;
250 ATH_MSG_WARNING( "Configured to retrieve L1 from LVL1CTP::Lvl1Result but this was not found");
251 return NotFound;
252 }
253 }
254
255 SG::ReadHandle<ROIB::RoIBResult> l1roibRH{m_l1roibResultKey, ctx};
256 if (!l1roibRH.isValid()) {
257 result = nullptr;
258 ATH_MSG_WARNING ( "Trying to do L1, but RoIBResult not found" ) ;
259 return NotFound;
260 }
261
262 const ROIB::RoIBResult* roIBResult = l1roibRH.cptr();
263
264 ATH_MSG_DEBUG ( "Got ROIBResult from StoreGate with key " << m_l1roibResultKey ) ;
265
266 std::vector< std::unique_ptr<LVL1CTP::Lvl1Item> > itemConfig = m_lvl1Tool->makeLvl1ItemConfig(ctx);
267
268 if ((roIBResult->cTPResult()).isComplete()) {
269 m_lvl1Tool->createL1Items(itemConfig, *roIBResult,&result);
270 ATH_MSG_DEBUG ( "Build LVL1CTP::Lvl1Result from valid CTPResult.") ;
271 } else {
272 ATH_MSG_DEBUG ( "No LVL1CTP::Lvl1Result build since no valid CTPResult is available.") ;
273 }
274
275 return OK;
276}
const CTPResult & cTPResult() const
Gets the CTP part of the L1 RDO.
SG::ReadHandleKey< ROIB::RoIBResult > m_l1roibResultKey
SG::ReadHandleKey< LVL1CTP::Lvl1Result > m_l1ResultKey
Gaudi::Property< bool > m_doL1
ToolHandle< HLT::ILvl1ResultAccessTool > m_lvl1Tool
tool to ease the access to the L1 results (RoIs, items, etc)

◆ initialize()

StatusCode TrigDecisionMaker::initialize ( )
overridevirtual

std Gaudi initialize method -> read-in trigger configuration

Definition at line 54 of file TrigDecisionMaker.cxx.

55{
56 m_nEvents = 0;
57 m_l1_error = 0;
58 m_l2_error = 0;
59 m_ef_error = 0;
60 m_hlt_error = 0;
61 m_td_error = 0;
62 m_td_skip = 0;
63 m_l1_notFound = 0;
64 m_l2_notFound = 0;
65 m_ef_notFound = 0;
67 m_l1_notReq = 0;
68 m_l2_notReq = 0;
69 m_ef_notReq = 0;
70 m_hlt_notReq = 0;
71 m_l1_passed = 0;
72 m_l2_passed = 0;
73 m_ef_passed = 0;
74 m_hlt_passed = 0;
75
76 ATH_MSG_DEBUG ( "Initializing TrigDecisionMaker..." ) ;
77 ATH_MSG_DEBUG ( "Properties:" ) ;
78 ATH_MSG_DEBUG ( " doL1 = " << (m_doL1 ? "True":"False") ) ;
79 ATH_MSG_DEBUG ( " doL2 = " << (m_doL2 ? "True":"False") ) ;
80 ATH_MSG_DEBUG ( " doEF = " << (m_doEF ? "True":"False") ) ;
81 ATH_MSG_DEBUG ( " doHLT = " << (m_doHLT ? "True":"False") ) ;
82 ATH_MSG_DEBUG ( " TrigDecisionKey = " << m_trigDecisionKey ) ;
83 ATH_MSG_DEBUG ( " TrigL1ResultKey = " << m_l1ResultKey ) ;
84 ATH_MSG_DEBUG ( " TrigROIBL1ResultKey = " << m_l1roibResultKey ) ;
85 ATH_MSG_DEBUG ( " TrigL2ResultKey = " << m_l2ResultKey ) ;
86 ATH_MSG_DEBUG ( " TrigEFResultKey = " << m_efResultKey ) ;
87 ATH_MSG_DEBUG ( " TrigHLTResultKey= " << m_hltResultKey ) ;
88
89 ATH_CHECK( m_lvl1Tool.retrieve() );
90
91 ATH_CHECK( m_bgKey.initialize() );
92 ATH_CHECK( m_HLTMenuKey.initialize() );
93 ATH_CHECK( m_trigDecisionKey.initialize() );
95 ATH_CHECK( m_l1roibResultKey.initialize(m_doL1 && m_l1ResultKey.empty()) );
96 ATH_CHECK( m_l2ResultKey.initialize(m_doL2) );
97 ATH_CHECK( m_efResultKey.initialize(m_doEF) );
98 ATH_CHECK( m_hltResultKey.initialize(m_doHLT) );
99
100 return StatusCode::SUCCESS;
101}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_bgKey

SG::ReadCondHandleKey<TrigConf::L1BunchGroupSet> TrigDec::TrigDecisionMaker::m_bgKey {this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"}
private

Definition at line 96 of file TrigDecisionMaker.h.

96{this, "L1BunchGroup", "L1BunchGroup", "L1BunchGroupSet key name"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doEF

Gaudi::Property<bool> TrigDec::TrigDecisionMaker::m_doEF {this, "doEF", true, "flag whether or not to consider L3 (EF) trigger information"}
private

Definition at line 93 of file TrigDecisionMaker.h.

93{this, "doEF", true, "flag whether or not to consider L3 (EF) trigger information"};

◆ m_doHLT

Gaudi::Property<bool> TrigDec::TrigDecisionMaker::m_doHLT {this, "doHLT", true, "flag whether or not to consider merged L2EF=HLT trigger information"}
private

Definition at line 94 of file TrigDecisionMaker.h.

94{this, "doHLT", true, "flag whether or not to consider merged L2EF=HLT trigger information"};

◆ m_doL1

Gaudi::Property<bool> TrigDec::TrigDecisionMaker::m_doL1 {this, "doL1", true, "flag whether or not to consider L1 trigger information"}
private

Definition at line 91 of file TrigDecisionMaker.h.

91{this, "doL1", true, "flag whether or not to consider L1 trigger information"};

◆ m_doL2

Gaudi::Property<bool> TrigDec::TrigDecisionMaker::m_doL2 {this, "doL2", true, "flag whether or not to consider L2 trigger information"}
private

Definition at line 92 of file TrigDecisionMaker.h.

92{this, "doL2", true, "flag whether or not to consider L2 trigger information"};

◆ m_ef_error

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_ef_error
private

Definition at line 109 of file TrigDecisionMaker.h.

◆ m_ef_notFound

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_ef_notFound
private

Definition at line 110 of file TrigDecisionMaker.h.

◆ m_ef_notReq

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_ef_notReq
private

Definition at line 111 of file TrigDecisionMaker.h.

◆ m_ef_passed

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_ef_passed
private

Definition at line 112 of file TrigDecisionMaker.h.

◆ m_efResultKey

SG::ReadHandleKey<HLT::HLTResult> TrigDec::TrigDecisionMaker::m_efResultKey {this, "EFResultKey", "HLTResult_EF", "SK key to retrieve the EF result from SG" }
private

Definition at line 102 of file TrigDecisionMaker.h.

102{this, "EFResultKey", "HLTResult_EF", "SK key to retrieve the EF result from SG" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_hlt_error

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_hlt_error
private

Definition at line 109 of file TrigDecisionMaker.h.

◆ m_hlt_notFound

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_hlt_notFound
private

statistics: number of events where L1, HLT results were not found

Definition at line 110 of file TrigDecisionMaker.h.

◆ m_hlt_notReq

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_hlt_notReq
private

statistics: number of events where something was not requested

Definition at line 111 of file TrigDecisionMaker.h.

◆ m_hlt_passed

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_hlt_passed
private

statistics: number of events that passed the given trigger lvl

Definition at line 112 of file TrigDecisionMaker.h.

◆ m_HLTMenuKey

SG::ReadHandleKey<TrigConf::HLTMenu> TrigDec::TrigDecisionMaker::m_HLTMenuKey {this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"}
private

Definition at line 97 of file TrigDecisionMaker.h.

97{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu key"};

◆ m_hltResultKey

SG::ReadHandleKey<HLT::HLTResult> TrigDec::TrigDecisionMaker::m_hltResultKey {this, "HLTResultKey", "HLTResult_HLT", " SK key to retrieve the merged HLT result from SG" }
private

Definition at line 103 of file TrigDecisionMaker.h.

103{this, "HLTResultKey", "HLTResult_HLT", " SK key to retrieve the merged HLT result from SG" };

◆ m_l1_error

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l1_error
mutableprivate

Definition at line 109 of file TrigDecisionMaker.h.

◆ m_l1_notFound

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l1_notFound
mutableprivate

Definition at line 110 of file TrigDecisionMaker.h.

◆ m_l1_notReq

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l1_notReq
mutableprivate

Definition at line 111 of file TrigDecisionMaker.h.

◆ m_l1_passed

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l1_passed
mutableprivate

Definition at line 112 of file TrigDecisionMaker.h.

◆ m_l1ResultKey

SG::ReadHandleKey<LVL1CTP::Lvl1Result> TrigDec::TrigDecisionMaker::m_l1ResultKey {this, "L1ResultKey", "Lvl1Result", "SK key to retrieve the L1 result from SG" }
private

Definition at line 100 of file TrigDecisionMaker.h.

100{this, "L1ResultKey", "Lvl1Result", "SK key to retrieve the L1 result from SG" };

◆ m_l1roibResultKey

SG::ReadHandleKey<ROIB::RoIBResult> TrigDec::TrigDecisionMaker::m_l1roibResultKey {this, "L1ROIBResultKey", "RoIBResult", "SK key to retrieve the L1 ROIB result from SG" }
private

Definition at line 99 of file TrigDecisionMaker.h.

99{this, "L1ROIBResultKey", "RoIBResult", "SK key to retrieve the L1 ROIB result from SG" };

◆ m_l2_error

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l2_error
private

Definition at line 109 of file TrigDecisionMaker.h.

◆ m_l2_notFound

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l2_notFound
private

Definition at line 110 of file TrigDecisionMaker.h.

◆ m_l2_notReq

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l2_notReq
private

Definition at line 111 of file TrigDecisionMaker.h.

◆ m_l2_passed

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_l2_passed
private

Definition at line 112 of file TrigDecisionMaker.h.

◆ m_l2ResultKey

SG::ReadHandleKey<HLT::HLTResult> TrigDec::TrigDecisionMaker::m_l2ResultKey {this, "L2ResultKey", "HLTResult_L2", "SK key to retrieve the L2 result from SG" }
private

Definition at line 101 of file TrigDecisionMaker.h.

101{this, "L2ResultKey", "HLTResult_L2", "SK key to retrieve the L2 result from SG" };

◆ m_lvl1Tool

ToolHandle<HLT::ILvl1ResultAccessTool> TrigDec::TrigDecisionMaker::m_lvl1Tool {this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"}
private

tool to ease the access to the L1 results (RoIs, items, etc)

Definition at line 105 of file TrigDecisionMaker.h.

105{this, "Lvl1ResultAccessTool", "HLT::Lvl1ResultAccessTool/Lvl1ResultAccessTool", "L1 tool to fetch"};

◆ m_nEvents

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_nEvents
mutableprivate

statistics: number of processed events

Definition at line 108 of file TrigDecisionMaker.h.

◆ m_td_error

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_td_error
private

Definition at line 109 of file TrigDecisionMaker.h.

◆ m_td_skip

std::atomic<unsigned int> TrigDec::TrigDecisionMaker::m_td_skip
private

statistics: error numbers

Definition at line 109 of file TrigDecisionMaker.h.

◆ m_trigDecisionKey

SG::WriteHandleKey<TrigDecision> TrigDec::TrigDecisionMaker::m_trigDecisionKey {this, "TrigDecisionKey", "TrigDecision", "SG key to save the TrigDecision object" }
private

Definition at line 98 of file TrigDecisionMaker.h.

98{this, "TrigDecisionKey", "TrigDecision", "SG key to save the TrigDecision object" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: