ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
GlobalSim::jXEInputAlgTool Class Reference

#include <jXEInputAlgTool.h>

Inheritance diagram for GlobalSim::jXEInputAlgTool:
Collaboration diagram for GlobalSim::jXEInputAlgTool:

Public Member Functions

 jXEInputAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~jXEInputAlgTool ()=default
 
StatusCode initialize () override
 
virtual StatusCode run (const EventContext &ctx) const override
 
virtual std::string toString () const override
 

Private Attributes

SG::ReadHandleKey< xAOD::jFexMETRoIContainerm_jFexMETRoIKey
 
SG::WriteHandleKey< GlobalSim::jXETOBArraym_jXETOBArrayWriteKey
 
ToolHandle< GenericMonitoringToolm_monTool
 

Static Private Attributes

static constexpr int s_Et_conversion {2}
 
static constexpr double s_EtDouble_conversion {0.1}
 

Detailed Description

Definition at line 24 of file jXEInputAlgTool.h.

Constructor & Destructor Documentation

◆ jXEInputAlgTool()

GlobalSim::jXEInputAlgTool::jXEInputAlgTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 13 of file jXEInputAlgTool.cxx.

15  :
16  base_class(type, name, parent){
17  }

◆ ~jXEInputAlgTool()

virtual GlobalSim::jXEInputAlgTool::~jXEInputAlgTool ( )
virtualdefault

Member Function Documentation

◆ initialize()

StatusCode GlobalSim::jXEInputAlgTool::initialize ( )
override

Definition at line 19 of file jXEInputAlgTool.cxx.

19  {
20 
21  CHECK(m_jFexMETRoIKey.initialize());
23 
24  CHECK(m_monTool.retrieve());
25 
26  return StatusCode::SUCCESS;
27  }

◆ run()

StatusCode GlobalSim::jXEInputAlgTool::run ( const EventContext &  ctx) const
overridevirtual

Definition at line 29 of file jXEInputAlgTool.cxx.

29  {
30 
32  jXEContainer(m_jFexMETRoIKey, ctx);
33 
34  CHECK(jXEContainer.isValid());
35 
36  auto jXEs = std::make_unique<GlobalSim::jXETOBArray>("InputjJets", 1);
37 
38 
39  int global_ExTopo = 0;
40  int global_EyTopo = 0;
41 
42  for(const xAOD::jFexMETRoI* jFexRoI : *jXEContainer){
43 
44  // Get the XE components and convert to 100 MeV units
45  int ExTopo = jFexRoI->tobEx() * s_Et_conversion;
46  int EyTopo = jFexRoI->tobEy() * s_Et_conversion;
47  int jFexNumber = jFexRoI->jFexNumber();
48  int fpgaNumber = jFexRoI->fpgaNumber();
49 
50  //Note: flipped to produce the right sign
51  int hemisphere = fpgaNumber == 0 ? -1 : 1;
52 
53  ExTopo = hemisphere * ExTopo;
54  EyTopo = hemisphere * EyTopo;
55 
56  global_ExTopo += ExTopo;
57  global_EyTopo += EyTopo;
58 
59  ATH_MSG_DEBUG("EDM jFex XE Number: "
60  << jFexNumber
61  << " FPGA Number: "
62  << fpgaNumber
63  << " Ex: "
64  << ExTopo
65  << " Ey: "
66  << EyTopo
67  );
68  }
69 
70  unsigned long long global_ExTopoLong =
71  static_cast<unsigned long long>(global_ExTopo);
72 
73  unsigned long long global_EyTopoLong =
74  static_cast<unsigned long long>(global_EyTopo);
75 
76  unsigned long long Et2Topo =
77  global_ExTopoLong*global_ExTopoLong + global_EyTopoLong*global_EyTopoLong;
78 
79  unsigned int EtTopo = std::sqrt(Et2Topo);
80 
81  TCS::jXETOB jxe(global_ExTopo, global_EyTopo, EtTopo, TCS::JXE);
82 
83  jxe.setExDouble(static_cast<double>(global_ExTopo * s_EtDouble_conversion));
84  jxe.setEyDouble(static_cast<double>(global_EyTopo * s_EtDouble_conversion));
85  jxe.setEtDouble(static_cast<double>(EtTopo * s_EtDouble_conversion));
86  jxe.setEt2(Et2Topo);
87 
88  jXEs->push_back(jxe);
89 
91  ctx);
92  CHECK(h_write.record(std::move(jXEs)));
93 
94  auto mon_h_jXE_Pt =
95  Monitored::Scalar("jXETOBPt", jxe.EtDouble());
96 
97  auto mon_h_jXE_Phi =
98  Monitored::Scalar("jXETOBPhi", atan2(jxe.Ey(),jxe.Ex()));
99 
100 
102  mon_h_jXE_Pt,
103  mon_h_jXE_Phi);
104 
105  return StatusCode::SUCCESS;
106  }

