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

#include <PixelRawDataProviderTool.h>

Inheritance diagram for PixelRawDataProviderTool:
Collaboration diagram for PixelRawDataProviderTool:

Public Member Functions

 PixelRawDataProviderTool (const std::string &type, const std::string &name, const IInterface *parent)
 constructor
StatusCode initialize () override
 initialize
StatusCode convert (std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vecRobs, IPixelRDO_Container *rdoIdc, IDCInDetBSErrContainer &decodingErrors, const EventContext &ctx) const final
 this is the main decoding method
int SizeOfIDCInDetBSErrContainer () const final
 Size of IDCInDetBSErrContainer.
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

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool InterfaceID.

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< IPixelRodDecoderm_decoder {this, "Decoder", "PixelRodDecoder", "Tool for PixelRodDecoder"}
SG::WriteHandleKey< InDetTimeCollectionm_LVL1CollectionKey {this, "LVL1CollectionName", "PixelLVL1ID"}
SG::WriteHandleKey< InDetTimeCollectionm_BCIDCollectionKey {this, "BCIDCollectionName", "PixelBCID"}
Gaudi::Property< bool > m_storeInDetTimeColls {this, "StoreInDetTimeCollections", true, "Store LVL1ID and BCID"}
std::atomic_int m_DecodeErrCount
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 21 of file PixelRawDataProviderTool.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

◆ PixelRawDataProviderTool()

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

constructor

Definition at line 17 of file PixelRawDataProviderTool.cxx.

17 :
18 AthAlgTool(type,name,parent),
20{
21 declareInterface<IPixelRawDataProviderTool>(this);
22}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ convert()

StatusCode PixelRawDataProviderTool::convert ( std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > & vecRobs,
IPixelRDO_Container * rdoIdc,
IDCInDetBSErrContainer & decodingErrors,
const EventContext & ctx ) const
finalvirtual

this is the main decoding method

Implements IPixelRawDataProviderTool.

Definition at line 34 of file PixelRawDataProviderTool.cxx.

35 {
36 if (vecRobs.size()==0) { return StatusCode::SUCCESS; }
37
38 std::vector<const ROBFragment*>::const_iterator rob_it = vecRobs.begin();
39
40#ifdef PIXEL_DEBUG
41 ATH_MSG_DEBUG(" New ROD collection found: LVL1=" << (*rob_it)->rod_lvl1_id() << " Size=" << vecRobs.size());
42#endif
43#ifdef PLOTS
44 std::cout << " New ROD collection found: LVL1=" << (*rob_it)->rod_lvl1_id() << " Size=" << vecRobs.size() << std::endl;
45#endif
46
47 SG::WriteHandle<InDetTimeCollection> LVL1Collection;
48 SG::WriteHandle<InDetTimeCollection> BCIDCollection;
49
51 // are we working on a new event ?
52 LVL1Collection = SG::makeHandle(m_LVL1CollectionKey,ctx);
53 ATH_CHECK(LVL1Collection.record(std::make_unique<InDetTimeCollection>()));
54 ATH_MSG_DEBUG("InDetTimeCollection " << LVL1Collection.name() << " registered in StoreGate");
55 LVL1Collection->reserve(vecRobs.size());
56
57 BCIDCollection = SG::makeHandle(m_BCIDCollectionKey,ctx);
58 ATH_CHECK(BCIDCollection.record(std::make_unique<InDetTimeCollection>()));
59 ATH_MSG_DEBUG("InDetTimeCollection " << BCIDCollection.name() << " registered in StoreGate");
60 BCIDCollection->reserve(vecRobs.size());
61 }
62
63#ifdef PIXEL_DEBUG
64 ATH_MSG_DEBUG(" New event, reset the collection set");
65#endif
66
67 // loop over the ROB fragments
68 for (; rob_it!=vecRobs.end(); ++rob_it) {
69 uint32_t robid = (*rob_it)->rob_source_id();
70#ifdef PIXEL_DEBUG
71 ATH_MSG_DEBUG("Found ROB " << std::hex << robid << std::dec);
72#endif
73
75 unsigned int lvl1id = (*rob_it)->rod_lvl1_id();
76 LVL1Collection->emplace_back(robid,lvl1id) ;
77
78 unsigned int bcid = (*rob_it)->rod_bc_id();
79 BCIDCollection->emplace_back(robid,bcid);
80
81#ifdef PIXEL_DEBUG
82 ATH_MSG_DEBUG("Stored LVL1ID "<<lvl1id<<" and BCID "<<bcid<<" in InDetTimeCollections");
83#endif
84
85 }
86
87 // here the code for the timing monitoring should be reinserted
88 // using 1 container per event and subdetector
89 StatusCode sc = m_decoder->fillCollection(&**rob_it, rdoIdc, decodingErrors,nullptr,ctx);
90
91 const int issuesMessageCountLimit = 100;
92 if (sc==StatusCode::FAILURE) {
93 if (m_DecodeErrCount < issuesMessageCountLimit) {
94 ATH_MSG_INFO("Problem with Pixel ByteStream Decoding!");
96 }
97 else if (issuesMessageCountLimit == m_DecodeErrCount) {
98 ATH_MSG_INFO("Too many Problems with Pixel Decoding messages. Turning message off.");
100 }
101 }
102 }
103 return StatusCode::SUCCESS;
104}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
SG::WriteHandleKey< InDetTimeCollection > m_LVL1CollectionKey
Gaudi::Property< bool > m_storeInDetTimeColls
SG::WriteHandleKey< InDetTimeCollection > m_BCIDCollectionKey
ToolHandle< IPixelRodDecoder > m_decoder
const std::string & name() const
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
setEventNumber setTimeStamp bcid
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 PixelRawDataProviderTool::initialize ( )
override

