ATLAS Offline Software
EnergyThreshold_jXE.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 /*********************************
5  * EnergyThreshold_jXE.cxx
6  * Based on L1TopoAlgorithm package
7 **********************************/
8 
9 
10 #include "EnergyThreshold_jXE.h"
11 
12 #include "../IO/jXETOBArray.h"
13 #include "../IO/Count.h"
14 
15 #include <sstream>
16 
17 
18 namespace GlobalSim {
20  unsigned int nbits,
21  unsigned int threshold):
22  m_name{name},
23  m_nbits{nbits},
24  m_100MeVthreshold{threshold} // L1TopoSim uses L1Menu.thrValue100MeV()
25  {
26 
27  if (m_nbits == 0) {
28  throw std::runtime_error("EnergyThreshold_jXE m_nbits == 0");
29  }
30  }
31 
32  StatusCode EnergyThreshold_jXE::run(const jXETOBArray& jXEs,
33  Count& count) {
34 
35  count.setNBits(m_nbits);
36 
37  int countVal{0};
38 
39  auto threshsq = m_100MeVthreshold * m_100MeVthreshold;
40 
41  for(const auto& jxe : jXEs) {
42  m_inputET.push_back(jxe->Et());
43 
44  if(jxe->Et2() > threshsq) {
45  ++countVal;
46  m_passingET.push_back(jxe->Et());
47  }
48 
49  }
50 
51  count.setSizeCount(countVal);
52 
53  return StatusCode::SUCCESS;
54  }
55 
56  std::string EnergyThreshold_jXE::toString() const {
57  std::stringstream ss;
58  ss << "EnergyThreshold_jXE. name: " << m_name << '\n'
59  << " threshold " << m_100MeVthreshold
60  << " numberOfBits " << m_nbits;
61  return ss.str();
62  }
63 
64  const std::vector<double>& EnergyThreshold_jXE::input_ET() const{
65  return m_inputET;
66  }
67 
68  const std::vector<double>& EnergyThreshold_jXE::passing_ET() const {
69  return m_passingET;
70  }
71 
72  const std::vector<double>& EnergyThreshold_jXE::counts() const {
73  return m_counts;
74  }
75 }
GlobalSim::EnergyThreshold_jXE::m_inputET
std::vector< double > m_inputET
Definition: EnergyThreshold_jXE.h:46
GlobalSim::EnergyThreshold_jXE::m_passingET
std::vector< double > m_passingET
Definition: EnergyThreshold_jXE.h:47
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
GlobalSim::EnergyThreshold_jXE::run
StatusCode run(const jXETOBArray &input, Count &count)
Definition: EnergyThreshold_jXE.cxx:35
GlobalSim::EnergyThreshold_jXE::m_counts
std::vector< double > m_counts
Definition: EnergyThreshold_jXE.h:48
GlobalSim::EnergyThreshold_jXE::m_name
std::string m_name
Definition: EnergyThreshold_jXE.h:40
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
GlobalSim::EnergyThreshold_jXE::EnergyThreshold_jXE
EnergyThreshold_jXE(const std::string &name, unsigned int nbits, unsigned int threshold)
Definition: EnergyThreshold_jXE.cxx:22
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GlobalSim::EnergyThreshold_jXE::m_100MeVthreshold
unsigned int m_100MeVthreshold
Definition: EnergyThreshold_jXE.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
threshold
Definition: chainparser.cxx:74
GlobalSim::EnergyThreshold_jXE::input_ET
const std::vector< double > & input_ET() const
Definition: EnergyThreshold_jXE.cxx:67
GlobalSim::EnergyThreshold_jXE::counts
const std::vector< double > & counts() const
Definition: EnergyThreshold_jXE.cxx:75
GlobalSim::EnergyThreshold_jXE::m_nbits
unsigned int m_nbits
Definition: EnergyThreshold_jXE.h:42
GlobalSim::EnergyThreshold_jXE::toString
std::string toString() const
Definition: EnergyThreshold_jXE.cxx:59
EnergyThreshold_jXE.h
GlobalSim::EnergyThreshold_jXE::passing_ET
const std::vector< double > & passing_ET() const
Definition: EnergyThreshold_jXE.cxx:71