ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1BS::CpmRoiByteStreamV2Tool Class Reference

Tool to perform ROB fragments to CPM TOB RoI and CPM TOB RoI to raw data conversions. More...

#include <CpmRoiByteStreamV2Tool.h>

Inheritance diagram for LVL1BS::CpmRoiByteStreamV2Tool:
Collaboration diagram for LVL1BS::CpmRoiByteStreamV2Tool:

Public Member Functions

 CpmRoiByteStreamV2Tool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~CpmRoiByteStreamV2Tool ()
virtual StatusCode initialize () override
StatusCode convert (const EventContext &ctx, const std::string &robFrags, DataVector< LVL1::CPMTobRoI > *roiCollection) const
 Convert ROB fragments to CPM RoIs.
StatusCode convert (const IROBDataProviderSvc::VROBFRAG &robFrags, DataVector< LVL1::CPMTobRoI > *roiCollection) const
StatusCode convert (const DataVector< LVL1::CPMTobRoI > *roiCollection) const
 Convert CPM RoI to bytestream.
const std::vector< uint32_t > & sourceIDs (const std::string &sgKey) const
 Return reference to vector with all possible Source Identifiers.
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 DataVector< LVL1::CPMTobRoICpmRoiCollection
typedef std::map< uint32_t, const LVL1::CPMTobRoI * > CpmRoiMap
typedef IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
typedef OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
typedef OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::vector< uint32_t > makeSourceIDs (bool roiDaq) const
void setupCpmRoiMap (const CpmRoiCollection *roiCollection, CpmRoiMap &roiMap) const
 Set up CPM RoI map.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< IByteStreamCnvSvcm_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
ServiceHandle< IROBDataProviderSvcm_robDataProvider
ToolHandle< LVL1BS::L1CaloErrorByteStreamToolm_errorTool
 Property: Error collection tool.
int m_crateOffsetHw
 Property: Hardware crate number offset.
int m_crateOffsetSw
 Property: Software crate number offset.
int m_version
 Property: Sub_block header version.
int m_dataFormat
 Property: Data compression format.
const int m_crates
 Number of crates.
const int m_modules
 Number of CPM modules per crate.
int m_slinks
 Property: Number of slinks per crate when writing out bytestream.
int m_crateMin
 Property: Minimum crate number when writing out bytestream.
int m_crateMax
 Property: Maximum crate number when writing out bytestream.
std::vector< uint32_t > m_sourceIDsProp
 Property: ROB source IDs.
std::vector< uint32_t > m_sourceIDsRoIBProp
 Property: ROB source IDs for RoIB.
const eformat::SubDetector m_subDetector
 Sub-detector type.
const L1CaloSrcIdMap m_srcIdMap
 Source ID converter.
bool m_isM7Format
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

Tool to perform ROB fragments to CPM TOB RoI and CPM TOB RoI to raw data conversions.

Based on ROD document version X_xxx. <<== CHECK

Author
Peter Faulkner

Definition at line 47 of file CpmRoiByteStreamV2Tool.h.

Member Typedef Documentation

◆ CpmRoiCollection

◆ CpmRoiMap

typedef std::map<uint32_t, const LVL1::CPMTobRoI*> LVL1BS::CpmRoiByteStreamV2Tool::CpmRoiMap
private

Definition at line 77 of file CpmRoiByteStreamV2Tool.h.

◆ ROBIterator

typedef IROBDataProviderSvc::VROBFRAG::const_iterator LVL1BS::CpmRoiByteStreamV2Tool::ROBIterator
private

Definition at line 78 of file CpmRoiByteStreamV2Tool.h.

◆ ROBPointer

◆ RODPointer

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CpmRoiByteStreamV2Tool()

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

Definition at line 40 of file CpmRoiByteStreamV2Tool.cxx.

