ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSim::eEmEg1BDTMultAlgTool Class Reference

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

#include <eEmEg1BDTMultAlgTool.h>

Inheritance diagram for GlobalSim::eEmEg1BDTMultAlgTool:
Collaboration diagram for GlobalSim::eEmEg1BDTMultAlgTool:

Public Member Functions

 eEmEg1BDTMultAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~eEmEg1BDTMultAlgTool () override=default
virtual StatusCode initialize () override
 Initialize function running before first event.
virtual StatusCode countPassingTOBs (const EventContext &, unsigned int &N_pass_tobs) const override
virtual std::string toString () const override
virtual StatusCode updateTIP (std::bitset< s_nbits_TIP > &, const std::unique_ptr< IDataCollector > &, const EventContext &) const override

Private Attributes

std::unique_ptr< ICommonSelectorm_c_selector {nullptr}
std::unique_ptr< IeEmEg1BDTSelectorm_bdt_selector {nullptr}
SG::ReadHandleKey< IOBitwise::eEmEg1BDTTOBContainerm_eEmEg1BDTTOBContainerKey
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::string > m_Eg1BDT_str
Gaudi::Property< std::string > m_Eg1BDT_op
Gaudi::Property< std::string > m_menu_name
Gaudi::Property< bool > m_enableDump

Detailed Description

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

Cutting on the eEmEg1BDT score

Definition at line 26 of file eEmEg1BDTMultAlgTool.h.

Constructor & Destructor Documentation

◆ eEmEg1BDTMultAlgTool()

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

Definition at line 14 of file eEmEg1BDTMultAlgTool.cxx.

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

◆ ~eEmEg1BDTMultAlgTool()

virtual GlobalSim::eEmEg1BDTMultAlgTool::~eEmEg1BDTMultAlgTool ( )
overridevirtualdefault

Member Function Documentation

◆ countPassingTOBs()

StatusCode GlobalSim::eEmEg1BDTMultAlgTool::countPassingTOBs ( const EventContext & ctx,
unsigned int & N_pass_tobs ) const
overridevirtual

Definition at line 50 of file eEmEg1BDTMultAlgTool.cxx.

50 {
51 auto tobs =
52 SG::ReadHandle<GlobalSim::IOBitwise::eEmEg1BDTTOBContainer>(m_eEmEg1BDTTOBContainerKey,
53 ctx);
54
55 CHECK(tobs.isValid());
56
57 // check if any of the incoming tobs is selected.
58
59 std::vector<bool> tob_pass(tobs->size(), false);
60 for (int tob_it = 0; const GlobalSim::IOBitwise::eEmEg1BDTTOB* t : *tobs){
61 if (m_c_selector->select(*t) and m_bdt_selector->select(*t)) {
62 tob_pass[tob_it] = true;
63 if (++N_pass_tobs == m_maxtob){
64 break;
65 }
66 }
67 tob_it++;
68 }
69
70 ATH_MSG_DEBUG("no of passing TOBS" << N_pass_tobs);
71
72 if (m_enableDump) {
73 std::stringstream ss;
74 ss << "\nRun " << ctx << '\n';
75 std::size_t ind{0};
76 for (const GlobalSim::IOBitwise::eEmEg1BDTTOB* tob : *tobs) {
77 ss << tob->to_string() << ' ' << std::boolalpha << " pass " << tob_pass[ind++] << '\n';
78 }
79 ss << "tob count " << N_pass_tobs << '\n';
80
81 std::ofstream out(name() + ".log", std::ios_base::app);
82 out << ss.str();
83 out.close();
84 }
85
86 return StatusCode::SUCCESS;
87 }
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
static Double_t ss
std::unique_ptr< ICommonSelector > m_c_selector
SG::ReadHandleKey< IOBitwise::eEmEg1BDTTOBContainer > m_eEmEg1BDTTOBContainerKey
std::unique_ptr< IeEmEg1BDTSelector > m_bdt_selector

◆ initialize()

StatusCode GlobalSim::eEmEg1BDTMultAlgTool::initialize ( )
overridevirtual

Initialize function running before first event.

Definition at line 22 of file eEmEg1BDTMultAlgTool.cxx.

22 {
24
26
27 // create the necessary selector objects
28 m_c_selector = std::make_unique<CommonSelector>(m_et_low_str,
34 );
35
36 try {
37 m_bdt_selector = std::make_unique<eEmEg1BDTSelector>(std::stoul(m_Eg1BDT_str),
39 );
40 } catch (const std::exception& e) {
41
42 ATH_MSG_ERROR("Error initialising eEmEg1BDTSelector " << e.what());
43 return StatusCode::FAILURE;
44 }
45
46 return StatusCode::SUCCESS;
47 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
virtual StatusCode initialize() override
Initialize function running before first event.
Gaudi::Property< std::string > m_phi_low_str
Gaudi::Property< std::string > m_eta_high_str
Gaudi::Property< std::string > m_et_low_str
Gaudi::Property< std::string > m_Eg1BDT_str
Gaudi::Property< std::string > m_Eg1BDT_op
Gaudi::Property< std::string > m_phi_high_str
Gaudi::Property< std::string > m_eta_low_str
Gaudi::Property< std::string > m_et_high_str

◆ toString()

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

Definition at line 89 of file eEmEg1BDTMultAlgTool.cxx.

89 {
90 std::stringstream ss;
91 ss <<name () << ": " <<m_menu_name << ' '
92 << "eEmEg1BDTMultAlgTool read, select, count and report number of related eEmEg1BDTTOBS\n"
93 << m_c_selector->to_string() << '\n'
94 << m_bdt_selector->to_string() << '\n'
95 << m_TIP_position << ' ' << m_TIP_width;
96
97 return ss.str();
98 }
Gaudi::Property< std::string > m_menu_name

◆ updateTIP()

StatusCode GlobalSim::TIPWriterAlgTool::updateTIP ( std::bitset< s_nbits_TIP > & word,
const std::unique_ptr< IDataCollector > & dc,
const EventContext & ctx ) const
override

Definition at line 34 of file TIPWriterAlgTool.cxx.

42 {
43
44 if (dc){dc->collect(*this, "start");}
45
46 unsigned int N_pass_tobs{0};
47 ATH_CHECK( countPassingTOBs(ctx, N_pass_tobs) );
48 ATH_MSG_DEBUG("no of passing TOBS" << N_pass_tobs);
49
50 auto count_bits = std::bitset<s_nbits_TIP>(N_pass_tobs);
51 word |= (count_bits << m_TIP_position);
52
53 ATH_MSG_DEBUG("TIP word " << word);
54 if (dc){dc->collect(*this, "end");}
55
56 return StatusCode::SUCCESS;
57 }
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &N_pass_tobs) const override

Member Data Documentation

◆ m_bdt_selector

std::unique_ptr<IeEmEg1BDTSelector> GlobalSim::eEmEg1BDTMultAlgTool::m_bdt_selector {nullptr}
private

Definition at line 47 of file eEmEg1BDTMultAlgTool.h.

47{nullptr};

◆ m_c_selector

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

Definition at line 46 of file eEmEg1BDTMultAlgTool.h.

46{nullptr};

◆ m_eEmEg1BDTTOBContainerKey

SG::ReadHandleKey<IOBitwise::eEmEg1BDTTOBContainer> GlobalSim::eEmEg1BDTMultAlgTool::m_eEmEg1BDTTOBContainerKey
private
Initial value:
{
this,
"eEmEg1BDTTOBContainerKey",
"eEmEg1BDTTOBContainer",
"Key for GlobalSim eEmEg1BDTTOB container"}

Definition at line 50 of file eEmEg1BDTMultAlgTool.h.

50 {
51 this,
52 "eEmEg1BDTTOBContainerKey",
53 "eEmEg1BDTTOBContainer",
54 "Key for GlobalSim eEmEg1BDTTOB container"};

◆ m_Eg1BDT_op

Gaudi::Property<std::string> GlobalSim::eEmEg1BDTMultAlgTool::m_Eg1BDT_op
private
Initial value:
{
this,
"Eg1BDT_op",
"unknown",
"Eg1BDT cut_operator"}

Definition at line 99 of file eEmEg1BDTMultAlgTool.h.

99 {
100 this,
101 "Eg1BDT_op",
102 "unknown",
103 "Eg1BDT cut_operator"};

◆ m_Eg1BDT_str

Gaudi::Property<std::string> GlobalSim::eEmEg1BDTMultAlgTool::m_Eg1BDT_str
private
Initial value:
{
this,
"Eg1BDT",
"0",
"Eg1BDT lcut_value"}

Definition at line 93 of file eEmEg1BDTMultAlgTool.h.

93 {
94 this,
95 "Eg1BDT",
96 "0",
97 "Eg1BDT lcut_value"};

◆ m_enableDump

Gaudi::Property<bool> GlobalSim::eEmEg1BDTMultAlgTool::m_enableDump
private
Initial value:
{
this,
"enable_dump",
false,
"flag to enable debug dumps"
}

Definition at line 112 of file eEmEg1BDTMultAlgTool.h.

112 {
113 this,
114 "enable_dump",
115 false,
116 "flag to enable debug dumps"
117 };

◆ m_et_high_str

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

Definition at line 62 of file eEmEg1BDTMultAlgTool.h.

62 {
63 this,
64 "et_high",
65 "inf",
66 "et high for window selector"};

◆ m_et_low_str

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

Definition at line 56 of file eEmEg1BDTMultAlgTool.h.

56 {
57 this,
58 "et_low",
59 "0",
60 "et low for window selector"};

◆ m_eta_high_str

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

Definition at line 74 of file eEmEg1BDTMultAlgTool.h.

74 {
75 this,
76 "eta_high",
77 "inf",
78 "eta high for window selector"};

◆ m_eta_low_str

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

Definition at line 68 of file eEmEg1BDTMultAlgTool.h.

68 {
69 this,
70 "eta_low",
71 "0",
72 "eta low for window selector"};

◆ m_menu_name

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

Definition at line 105 of file eEmEg1BDTMultAlgTool.h.

105 {
106 this,
107 "menu_name",
108 "unknown",
109 "name from json menu file"
110 };

◆ m_phi_high_str

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

Definition at line 86 of file eEmEg1BDTMultAlgTool.h.

86 {
87 this,
88 "phi_high",
89 "inf",
90 "phi high for window selector"};

◆ m_phi_low_str

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

Definition at line 80 of file eEmEg1BDTMultAlgTool.h.

80 {
81 this,
82 "phi_low",
83 "0",
84 "phi low for window selector"};

The documentation for this class was generated from the following files: