ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ITkStripsRawContByteStreamTool Class Reference

Athena Algorithm Tool to provide conversion from ITkStrips RDO container to ByteStream. More...

#include <ITkStripsRawContByteStreamTool.h>

Inheritance diagram for ITkStripsRawContByteStreamTool:
Collaboration diagram for ITkStripsRawContByteStreamTool:

Public Member Functions

 ITkStripsRawContByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor. More...
 
virtual ~ITkStripsRawContByteStreamTool ()=default
 Destructor. More...
 
virtual StatusCode initialize () override
 Initialize. More...
 
virtual StatusCode finalize () override
 Finalize. More...
 
virtual StatusCode convert (const SCT_RDO_Container *itkRDOCont) const override
 Main Convert method. More...
 

Private Attributes

ServiceHandle< ByteStreamCnvSvcm_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
 
ToolHandle< IITkStripsRodEncoderm_encoder {this, "Encoder", "ITkStripsRodEncoder", "ITkStrips ROD Encoder for RDO to BS conversion"}
 Algorithm Tool to decode ROB bytestream data into RDO. More...
 
ToolHandle< ISCT_CablingToolm_cabling {this, "ITkStripsCablingTool", "SCT_CablingTool", "Tool to retrieve ITk Strips Cabling"}
 Providing mappings of online and offline identifiers and also serial numbers. More...
 
const SCT_IDm_itkStripsIDHelper {nullptr}
 Identifier helper class for the SCT subdetector that creates compact Identifier objects and IdentifierHash or hash IDs. More...
 
UnsignedShortProperty m_rodBlockVersion {this, "RodBlockVersion", 0}
 

Detailed Description

Athena Algorithm Tool to provide conversion from ITkStrips RDO container to ByteStream.

Conversion from ITkStrips RDO container to ByteStream, and fill it in RawEvent.

Contains convert method that maps ROD ID's to vectors of RDOs in those RODs, then loops through the map, using RodEncoder to fill data for each ROD in turn.

Definition at line 32 of file ITkStripsRawContByteStreamTool.h.

Constructor & Destructor Documentation

◆ ITkStripsRawContByteStreamTool()

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

Constructor.

Definition at line 17 of file ITkStripsRawContByteStreamTool.cxx.

18  :
19  base_class(type, name, parent){
20  //nop
21 }

◆ ~ITkStripsRawContByteStreamTool()

virtual ITkStripsRawContByteStreamTool::~ITkStripsRawContByteStreamTool ( )
virtualdefault

Destructor.

Member Function Documentation

◆ convert()

StatusCode ITkStripsRawContByteStreamTool::convert ( const SCT_RDO_Container itkRDOCont) const
overridevirtual

Main Convert method.

Maps ROD ID's to vectors of RDOs in those RODs, then loops through the map, using RodEncoder to fill data for each ROD in turn.

Parameters
itkRDOContITk RDO Container of Raw Data Collections.

Definition at line 45 of file ITkStripsRawContByteStreamTool.cxx.

45  {
46  FullEventAssembler<SrcIdMap>* fullEventAssembler = nullptr;
47  ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fullEventAssembler,"SCTRawCont") );
49  // Set ROD Minor version
50  fullEventAssembler->setRodMinorVersion(m_rodBlockVersion);
51  ATH_MSG_DEBUG(" Setting Minor Version Number to " << m_rodBlockVersion);
52  // Mapping between ROD IDs and the hits in that ROD
53  std::map<uint32_t, std::vector<const SCT_RDORawData*>> rdoMap;
54 
55  // The following few lines are to make sure there is an entry in the rdoMap for
56  // every ROD, even if there are no hits in it for a particular event
57  // (as there might be ByteStream errors e.g. TimeOut errors).
58  std::vector<std::uint32_t> listOfAllRODs;
59  m_cabling->getAllRods(listOfAllRODs);
60  for (std::uint32_t rod : listOfAllRODs) {
61  rdoMap[rod].clear();
62  }
63  // Loop over the collections in the ITkStrips RDO container
64  for (const auto* itkStripsRawColl : *itkStripsRDOCont) {
65  if (itkStripsRawColl == nullptr) {
66  ATH_MSG_WARNING("Null pointer to ITkStrips RDO collection.");
67  continue;
68  } else {
69  // Collection ID
70  Identifier idColl{itkStripsRawColl->identify()};
71  IdentifierHash idCollHash{m_itkStripsIDHelper->wafer_hash(idColl)};
72  uint32_t robid{m_cabling->getRobIdFromHash(idCollHash)};
73  if (robid == 0) continue;
74  // Building the ROD ID
75  eformat::helper::SourceIdentifier srcIDROB{robid};
76  eformat::helper::SourceIdentifier srcIDROD{srcIDROB.subdetector_id(), srcIDROB.module_id()};
77  uint32_t rodid{srcIDROD.code()};
78  // Loop over RDOs in the collection
79  for (const auto* rdo : *itkStripsRawColl) {
80  // Fill the ROD/RDO map
81  rdoMap[rodid].push_back(rdo);
82  }
83  }
84  } // End loop over collections
85 
86  // Now encode data for each ROD in turn
87  for (const auto& rodToRDOs : rdoMap) {
88  rod = fullEventAssembler->getRodData(rodToRDOs.first); // Get ROD data address
89  m_encoder->fillROD(*rod, rodToRDOs.first, rodToRDOs.second); // Encode ROD data
90  }
91  return StatusCode::SUCCESS;
92 }