43 : AthAlgTool(type, name, parent),
44 m_robDataProvider("ROBDataProviderSvc", name),
45 m_errorTool("LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
46 m_crates(4), m_modules(14),
47 m_subDetector (eformat::TDAQ_CALO_CLUSTER_PROC_ROI)
48{
49 declareInterface<CpmRoiByteStreamV2Tool>(this);
50
51 declareProperty("ErrorTool", m_errorTool,
52 "Tool to collect errors for monitoring");
53 declareProperty("CrateOffsetHw", m_crateOffsetHw = 8,
54 "Offset of CP crate numbers in bytestream");
55 declareProperty("CrateOffsetSw", m_crateOffsetSw = 0,
56 "Offset of CP crate numbers in RDOs");
57
58 // Properties for reading bytestream only
59 declareProperty("ROBSourceIDs", m_sourceIDsProp,
60 "ROB fragment source identifiers");
61 declareProperty("ROBSourceIDsRoIB", m_sourceIDsRoIBProp,
62 "ROB fragment source identifiers for RoIBs");
63
64 // Properties for writing bytestream only
65 declareProperty("DataVersion", m_version = 2,
66 "Format version number in sub-block header");
67 declareProperty("DataFormat", m_dataFormat = 1,
68 "Format identifier (0-1) in sub-block header");
69 declareProperty("SlinksPerCrate", m_slinks = 1,
70 "The number of S-Links per crate");
71 declareProperty("CrateMin", m_crateMin = 0,
72 "Minimum crate number, allows partial output");
73 declareProperty("CrateMax", m_crateMax = m_crates - 1,
74 "Maximum crate number, allows partial output");
75
76 declareProperty("IsM7Format", m_isM7Format = false,
77 "Set it for M7 raw data");
78
79}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const eformat::SubDetector m_subDetector
Sub-detector type.
int m_crateOffsetHw
Property: Hardware crate number offset.
int m_crateMin
Property: Minimum crate number when writing out bytestream.
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
int m_crateOffsetSw
Property: Software crate number offset.
std::vector< uint32_t > m_sourceIDsRoIBProp
Property: ROB source IDs for RoIB.
int m_version
Property: Sub_block header version.
ToolHandle< LVL1BS::L1CaloErrorByteStreamTool > m_errorTool
Property: Error collection tool.
const int m_modules
Number of CPM modules per crate.
int m_crateMax
Property: Maximum crate number when writing out bytestream.
int m_dataFormat
Property: Data compression format.
int m_slinks
Property: Number of slinks per crate when writing out bytestream.
const int m_crates
Number of crates.
std::vector< uint32_t > m_sourceIDsProp
Property: ROB source IDs.

◆ ~CpmRoiByteStreamV2Tool()

LVL1BS::CpmRoiByteStreamV2Tool::~CpmRoiByteStreamV2Tool ( )
virtual

Definition at line 83 of file CpmRoiByteStreamV2Tool.cxx.

84{
85}

Member Function Documentation

◆ convert() [1/3]

StatusCode LVL1BS::CpmRoiByteStreamV2Tool::convert ( const DataVector< LVL1::CPMTobRoI > * roiCollection) const

Convert CPM RoI to bytestream.

Definition at line 334 of file CpmRoiByteStreamV2Tool.cxx.

336{
337 const bool debug = msgLvl(MSG::DEBUG);
338 if (debug) msg(MSG::DEBUG);
339
340 // Get the event assembler
341 FullEventAssembler<L1CaloSrcIdMap>* fea = nullptr;
342 ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
343 "CpmRoiByteStreamV2") );
344 const uint16_t minorVersion = m_srcIdMap.minorVersion();
345 fea->setRodMinorVersion(minorVersion);
346
347 // Pointer to ROD data vector
348
350
351 // Sub-block for neutral format
352 CpmRoiSubBlockV2 subBlock;
353
354 // Set up the container map
355
356 // CPM RoI map
357 CpmRoiMap roiMap;
358 setupCpmRoiMap(roiCollection, roiMap);
359
360 if (debug)
361 {
362 msg() << "Number of RoIs to be written = " << roiCollection->size()
363 << " (collection), " << roiMap.size() << " (map)"
364 << endmsg;
365 }
366 int count = 0;
367 CpmRoiMap::const_iterator mapIter = roiMap.begin();
368 CpmRoiMap::const_iterator mapIterEnd = roiMap.end();
369
370 // Loop over data
371
372 const bool neutralFormat = m_dataFormat == L1CaloSubBlock::NEUTRAL;
373 const int modulesPerSlink = m_modules / m_slinks;
374 for (int crate = m_crateMin; crate <= m_crateMax; ++crate)
375 {
376 const int hwCrate = crate + m_crateOffsetHw;
377
378 // CPM modules are numbered 1 to m_modules
379 for (int module = 1; module <= m_modules; ++module)
380 {
381 const int mod = module - 1;
382
383 // Pack required number of modules per slink
384
385 if (mod % modulesPerSlink == 0)
386 {
387 const int daqOrRoi = 1;
388 const int slink = (m_slinks == 2) ? 2 * (mod / modulesPerSlink)
389 : mod / modulesPerSlink;
390 if (debug)
391 {
392 msg() << "Treating crate " << hwCrate
393 << " slink " << slink << endmsg
394 << "Data Version/Format: " << m_version
395 << " " << m_dataFormat << endmsg;
396 }
397 const uint32_t rodIdCpm = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
399 theROD = fea->getRodData(rodIdCpm);
400 if (neutralFormat)
401 {
402 const L1CaloUserHeader userHeader;
403 theROD->push_back(userHeader.header());
404 }
405 }
406 if (debug) msg() << "Module " << module << endmsg;
407
408 // Create a sub-block (Neutral format only)
409
410 if (neutralFormat)
411 {
412 subBlock.clear();
413 subBlock.setRoiHeader(m_version, hwCrate, module);
414 }
415
416 // Find CPM RoIs for this module
417
418 for (; mapIter != mapIterEnd; ++mapIter)
419 {
420 const LVL1::CPMTobRoI *const roi = mapIter->second;
421 if (roi->crate() < crate) continue;
422 if (roi->crate() > crate) break;
423 if (roi->cpm() < module) continue;
424 if (roi->cpm() > module) break;
425 if (roi->energy() || roi->isolation())
426 {
427 if (neutralFormat) subBlock.fillRoi(*roi);
428 else theROD->push_back(roi->roiWord());
429 ++count;
430 }
431 }
432
433 // Pack and write the sub-block
434
435 if (neutralFormat)
436 {
437 if ( !subBlock.pack())
438 {
439 msg(MSG::ERROR) << "CPMTobRoI sub-block packing failed" << endmsg;
440 return StatusCode::FAILURE;
441 }
442 if (debug)
443 {
444 msg() << "CPMTobRoI sub-block data words: "
445 << subBlock.dataWords() << endmsg;
446 }
447 subBlock.write(theROD);
448 }
449 }
450 }
451 if (debug)
452 {
453 msg() << "Number of RoIs written = " << count << endmsg;
454 }
455
456 if (debug) msg() << MSG::dec; // fill seems to leave it in hex
457
458 return StatusCode::SUCCESS;
459}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
const bool debug
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
size_type size() const noexcept
Returns the number of elements in the collection.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
RODDATA * getRodData(uint32_t id)
get a block of ROD data
void setupCpmRoiMap(const CpmRoiCollection *roiCollection, CpmRoiMap &roiMap) const
Set up CPM RoI map.
const L1CaloSrcIdMap m_srcIdMap
Source ID converter.
std::map< uint32_t, const LVL1::CPMTobRoI * > CpmRoiMap
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
uint32_t roiWord() const
Return packed RoI word.
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
setWord1 uint16_t
setEventNumber uint32_t

