ATLAS Offline Software
jFEXLargeRJetAlgo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 //***************************************************************************
5 // jFEXSmallRJetAlgo - Algorithm for small R jet Algorithm in jFEX
6 // -------------------
7 // begin : 03 11 2020
8 // email : varsiha.sothilingam@cern.ch
9 //***************************************************************************
10 
11 #include <iostream>
12 #include <vector>
14 #include "L1CaloFEXSim/jTower.h"
20 #include "StoreGate/StoreGateSvc.h"
21 
22 namespace LVL1{
23 
24 LVL1::jFEXLargeRJetAlgo::jFEXLargeRJetAlgo(const std::string& type, const std::string& name, const IInterface* parent):
26  {
27  declareInterface<IjFEXLargeRJetAlgo>(this);
28  }
29 
32 {
33 }
35 {
36  ATH_CHECK(m_jTowerContainerKey.initialize());
37 
38  return StatusCode::SUCCESS;
39 
40 }
41 
43  m_jTowerContainer = SG::ReadHandle<jTowerContainer>(m_jTowerContainerKey);
44  if(! m_jTowerContainer.isValid()) {
45  ATH_MSG_ERROR("Could not retrieve jTowerContainer " << m_jTowerContainerKey.key());
46 
47  return StatusCode::FAILURE;
48  }
49 
50  return StatusCode::SUCCESS;
51 }
52 
53 void LVL1::jFEXLargeRJetAlgo::setupCluster(int inputTable[15][15]){
54 
55  std::copy(&inputTable[0][0], &inputTable[0][0] + 225 , &m_largeRJetEtRing_IDs[0][0]);
56 
57 }
58 
60  int RingET =0;
61  for(int n =0; n <15; n++) {
62  for(int m =0; m <15; m++) {
63  int et = getTTowerET(m_largeRJetEtRing_IDs[n][m]);
64  RingET +=et;
65  }
66  }
67  return RingET;
68 }
69 
71  m_saturation = false;
72  for(int n =0; n <15; n++) {
73  for(int m =0; m <15; m++) {
74  m_saturation = m_saturation || getTTowerSat(m_largeRJetEtRing_IDs[n][m]);
75  }
76  }
77  return m_saturation;
78 }
79 
80 unsigned int LVL1::jFEXLargeRJetAlgo::getLargeClusterET(unsigned int smallClusterET, unsigned int largeRingET){
81  int largeClusterET = smallClusterET + largeRingET;
82  return largeClusterET;
83 }
84 
85 
86 //Gets the ET for the TT. This ET is EM + HAD
87 int LVL1::jFEXLargeRJetAlgo::getTTowerET(unsigned int TTID ) {
88  if(TTID == 0) {
89  return 0;
90  }
91 
92  if(m_map_Etvalues.find(TTID) != m_map_Etvalues.end()) {
93  return m_map_Etvalues[TTID][0];
94  }
95 
96  //we shouldn't arrive here
97  return 0;
98 
99 }
100 
101 //getter for tower saturation
102 bool LVL1::jFEXLargeRJetAlgo::getTTowerSat(unsigned int TTID ) {
103  if(TTID == 0) {
104  return false;
105  }
106 
107  const LVL1::jTower * tmpTower = m_jTowerContainer->findTower(TTID);
108  return tmpTower->getTowerSat();
109 }
110 
111 
112 void LVL1::jFEXLargeRJetAlgo::setFPGAEnergy(std::unordered_map<int,std::vector<int> > et_map){
113  m_map_Etvalues=et_map;
114 }
115 
116 }// end of namespace LVL1
117 
118 
119 
et
Extra patterns decribing particle interation process.
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
LVL1::jFEXLargeRJetAlgo::setFPGAEnergy
virtual void setFPGAEnergy(std::unordered_map< int, std::vector< int > > et_map) override
Definition: jFEXLargeRJetAlgo.cxx:112
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LVL1::jFEXLargeRJetAlgo::jFEXLargeRJetAlgo
jFEXLargeRJetAlgo(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
Definition: jFEXLargeRJetAlgo.cxx:24
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::jTower::getTowerSat
bool getTowerSat() const
Definition: jTower.h:65
AthAlgorithm.h
LVL1::jFEXLargeRJetAlgo::getLRjetSat
virtual bool getLRjetSat() override
Definition: jFEXLargeRJetAlgo.cxx:70
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1::jFEXLargeRJetAlgo::getTTowerET
int getTTowerET(unsigned int TTID)
Definition: jFEXLargeRJetAlgo.cxx:87
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell_SuperCell_ID.h
Helper class for offline supercell identifiers.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::jFEXLargeRJetAlgo::getRingET
virtual unsigned int getRingET() override
Definition: jFEXLargeRJetAlgo.cxx:59
TrigConf::name
Definition: HLTChainList.h:35
jTowerContainer.h
LVL1::jFEXLargeRJetAlgo::getLargeClusterET
virtual unsigned int getLargeClusterET(unsigned int smallClusterET, unsigned int largeRingET) override
Definition: jFEXLargeRJetAlgo.cxx:80
jFEXLargeRJetAlgo.h
LVL1::jFEXLargeRJetAlgo::safetyTest
virtual StatusCode safetyTest() override
Definition: jFEXLargeRJetAlgo.cxx:42
CaloCellContainer.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1::jFEXLargeRJetAlgo::~jFEXLargeRJetAlgo
virtual ~jFEXLargeRJetAlgo()
Destructor.
Definition: jFEXLargeRJetAlgo.cxx:31
LVL1::jTower
The jTower class is an interface object for jFEX trigger algorithms The purposes are twofold:
Definition: jTower.h:40
CaloIdManager.h
LVL1::jFEXLargeRJetAlgo::getTTowerSat
bool getTTowerSat(unsigned int TTID)
Definition: jFEXLargeRJetAlgo.cxx:102
calibdata.copy
bool copy
Definition: calibdata.py:27
AthAlgTool
Definition: AthAlgTool.h:26
jTower.h
StoreGateSvc.h
LVL1::jFEXLargeRJetAlgo::setupCluster
virtual void setupCluster(int inputTable[15][15]) override
Definition: jFEXLargeRJetAlgo.cxx:53
LVL1::jFEXLargeRJetAlgo::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition: jFEXLargeRJetAlgo.cxx:34