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

#include <ITkPixelHitSortingTool.h>

Inheritance diagram for ITkPixelHitSortingTool:
Collaboration diagram for ITkPixelHitSortingTool:

Public Types

typedef ITkPixLayout< uint16_t > HitMap

Public Member Functions

 ITkPixelHitSortingTool (const std::string &type, const std::string &name, const IInterface *parent)
StatusCode initialize ()
template<class ContainerType>
std::map< ITkPixelOnlineId, HitMap > sortRDOHits (const ContainerType *rdoContainer, const ITkPixelCablingData *cabling) const
template<class ContainerType, class RDOType>
StatusCode createRDO (std::map< ITkPixelOnlineId, HitMap > &EventHitMaps, ContainerType *rdoContainer) const
template<class ContainerType>
std::map< ITkPixelOnlineId, ITkPixLayout< uint16_t > > sortRDOHits (const ContainerType *rdoContainer, const ITkPixelCablingData *cabling) const
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< StoreGateSvc > StoreGateSvc_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

ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout {this, "PixelReadoutManager", "ITkPixelReadoutManager", "Pixel readout manager"}
const PixelID * m_pixIdHelper {}
const InDetDD::PixelDetectorManager * m_detManager {}
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

Definition at line 30 of file ITkPixelHitSortingTool.h.

Member Typedef Documentation

◆ HitMap

Definition at line 33 of file ITkPixelHitSortingTool.h.

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ITkPixelHitSortingTool()

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

Definition at line 20 of file ITkPixelHitSortingTool.cxx.

20 :
21 AthAlgTool(type,name,parent)
22{
23 //not much to construct as of now
24}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ createRDO()

template<class ContainerType, class RDOType>
StatusCode ITkPixelHitSortingTool::createRDO ( std::map< ITkPixelOnlineId, HitMap > & EventHitMaps,
ContainerType * rdoContainer ) const

◆ 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 ITkPixelHitSortingTool::initialize ( )

Definition at line 27 of file ITkPixelHitSortingTool.cxx.

27 {
28 ATH_CHECK(m_pixelReadout.retrieve());
29 ATH_CHECK(detStore()->retrieve(m_pixIdHelper, "PixelID"));
30 ATH_CHECK(detStore()->retrieve(m_detManager, "ITkPixel"));
31 return StatusCode::SUCCESS;
32}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
const InDetDD::PixelDetectorManager * m_detManager

◆ 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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ sortRDOHits() [1/2]

template<class ContainerType>
std::map< ITkPixelOnlineId, ITkPixLayout< uint16_t > > ITkPixelHitSortingTool::sortRDOHits ( const ContainerType * rdoContainer,
const ITkPixelCablingData * cabling ) const

Definition at line 35 of file ITkPixelHitSortingTool.cxx.

35 {
36
37 std::map<ITkPixelOnlineId, ITkPixLayout<uint16_t>> EventHitMaps;
38
39 for(const auto& RDO_Collection : *rdoContainer){
40
41 for(const auto *const rdo : *RDO_Collection) {
42
43 const Identifier rdoID = rdo->identify();
44 const Identifier waferID = m_pixIdHelper->wafer_id(rdoID);
45
46 const uint16_t tot = rdo->getToT();
47
48 uint16_t col = (uint16_t) m_pixIdHelper->eta_index(rdoID);
49 uint16_t row = (uint16_t) m_pixIdHelper->phi_index(rdoID);
50 const uint32_t chip = (const uint32_t) ITkPixelCablingData::chipID( cabling->transformType(waferID.get_identifier32().get_compact()), col, row);
51
52 ATH_MSG_DEBUG("Before Inverse transform");
53 ITkPixelCabling::chipToModuleInverseTransform(cabling->transformType(waferID.get_identifier32().get_compact()), chip, col, row);
54 ATH_MSG_DEBUG("After Inverse transform");
55 //find out if we're dealing with 25x100 sensors
56 const InDetDD::SiDetectorElement *element = m_detManager->getDetectorElement(waferID);
57 const InDetDD::PixelModuleDesign *p_design = static_cast<const InDetDD::PixelModuleDesign *>(&element->design());
58 const uint nChips = p_design->numberOfCircuits();
59 const uint rowsPerFE = p_design->rowsPerCircuit();
60 const uint colsPerFE = p_design->columnsPerCircuit();
61
62 ATH_MSG_DEBUG("Module specs: nChips = " << nChips << ", rows per FE = " << rowsPerFE << " cols per FE = " << colsPerFE);
63 //<----------
64
65 //Store ToT+1, reserve 0 for no hit.
66 //HitMap and encoder labels rows/cols from 0
67
68 //Data from a FE are identified by "DetectorResourceID", which is part
69 //of the header delimiting individual FE payloads within a ROD fragment
70 //payload. The DetectorResourceID is detector-defined. For pixels, it
71 //has an 'online part', containing chipID and information useful for decoding
72 //(chipID on/off). Then there's an offline-specific part
73 //composed - for convenience - of (offline) module ID. We can mask out
74 //the auxiliary online info to get the mapping from FE -> online ID
75 // offlineDetectorResourceID = chipID [2 MSB] | module ID [24 LSB]
76 //Furthermore, we need to know which ROB fragment the data will go to,
77 //hence we need the 'sourceID' (in eformat vocabulary), which identifies
78 //the DMA buffer on the FELIX machine that received the data. This is
79 //all provided by the cabling package, which gives
80 // offlineDetectorResourceID -> {DetectorResourceID, sourceID}
81 //mapping.
82
83 //ITkPixelCabling::ModuleInfo mi = cabling->onlineModuleInfo(waferID);
84 uint32_t offlineDetectorResourceID = (waferID.get_identifier32().get_compact() >> 8) | (chip << 30);
85
86 ITkPixelOnlineId onlineID = cabling->onlineId(offlineDetectorResourceID);
87
88 //Found a valid ID?
89 if (onlineID.sourceID() == 0xFFFFFFFF){
90 ATH_MSG_WARNING("Cabling not found for module bec " << std::dec << m_pixIdHelper->barrel_ec(waferID) << " ld " << m_pixIdHelper->layer_disk(waferID) << " eta " << m_pixIdHelper->eta_module(waferID) << " phi " << m_pixIdHelper->phi_module(waferID) << ", proceeding with a dummy value");
91 onlineID = ITkPixelOnlineId(0x00170000 | (offlineDetectorResourceID & 0x0000FFFF), offlineDetectorResourceID | 0xF0000000);
92 }
93
94 ATH_MSG_DEBUG(" Chip: " << std::hex << onlineID << std::dec << " ID: " << chip << " col: " << col << " row: " << row << " ToT: " << tot << " eta_index = " << m_pixIdHelper->eta_index(rdoID) << " phi index = " << m_pixIdHelper->phi_index(rdoID) << " rowsPerFE = " << rowsPerFE << " colsPerFE = " << colsPerFE << "\n");
95
96 EventHitMaps[onlineID](col, row) = tot + 1;
97
98 };
99 };
100
101 return EventHitMaps;
102
103}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
unsigned int uint
static uint8_t chipID(const ITkPixelCabling::TransformType &t, const uint16_t &col, const uint16_t &row)
std::uint32_t sourceID() const
Return the rod/rob Id.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
int rowsPerCircuit() const
Number of cell rows per circuit:
int numberOfCircuits() const
Total number of circuits:
int columnsPerCircuit() const
Number of cell columns per circuit:
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
static void chipToModuleInverseTransform(const TransformType &transform, const uint8_t &chipID, uint16_t &col, uint16_t &row)
row
Appending html table to final .html summary file.
setWord1 uint16_t
setEventNumber uint32_t

◆ sortRDOHits() [2/2]

template<class ContainerType>
std::map< ITkPixelOnlineId, HitMap > ITkPixelHitSortingTool::sortRDOHits ( const ContainerType * rdoContainer,
const ITkPixelCablingData * cabling ) const

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detManager

const InDetDD::PixelDetectorManager* ITkPixelHitSortingTool::m_detManager {}
private

Definition at line 52 of file ITkPixelHitSortingTool.h.

52{};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_pixelReadout

ServiceHandle< InDetDD::IPixelReadoutManager > ITkPixelHitSortingTool::m_pixelReadout {this, "PixelReadoutManager", "ITkPixelReadoutManager", "Pixel readout manager"}
private

Definition at line 48 of file ITkPixelHitSortingTool.h.

48{this, "PixelReadoutManager", "ITkPixelReadoutManager", "Pixel readout manager"};

◆ m_pixIdHelper

const PixelID* ITkPixelHitSortingTool::m_pixIdHelper {}
private

Definition at line 50 of file ITkPixelHitSortingTool.h.

50{};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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