ATLAS Offline Software
Loading...
Searching...
No Matches
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
9FakeLArTimeOffset::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;}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
std::string m_keyFebOffset
std::vector< unsigned > m_FEBids
std::string m_keyGlobalOffset
FakeLArTimeOffset(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< float > m_FEBtimeOffsets
void setTimeOffset(const HWIdentifier fId, const float offset)
void setTimeOffset(const float offset)