ATLAS Offline Software
Loading...
Searching...
No Matches
CommonSelector.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "./CommonSelector.h"
6#include <sstream>
7
8namespace GlobalSim {
9
10 using namespace GlobalSim::IOBitwise;
11
12 CommonSelector::CommonSelector(const std::string& et_low,
13 const std::string& et_high,
14 const std::string& eta_low,
15 const std::string& eta_high,
16 const std::string& phi_low,
17 const std::string& phi_high):
18 m_et_low{std::stoul(et_low)},
19 m_eta_low{std::stoul(eta_low)},
20 m_phi_low{std::stoul(phi_low)} {
21 //
22 auto unsignedLong = [](const std::string & txt)->unsigned long{
23 if (txt == "inf") return ULONG_MAX;
24 return std::stoul(txt);
25 };
26 //
27 m_et_high = unsignedLong(et_high);
28 m_eta_high = unsignedLong(eta_high);
29 m_phi_high = unsignedLong(phi_high);
30 }
31
32
33 bool CommonSelector::select(const CommonTOB& tob) const {
34 {
35 auto et = tob.et_bits().to_ulong();
36 if (et < m_et_low or et >= m_et_high) {return false;}
37 }
38
39 {
40 auto eta = tob.eta_bits().to_ulong();
41 if (eta < m_eta_low or eta >= m_eta_high) {return false;}
42 }
43
44 {
45 auto phi = tob.phi_bits().to_ulong();
46 if (phi < m_phi_low or phi >= m_phi_high) {return false;}
47 }
48
49 return true;
50 };
51
52 std::string CommonSelector::to_string() const {
53
54 auto ss = std::stringstream();
55 ss << "et_low: " << m_et_low <<' '
56 << "et_high: " << m_et_high <<' '
57 << "eta_low: " << m_eta_low <<' '
58 << "eta_high: " << m_eta_high <<' '
59 << "phi_low: " << m_phi_low <<' '
60 << "phi_high: " << m_phi_high;
61
62 return ss.str();
63 };
64
65}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
float et(const xAOD::jFexSRJetRoI *j)
static Double_t ss
CommonSelector()=default
Passes all.
virtual bool select(const CommonTOB &) const override
virtual std::string to_string() const override
virtual std::bitset< s_et_width > et_bits() const
Definition CommonTOB.cxx:28
virtual std::bitset< s_eta_width > eta_bits() const
Definition CommonTOB.cxx:32
virtual std::bitset< s_phi_width > phi_bits() const
Definition CommonTOB.cxx:36
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
STL namespace.
Extra patterns decribing particle interation process.