initialize

Definition at line 24 of file PixelRawDataProviderTool.cxx.

24 {
25 ATH_CHECK(AthAlgTool::initialize());
26 ATH_CHECK(m_decoder.retrieve());
27
30
31 return StatusCode::SUCCESS;
32}

◆ 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.

◆ interfaceID()

const InterfaceID & IPixelRawDataProviderTool::interfaceID ( )
inlinestaticinherited

AlgTool InterfaceID.

Definition at line 35 of file IPixelRawDataProviderTool.h.

35 {
36static const InterfaceID IID_IPixelRawDataProviderTool("IPixelRawDataProviderTool", 1, 0);
37return IID_IPixelRawDataProviderTool;
38}

◆ 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 }

◆ SizeOfIDCInDetBSErrContainer()

int PixelRawDataProviderTool::SizeOfIDCInDetBSErrContainer ( ) const
finalvirtual

Size of IDCInDetBSErrContainer.

Implements IPixelRawDataProviderTool.

Definition at line 106 of file PixelRawDataProviderTool.cxx.

106 {
107 //=========================================================
108 // Size of Pixel BS Error container
109 //
110 // The error would be stored not only for module but also each FE (x16) per module.
111 // In addition, IBL FEI4 provides error counter between trigger, this also extends
112 // the size beyond nominal module + FE ID. These numbers come from the hardware
113 // specification so that there is no easy way to document in the header file.
114 // Rather, put the hardcoded number here.
115 //
116 // Total number of pixel modules: 2048
117 // Number of FE chips per module: 16
118 // -------------------------------------
119 // 2048 x 17 (module + FE) = 34816
120 //
121 // IBL extra error information :
122 // 280(module) x 2(FE) x 32(error counter) = 17920
123 // -------------------------------------
124 //
125 // isActive status : 2048
126 // -------------------------------------
127 // Total : 54784
128 //=========================================================
130}
static constexpr size_t ERROR_CONTAINER_MAX

◆ 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_BCIDCollectionKey

SG::WriteHandleKey<InDetTimeCollection> PixelRawDataProviderTool::m_BCIDCollectionKey {this, "BCIDCollectionName", "PixelBCID"}
private

Definition at line 48 of file PixelRawDataProviderTool.h.

48{this, "BCIDCollectionName", "PixelBCID"};

◆ m_DecodeErrCount

std::atomic_int PixelRawDataProviderTool::m_DecodeErrCount
mutableprivate

Definition at line 51 of file PixelRawDataProviderTool.h.

◆ m_decoder

ToolHandle<IPixelRodDecoder> PixelRawDataProviderTool::m_decoder {this, "Decoder", "PixelRodDecoder", "Tool for PixelRodDecoder"}
private

Definition at line 43 of file PixelRawDataProviderTool.h.

44{this, "Decoder", "PixelRodDecoder", "Tool for PixelRodDecoder"};

◆ 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_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_LVL1CollectionKey

SG::WriteHandleKey<InDetTimeCollection> PixelRawDataProviderTool::m_LVL1CollectionKey {this, "LVL1CollectionName", "PixelLVL1ID"}
private

Definition at line 47 of file PixelRawDataProviderTool.h.

47{this, "LVL1CollectionName", "PixelLVL1ID"};

◆ m_storeInDetTimeColls

Gaudi::Property<bool> PixelRawDataProviderTool::m_storeInDetTimeColls {this, "StoreInDetTimeCollections", true, "Store LVL1ID and BCID"}
private

Definition at line 49 of file PixelRawDataProviderTool.h.

49{this, "StoreInDetTimeCollections", true, "Store LVL1ID and BCID"};

◆ 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: