ATLAS Offline Software
L1CaloLArTowerEnergy.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 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  m_ttService(nullptr),
17  m_badFebMasker("LArBadFebMasker")
18  {
19  }
20 
22 
23  ATH_MSG_INFO("Initialize LVL1::L1CaloLArTowerEnergy");
24 
25  StatusCode sc;
26 
27  sc = detStore()->retrieve(m_caloMgr) ;
28  if(sc.isFailure()){ATH_MSG_ERROR( "Cannot access caloMgr");return sc;}
29 
30  sc = detStore()->retrieve(m_LArOnlineHelper,"LArOnlineID") ;
31  if(sc.isFailure()){ATH_MSG_ERROR( "Cannot access LArOnlineID");return sc;}
32 
33  //Use the CaloIdManager to get a pointer to an instance of the CaloLVL1_ID helper
35  if(!m_lvl1Helper) {
36  ATH_MSG_ERROR( "Cannot access CaloLVL1_ID helper." );
37  return StatusCode::FAILURE;
38  }
39 
40  ATH_CHECK(m_badFebMasker.retrieve());
41 
42  //Retrieve cabling & tt services
43  ISvcLocator* svcLoc = Gaudi::svcLocator( );
44  IToolSvc* toolSvc;
45 
46  sc = svcLoc->service( "ToolSvc",toolSvc );
47  if(sc.isSuccess()) {
48  sc = toolSvc->retrieveTool("CaloTriggerTowerService",m_ttService);
49  if(sc.isFailure()){ATH_MSG_ERROR("Could not retrieve CaloTriggerTowerService Tool");return sc;}
50 
51  }
52 
54 
55  return sc;
56  }
57 
59  return StatusCode::SUCCESS;
60  }
61 
62 
63 
64  double L1CaloLArTowerEnergy::IDeta(const Identifier& TTid) const {
65  int region = m_lvl1Helper->region(TTid);
66  int ieta = m_lvl1Helper->eta(TTid);
67  int sign = m_lvl1Helper->pos_neg_z(TTid);
68 
69  double gran[4] = {0.1, 0.2, 0.1, 0.425};
70  double offset[4] = {0., 2.5, 3.1, 3.2};
71  double eta;
72 
73  if (region>=0 && region<=3) {
74  eta = sign* ( ( (ieta+0.5) * gran[region] ) + offset[region] );
75  }
76  else {
77  eta = 0.;
78  }
79  return eta;
80  }
81 
82 
84  {
86  return hasMissingFEB (**cabling, TTid);
87  }
89  const Identifier& TTid) const
90  {
91  bool result = false;
92 
93  std::vector<Identifier> TT_cells_vec = m_ttService->createCellIDvecTT(TTid) ;
94 
95  if(TT_cells_vec.size()!=0)
96  {
97  std::vector<Identifier>::const_iterator it = TT_cells_vec.begin();
98  std::vector<Identifier>::const_iterator it_e = TT_cells_vec.end();
99 
100  for (; it!=it_e; ++it)
101  {
102  HWIdentifier chid = cabling.createSignalChannelID(*it);
103  HWIdentifier febId = m_LArOnlineHelper->feb_Id(chid);
104  LArBadFeb febstatus = m_badFebMasker->febStatus(febId);
105  bool deadReadout = febstatus.deadReadout();
106  bool desactivatedInOKS = febstatus.deactivatedInOKS();
107 
108  if(deadReadout || desactivatedInOKS) result = true;
109  }
110  }
111  else{
112  ATH_MSG_ERROR( "Cannot retreive feb status for trigger Tower " << TTid );
113  }
114 
115  return result;
116  }
117 } // end of namespace
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
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
skel.it
it
Definition: skel.GENtoEVGEN.py:423
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
LVL1::L1CaloLArTowerEnergy::m_ttService
CaloTriggerTowerService * m_ttService
Definition: L1CaloLArTowerEnergy.h:68
CaloLVL1_ID::region
int region(const Identifier id) const
return region according to :
Definition: CaloLVL1_ID.h:647
LVL1::L1CaloLArTowerEnergy::hasMissingFEB
virtual bool hasMissingFEB(const Identifier &TTid) const override
Declare the interface that the class provides.
Definition: L1CaloLArTowerEnergy.cxx:83
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
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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:64
CaloTriggerTowerService::createCellIDvecTT
std::vector< Identifier > createCellIDvecTT(const Identifier &id) const
Return a vector of offline Identifiers (corresponding helpers = LArEM_ID, LArHEC_ID,...
Definition: CaloTriggerTowerService.cxx:334
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
LVL1::L1CaloLArTowerEnergy::finalize
virtual StatusCode finalize() override
Definition: L1CaloLArTowerEnergy.cxx:58
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:127
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:21
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:1483
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:64
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:65
LVL1::L1CaloLArTowerEnergy::m_LArOnlineHelper
const LArOnlineID * m_LArOnlineHelper
Definition: L1CaloLArTowerEnergy.h:66
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20