◆ convert() [2/3]

StatusCode LVL1BS::CpmRoiByteStreamV2Tool::convert ( const EventContext & ctx,
const std::string & robFrags,
DataVector< LVL1::CPMTobRoI > * roiCollection ) const

Convert ROB fragments to CPM RoIs.

Definition at line 102 of file CpmRoiByteStreamV2Tool.cxx.

106{
107 const std::vector<uint32_t>& vID(sourceIDs(sgKey));
108 // // get ROB fragments
110 m_robDataProvider->getROBData(ctx, vID, robFrags, "CpmRoiByteStreamV2Tool");
111 ATH_MSG_DEBUG("Number of ROB fragments:" << robFrags.size());
112 return convert(robFrags, collection);
113}
#define ATH_MSG_DEBUG(x)
std::vector< const ROBF * > VROBFRAG
StatusCode convert(const EventContext &ctx, const std::string &robFrags, DataVector< LVL1::CPMTobRoI > *roiCollection) const
Convert ROB fragments to CPM RoIs.
const std::vector< uint32_t > & sourceIDs(const std::string &sgKey) const
Return reference to vector with all possible Source Identifiers.

◆ convert() [3/3]

StatusCode LVL1BS::CpmRoiByteStreamV2Tool::convert ( const IROBDataProviderSvc::VROBFRAG & robFrags,
DataVector< LVL1::CPMTobRoI > * roiCollection ) const

