ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArTest
LArEventTest
src
FakeLArTimeOffset.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArEventTest/FakeLArTimeOffset.h
"
6
#include "
LArRawConditions/LArFEBTimeOffset.h
"
7
#include "
LArRawConditions/LArGlobalTimeOffset.h
"
8
9
FakeLArTimeOffset::FakeLArTimeOffset
(
const
std::string & name, ISvcLocator * pSvcLocator)
10
:
AthAlgorithm
(name, pSvcLocator)
11
{
12
declareProperty
(
"FEBids"
,
m_FEBids
);
13
declareProperty
(
"FEbTimeOffsets"
,
m_FEBtimeOffsets
);
14
declareProperty
(
"GlobalTimeOffset"
,
m_globalTimeOffset
=0);
15
declareProperty
(
"FebTimeOffsetKey"
,
m_keyFebOffset
=
"FebTimeOffset"
);
16
declareProperty
(
"GlobalTimeOffsetKey"
,
m_keyGlobalOffset
=
"GlobalTimeOffset"
);
17
}
18
19
FakeLArTimeOffset::~FakeLArTimeOffset
() {}
20
21
StatusCode
FakeLArTimeOffset::initialize
() {
22
ATH_MSG_DEBUG
(
"Initialize..."
);
23
//Check Consistency
24
if
(
m_FEBtimeOffsets
.size()!=
m_FEBids
.size()) {
25
ATH_MSG_ERROR
(
"Problem with jobOpts: Have "
<<
m_FEBtimeOffsets
.size() <<
" time offset values for "
26
<<
m_FEBids
.size() <<
" FEBs."
);
27
return
StatusCode::FAILURE;
28
}
29
LArGlobalTimeOffset
* globalTimeOffset=
new
LArGlobalTimeOffset
();
30
globalTimeOffset->
setTimeOffset
(
m_globalTimeOffset
);
31
ATH_CHECK
(
detStore
()->record(globalTimeOffset,
m_keyGlobalOffset
) );
32
const
ILArGlobalTimeOffset
* ilarGobalTimeOffset=globalTimeOffset;
33
ATH_CHECK
(
detStore
()->symLink(globalTimeOffset,ilarGobalTimeOffset) );
34
35
LArFEBTimeOffset
* febTimeOffset=
new
LArFEBTimeOffset
();
36
for
(
unsigned
i=0;i<
m_FEBids
.size();i++) {
37
const
HWIdentifier
id(
m_FEBids
[i]);
38
febTimeOffset->
setTimeOffset
(
id
,
m_FEBtimeOffsets
[i]);
39
ATH_MSG_DEBUG
(
"FEB 0x"
<< MSG::hex <<
id
<<
" Offset="
<<
m_FEBtimeOffsets
[i] );
40
}
41
ATH_CHECK
(
detStore
()->record(febTimeOffset,
m_keyFebOffset
) );
42
const
ILArFEBTimeOffset
* ilarFEBTimeOffset=febTimeOffset;
43
ATH_CHECK
(
detStore
()->symLink(febTimeOffset,ilarFEBTimeOffset) );
44
return
StatusCode::SUCCESS;
45
}
46
47
48
49
StatusCode
FakeLArTimeOffset::execute
(
const
EventContext&
/*ctx*/
)
50
{
return
StatusCode::SUCCESS;}
51
52
StatusCode
FakeLArTimeOffset::finalize
()
53
{
return
StatusCode::SUCCESS;}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
FakeLArTimeOffset.h
LArFEBTimeOffset.h
LArGlobalTimeOffset.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
FakeLArTimeOffset::m_keyFebOffset
std::string m_keyFebOffset
Definition
FakeLArTimeOffset.h:26
FakeLArTimeOffset::m_FEBids
std::vector< unsigned > m_FEBids
Definition
FakeLArTimeOffset.h:22
FakeLArTimeOffset::m_keyGlobalOffset
std::string m_keyGlobalOffset
Definition
FakeLArTimeOffset.h:26
FakeLArTimeOffset::~FakeLArTimeOffset
~FakeLArTimeOffset()
Definition
FakeLArTimeOffset.cxx:19
FakeLArTimeOffset::finalize
StatusCode finalize()
Definition
FakeLArTimeOffset.cxx:52
FakeLArTimeOffset::FakeLArTimeOffset
FakeLArTimeOffset(const std::string &name, ISvcLocator *pSvcLocator)
Definition
FakeLArTimeOffset.cxx:9
FakeLArTimeOffset::m_globalTimeOffset
float m_globalTimeOffset
Definition
FakeLArTimeOffset.h:24
FakeLArTimeOffset::m_FEBtimeOffsets
std::vector< float > m_FEBtimeOffsets
Definition
FakeLArTimeOffset.h:23
FakeLArTimeOffset::initialize
StatusCode initialize()
Definition
FakeLArTimeOffset.cxx:21
FakeLArTimeOffset::execute
StatusCode execute(const EventContext &ctx)
Execute method.
Definition
FakeLArTimeOffset.cxx:49
HWIdentifier
Definition
HWIdentifier.h:13
ILArFEBTimeOffset
Definition
ILArFEBTimeOffset.h:11
ILArGlobalTimeOffset
Definition
ILArGlobalTimeOffset.h:10
LArFEBTimeOffset
Definition
LArFEBTimeOffset.h:13
LArFEBTimeOffset::setTimeOffset
void setTimeOffset(const HWIdentifier fId, const float offset)
Definition
LArFEBTimeOffset.h:17
LArGlobalTimeOffset
Definition
LArGlobalTimeOffset.h:11
LArGlobalTimeOffset::setTimeOffset
void setTimeOffset(const float offset)
Definition
LArGlobalTimeOffset.h:15
Generated on
for ATLAS Offline Software by
1.17.0