◆ finalize()

StatusCode ITkStripsRawContByteStreamTool::finalize ( )
overridevirtual

Finalize.

Definition at line 38 of file ITkStripsRawContByteStreamTool.cxx.

38  {
39  return StatusCode::SUCCESS;
40 }

◆ initialize()

StatusCode ITkStripsRawContByteStreamTool::initialize ( )
overridevirtual

Initialize.

Definition at line 25 of file ITkStripsRawContByteStreamTool.cxx.

25  {
26  ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
27  // Retrieve ID mapping
28  ATH_CHECK(m_cabling.retrieve());
29  ATH_MSG_DEBUG("Retrieved service " << m_cabling);
30  // Get the SCT Helper, valid also for ITk strips
32  return StatusCode::SUCCESS;
33 }

Member Data Documentation

◆ m_byteStreamCnvSvc

ServiceHandle<ByteStreamCnvSvc> ITkStripsRawContByteStreamTool::m_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
private

Definition at line 59 of file ITkStripsRawContByteStreamTool.h.

◆ m_cabling

ToolHandle<ISCT_CablingTool> ITkStripsRawContByteStreamTool::m_cabling {this, "ITkStripsCablingTool", "SCT_CablingTool", "Tool to retrieve ITk Strips Cabling"}
private

Providing mappings of online and offline identifiers and also serial numbers.

Definition at line 66 of file ITkStripsRawContByteStreamTool.h.

◆ m_encoder

ToolHandle<IITkStripsRodEncoder> ITkStripsRawContByteStreamTool::m_encoder {this, "Encoder", "ITkStripsRodEncoder", "ITkStrips ROD Encoder for RDO to BS conversion"}
private

Algorithm Tool to decode ROB bytestream data into RDO.

Definition at line 63 of file ITkStripsRawContByteStreamTool.h.

◆ m_itkStripsIDHelper

const SCT_ID* ITkStripsRawContByteStreamTool::m_itkStripsIDHelper {nullptr}
private

Identifier helper class for the SCT subdetector that creates compact Identifier objects and IdentifierHash or hash IDs.

Also allows decoding of these IDs.

Definition at line 70 of file ITkStripsRawContByteStreamTool.h.

◆ m_rodBlockVersion

UnsignedShortProperty ITkStripsRawContByteStreamTool::m_rodBlockVersion {this, "RodBlockVersion", 0}
private

Definition at line 72 of file ITkStripsRawContByteStreamTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
FullEventAssembler< SrcIdMap >
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ITkStripsRawContByteStreamTool::m_itkStripsIDHelper
const SCT_ID * m_itkStripsIDHelper
Identifier helper class for the SCT subdetector that creates compact Identifier objects and Identifie...
Definition: ITkStripsRawContByteStreamTool.h:70
ITkStripsRawContByteStreamTool::m_cabling
ToolHandle< ISCT_CablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
Definition: ITkStripsRawContByteStreamTool.h:66
ITkStripsRawContByteStreamTool::m_encoder
ToolHandle< IITkStripsRodEncoder > m_encoder
Algorithm Tool to decode ROB bytestream data into RDO.
Definition: ITkStripsRawContByteStreamTool.h:63
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
ITkStripsRawContByteStreamTool::m_rodBlockVersion
UnsignedShortProperty m_rodBlockVersion
Definition: ITkStripsRawContByteStreamTool.h:72
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FullEventAssembler::setRodMinorVersion
void setRodMinorVersion(uint16_t m)
change the ROD minor version
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ITkStripsRawContByteStreamTool::m_byteStreamCnvSvc
ServiceHandle< ByteStreamCnvSvc > m_byteStreamCnvSvc
Definition: ITkStripsRawContByteStreamTool.h:60
IdentifierHash
Definition: IdentifierHash.h:38
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data