ATLAS Offline Software
L1CaloLArTowerEnergy.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 namespace LVL1{
10 
12  asg::AsgTool( name ),
13  m_lvl1Helper(nullptr),
14  m_caloMgr(nullptr),
15  m_LArOnlineHelper(nullptr)
16  {
17  }
18 
20 
21  ATH_MSG_INFO("Initialize LVL1::L1CaloLArTowerEnergy");
22 
24  ATH_CHECK( detStore()->retrieve(m_LArOnlineHelper,"LArOnlineID") );
25 
26  //Use the CaloIdManager to get a pointer to an instance of the CaloLVL1_ID helper
28  if(!m_lvl1Helper) {
29  ATH_MSG_ERROR( "Cannot access CaloLVL1_ID helper." );
30  return StatusCode::FAILURE;
31  }
32 
33  ATH_CHECK(m_badFebMasker.retrieve());
34 
35  //Retrieve cabling & tt services
36  ATH_CHECK( m_ttService.retrieve() );
38 
39  return StatusCode::SUCCESS;
40  }
41 
42 
43  double L1CaloLArTowerEnergy::IDeta(const Identifier& TTid) const {
44  int region = m_lvl1Helper->region(TTid);
45  int ieta = m_lvl1Helper->eta(TTid);
46  int sign = m_lvl1Helper->pos_neg_z(TTid);
47 
48  double gran[4] = {0.1, 0.2, 0.1, 0.425};
49  double offset[4] = {0., 2.5, 3.1, 3.2};
50  double eta;
51 
52  if (region>=0 && region<=3) {
53  eta = sign* ( ( (ieta+0.5) * gran[region] ) + offset[region] );
54  }
55  else {
56  eta = 0.;
57  }
58  return eta;
59  }
60 
61 
63  {
65  return hasMissingFEB (**cabling, TTid);
66  }
68  const Identifier& TTid) const
69  {
70  bool result = false;
71 
72  std::vector<Identifier> TT_cells_vec = m_ttService->createCellIDvecTT(TTid) ;
73 
74  if(TT_cells_vec.size()!=0)
75  {
76  std::vector<Identifier>::const_iterator it = TT_cells_vec.begin();
77  std::vector<Identifier>::const_iterator it_e = TT_cells_vec.end();
78 
79  for (; it!=it_e; ++it)
80  {
81  HWIdentifier chid = cabling.createSignalChannelID(*it);
82  HWIdentifier febId = m_LArOnlineHelper->feb_Id(chid);
83  LArBadFeb febstatus = m_badFebMasker->febStatus(febId);
84  bool deadReadout = febstatus.deadReadout();
85  bool desactivatedInOKS = febstatus.deactivatedInOKS();
86 
87  if(deadReadout || desactivatedInOKS) result = true;
88  }
89  }
90  else{
91  ATH_MSG_ERROR( "Cannot retreive feb status for trigger Tower " << TTid );
92  }
93 
94  return result;
95  }
96 } // end of namespace
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
get_generator_info.result
result
Definition: get_generator_info.py:21
LVL1::L1CaloLArTowerEnergy::m_badFebMasker
ToolHandle< ILArBadFebMasker > m_badFebMasker
Definition: L1CaloLArTowerEnergy.h:70
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
skel.it
it
Definition: skel.GENtoEVGEN.py:396
LArBadFeb::deadReadout
bool deadReadout() const
FEB is not sending readout data, but the L1 trigger path is working.
Definition: LArBadFeb.h:33
asg
Definition: DataHandleTestTool.h:28
CaloLVL1_ID::region
int region(const Identifier id) const
return region according to :
Definition: CaloLVL1_ID.h:647
LVL1::L1CaloLArTowerEnergy::m_ttService
ToolHandle< CaloTriggerTowerService > m_ttService
Definition: L1CaloLArTowerEnergy.h:68
LVL1::L1CaloLArTowerEnergy::hasMissingFEB
virtual bool hasMissingFEB(const Identifier &TTid) const override
Declare the interface that the class provides.
Definition: L1CaloLArTowerEnergy.cxx:62
L1CaloLArTowerEnergy.h
LVL1::L1CaloLArTowerEnergy::L1CaloLArTowerEnergy
L1CaloLArTowerEnergy(const std::string &name)
Create a proper constructor for Athena.
Definition: L1CaloLArTowerEnergy.cxx:11
HWIdentifier
Definition: HWIdentifier.h:13
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
ReadCondHandle.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArBadChannelCont.h
LVL1::L1CaloLArTowerEnergy::IDeta
virtual double IDeta(const Identifier &TTid) const override
Definition: L1CaloLArTowerEnergy.cxx:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LVL1::L1CaloLArTowerEnergy::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: L1CaloLArTowerEnergy.h:73
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
CaloIdManager::getLVL1_ID
const CaloLVL1_ID * getLVL1_ID(void) const
Definition: CaloIdManager.cxx:75
LVL1::L1CaloLArTowerEnergy::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: L1CaloLArTowerEnergy.cxx:19
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigConf::name
Definition: HLTChainList.h:35
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1479
LArBadFeb
Definition: LArBadFeb.h:10
CaloLVL1_ID::eta
int eta(const Identifier id) const
return eta according to :
Definition: CaloLVL1_ID.h:653
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LVL1::L1CaloLArTowerEnergy::m_lvl1Helper
const CaloLVL1_ID * m_lvl1Helper
Definition: L1CaloLArTowerEnergy.h:63
LArBadFeb::deactivatedInOKS
bool deactivatedInOKS() const
Deactivated in OKS.
Definition: LArBadFeb.h:39
CaloLVL1_ID::pos_neg_z
int pos_neg_z(const Identifier id) const
return pos_neg_z according to :
Definition: CaloLVL1_ID.h:635
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LVL1::L1CaloLArTowerEnergy::m_caloMgr
const CaloIdManager * m_caloMgr
Definition: L1CaloLArTowerEnergy.h:64
LVL1::L1CaloLArTowerEnergy::m_LArOnlineHelper
const LArOnlineID * m_LArOnlineHelper
Definition: L1CaloLArTowerEnergy.h:65
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
Identifier
Definition: IdentifierFieldParser.cxx:14