ATLAS Offline Software
Loading...
Searching...
No Matches
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
9namespace 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
23 ATH_CHECK( detStore()->retrieve(m_caloMgr) );
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
27 m_lvl1Helper = m_caloMgr->getLVL1_ID();
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() );
37 ATH_CHECK( m_cablingKey.initialize() );
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
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
int sign(int a)
const ServiceHandle< StoreGateSvc > & detStore() const
bool deactivatedInOKS() const
Deactivated in OKS.
Definition LArBadFeb.h:39
bool deadReadout() const
FEB is not sending readout data, but the L1 trigger path is working.
Definition LArBadFeb.h:33
virtual double IDeta(const Identifier &TTid) const override
virtual bool hasMissingFEB(const Identifier &TTid) const override
Declare the interface that the class provides.
ToolHandle< CaloTriggerTowerService > m_ttService
const CaloIdManager * m_caloMgr
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
L1CaloLArTowerEnergy(const std::string &name)
Create a proper constructor for Athena.
ToolHandle< ILArBadFebMasker > m_badFebMasker
const LArOnlineID * m_LArOnlineHelper
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...