ATLAS Offline Software
ResultBuilder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef TRIGT1CTP_RESULTBUILDER_H
7 #define TRIGT1CTP_RESULTBUILDER_H
8 
9 // local includes
10 //#include "./SpecialTrigger.h"
11 #include "./ThresholdMap.h"
12 #include "./ItemMap.h"
13 
14 #include <stdint.h>
15 
16 // For handling different CTP versions:
17 #include "CTPfragment/CTPdataformatVersion.h"
18 #include "GaudiKernel/EventIDBase.h"
19 
21 
22 // L1 configuration data
23 #include "TrigConfData/L1Menu.h"
24 
25 // Output to the RoIB:
27 
28 // Output to the DAQ:
29 #include "TrigT1Result/CTP_RDO.h"
30 
31 #include "CLHEP/Random/RandomEngine.h"
32 
33 namespace LVL1CTP {
34 
40  class ResultBuilder : public AthAlgTool {
41 
42  public:
43 
44  ResultBuilder( const std::string& type, const std::string& name, const IInterface* parent );
46 
47  void setRandomEngine( CLHEP::HepRandomEngine* rndmEngine );
48 
50 
51  StatusCode buildItemDecision( const std::map<std::string, unsigned int> & thrMultiMap,
52  std::map<std::string, unsigned int> & itemDecisionMap,
53  CLHEP::HepRandomEngine* rndmEngine ) const;
54 
55 
56  StatusCode constructResultVectors( const std::map<std::string, unsigned int> & itemDecisionMap,
57  std::vector<uint32_t> & tbp, std::vector<uint32_t> & tap, std::vector<uint32_t> & tav,
58  unsigned char & triggerType ) const;
59 
60 
61  StatusCode constructTIPVector( const std::map<std::string, unsigned int> & thrMultiMap,
62  std::vector<uint32_t> & tip ) const;
63 
64 
66  std::unique_ptr<CTPSLink> constructRoIResult( const EventIDBase & eventID,
67  const std::vector<uint32_t> & tbp, const std::vector<uint32_t> & tap,
68  const std::vector<uint32_t> & tav, const std::vector<uint32_t> & tip,
69  const std::vector<uint32_t> & extra,
70  const unsigned char triggerType ) const;
71 
73  std::unique_ptr<CTP_RDO> constructRDOResult( const EventIDBase & eventID,
74  const std::vector<uint32_t> & tbp, const std::vector<uint32_t> & tap,
75  const std::vector<uint32_t> & tav, const std::vector<uint32_t> & tip,
76  const std::vector<uint32_t> & extra ) const;
77 
78  private:
79 
80  enum WrdType { TBP = 0x01, TAP = 0x02, TAV = 0x04 };
81 
83 
85  std::vector<std::string> firedItems(const std::vector<uint32_t>& triggerWords) const;
86 
87  // configuration information
88  std::unique_ptr<ThresholdMap> m_thrConfigMap{ nullptr };
89  std::unique_ptr<ItemMap> m_itemConfigMap{ nullptr };
91  unsigned int m_ctpVersionNumber { 4 };
92  CTPdataformatVersion* m_ctpDataFormat { nullptr };
93  };
94 
95 
96  // typedefs
97 
98  // generic typedef for easy access to TIP/TBP/TAP/TAV information
99  typedef std::vector<uint32_t> (ResultBuilder::*Result)() const;
100 
101 } // namespace LVL1CTP
102 
103 #endif // TRIGT1CTP_RESULTBUILDER_H
LVL1CTP::ResultBuilder::~ResultBuilder
~ResultBuilder()
Definition: ResultBuilder.cxx:42
LVL1CTP::ResultBuilder
Class used to create the CTP output (RDO, SLink and TriggerInfo)
Definition: ResultBuilder.h:40
LVL1CTP::ResultBuilder::constructRoIResult
std::unique_ptr< CTPSLink > constructRoIResult(const EventIDBase &eventID, const std::vector< uint32_t > &tbp, const std::vector< uint32_t > &tap, const std::vector< uint32_t > &tav, const std::vector< uint32_t > &tip, const std::vector< uint32_t > &extra, const unsigned char triggerType) const
build RoI result (LVL1CTP::CTPSLink)
Definition: ResultBuilder.cxx:228
LVL1CTP::ResultBuilder::constructResultVectors
StatusCode constructResultVectors(const std::map< std::string, unsigned int > &itemDecisionMap, std::vector< uint32_t > &tbp, std::vector< uint32_t > &tap, std::vector< uint32_t > &tav, unsigned char &triggerType) const
Definition: ResultBuilder.cxx:183
LVL1CTP::ResultBuilder::firedItems
std::vector< std::string > firedItems(const std::vector< uint32_t > &triggerWords) const
build list of fired items and dump to string
Definition: ResultBuilder.cxx:352
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
LVL1CTP::ResultBuilder::m_ctpDataFormat
CTPdataformatVersion * m_ctpDataFormat
CTP data format details.
Definition: ResultBuilder.h:92
LVL1CTP::ResultBuilder::setConfiguration
StatusCode setConfiguration(const TrigConf::L1Menu &l1menu)
Definition: ResultBuilder.cxx:51
LVL1CTP::ResultBuilder::m_internalTrigger
InternalTriggerMap m_internalTrigger
internal triggers BGRP and RNDM
Definition: ResultBuilder.h:90
xAOD::tap
setBGCode tap
Definition: TrigDecision_v1.cxx:43
LVL1CTP::ResultBuilder::constructTIPVector
StatusCode constructTIPVector(const std::map< std::string, unsigned int > &thrMultiMap, std::vector< uint32_t > &tip) const
Definition: ResultBuilder.cxx:89
ItemMap.h
LVL1CTP::ResultBuilder::TBP
@ TBP
Definition: ResultBuilder.h:80
ThresholdMap.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1CTP::InternalTriggerMap
std::map< std::string, const ISpecialTrigger * > InternalTriggerMap
Definition: SpecialTrigger.h:16
LVL1CTP::ResultBuilder::constructRDOResult
std::unique_ptr< CTP_RDO > constructRDOResult(const EventIDBase &eventID, const std::vector< uint32_t > &tbp, const std::vector< uint32_t > &tap, const std::vector< uint32_t > &tav, const std::vector< uint32_t > &tip, const std::vector< uint32_t > &extra) const
build RDO result (CTP_RDO)
Definition: ResultBuilder.cxx:312
LVL1CTP::ResultBuilder::WrdType
WrdType
Definition: ResultBuilder.h:80
LVL1CTP::ResultBuilder::buildItemDecision
StatusCode buildItemDecision(const std::map< std::string, unsigned int > &thrMultiMap, std::map< std::string, unsigned int > &itemDecisionMap, CLHEP::HepRandomEngine *rndmEngine) const
Definition: ResultBuilder.cxx:149
python.handimod.extra
int extra
Definition: handimod.py:522
Result
Definition: fbtTestBasics.cxx:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LVL1CTP::ResultBuilder::m_ctpVersionNumber
unsigned int m_ctpVersionNumber
CTP data format version (4 in most of Run 2 and in Run 3)
Definition: ResultBuilder.h:91
LVL1CTP::ResultBuilder::m_thrConfigMap
std::unique_ptr< ThresholdMap > m_thrConfigMap
Map between threshold objects and their CTP-internal description.
Definition: ResultBuilder.h:88
CTP_RDO.h
LVL1CTP::ResultBuilder::ResultBuilder
ResultBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ResultBuilder.cxx:33
LVL1CTP::ResultBuilder::TAV
@ TAV
Definition: ResultBuilder.h:80
LVL1CTP::ResultBuilder::m_itemConfigMap
std::unique_ptr< ItemMap > m_itemConfigMap
Map between item objects and their CTP-internal description.
Definition: ResultBuilder.h:89
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
RunTileMonitoring.triggerType
triggerType
Definition: RunTileMonitoring.py:162
LVL1CTP::ResultBuilder::createTriggerConfigMaps
StatusCode createTriggerConfigMaps(const TrigConf::L1Menu &l1menu)
Definition: ResultBuilder.cxx:60
LVL1CTP
Definition: Lvl1ResultAccessTool.h:20
LVL1CTP::ResultBuilder::setRandomEngine
void setRandomEngine(CLHEP::HepRandomEngine *rndmEngine)
AthAlgTool
Definition: AthAlgTool.h:26
L1Menu.h
LVL1CTP::ResultBuilder::TAP
@ TAP
Definition: ResultBuilder.h:80