ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_ReadoutData.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
12
13#ifndef SCT_ConditionData_SCT_ReadoutData_h
14#define SCT_ConditionData_SCT_ReadoutData_h
15
16// Athena
20
21// C++ STL
22#include <bitset>
23#include <memory>
24#include <vector>
25
26class Identifier;
27
32namespace SCT_Parameters {
34}
35
41 : public AthMessaging
42{
43public:
44
45 SCT_ReadoutData(IMessageSvc* msgSvc=nullptr);
46 ~SCT_ReadoutData() = default;
47
52
55 return m_chipMap[chip.id()].input(chip.inPort());
56 }
57
60 return m_chipMap[chip.id()].output(chip.outPort());
61 }
62
64 void setChipIn(const SCT_Chip& chip, int link) {
65 m_chipInReadout.set(chip.id());
66 if (link==0) m_chipsOnLink0.push_back(chip.id());
67 if (link==1) m_chipsOnLink1.push_back(chip.id());
68 }
69
71 void setChipOut(const SCT_Chip& chip) {
72 m_chipInReadout.reset(chip.id());
73 }
74
76 bool isChipReadOut(const SCT_Chip& chip) const {
77 return m_chipInReadout.test(chip.id());
78 }
79
81 void setModuleType(const Identifier& moduleId, int bec);
82
84 void setChipMap();
85
87 void checkLink(int link);
88
90 bool hasConnectedInput(const SCT_Chip& chip) const;
91
93 bool isEndBeingTalkedTo(const SCT_Chip& chip) const;
94
97
99 bool followReadoutUpstream(int link, const SCT_Chip& chip, int remainingDepth = 12);
100
102 bool isLinkStandard(int link) const;
103
105 void printStatus(const Identifier& moduleId) const;
106
108 void setChips(std::vector<SCT_Chip>& chips);
109
111 void setLinkStatus(bool link0ok, bool link1ok);
112
114 void clearChipReadout();
115
116private:
117
119 std::vector<SCT_Chip>* m_chips{nullptr};
120 std::vector<SCT_PortMap> m_chipMap{};
121 bool m_linkActive[2]{false, false};
122 std::bitset<SCT_Parameters::NChips> m_chipInReadout{};
124 std::vector<int> m_chipsOnLink0{};
125 std::vector<int> m_chipsOnLink1{};
126};
127
128#endif // SCT_ConditionData_SCT_ReadoutData_h
Header file storing infomration on the SCT chips: id, config, mask.
Header file for the SCT_PortMap class.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Class which stores infomration on the SCT chips: id, config, mask.
Definition SCT_Chip.h:27
short inPort() const
Active input port.
Definition SCT_Chip.h:44
short outPort() const
Active output port.
Definition SCT_Chip.h:46
short id() const
Chip Id.
Definition SCT_Chip.h:42
void clearChipReadout()
Set all chips out of readout and clear both links to start.
bool isChipReadOut(const SCT_Chip &chip) const
Test if chip is in readout or not.
void setModuleType(const Identifier &moduleId, int bec)
Set the module type.
SCT_Parameters::ChipType inputChip(const SCT_Chip &chip) const
Find the ID of the input chip for chip.
~SCT_ReadoutData()=default
std::vector< int > m_chipsOnLink1
bool hasConnectedInput(const SCT_Chip &chip) const
Chip has a correctly connected input.
void setLinkStatus(bool link0ok, bool link1ok)
Set link status.
SCT_ReadoutData & operator=(const SCT_ReadoutData &)=delete
No assignment operator.
bool m_linkActive[2]
Links status for link 0 and 1.
void setChipIn(const SCT_Chip &chip, int link)
Set chip in readout and which link it is on.
std::bitset< SCT_Parameters::NChips > m_chipInReadout
Bitset indicating whether a chip is readout or not.
std::vector< SCT_PortMap > m_chipMap
Vector of port mapping from the chips in an SCT module.
bool followReadoutUpstream(int link, const SCT_Chip &chip, int remainingDepth=12)
Follow the readout to the input side.
SCT_ReadoutData(IMessageSvc *msgSvc=nullptr)
void setChipMap()
Fill the chip mapping.
void maskChipsNotInReadout()
Mask the chips that are not in the readout.
void setChipOut(const SCT_Chip &chip)
Set chip out of readout and reset link.
std::vector< int > m_chipsOnLink0
The chips read out on link 0.
void checkLink(int link)
Check which chips are in the readout for a particular link and if the readout is sane.
void setChips(std::vector< SCT_Chip > &chips)
Set SCT_Chip vectors.
SCT_Parameters::ModuleType m_type
The type of this module (Barrel, Modified Barrel (0 or 1), Endcap)
SCT_ReadoutData(const SCT_ReadoutData &)=delete
No copy ctor.
bool isEndBeingTalkedTo(const SCT_Chip &chip) const
Chip is an end but is being talked to.
bool isLinkStandard(int link) const
is the readout for a particular link sane
SCT_Parameters::ChipType outputChip(const SCT_Chip &chip) const
Find the ID of the output chip for chip.
void printStatus(const Identifier &moduleId) const
Print readout status.
std::vector< SCT_Chip > * m_chips
Private data.
Enums for chip type.
Definition SCT_PortMap.h:17