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

AlgTool to count GlobalSim::IOBitwise::eEmTOB objects. More...

#include <CommonSortSelectAlgTool.h>

Inheritance diagram for GlobalSim::CommonSortSelectAlgTool:
Collaboration diagram for GlobalSim::CommonSortSelectAlgTool:

Public Member Functions

 CommonSortSelectAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~CommonSortSelectAlgTool () override=default
 
virtual StatusCode initialize () override
 Initialize function running before first event. More...
 
virtual StatusCode run (const EventContext &) const override
 
virtual std::string toString () const override
 

Private Member Functions

void dump () const
 

Private Attributes

std::unique_ptr< ICommonSelectorm_c_selector {nullptr}
 
SG::ReadHandleKey< GlobalSim::IOBitwise::ICommonTOBContainerm_inTOBContainerKey
 
SG::WriteHandleKey< GlobalSim::IOBitwise::ICommonTOBContainerm_outTOBContainerKey
 
Gaudi::Property< std::string > m_et_low_str
 
Gaudi::Property< std::string > m_et_high_str
 
Gaudi::Property< std::string > m_eta_low_str
 
Gaudi::Property< std::string > m_eta_high_str
 
Gaudi::Property< std::string > m_phi_low_str
 
Gaudi::Property< std::string > m_phi_high_str
 
Gaudi::Property< std::size_t > m_maxTOBs
 
Gaudi::Property< std::string > m_menu_name
 
Gaudi::Property< bool > m_enableDump
 

Detailed Description

AlgTool to count GlobalSim::IOBitwise::eEmTOB objects.

Definition at line 29 of file CommonSortSelectAlgTool.h.

Constructor & Destructor Documentation

◆ CommonSortSelectAlgTool()

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

Definition at line 13 of file CommonSortSelectAlgTool.cxx.

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

◆ ~CommonSortSelectAlgTool()

virtual GlobalSim::CommonSortSelectAlgTool::~CommonSortSelectAlgTool ( )
overridevirtualdefault

Member Function Documentation

◆ dump()

void GlobalSim::CommonSortSelectAlgTool::dump ( ) const
private

◆ initialize()

StatusCode GlobalSim::CommonSortSelectAlgTool::initialize ( )
overridevirtual

Initialize function running before first event.

Definition at line 21 of file CommonSortSelectAlgTool.cxx.

21  {
22 
25 
26  // create the selector function object
27  m_c_selector = std::make_unique<CommonSelector>(m_et_low_str,
33  );
34 
35  return StatusCode::SUCCESS;
36  }

◆ run()

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

Definition at line 39 of file CommonSortSelectAlgTool.cxx.

39  {
40  auto tobs =
42  ctx);
43 
44  CHECK(tobs.isValid());
45 
46  // copy selected tobs to the output container
47 
48  auto out_tobs =
49  std::make_unique<IOBitwise::ICommonTOBContainer>(tobs->size());
50 
51  std::copy_if(std::cbegin(*tobs),
52  std::cend(*tobs),
53  std::back_inserter(*out_tobs),
54  [&selector=m_c_selector](const auto& tob) {
55  return selector->select(*tob);});
56 
57  ATH_MSG_DEBUG("no of TOBS in, selected: " << tobs->size()
58  << " " << out_tobs->size());
59 
60  std::size_t maxTOBs{m_maxTOBs};
61  out_tobs->resize(std::min(maxTOBs, out_tobs->size()));
62 
63  std::sort(std::begin(*out_tobs),
64  std::end(*out_tobs),
65  [](const auto& l, const auto& r) {
66  return l->et_bits().to_ulong() < r->et_bits().to_ulong();
67  });
68 
70  h_out(m_outTOBContainerKey, ctx);
71 
72  CHECK(h_out.record(std::move(out_tobs)));
73 
74  return StatusCode::SUCCESS;
75  }

◆ toString()

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

Definition at line 77 of file CommonSortSelectAlgTool.cxx.

77  {
78  std::stringstream ss;
79  ss <<name () << ": " <<m_menu_name << ' '
80  << "CommonSortSelectAlgTool read, select, and sort CommonTOBS\n"
81  << m_c_selector->to_string() << '\n';
82  return ss.str();
83  }

Member Data Documentation

◆ m_c_selector

std::unique_ptr<ICommonSelector> GlobalSim::CommonSortSelectAlgTool::m_c_selector {nullptr}
private

Definition at line 45 of file CommonSortSelectAlgTool.h.

◆ m_enableDump

Gaudi::Property<bool> GlobalSim::CommonSortSelectAlgTool::m_enableDump
private
Initial value:
{
this,
"enable_dump",
"False",
"floag to eanble debug dumps"
}

Definition at line 113 of file CommonSortSelectAlgTool.h.

◆ m_et_high_str

Gaudi::Property<std::string> GlobalSim::CommonSortSelectAlgTool::m_et_high_str
private
Initial value:
{
this,
"et_high",
"inf",
"et high for window selector"}

Definition at line 69 of file CommonSortSelectAlgTool.h.

◆ m_et_low_str

Gaudi::Property<std::string> GlobalSim::CommonSortSelectAlgTool::m_et_low_str
private
Initial value:
{
this,
"et_low",
"0",
"et low for window selector"}

