ATLAS Offline Software
L1Connector.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGCONFDATA_L1CONNECTOR_H
6 #define TRIGCONFDATA_L1CONNECTOR_H
7 
10 
11 #include <map>
12 #include <vector>
13 
14 namespace TrigConf {
15 
21  class TriggerLine {
22  public:
23  TriggerLine(const std::string & name, unsigned int startbit, unsigned int nbits, unsigned int flatindex, unsigned int fpga=0, unsigned int clock=0, const std::string & connName="") :
25  {}
26  const std::string & name() const { return m_name; }
27  unsigned int startbit() const { return m_startbit; }
28  unsigned int flatindex() const { return m_flatindex; }
29  unsigned int endbit() const { return m_startbit + m_nbits - 1; }
30  unsigned int nbits() const { return m_nbits; }
31  unsigned int fpga() const { return m_fpga; }
32  unsigned int clock() const { return m_clock; }
33  const std::string & connName() const { return m_connName; }
34  private:
35  std::string m_name; // the name of the threshold whose multiplicity is transmitted
36  unsigned int m_startbit; // the location on the cable - first bit
37  unsigned int m_nbits; // the location on the cable - number of bits used to encode the multiplicity
38  unsigned int m_flatindex; // position of output bit in topo board for a given fpga/clock - first bit
39  unsigned int m_fpga; // for electrical signals from L1Topo boards only: the fpga the signal is coming from
40  unsigned int m_clock; // for electrical signals from L1Topo boards only: the clock of the signal
41  std::string m_connName; // the name of the connector where the triggerline is allocated
42  };
43 
45  class L1Connector final : public DataStructure {
46  public:
47 
49 
51  L1Connector();
52 
53  L1Connector(const L1Connector &) = delete;
54  L1Connector& operator=(const L1Connector&) = delete;
55  L1Connector(L1Connector&&) = delete;
56 
60  L1Connector(const std::string & connName, const ptree & data);
61 
63  virtual ~L1Connector() override = default;
64 
65  virtual std::string className() const override;
66 
68  std::size_t size() const;
69 
70  std::string type() const;
71 
74 
76  std::vector<std::string> triggerLineNames() const;
77 
87  const std::vector<TrigConf::TriggerLine> & triggerLines(unsigned int fpga = 0, unsigned int clock = 0) const;
88 
89  bool hasLine( const std::string & lineName ) const;
90 
91  const TrigConf::TriggerLine & triggerLine( const std::string & lineName ) const;
92 
93  bool legacy() const { return m_isLegacy; }
94 
95  [[deprecated("Use legacy() instead.")]]
96  bool isLegacy() const { return m_isLegacy; }
97 
98  std::size_t maxFpga() const { return m_maxFpga; }
99 
100  std::size_t maxClock() const { return m_maxClock; }
101 
102  private:
103 
105  virtual void update() override;
106 
108  std::vector<TrigConf::TriggerLine> m_triggerLines[2][2];
109  std::map<std::string, TrigConf::TriggerLine*> m_lineByName;
110  std::size_t m_maxFpga{1};
111  std::size_t m_maxClock{1};
112 
114  };
115 
116 }
117 
118 #endif
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition: DataStructure.h:83
TrigConf::TriggerLine::flatindex
unsigned int flatindex() const
Definition: L1Connector.h:28
TrigConf::L1Connector::connectorType
ConnectorType connectorType() const
Accessor to the connector type.
Definition: L1Connector.cxx:137
TrigConf::L1Connector
L1 connectors configuration.
Definition: L1Connector.h:45
TrigConf::TriggerLine::m_connName
std::string m_connName
Definition: L1Connector.h:41
TrigConf::L1Connector::type
std::string type() const
Definition: L1Connector.cxx:123
TrigConf::TriggerLine::endbit
unsigned int endbit() const
Definition: L1Connector.h:29
TrigConf::L1Connector::triggerLine
const TrigConf::TriggerLine & triggerLine(const std::string &lineName) const
Definition: L1Connector.cxx:181
TrigConf::TriggerLine::startbit
unsigned int startbit() const
Definition: L1Connector.h:27
TrigConf::L1Connector::m_triggerLines
std::vector< TrigConf::TriggerLine > m_triggerLines[2][2]
Definition: L1Connector.h:108
TrigConf::L1Connector::ConnectorType
ConnectorType
Definition: L1Connector.h:48
TrigConf::L1Connector::~L1Connector
virtual ~L1Connector() override=default
Destructor.
TrigConf::L1Connector::className
virtual std::string className() const override
A string that is the name of the class.
Definition: L1Connector.cxx:21
TrigConf::L1Connector::operator=
L1Connector & operator=(const L1Connector &)=delete
TrigConf::TriggerLine::TriggerLine
TriggerLine(const std::string &name, unsigned int startbit, unsigned int nbits, unsigned int flatindex, unsigned int fpga=0, unsigned int clock=0, const std::string &connName="")
Definition: L1Connector.h:23
TrigConf::L1Connector::ConnectorType::OPTICAL
@ OPTICAL
TrigConf::L1Connector::L1Connector
L1Connector()
Constructor.
Definition: L1Connector.cxx:10
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::L1Connector::ConnectorType::CTPIN
@ CTPIN
TrigConf::TriggerLine
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition: L1Connector.h:21
TrigConf::L1Connector::maxFpga
std::size_t maxFpga() const
Definition: L1Connector.h:98
TrigConf::TriggerLine::m_fpga
unsigned int m_fpga
Definition: L1Connector.h:39
TrigConf::L1Connector::update
virtual void update() override
Update the internal members.
Definition: L1Connector.cxx:26
TrigConf::L1Connector::isLegacy
bool isLegacy() const
Definition: L1Connector.h:96
TrigConf::TriggerLine::connName
const std::string & connName() const
Definition: L1Connector.h:33
TrigConf::L1Connector::m_lineByName
std::map< std::string, TrigConf::TriggerLine * > m_lineByName
Definition: L1Connector.h:109
TrigConf::L1Connector::maxClock
std::size_t maxClock() const
Definition: L1Connector.h:100
TrigConf::L1Connector::ConnectorType::ELECTRICAL
@ ELECTRICAL
TrigConf::L1Connector::legacy
bool legacy() const
Definition: L1Connector.h:93
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::TriggerLine::name
const std::string & name() const
Definition: L1Connector.h:26
TrigConf::L1Connector::L1Connector
L1Connector(L1Connector &&)=delete
TrigConf::TriggerLine::m_startbit
unsigned int m_startbit
Definition: L1Connector.h:36
TrigConf::TriggerLine::clock
unsigned int clock() const
Definition: L1Connector.h:32
TrigConf::L1Connector::hasLine
bool hasLine(const std::string &lineName) const
Definition: L1Connector.cxx:175
ConstIter.h
TrigConf::L1Connector::triggerLines
const std::vector< TrigConf::TriggerLine > & triggerLines(unsigned int fpga=0, unsigned int clock=0) const
Accessor to the triggerlines on the connector.
Definition: L1Connector.cxx:169
TrigConf::DataStructure
Base class for Trigger configuration data and wrapper around underlying representation.
Definition: DataStructure.h:37
TrigConf::TriggerLine::nbits
unsigned int nbits() const
Definition: L1Connector.h:30
TrigConf::TriggerLine::m_clock
unsigned int m_clock
Definition: L1Connector.h:40
runJobs.deprecated
deprecated
Definition: runJobs.py:191
TrigConf::TriggerLine::m_name
std::string m_name
Definition: L1Connector.h:35
TrigConf::TriggerLine::m_flatindex
unsigned int m_flatindex
Definition: L1Connector.h:38
TrigConf::TriggerLine::fpga
unsigned int fpga() const
Definition: L1Connector.h:31
TrigConf::L1Connector::size
std::size_t size() const
Accessor to the number of trigger lines.
Definition: L1Connector.cxx:143
TrigConf::L1Connector::L1Connector
L1Connector(const L1Connector &)=delete
TrigConf::L1Connector::m_maxClock
std::size_t m_maxClock
Definition: L1Connector.h:111
TrigConf::L1Connector::triggerLineNames
std::vector< std::string > triggerLineNames() const
names of all trigger lines
Definition: L1Connector.cxx:155
DataStructure.h
TrigConf::L1Connector::m_type
ConnectorType m_type
Definition: L1Connector.h:107
TrigConf::DataStructure::ptree
boost::property_tree::ptree ptree
Definition: DataStructure.h:40
TrigConf::TriggerLine::m_nbits
unsigned int m_nbits
Definition: L1Connector.h:37
TrigConf::L1Connector::m_maxFpga
std::size_t m_maxFpga
Definition: L1Connector.h:110
TrigConf::L1Connector::m_isLegacy
bool m_isLegacy
Definition: L1Connector.h:113