ATLAS Offline Software
GfexInputMonitorAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 GfexInputMonitorAlgorithm::GfexInputMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
8  : AthMonitorAlgorithm(name,pSvcLocator)
9 {
10 }
11 
13 
14  ATH_MSG_DEBUG("GfexInputMonitorAlgorith::initialize");
15  ATH_MSG_DEBUG("Package Name "<< m_packageName);
16  ATH_MSG_DEBUG("m_gFexTowerContainer"<< m_gFexTowerContainerKey);
17 
18  // we initialise all the containers that we need
19  ATH_CHECK( m_gFexTowerContainerKey.initialize() );
20 
22 }
23 
24 StatusCode GfexInputMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
25 
26  ATH_MSG_DEBUG("GfexInputMonitorAlgorithm::fillHistograms");
27 
28  // Access gFex gTower container
30  if(!gFexTowerContainer.isValid()){
31  ATH_MSG_ERROR("No gFex Tower container found in storegate "<< m_gFexTowerContainerKey);
32  return StatusCode::SUCCESS;
33  }
34 
35  // monitored variables for histograms
36  auto nGfexTowers = Monitored::Scalar<int>("NGfexTowers",0.0);
37  auto Towereta = Monitored::Scalar<float>("TowerEta",0.0);
38  auto Towerphi = Monitored::Scalar<float>("TowerPhi",0.0);
39  auto Toweretaindex = Monitored::Scalar<uint8_t>("TowerEtaindex",0.0);
40  auto Towerphiindex = Monitored::Scalar<uint8_t>("TowerPhiindex",0.0);
41  auto Towerfpga = Monitored::Scalar<uint8_t>("TowerFpga",0.0);
42  auto Toweret = Monitored::Scalar<uint16_t>("TowerEt",0.0);
43  auto Towersaturationflag = Monitored::Scalar<char>("TowerSaturationflag",0.0);
44 
45  ATH_MSG_DEBUG("number of gfex towers = "<< gFexTowerContainer->size());
46 
47  unsigned int ngfexTowers=gFexTowerContainer->size();
48  nGfexTowers=ngfexTowers;
49  fill(m_packageName,nGfexTowers);
50 
51  for(const xAOD::gFexTower* gfexTowerRoI : *gFexTowerContainer){
52 
53  Towereta=gfexTowerRoI->eta();
54  Towerphi=gfexTowerRoI->phi();
55  fill(m_packageName,Towereta,Towerphi);
56 
57  Toweretaindex=gfexTowerRoI->iEta();
58  Towerphiindex=gfexTowerRoI->iPhi();
59  fill(m_packageName,Toweretaindex,Towerphiindex);
60 
61  Towerfpga=gfexTowerRoI->fpga();
62  fill(m_packageName,Towerfpga);
63 
64  Toweret=gfexTowerRoI->towerEt();
65  fill(m_packageName,Toweret);
66 
67  Towersaturationflag=gfexTowerRoI->isSaturated();
68  fill(m_packageName,Towersaturationflag);
69 
70  }
71 
72  return StatusCode::SUCCESS;
73 }
74 
75 
GfexInputMonitorAlgorithm::m_packageName
StringProperty m_packageName
Definition: GfexInputMonitorAlgorithm.h:23
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
GfexInputMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: GfexInputMonitorAlgorithm.cxx:12
GfexInputMonitorAlgorithm::GfexInputMonitorAlgorithm
GfexInputMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: GfexInputMonitorAlgorithm.cxx:7
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
GfexInputMonitorAlgorithm.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::gFexTower_v1
Class describing input data of a LVL1 eFEX.
Definition: gFexTower_v1.h:22
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
GfexInputMonitorAlgorithm::m_gFexTowerContainerKey
SG::ReadHandleKey< xAOD::gFexTowerContainer > m_gFexTowerContainerKey
Definition: GfexInputMonitorAlgorithm.h:26
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
xAOD::gFexTowerContainer
gFexTowerContainer_v1 gFexTowerContainer
Define the latest version of the TriggerTower container.
Definition: gFexTowerContainer.h:14
GfexInputMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: GfexInputMonitorAlgorithm.cxx:24
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.