Definition at line 63 of file CommonSortSelectAlgTool.h.

◆ m_eta_high_str

Gaudi::Property<std::string> GlobalSim::CommonSortSelectAlgTool::m_eta_high_str
private
Initial value:
{
this,
"eta_high",
"inf",
"eta high for window selector"}

Definition at line 81 of file CommonSortSelectAlgTool.h.

◆ m_eta_low_str

Gaudi::Property<std::string> GlobalSim::CommonSortSelectAlgTool::m_eta_low_str
private
Initial value:
{
this,
"eta_low",
"0",
"eta low for window selector"}

Definition at line 75 of file CommonSortSelectAlgTool.h.

◆ m_inTOBContainerKey

SG::ReadHandleKey<GlobalSim::IOBitwise::ICommonTOBContainer> GlobalSim::CommonSortSelectAlgTool::m_inTOBContainerKey
private
Initial value:
{
this,
"inTOBs",
"inTOBs",
"Key for GlobalSim CommonTOB container"}

Definition at line 48 of file CommonSortSelectAlgTool.h.

◆ m_maxTOBs

Gaudi::Property<std::size_t> GlobalSim::CommonSortSelectAlgTool::m_maxTOBs
private
Initial value:
{
this,
"maxTOBs",
10,
"max number of TOBs in to be passed to client"}

Definition at line 100 of file CommonSortSelectAlgTool.h.

◆ m_menu_name

Gaudi::Property<std::string> GlobalSim::CommonSortSelectAlgTool::m_menu_name
private
Initial value:
{
this,
"menu_name",
"unknown",
"name from json menu file"
}

Definition at line 106 of file CommonSortSelectAlgTool.h.

◆ m_outTOBContainerKey

SG::WriteHandleKey<GlobalSim::IOBitwise::ICommonTOBContainer> GlobalSim::CommonSortSelectAlgTool::m_outTOBContainerKey
private
Initial value:
{
this,
"outTOBs",
"outTOBs",
"Key for GlobalSim CommonTOB container"}

Definition at line 56 of file CommonSortSelectAlgTool.h.

◆ m_phi_high_str

Gaudi::Property<std::string> GlobalSim::CommonSortSelectAlgTool::m_phi_high_str
private
Initial value:
{
this,
"phi_high",
"inf",
"phi high for window selector"}

Definition at line 93 of file CommonSortSelectAlgTool.h.

◆ m_phi_low_str

Gaudi::Property<std::string> GlobalSim::CommonSortSelectAlgTool::m_phi_low_str
private
Initial value:
{
this,
"phi_low",
"0",
"phi low for window selector"}

Definition at line 87 of file CommonSortSelectAlgTool.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:672
GlobalSim::CommonSortSelectAlgTool::m_et_high_str
Gaudi::Property< std::string > m_et_high_str
Definition: CommonSortSelectAlgTool.h:69
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
GlobalSim::CommonSortSelectAlgTool::m_phi_high_str
Gaudi::Property< std::string > m_phi_high_str
Definition: CommonSortSelectAlgTool.h:93
GlobalSim::CommonSortSelectAlgTool::m_eta_low_str
Gaudi::Property< std::string > m_eta_low_str
Definition: CommonSortSelectAlgTool.h:75
GlobalSim::CommonSortSelectAlgTool::m_phi_low_str
Gaudi::Property< std::string > m_phi_low_str
Definition: CommonSortSelectAlgTool.h:87
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
ReadBchFromCrest.begin
begin
Definition: ReadBchFromCrest.py:80
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:157
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
GlobalSim::CommonSortSelectAlgTool::m_maxTOBs
Gaudi::Property< std::size_t > m_maxTOBs
Definition: CommonSortSelectAlgTool.h:100
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AnalysisUtils::copy_if
Out copy_if(In first, const In &last, Out res, const Pred &p)
Definition: IFilterUtils.h:30
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::CommonSortSelectAlgTool::m_menu_name
Gaudi::Property< std::string > m_menu_name
Definition: CommonSortSelectAlgTool.h:106
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
GlobalSim::CommonSortSelectAlgTool::m_et_low_str
Gaudi::Property< std::string > m_et_low_str
Definition: CommonSortSelectAlgTool.h:63
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:610
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
GlobalSim::CommonSortSelectAlgTool::m_outTOBContainerKey
SG::WriteHandleKey< GlobalSim::IOBitwise::ICommonTOBContainer > m_outTOBContainerKey
Definition: CommonSortSelectAlgTool.h:56
GlobalSim::CommonSortSelectAlgTool::m_inTOBContainerKey
SG::ReadHandleKey< GlobalSim::IOBitwise::ICommonTOBContainer > m_inTOBContainerKey
Definition: CommonSortSelectAlgTool.h:48
GlobalSim::CommonSortSelectAlgTool::m_c_selector
std::unique_ptr< ICommonSelector > m_c_selector
Definition: CommonSortSelectAlgTool.h:45
GlobalSim::CommonSortSelectAlgTool::m_eta_high_str
Gaudi::Property< std::string > m_eta_high_str
Definition: CommonSortSelectAlgTool.h:81