ATLAS Offline Software
Loading...
Searching...
No Matches
CommonSelector.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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 if(et_high == "inf") {
23 m_et_high = ULONG_MAX;
24 } else {
25 m_et_high = std::stoul(et_high);
26 }
27
28 if(eta_high == "inf") {
29 m_eta_high = ULONG_MAX;
30 } else {
31 m_eta_high = std::stoul(eta_high);
32 }
33
34 if(eta_high == "inf") {
35 m_phi_high = ULONG_MAX;
36 } else {
37 m_phi_high = std::stoul(phi_high);
38 }
39 }
40
41
42 bool CommonSelector::select(const ICommonTOB& tob) const {
43 {
44 auto et = tob.et_bits().to_ulong();
45 if (et < m_et_low or et >= m_et_high) {return false;}
46 }
47
48 {
49 auto eta = tob.eta_bits().to_ulong();
50 if (eta < m_eta_low or eta >= m_eta_high) {return false;}
51 }
52
53 {
54 auto phi = tob.phi_bits().to_ulong();
55 if (phi < m_phi_low or phi >= m_phi_high) {return false;}
56 }
57
58 return true;
59 };
60
61 std::string CommonSelector::to_string() const {
62
63 auto ss = std::stringstream();
64 ss << "et_low: " << m_et_low <<' '
65 << "et_high: " << m_et_high <<' '
66 << "eta_low: " << m_eta_low <<' '
67 << "eta_high: " << m_eta_high <<' '
68 << "phi_low: " << m_phi_low <<' '
69 << "phi_high: " << m_phi_high;
70
71 return ss.str();
72 };
73
74}
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 ICommonTOB &) const override
virtual std::string to_string() const override
Class to hold common (eta/eta/phi) TOB bits.
Definition ICommonTOB.h:27
virtual std::bitset< s_et_width > et_bits() const =0
Returns the eT bits of this TOB.
virtual std::bitset< s_eta_width > eta_bits() const =0
Returns the eta bits of this TOB.
virtual std::bitset< s_phi_width > phi_bits() const =0
Returns the phi bits of this TOB.
AlgTool that to test whether expected the TIP values generated by data supplied by eEmMultTestBench c...
STL namespace.
Extra patterns decribing particle interation process.