ATLAS Offline Software
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 
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 
20 
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 
50 {return StatusCode::SUCCESS;}
51 
53 {return StatusCode::SUCCESS;}
ILArGlobalTimeOffset
Definition: ILArGlobalTimeOffset.h:10
FakeLArTimeOffset::initialize
StatusCode initialize()
Definition: FakeLArTimeOffset.cxx:21
FakeLArTimeOffset::m_globalTimeOffset
float m_globalTimeOffset
Definition: FakeLArTimeOffset.h:24
LArFEBTimeOffset.h
FakeLArTimeOffset::~FakeLArTimeOffset
~FakeLArTimeOffset()
Definition: FakeLArTimeOffset.cxx:19
FakeLArTimeOffset::FakeLArTimeOffset
FakeLArTimeOffset(const std::string &name, ISvcLocator *pSvcLocator)
Definition: FakeLArTimeOffset.cxx:9
LArFEBTimeOffset
Definition: LArFEBTimeOffset.h:13
FakeLArTimeOffset::finalize
StatusCode finalize()
Definition: FakeLArTimeOffset.cxx:52
FakeLArTimeOffset::m_FEBids
std::vector< unsigned > m_FEBids
Definition: FakeLArTimeOffset.h:22
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArGlobalTimeOffset
Definition: LArGlobalTimeOffset.h:11
FakeLArTimeOffset::m_keyGlobalOffset
std::string m_keyGlobalOffset
Definition: FakeLArTimeOffset.h:26
FakeLArTimeOffset::execute
StatusCode execute()
Definition: FakeLArTimeOffset.cxx:49
HWIdentifier
Definition: HWIdentifier.h:13
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ILArFEBTimeOffset
Definition: ILArFEBTimeOffset.h:11
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthAlgorithm
Definition: AthAlgorithm.h:47
FakeLArTimeOffset::m_keyFebOffset
std::string m_keyFebOffset
Definition: FakeLArTimeOffset.h:26
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
FakeLArTimeOffset.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArGlobalTimeOffset::setTimeOffset
void setTimeOffset(const float offset)
Definition: LArGlobalTimeOffset.h:15
LArFEBTimeOffset::setTimeOffset
void setTimeOffset(const HWIdentifier fId, const float offset)
Definition: LArFEBTimeOffset.h:17
LArGlobalTimeOffset.h
FakeLArTimeOffset::m_FEBtimeOffsets
std::vector< float > m_FEBtimeOffsets
Definition: FakeLArTimeOffset.h:23