Definition at line 115 of file CpmRoiByteStreamV2Tool.cxx.

118{
119 const bool debug = msgLvl(MSG::DEBUG);
120 if (debug) msg(MSG::DEBUG);
121
122 // Sub-block for neutral format
123 CpmRoiSubBlockV2 subBlock;
124
125 // Loop over ROB fragments
126
127 int robCount = 0;
128 std::set<uint32_t> dupCheck;
129 std::set<uint32_t> dupRoiCheck;
130 ROBIterator rob = robFrags.begin();
131 ROBIterator robEnd = robFrags.end();
132 for (; rob != robEnd; ++rob)
133 {
134
135 if (debug)
136 {
137 ++robCount;
138 msg() << "Treating ROB fragment " << robCount << endmsg;
139 }
140
141 // Skip fragments with ROB status errors
142
143 uint32_t robid = (*rob)->source_id();
144 if ((*rob)->nstatus() > 0)
145 {
146 ROBPointer robData;
147 (*rob)->status(robData);
148 if (*robData != 0)
149 {
150 m_errorTool->robError(robid, *robData);
151 if (debug) msg() << "ROB status error - skipping fragment" << endmsg;
152 continue;
153 }
154 }
155
156 // Skip duplicate fragments
157
158 if (!dupCheck.insert(robid).second)
159 {
161 if (debug) msg() << "Skipping duplicate ROB fragment" << endmsg;
162 continue;
163 }
164
165 // Unpack ROD data (slinks)
166
167 RODPointer payloadBeg;
169 RODPointer payloadEnd;
170 (*rob)->rod_data(payloadBeg);
171 payloadEnd = payloadBeg + (*rob)->rod_ndata();
172 payload = payloadBeg;
173 if (payload == payloadEnd)
174 {
175 if (debug) msg() << "ROB fragment empty" << endmsg;
176 continue;
177 }
178
179 // Check identifier
180 const uint32_t sourceID = (*rob)->rod_source_id();
181 if (m_srcIdMap.getRobID(sourceID) != robid ||
182 m_srcIdMap.subDet(sourceID) != m_subDetector ||
183 m_srcIdMap.daqOrRoi(sourceID) != 1 ||
184 (m_srcIdMap.slink(sourceID) != 0 && m_srcIdMap.slink(sourceID) != 2) ||
185 m_srcIdMap.crate(sourceID) < m_crateOffsetHw ||
186 m_srcIdMap.crate(sourceID) >= m_crateOffsetHw + m_crates)
187 {
189 if (debug)
190 {
191 msg() << "Wrong source identifier in data: "
192 << MSG::hex << sourceID << MSG::dec << endmsg;
193 }
194 continue;
195 }
196
197 // Check minor version
198 const int minorVersion = (*rob)->rod_version() & 0xffff;
199 if (minorVersion <= m_srcIdMap.minorVersionPreLS1())
200 {
201 if (debug) msg() << "Skipping pre-LS1 data" << endmsg;
202 continue;
203 }
204 const int rodCrate = m_srcIdMap.crate(sourceID);
205 if (debug)
206 {
207 msg() << "Treating crate " << rodCrate
208 << " slink " << m_srcIdMap.slink(sourceID) << endmsg;
209 }
210
211 // First word may be User Header
212 if (L1CaloUserHeader::isValid(*payload))
213 {
214 L1CaloUserHeader userHeader(*payload);
215 userHeader.setVersion(minorVersion);
216 const int headerWords = userHeader.words();
217 if (headerWords != 1 )
218 {
220 if (debug) msg() << "Unexpected number of user header words: "
221 << headerWords << endmsg;
222 continue;
223 }
224 for (int i = 0; i < headerWords; ++i) ++payload;
225 }
226
227 // Loop over sub-blocks if there are any
228
229 unsigned int rodErr = L1CaloSubBlock::ERROR_NONE;
230 while (payload != payloadEnd)
231 {
232
234 {
235 subBlock.clear();
236 payload = subBlock.read(payload, payloadEnd);
237 if (debug)
238 {
239 msg() << "CPM RoI sub-block: Crate " << subBlock.crate()
240 << " Module " << subBlock.module() << endmsg;
241 }
242 // Unpack sub-block
243 if (subBlock.dataWords() && !subBlock.unpack())
244 {
245 if (debug)
246 {
247 std::string errMsg(subBlock.unpackErrorMsg());
248 msg() << "CPM RoI sub-block unpacking failed: " << errMsg << endmsg;
249 }
250 rodErr = subBlock.unpackErrorCode();
251 break;
252 }
253 const int numChips = 8;
254 const int numLocs = 2;
255 const int numTypes = 2;
256 for (int chip = 0; chip < numChips; ++chip)
257 {
258 for (int loc = 0; loc < numLocs; ++loc)
259 {
260 for (int type = 0; type < numTypes; ++type)
261 {
262 const LVL1::CPMTobRoI roi = subBlock.roi(chip, loc, type);
263 if (roi.energy() || roi.isolation())
264 {
265 roiCollection->push_back(new LVL1::CPMTobRoI(roi));
266 }
267 }
268 }
269 }
270 }
271 else
272 {
273 // Just RoI word
274 LVL1::CPMTobRoI roi;
276 if (m_isM7Format)
277 roiWord |= 0x80000000;
278
279 if (roi.setRoiWord(roiWord))
280 {
281 if (roi.crate() != rodCrate - m_crateOffsetHw)
282 {
283 if (debug) msg() << "Inconsistent RoI crate number: "
284 << roi.crate() << endmsg;
286 break;
287 }
288 if (roi.cpm() == 0 || roi.cpm() > m_modules)
289 {
290 if (debug) msg() << "Invalid CPM number: "
291 << roi.cpm() << endmsg;
293 break;
294 }
295 const uint32_t location = roiWord & 0xffff0000;
296 if (dupRoiCheck.insert(location).second)
297 {
298 if (roi.energy() || roi.isolation())
299 {
300 roiCollection->push_back(new LVL1::CPMTobRoI(roiWord));
301 }
302 }
303 else
304 {
305 if (debug) msg() << "Duplicate RoI word "
306 << MSG::hex << roiWord << MSG::dec << endmsg;
308 break;
309 }
310 }
311 else
312 {
313 if (debug) msg() << "Invalid RoI word "
314 << MSG::hex << roiWord << MSG::dec << endmsg;
316 break;
317 }
318 ++payload;
319 }
320 }
321 if (rodErr != L1CaloSubBlock::ERROR_NONE)
322 m_errorTool->rodError(robid, rodErr);
323 }
324 if (debug)
325 {
326 msg() << "Number of RoIs read = " << roiCollection->size() << endmsg;
327 }
328
329 return StatusCode::SUCCESS;
330}
value_type push_back(value_type pElem)
Add an element to the end of the collection.
OFFLINE_FRAGMENTS_NAMESPACE::PointerType ROBPointer
IROBDataProviderSvc::VROBFRAG::const_iterator ROBIterator
OFFLINE_FRAGMENTS_NAMESPACE::PointerType RODPointer
static SubBlockWordType wordType(uint32_t word)
Word identification.
static bool isValid(uint32_t word)
Test for valid header word.
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
Definition CPMTobRoI.cxx:57

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

