ATLAS Offline Software
Loading...
Searching...
No Matches
L1Connector.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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#include <string>
14
15namespace TrigConf {
16
23 public:
24 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="") :
26 {}
27 const std::string & name() const { return m_name; }
28 unsigned int startbit() const { return m_startbit; }
29 unsigned int flatindex() const { return m_flatindex; }
30 unsigned int endbit() const { return m_startbit + m_nbits - 1; }
31 unsigned int nbits() const { return m_nbits; }
32 unsigned int fpga() const { return m_fpga; }
33 unsigned int clock() const { return m_clock; }
34 const std::string & connName() const { return m_connName; }
35 private:
36 std::string m_name; // the name of the threshold whose multiplicity is transmitted
37 unsigned int m_startbit; // the location on the cable - first bit
38 unsigned int m_nbits; // the location on the cable - number of bits used to encode the multiplicity
39 unsigned int m_flatindex; // position of output bit in topo board for a given fpga/clock - first bit
40 unsigned int m_fpga; // for electrical signals from L1Topo boards only: the fpga the signal is coming from
41 unsigned int m_clock; // for electrical signals from L1Topo boards only: the clock of the signal
42 std::string m_connName; // the name of the connector where the triggerline is allocated
43 };
44
46 class L1Connector final : public DataStructure {
47 public:
48
50
53
54 L1Connector(const L1Connector &) = delete;
57
61 L1Connector(const std::string & connName, const ptree & data);
62
64 virtual ~L1Connector() override = default;
65
66 virtual std::string className() const override;
67
69 std::size_t size() const;
70
71 std::string type() const;
72
75
77 std::vector<std::string> triggerLineNames() const;
78
88 const std::vector<TrigConf::TriggerLine> & triggerLines(unsigned int fpga = 0, unsigned int clock = 0) const;
89
90 bool hasLine( const std::string & lineName ) const;
91
92 const TrigConf::TriggerLine & triggerLine( const std::string & lineName ) const;
93
94 bool legacy() const { return m_isLegacy; }
95
96 [[deprecated("Use legacy() instead.")]]
97 bool isLegacy() const { return m_isLegacy; }
98
99 std::size_t maxFpga() const { return m_maxFpga; }
100
101 std::size_t maxClock() const { return m_maxClock; }
102
103 private:
104
106 virtual void update() override;
107
109 std::vector<TrigConf::TriggerLine> m_triggerLines[2][2];
110 std::map<std::string, TrigConf::TriggerLine*> m_lineByName;
111 std::size_t m_maxFpga{1};
112 std::size_t m_maxClock{1};
113
115 };
116
117}
118
119#endif
const ptree & data() const
Access to the underlying data, if needed.
DataStructure()
Default constructor, leading to an uninitialized configuration object.
boost::property_tree::ptree ptree
std::vector< TrigConf::TriggerLine > m_triggerLines[2][2]
bool isLegacy() const
Definition L1Connector.h:97
bool hasLine(const std::string &lineName) const
std::size_t maxFpga() const
Definition L1Connector.h:99
std::string type() const
ConnectorType connectorType() const
Accessor to the connector type.
virtual std::string className() const override
A string that is the name of the class.
bool legacy() const
Definition L1Connector.h:94
const TrigConf::TriggerLine & triggerLine(const std::string &lineName) const
const std::vector< TrigConf::TriggerLine > & triggerLines(unsigned int fpga=0, unsigned int clock=0) const
Accessor to the triggerlines on the connector.
L1Connector & operator=(const L1Connector &)=delete
std::size_t size() const
Accessor to the number of trigger lines.
std::size_t maxClock() const
L1Connector(L1Connector &&)=delete
ConnectorType m_type
std::map< std::string, TrigConf::TriggerLine * > m_lineByName
virtual void update() override
Update the internal members.
L1Connector(const L1Connector &)=delete
L1Connector()
Constructor.
std::vector< std::string > triggerLineNames() const
names of all trigger lines
virtual ~L1Connector() override=default
Destructor.
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition L1Connector.h:22
std::string m_connName
Definition L1Connector.h:42
unsigned int m_clock
Definition L1Connector.h:41
unsigned int m_nbits
Definition L1Connector.h:38
unsigned int clock() const
Definition L1Connector.h:33
unsigned int endbit() const
Definition L1Connector.h:30
unsigned int m_startbit
Definition L1Connector.h:37
unsigned int flatindex() const
Definition L1Connector.h:29
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:24
unsigned int startbit() const
Definition L1Connector.h:28
unsigned int nbits() const
Definition L1Connector.h:31
unsigned int m_fpga
Definition L1Connector.h:40
const std::string & connName() const
Definition L1Connector.h:34
const std::string & name() const
Definition L1Connector.h:27
unsigned int fpga() const
Definition L1Connector.h:32
unsigned int m_flatindex
Definition L1Connector.h:39
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22