ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileSvc
TileByteStream
src
TileMuRcvContByteStreamTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//****************************************************************************
6
// Filename : TileMuRcvContByteStreamTool.cxx
7
// Author : Joao Gentil Saraiva (jmendes@cern.ch)
8
// Created : February 2015
9
//
10
// DESCRIPTION
11
// AlgTool used in the TileMuRcv to BS conversion
12
//
13
// BUGS:
14
//
15
// History:
16
//
17
//****************************************************************************
18
19
// Gaudi includes
20
21
// Atlas includes
22
#include "
AthenaKernel/errorcheck.h
"
23
#include "
StoreGate/ReadCondHandle.h
"
24
25
// Tile includes
26
#include "
TileByteStream/TileMuRcvContByteStreamTool.h
"
27
#include "
TileByteStream/TileROD_Decoder.h
"
28
#include "
TileByteStream/TileROD_Encoder.h
"
29
#include "
TileEvent/TileMuonReceiverObj.h
"
30
#include "
TileEvent/TileContainer.h
"
31
#include "
TileIdentifier/TileHWID.h
"
32
33
#include "
AthenaKernel/CLASS_DEF.h
"
34
35
#include <map>
36
#include <stdint.h>
37
38
static
const
InterfaceID
IID_ITileMuRcvContByteStreamTool
(
"TileMuRcvContByteStreamTool"
, 1, 0);
39
40
const
InterfaceID&
TileMuRcvContByteStreamTool::interfaceID
() {
41
return
IID_ITileMuRcvContByteStreamTool
;
42
}
43
44
// default constructor
45
46
TileMuRcvContByteStreamTool::TileMuRcvContByteStreamTool
(
const
std::string&
type
,
const
std::string& name,
47
const
IInterface* parent)
48
:
AthAlgTool
(
type
, name, parent)
49
,
m_tileHWID
(0)
50
,
m_runPeriod
(0)
51
{
52
declareInterface<TileMuRcvContByteStreamTool>(
this
);
53
}
54
55
// destructor
56
57
TileMuRcvContByteStreamTool::~TileMuRcvContByteStreamTool
() {
58
}
59
60
StatusCode
TileMuRcvContByteStreamTool::initialize
() {
61
62
ATH_MSG_INFO
(
"Initializing TileMuRcvContByteStreamTool"
);
63
64
ATH_CHECK
(
detStore
()->retrieve(
m_tileHWID
,
"TileHWID"
) );
65
66
ToolHandle<TileROD_Decoder> dec(
"TileROD_Decoder"
);
67
ATH_CHECK
( dec.retrieve() );
68
69
ATH_CHECK
(
m_hid2RESrcIDKey
.initialize(
m_initializeForWriting
) );
70
71
const
TileCablingService
*cabling =
TileCablingService::getInstance
();
72
m_runPeriod
= cabling->runPeriod();
73
74
return
StatusCode::SUCCESS;
75
}
76
77
StatusCode
TileMuRcvContByteStreamTool::finalize
() {
78
ATH_MSG_INFO
(
"Finalizing TileMuRcvContByteStreamTool successfuly"
);
79
return
StatusCode::SUCCESS;
80
}
81
82
StatusCode
TileMuRcvContByteStreamTool::convert
(
TileMuonReceiverContainer
* cont,
FullEventAssembler<TileHid2RESrcID>
*fea)
const
83
{
84
ATH_MSG_INFO
(
"Executing TileMuRcvContByteStreamTool::convert method"
);
85
86
SG::ReadCondHandle<TileHid2RESrcID>
hid2re{
m_hid2RESrcIDKey
};
87
88
int
n = 0;
89
uint32_t frag_id = 0x0;
90
uint32_t reid = 0x0;
91
92
TileMuonReceiverContainer::const_iterator
it_cont = cont->
begin
();
93
TileMuonReceiverContainer::const_iterator
end_cont = cont->
end
();
94
95
// skip thresholds stored at first position of the container
96
//
97
++it_cont;
98
99
std::map<uint32_t, TileROD_Encoder> mapEncoder;
100
101
for
(; it_cont != end_cont; ++it_cont)
102
{
103
n++;
104
frag_id = (*it_cont)->identify();
105
reid = hid2re->getRodTileMuRcvID(frag_id);
106
mapEncoder[reid].setTileHWID(
m_tileHWID
,
m_runPeriod
);
107
const
TileMuonReceiverObj
* tileMuRcv = *it_cont;
108
mapEncoder[reid].addTileMuRcvObj(tileMuRcv);
109
}
110
111
ATH_MSG_DEBUG
(
" Number of TileMuonReceiverObj objects counted "
<< n <<
" out of the possible "
<< cont->
size
()-1 );
112
113
// fill ROD
114
//
115
std::map<uint32_t, TileROD_Encoder>::iterator map_it = mapEncoder.begin();
116
std::map<uint32_t, TileROD_Encoder>::iterator map_end = mapEncoder.end();
117
118
FullEventAssembler<TileHid2RESrcID>::RODDATA
* theROD;
119
120
TileROD_Encoder
* theEncoder;
121
122
for
(; map_it != map_end; ++map_it)
123
{
124
theROD = fea->
getRodData
( (*map_it).first );
125
theEncoder = &( (*map_it).second );
126
theEncoder -> fillRODTileMuRcvObj( *theROD );
127
ATH_MSG_DEBUG
(
" Number of words in ROD "
<<MSG::hex<< (*map_it).first <<MSG::dec<<
": "
<< theROD->size() );
// DEBUG
128
ATH_MSG_DEBUG
(
" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "
);
// DEBUG
129
}
130
131
return
StatusCode::SUCCESS;
132
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CLASS_DEF.h
macros to associate a CLID to a type
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ReadCondHandle.h
TileContainer.h
TileMuonReceiverContainer
TileContainer< TileMuonReceiverObj > TileMuonReceiverContainer
Definition
TileContainer.h:71
TileHWID.h
IID_ITileMuRcvContByteStreamTool
static const InterfaceID IID_ITileMuRcvContByteStreamTool("TileMuRcvContByteStreamTool", 1, 0)
TileMuRcvContByteStreamTool.h
TileMuonReceiverObj.h
TileROD_Decoder.h
TileROD_Encoder.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
TileContainer< TileMuonReceiverObj >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector< TELEMENT >::end
const_iterator end() const noexcept
DataVector< TELEMENT >::begin
const_iterator begin() const noexcept
DataVector< TELEMENT >::size
size_type size() const noexcept
FullEventAssembler
Template class for assembling a full atlas raw event from subfragments.
Definition
FullEventAssembler.h:38
FullEventAssembler::RODDATA
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
Definition
FullEventAssembler.h:52
FullEventAssembler::getRodData
RODDATA * getRodData(uint32_t id)
get a block of ROD data
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
TileCablingService
Definition
TileCablingService.h:23
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition
TileCablingService.cxx:24
TileMuRcvContByteStreamTool::finalize
virtual StatusCode finalize() override
Definition
TileMuRcvContByteStreamTool.cxx:77
TileMuRcvContByteStreamTool::m_tileHWID
const TileHWID * m_tileHWID
Definition
TileMuRcvContByteStreamTool.h:67
TileMuRcvContByteStreamTool::~TileMuRcvContByteStreamTool
virtual ~TileMuRcvContByteStreamTool()
Destructor.
Definition
TileMuRcvContByteStreamTool.cxx:57
TileMuRcvContByteStreamTool::m_initializeForWriting
Gaudi::Property< bool > m_initializeForWriting
Definition
TileMuRcvContByteStreamTool.h:62
TileMuRcvContByteStreamTool::TileMuRcvContByteStreamTool
TileMuRcvContByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition
TileMuRcvContByteStreamTool.cxx:46
TileMuRcvContByteStreamTool::m_hid2RESrcIDKey
SG::ReadCondHandleKey< TileHid2RESrcID > m_hid2RESrcIDKey
Definition
TileMuRcvContByteStreamTool.h:64
TileMuRcvContByteStreamTool::convert
StatusCode convert(TileMuonReceiverContainer *cont, FullEventAssembler< TileHid2RESrcID > *fea) const
Provides conversion from TileMuRcvContainer to bytestream.
Definition
TileMuRcvContByteStreamTool.cxx:82
TileMuRcvContByteStreamTool::initialize
virtual StatusCode initialize() override
Definition
TileMuRcvContByteStreamTool.cxx:60
TileMuRcvContByteStreamTool::m_runPeriod
int m_runPeriod
Definition
TileMuRcvContByteStreamTool.h:69
TileMuRcvContByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition
TileMuRcvContByteStreamTool.cxx:40
TileMuonReceiverObj
Definition
TileMuonReceiverObj.h:28
TileROD_Encoder
Provides conversion from TileRawChannel, TileL2 and TMDB (digits,MF raw channel,decision) to ROD form...
Definition
TileROD_Encoder.h:46
type
Generated on
for ATLAS Offline Software by
1.17.0