◆ 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 LVL1BS::CpmRoiByteStreamV2Tool::initialize ( )
overridevirtual

Definition at line 90 of file CpmRoiByteStreamV2Tool.cxx.

91{
92 ATH_MSG_INFO ("Initializing " << name());
93
94 ATH_CHECK( m_errorTool.retrieve() );
95 ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
96
97 return StatusCode::SUCCESS;
98}
#define ATH_MSG_INFO(x)

◆ 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 & LVL1BS::CpmRoiByteStreamV2Tool::interfaceID ( )
static

AlgTool InterfaceID.

Definition at line 33 of file CpmRoiByteStreamV2Tool.cxx.

34{
36}
static const InterfaceID IID_ICpmRoiByteStreamV2Tool("CpmRoiByteStreamV2Tool", 1, 1)

◆ makeSourceIDs()

std::vector< uint32_t > LVL1BS::CpmRoiByteStreamV2Tool::makeSourceIDs ( bool roiDaq) const
private

Definition at line 463 of file CpmRoiByteStreamV2Tool.cxx.

464{
465 std::vector<uint32_t> sourceIDs;
466
467 if (roiDaq) {
469 }
470 else {
472 }
473
474 if (sourceIDs.empty()) {
475 const int maxCrates = m_crates + m_crateOffsetHw;
476 const int maxSlinks = m_srcIdMap.maxSlinks();
477 for (int hwCrate = m_crateOffsetHw; hwCrate < maxCrates; ++hwCrate)
478 {
479 for (int slink = 0; slink < maxSlinks; ++slink)
480 {
481 const int daqOrRoi = 1;
482 const uint32_t rodId = m_srcIdMap.getRodID(hwCrate, slink, daqOrRoi,
484 const uint32_t robId = m_srcIdMap.getRobID(rodId);
485 if (roiDaq)
486 {
487 if (slink < 2) sourceIDs.push_back(robId);
488 }
489 else if (slink >= 2) sourceIDs.push_back(robId);
490 }
491 }
492
493 }
494 return sourceIDs;
495}

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

◆ setupCpmRoiMap()

void LVL1BS::CpmRoiByteStreamV2Tool::setupCpmRoiMap ( const CpmRoiCollection * roiCollection,
CpmRoiMap & roiMap ) const
private

Set up CPM RoI map.

Definition at line 517 of file CpmRoiByteStreamV2Tool.cxx.

520{
521 roiMap.clear();
522 if (roiCollection)
523 {
524 CpmRoiCollection::const_iterator pos = roiCollection->begin();
525 CpmRoiCollection::const_iterator pose = roiCollection->end();
526 for (; pos != pose; ++pos)
527 {
528 const LVL1::CPMTobRoI *const roi = *pos;
529 const int type = roi->type();
530 const int crate = roi->crate();
531 const int cpm = roi->cpm();
532 const int chip = roi->chip();
533 const int loc = roi->location() >> 2;
534 const uint32_t key = (((((((crate << 4) | cpm) << 3) | chip) << 1) | loc) << 1) | type;
535 roiMap.insert(std::make_pair(key, roi));
536 }
537 }
538}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
int chip() const
Return CP chip number (0-7).
int location() const
Return location (RoI local coords) (0-7).

◆ sourceIDs()

const std::vector< uint32_t > & LVL1BS::CpmRoiByteStreamV2Tool::sourceIDs ( const std::string & sgKey) const

Return reference to vector with all possible Source Identifiers.

Definition at line 497 of file CpmRoiByteStreamV2Tool.cxx.

499{
500 const std::string flag("RoIB");
501 const std::string::size_type pos = sgKey.find(flag);
502 const bool roiDaq =
503 (pos == std::string::npos || pos != sgKey.length() - flag.length());
504
505 if (roiDaq) {
506 static const std::vector<uint32_t> sourceIDs = makeSourceIDs(roiDaq);
507 return sourceIDs;
508 }
509 else {
510 static const std::vector<uint32_t> sourceIDsRoIB = makeSourceIDs(roiDaq);
511 return sourceIDsRoIB;
512 }
513}
std::vector< uint32_t > makeSourceIDs(bool roiDaq) const
bool flag
Definition master.py:29

◆ 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> LVL1BS::CpmRoiByteStreamV2Tool::m_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
private

Definition at line 73 of file CpmRoiByteStreamV2Tool.h.

74{ this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };

◆ m_crateMax

int LVL1BS::CpmRoiByteStreamV2Tool::m_crateMax
private

Property: Maximum crate number when writing out bytestream.

Definition at line 109 of file CpmRoiByteStreamV2Tool.h.

◆ m_crateMin

int LVL1BS::CpmRoiByteStreamV2Tool::m_crateMin
private

Property: Minimum crate number when writing out bytestream.

Definition at line 107 of file CpmRoiByteStreamV2Tool.h.

◆ m_crateOffsetHw

int LVL1BS::CpmRoiByteStreamV2Tool::m_crateOffsetHw
private

Property: Hardware crate number offset.

Definition at line 93 of file CpmRoiByteStreamV2Tool.h.

◆ m_crateOffsetSw

int LVL1BS::CpmRoiByteStreamV2Tool::m_crateOffsetSw
private

Property: Software crate number offset.

Definition at line 95 of file CpmRoiByteStreamV2Tool.h.

◆ m_crates

const int LVL1BS::CpmRoiByteStreamV2Tool::m_crates
private

Number of crates.

Definition at line 101 of file CpmRoiByteStreamV2Tool.h.

◆ m_dataFormat

int LVL1BS::CpmRoiByteStreamV2Tool::m_dataFormat
private

Property: Data compression format.

Definition at line 99 of file CpmRoiByteStreamV2Tool.h.

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

ToolHandle<LVL1BS::L1CaloErrorByteStreamTool> LVL1BS::CpmRoiByteStreamV2Tool::m_errorTool
private

Property: Error collection tool.

Definition at line 90 of file CpmRoiByteStreamV2Tool.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_isM7Format

bool LVL1BS::CpmRoiByteStreamV2Tool::m_isM7Format
private

Definition at line 121 of file CpmRoiByteStreamV2Tool.h.

◆ m_modules

const int LVL1BS::CpmRoiByteStreamV2Tool::m_modules
private

Number of CPM modules per crate.

Definition at line 103 of file CpmRoiByteStreamV2Tool.h.

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> LVL1BS::CpmRoiByteStreamV2Tool::m_robDataProvider
private

Definition at line 88 of file CpmRoiByteStreamV2Tool.h.

◆ m_slinks

int LVL1BS::CpmRoiByteStreamV2Tool::m_slinks
private

Property: Number of slinks per crate when writing out bytestream.

Definition at line 105 of file CpmRoiByteStreamV2Tool.h.

◆ m_sourceIDsProp

std::vector<uint32_t> LVL1BS::CpmRoiByteStreamV2Tool::m_sourceIDsProp
private

Property: ROB source IDs.

Definition at line 111 of file CpmRoiByteStreamV2Tool.h.

◆ m_sourceIDsRoIBProp

std::vector<uint32_t> LVL1BS::CpmRoiByteStreamV2Tool::m_sourceIDsRoIBProp
private

Property: ROB source IDs for RoIB.

Definition at line 113 of file CpmRoiByteStreamV2Tool.h.

◆ m_srcIdMap

const L1CaloSrcIdMap LVL1BS::CpmRoiByteStreamV2Tool::m_srcIdMap
private

Source ID converter.

Definition at line 117 of file CpmRoiByteStreamV2Tool.h.

◆ m_subDetector

const eformat::SubDetector LVL1BS::CpmRoiByteStreamV2Tool::m_subDetector
private

Sub-detector type.

Definition at line 115 of file CpmRoiByteStreamV2Tool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_version

int LVL1BS::CpmRoiByteStreamV2Tool::m_version
private

Property: Sub_block header version.

Definition at line 97 of file CpmRoiByteStreamV2Tool.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: