ATLAS Offline Software
CheckLArFebHeader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <vector>
7 #include "GaudiKernel/IToolSvc.h"
9 
10 CheckLArFebHeader::CheckLArFebHeader(const std::string& name, ISvcLocator* pSvcLocator)
11  : AthAlgorithm(name, pSvcLocator),
12  m_onlineHelper(0)
13 {
14  m_count=0;
15  //declareProperty("KeyList",m_keylistproperty);
16 }
17 
19 {
20 }
21 
23 {
24  ATH_MSG_INFO ( "Initialize" );
25  ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
26 
27  m_count=0;
28  ATH_MSG_DEBUG ( "======== CheckLArFebHeader initialize successfully ========" );
29  return StatusCode::SUCCESS;
30 }
31 
32 
34 {
35  m_count++;
36  const LArFebHeaderContainer *larFebHeaderContainer = nullptr;
37  ATH_CHECK( evtStore()->retrieve(larFebHeaderContainer) );
38 
39  for (const LArFebHeader* feb : *larFebHeaderContainer) {
40  if(feb->CheckErrorELVL1Id() || feb->CheckErrorBCId()) {
41  HWIdentifier febid=feb->FEBId();
42  int barrel_ec = m_onlineHelper->barrel_ec(febid);
43  int pos_neg = m_onlineHelper->pos_neg(febid);
44  int FT = m_onlineHelper->feedthrough(febid);
45  int slot = m_onlineHelper->slot(febid);
46  int BCID = feb->BCId();
47  int LVL1ID = feb->ELVL1Id();
48  int FebBCID = feb->FebBCId();
49  int FebLVL1ID = feb->FebELVL1Id();
50 
51  ATH_MSG_FATAL ( "TTC information mismatch in event " << m_count << ":" );
52  ATH_MSG_FATAL ( " FEBID = " << febid.get_compact() );
53  ATH_MSG_FATAL ( " BARREL/EC = " << barrel_ec << " POS/NEG = " << pos_neg );
54  ATH_MSG_FATAL ( " FT = " << FT << " SLOT = " << slot );
55  ATH_MSG_FATAL ( " TTC from ROD: LVL1ID = " << LVL1ID << " BCID = " << BCID );
56  ATH_MSG_FATAL ( " TTC from FEB: LVL1ID = " << FebLVL1ID << " BCID = " << FebBCID );
57 
58  return StatusCode::FAILURE;
59  } // End if
60  else
61  ATH_MSG_DEBUG ( "FEB header consistent." );
62  } // End FebHeader loop
63 
64  return StatusCode::SUCCESS;
65 }
66 
68 {
69  ATH_MSG_DEBUG ( ">>> Finalize" );
70  return StatusCode::SUCCESS;
71 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CheckLArFebHeader::CheckLArFebHeader
CheckLArFebHeader(const std::string &name, ISvcLocator *pSvcLocator)
Definition: CheckLArFebHeader.cxx:10
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CheckLArFebHeader::finalize
StatusCode finalize()
Definition: CheckLArFebHeader.cxx:67
LArOnlineID_Base::slot
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
Definition: LArOnlineID_Base.cxx:1957
Identifier::get_compact
value_type get_compact() const
Get the compact id.
HWIdentifier
Definition: HWIdentifier.h:13
LArOnlineID_Base::barrel_ec
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
Definition: LArOnlineID_Base.cxx:1938
CheckLArFebHeader::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: CheckLArFebHeader.h:33
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
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h: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
CheckLArFebHeader::initialize
StatusCode initialize()
Definition: CheckLArFebHeader.cxx:22
LArOnlineID_Base::pos_neg
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
Definition: LArOnlineID_Base.cxx:1950
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CheckLArFebHeader.h
LArFebHeader
Holds information from the FEB Header.
Definition: LArFebHeader.h:21
CheckLArFebHeader::~CheckLArFebHeader
~CheckLArFebHeader()
Definition: CheckLArFebHeader.cxx:18
AthAlgorithm
Definition: AthAlgorithm.h:47
LArFebHeaderContainer.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CheckLArFebHeader::m_count
int m_count
Definition: CheckLArFebHeader.h:32
LArNewCalib_Delay_OFC_Cali.FT
FT
Definition: LArNewCalib_Delay_OFC_Cali.py:123
LArOnlineID_Base::feedthrough
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
Definition: LArOnlineID_Base.cxx:1944
CheckLArFebHeader::execute
StatusCode execute()
Definition: CheckLArFebHeader.cxx:33
LArFebHeaderContainer
Container class for LArFebHeader.
Definition: LArFebHeaderContainer.h:20
PixelByteStreamErrors::LVL1ID
@ LVL1ID
Definition: PixelByteStreamErrors.h:13