◆ toString()

std::string GlobalSim::jXEInputAlgTool::toString ( ) const
overridevirtual

Definition at line 108 of file jXEInputAlgTool.cxx.

108  {
109  std::stringstream ss;
110  ss << "jXEInputAlgTool: " << name() << '\n'
111  << m_jFexMETRoIKey << '\n'
112  << m_jXETOBArrayWriteKey << '\n';
113  return ss.str();
114  }

Member Data Documentation

◆ m_jFexMETRoIKey

SG::ReadHandleKey<xAOD::jFexMETRoIContainer> GlobalSim::jXEInputAlgTool::m_jFexMETRoIKey
private
Initial value:
{this,
"jFexMETRoIKey", "L1_jFexMETRoI", "jFEX TE EDM"}

Definition at line 44 of file jXEInputAlgTool.h.

◆ m_jXETOBArrayWriteKey

SG::WriteHandleKey<GlobalSim::jXETOBArray> GlobalSim::jXEInputAlgTool::m_jXETOBArrayWriteKey
private
Initial value:
{this, "TOBArrayWriteKey", "",
"key to write out an jXETOBArray"}

Definition at line 48 of file jXEInputAlgTool.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> GlobalSim::jXEInputAlgTool::m_monTool
private
Initial value:
{
this, "monTool", "", "Monitoring tool to create histograms"}

Definition at line 55 of file jXEInputAlgTool.h.

◆ s_Et_conversion

constexpr int GlobalSim::jXEInputAlgTool::s_Et_conversion {2}
staticconstexprprivate

Definition at line 51 of file jXEInputAlgTool.h.

◆ s_EtDouble_conversion

constexpr double GlobalSim::jXEInputAlgTool::s_EtDouble_conversion {0.1}
staticconstexprprivate

Definition at line 52 of file jXEInputAlgTool.h.


The documentation for this class was generated from the following files:
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
TCS::JXE
@ JXE
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:27
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
GlobalSim::jXEInputAlgTool::s_Et_conversion
static constexpr int s_Et_conversion
Definition: jXEInputAlgTool.h:51
GlobalSim::jXEInputAlgTool::s_EtDouble_conversion
static constexpr double s_EtDouble_conversion
Definition: jXEInputAlgTool.h:52
xAOD::jFexMETRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexMETRoI_v1.h:22
GlobalSim::jXEInputAlgTool::m_jFexMETRoIKey
SG::ReadHandleKey< xAOD::jFexMETRoIContainer > m_jFexMETRoIKey
Definition: jXEInputAlgTool.h:44
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
GlobalSim::jXEInputAlgTool::m_jXETOBArrayWriteKey
SG::WriteHandleKey< GlobalSim::jXETOBArray > m_jXETOBArrayWriteKey
Definition: jXEInputAlgTool.h:48
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
GlobalSim::jXEInputAlgTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: jXEInputAlgTool.h:55
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TCS::jXETOB
Definition: jXETOB.h:13