ATLAS Offline Software
Loading...
Searching...
No Matches
ITkPixelCnvTool Class Reference

This tool orchestrates the individual steps in the BS conversion. More...

#include <ITkPixelCnvTool.h>

Inheritance diagram for ITkPixelCnvTool:
Collaboration diagram for ITkPixelCnvTool:

Public Member Functions

 ITkPixelCnvTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
 Retrieve helper tools.
template<class ContainerType>
StatusCode convertToByteStream (const ContainerType *cont) const
 Take ITkPixelRDO_Container or PixelRDO_Container and translate it to bytestream.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< ITkPixelHitSortingToolm_hitSortingTool {this, "HitSortingTool", ""}
ToolHandle< ITkPixelEncodingToolm_encodingTool {this, "EncodingTool", "", "The encoding tool"}
ServiceHandle< IByteStreamCnvSvcm_byteStreamCnvSvc {this, "ByteStreamConvertionService", "ByteStreamCnvSvc", "The Byte stream coversion service"}
SG::ReadCondHandleKey< ITkPixelCablingDatam_pixelCablingKey {this, "PixelCablingKey", "", "Cond Key of Pixel Cabling"}
ToolHandle< ITkPixelDataRateMonToolm_dataRateMonTool {this, "DataRateMonitoringTool", "", "Monitoring tool for data rate evaluation"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

This tool orchestrates the individual steps in the BS conversion.

Definition at line 30 of file ITkPixelCnvTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ITkPixelCnvTool()

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

Definition at line 20 of file ITkPixelCnvTool.cxx.

21 : AthAlgTool(type, name, parent)
22{}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ convertToByteStream()

template<class ContainerType>
template StatusCode ITkPixelCnvTool::convertToByteStream< PixelRDO_Container > ( const ContainerType * cont) const

Take ITkPixelRDO_Container or PixelRDO_Container and translate it to bytestream.

Definition at line 48 of file ITkPixelCnvTool.cxx.

48 {
49
50 //Get the cabling
51 SG::ReadCondHandle<ITkPixelCablingData> cablingData(m_pixelCablingKey);
52 const ITkPixelCablingData* cabling = *cablingData;
53
54 //Get the full event assembler from ByteStreamCnvSvcBase
55 //SrcIdMap translates lower lvl IDs into higher lvl, e. g. ROD -> ROB, ROB -> ROS, ROS -> Det
56 FullEventAssembler<SrcIdMap>* fea = 0;
57 ATH_CHECK(m_byteStreamCnvSvc->getFullEventAssembler(fea, "ITkPixelRawCont"));
58
59 fea->setDetEvtType(0x0);
60 fea->setLvl1TriggerType(0x0);
61
62 //Expose the buffer to be filled with the encoded data
63 //Other BS converters use FullEventAssembler<SrcIdMap>::RODDATA,
64 //which is just a typedef for std::vector<uint32_t>. Why the extra
65 //layer of renaming?
66 std::vector<uint32_t>* rod;
67
68 //sort the RDO hits based on the FE
69 const std::map<ITkPixelOnlineId, ITkPixLayout<uint16_t>> EventHitMaps = m_hitSortingTool->sortRDOHits(cont, cabling);
70
71 int nRODs = 0;
72
73 for (const auto& [onlineID, hitMap] : EventHitMaps){
74
75 //make a copy of the onlineID
76 uint32_t onID = (uint32_t)onlineID;
77
78 //Encode the FE hits
79 std::vector<uint32_t> encodedStream = m_encodingTool->encodeFE(hitMap, onID & 0x3);
80
81 //Is this a merged quad? If so, collapse the chip ID in the online identifier to 00
82 //we can get the information from cabling's online -> modlue Info map.
83 ITkPixelCabling::ModuleInfo mi = cabling->offlineModuleInfo((onID >> 2) << 2);
84 if (mi.type == ITkPixelCabling::ModuleType::MergedQuad) onID = (onID >> 2) << 2;
85
86 // passing information to the monitoring tool if initialised
87 if (not m_dataRateMonTool.empty()) {
88 m_dataRateMonTool->fill(mi.id.get_identifier32().get_compact(), encodedStream, hitMap);
89 }
90
91 //At this point, the ROD identifier will be labelled with lowest two bits 00 for single
92 //chips, chip 00 in unmerged quads and for entire merged quads, and with
93 //the rest up to 0x3 for the remaining 3 chips in unmerged quads. The higher bits are
94 //the online 'base'. We need this because of the unmerged quads, where one
95 //offline entity maps on 4 online entities.
96
97
98 //Create ROD and insert the payload
99 rod = fea->getRodData(onID);
100 if (rod->size() == 0) nRODs++;
101 rod->insert(rod->end(), encodedStream.begin(), encodedStream.end());
102
103 }
104 std::cout << "nRODs = " << nRODs << "\n";
105
106 return StatusCode::SUCCESS;
107}
#define ATH_CHECK
Evaluate an expression and check for errors.
void setLvl1TriggerType(uint8_t m)
change LVL1 Trigger Type
void setDetEvtType(uint32_t m)
change Detector Event Type
RODDATA * getRodData(uint32_t id)
get a block of ROD data
SG::ReadCondHandleKey< ITkPixelCablingData > m_pixelCablingKey
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
ToolHandle< ITkPixelEncodingTool > m_encodingTool
ToolHandle< ITkPixelHitSortingTool > m_hitSortingTool
ToolHandle< ITkPixelDataRateMonTool > m_dataRateMonTool
setEventNumber uint32_t

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode ITkPixelCnvTool::initialize ( )
overridevirtual

Retrieve helper tools.

Definition at line 27 of file ITkPixelCnvTool.cxx.

27 {
28
29 //Initialize the sub-tools
30 ATH_CHECK(m_hitSortingTool.retrieve());
31
32 ATH_CHECK(m_encodingTool.retrieve());
33
34 ATH_CHECK(m_pixelCablingKey.initialize());
35
36 if (not m_dataRateMonTool.empty())
37 ATH_CHECK(m_dataRateMonTool.retrieve());
38
39 return StatusCode::SUCCESS;
40
41}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_byteStreamCnvSvc

ServiceHandle<IByteStreamCnvSvc> ITkPixelCnvTool::m_byteStreamCnvSvc {this, "ByteStreamConvertionService", "ByteStreamCnvSvc", "The Byte stream coversion service"}
private

Definition at line 47 of file ITkPixelCnvTool.h.

47{this, "ByteStreamConvertionService", "ByteStreamCnvSvc", "The Byte stream coversion service"};

◆ m_dataRateMonTool

ToolHandle<ITkPixelDataRateMonTool> ITkPixelCnvTool::m_dataRateMonTool {this, "DataRateMonitoringTool", "", "Monitoring tool for data rate evaluation"}
private

Definition at line 51 of file ITkPixelCnvTool.h.

51{this, "DataRateMonitoringTool", "", "Monitoring tool for data rate evaluation"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_encodingTool

ToolHandle<ITkPixelEncodingTool> ITkPixelCnvTool::m_encodingTool {this, "EncodingTool", "", "The encoding tool"}
private

Definition at line 45 of file ITkPixelCnvTool.h.

45{this, "EncodingTool", "", "The encoding tool"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_hitSortingTool

ToolHandle<ITkPixelHitSortingTool> ITkPixelCnvTool::m_hitSortingTool {this, "HitSortingTool", ""}
private

Definition at line 43 of file ITkPixelCnvTool.h.

43{this, "HitSortingTool", ""};

◆ m_pixelCablingKey

SG::ReadCondHandleKey<ITkPixelCablingData> ITkPixelCnvTool::m_pixelCablingKey {this, "PixelCablingKey", "", "Cond Key of Pixel Cabling"}
private

Definition at line 49 of file ITkPixelCnvTool.h.

49{this, "PixelCablingKey", "", "Cond Key of Pixel Cabling"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: