Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
SCT_ReadoutTool Class Reference

#include <SCT_ReadoutTool.h>

Inheritance diagram for SCT_ReadoutTool:
Collaboration diagram for SCT_ReadoutTool:

Public Member Functions

 SCT_ReadoutTool (const std::string &type, const std::string &name, const IInterface *parent)
 Usual framework methods for an AlgTool. More...
 
virtual ~SCT_ReadoutTool ()=default
 
StatusCode initialize () override
 
StatusCode finalize () override
 
virtual StatusCode determineReadout (const Identifier &moduleId, std::vector< SCT_Chip > &chips, bool link0ok, bool link1ok) const override
 Determine which chips are in the readout for a module of a particular type by Identifier. More...
 
virtual StatusCode determineReadout (const int truncatedSerialNumber, std::vector< SCT_Chip > &chips, bool link0ok, bool link1ok) const override
 Determine which chips are in the readout for a module of a particular type by truncated serial number. More...
 

Private Attributes

const SCT_IDm_sctId
 Private data. More...
 
ToolHandle< ISCT_CablingToolm_cablingTool {this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"}
 

Detailed Description

Example class to show calling the SCT_ReadoutTool

Class to represent the SCT module readout

Definition at line 32 of file SCT_ReadoutTool.h.

Constructor & Destructor Documentation

◆ SCT_ReadoutTool()

SCT_ReadoutTool::SCT_ReadoutTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Usual framework methods for an AlgTool.

Definition at line 13 of file SCT_ReadoutTool.cxx.

13  :
14  base_class(type, name, parent),
15  m_sctId{nullptr}
16 {
17 }

◆ ~SCT_ReadoutTool()

virtual SCT_ReadoutTool::~SCT_ReadoutTool ( )
virtualdefault

Member Function Documentation

◆ determineReadout() [1/2]

StatusCode SCT_ReadoutTool::determineReadout ( const Identifier moduleId,
std::vector< SCT_Chip > &  chips,
bool  link0ok,
bool  link1ok 
) const
overridevirtual

Determine which chips are in the readout for a module of a particular type by Identifier.

Definition at line 50 of file SCT_ReadoutTool.cxx.

50  {
51  // This determineReadout(const Identifier is the main method of this class.
52  // Methods of SCT_ReadoutData are called in the following order in this method:
53  // setChips
54  // setLinkStatus
55  // setModuleType
56  // setChipMap
57  // clearChipReadout
58  // checkLink
59  // \_ followReadoutUpstream
60  // \_ setChipIn
61  // \_ setChipOut
62  // \_ hasConnectedInput
63  // \_ inputChip
64  // maskChipsNotInReadout
65  // \_ isChipReadOut
66  // printStatus
67  // \_ isLinkStandard
68  //
69  // The following two methods are not used.
70  // isEndBeingTalkedTo
71  // \_ outputChip
72 
73  // Determine which chips are in the module readout from Identifier
74  ATH_MSG_DEBUG("Determining Readout for module ID = " << moduleId);
75 
76  // Make sure there are 12 chips
77  if (chips.size()!=12) {
78  ATH_MSG_DEBUG("Readout must contain exactly 12 chips");
79  return StatusCode::SUCCESS;
80  }
81 
83 
84  // Set the chips and sort in order of ID
85  data.setChips(chips);
86 
87  // Set link status
88  data.setLinkStatus(link0ok, link1ok);
89 
90  // Determine module type (as per ModuleType enum) and set mapping
91  data.setModuleType(moduleId, m_sctId->barrel_ec(moduleId));
92  data.setChipMap();
93 
94  // Set all chips out of readout and clear both links to start
95  data.clearChipReadout();
96 
97  // Check the links
98  data.checkLink(0);
99  data.checkLink(1);
100 
101  // Mask chips not in readout
102  data.maskChipsNotInReadout();
103 
104  data.printStatus(moduleId);
105 
106  return StatusCode::SUCCESS;
107 }

◆ determineReadout() [2/2]

StatusCode SCT_ReadoutTool::determineReadout ( const int  truncatedSerialNumber,
std::vector< SCT_Chip > &  chips,
bool  link0ok,
bool  link1ok 
) const
overridevirtual

Determine which chips are in the readout for a module of a particular type by truncated serial number.

Definition at line 38 of file SCT_ReadoutTool.cxx.

38  {
39  // Determine which chips are in the module readout from truncated serial number
40 
41  // Get moduleId
42  const IdentifierHash& hash{m_cablingTool->getHashFromSerialNumber(truncatedSerialNumber)};
43  if (not hash.is_valid()) return StatusCode::SUCCESS;
45 
46  // Call identifier version
47  return determineReadout(moduleId, chips, link0ok, link1ok);
48 }

◆ finalize()

StatusCode SCT_ReadoutTool::finalize ( )
override

Definition at line 33 of file SCT_ReadoutTool.cxx.

33  {
34  ATH_MSG_DEBUG("Finalize SCT_ReadoutTool");
35  return StatusCode::SUCCESS;
36 }

◆ initialize()

StatusCode SCT_ReadoutTool::initialize ( )
override

Definition at line 20 of file SCT_ReadoutTool.cxx.

20  {
21  ATH_MSG_DEBUG("Initialize SCT_ReadoutTool");
22  // Retrieve cabling
23  if (not m_cablingTool.empty()) {
24  ATH_CHECK(m_cablingTool.retrieve());
25  }
26  // Retrieve SCT helper
27  ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID"));
28 
29  return StatusCode::SUCCESS;
30 }

Member Data Documentation

◆ m_cablingTool

ToolHandle<ISCT_CablingTool> SCT_ReadoutTool::m_cablingTool {this, "SCT_CablingTool", "SCT_CablingTool", "Tool to retrieve SCT Cabling"}
private

Definition at line 51 of file SCT_ReadoutTool.h.

◆ m_sctId

const SCT_ID* SCT_ReadoutTool::m_sctId
private

Private data.

ID helper for SCT

Definition at line 50 of file SCT_ReadoutTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SCT_ReadoutTool::m_sctId
const SCT_ID * m_sctId
Private data.
Definition: SCT_ReadoutTool.h:50
SCT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: SCT_ID.h:728
SCT_ID::module_id
Identifier module_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: SCT_ID.h:416
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SCT_ReadoutData
Definition: SCT_ReadoutData.h:42
SCT_ReadoutTool::m_cablingTool
ToolHandle< ISCT_CablingTool > m_cablingTool
Definition: SCT_ReadoutTool.h:51
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
SCT_ReadoutTool::determineReadout
virtual StatusCode determineReadout(const Identifier &moduleId, std::vector< SCT_Chip > &chips, bool link0ok, bool link1ok) const override
Determine which chips are in the readout for a module of a particular type by Identifier.
Definition: SCT_ReadoutTool.cxx:50
Identifier
Definition: IdentifierFieldParser.cxx:14