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 &, const std::unique_ptr< IDataCollector > &dc, 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,
const std::unique_ptr< IDataCollector > & dc,
unsigned int & N_pass_tobs ) const
overridevirtual

Definition at line 51 of file eEmEg1BDTMultAlgTool.cxx.

53 {
54 auto tobs =
55 SG::ReadHandle<GlobalSim::IOBitwise::eEmEg1BDTTOBContainer>(m_eEmEg1BDTTOBContainerKey,
56 ctx);
57
58 CHECK(tobs.isValid());
59
60 if(dc){
61 std::stringstream ss;
62 ss << "nummber of tobs "<< tobs->size() << '\n';
63 dc->collect(*this, ss.str());
64
65 for(const GlobalSim::IOBitwise::eEmEg1BDTTOB* t : *tobs){
66 dc->collect(*this, t->to_string());
67 }
68 }
69
70 // check if any of the incoming tobs is selected.
71
72 std::vector<bool> tob_pass(tobs->size(), false);
73 for (int tob_it = 0; const GlobalSim::IOBitwise::eEmEg1BDTTOB* t : *tobs){
74 if (m_c_selector->select(*t) and m_bdt_selector->select(*t)) {
75 tob_pass[tob_it] = true;
76 if (++N_pass_tobs == m_maxtob){
77 break;
78 }
79 }
80 tob_it++;
81 }
82
83 ATH_MSG_DEBUG("no of passing TOBS" << N_pass_tobs);
84
85 if (m_enableDump) {
86 std::stringstream ss;
87 ss << "\nRun " << ctx << '\n';
88 std::size_t ind{0};
89 for (const GlobalSim::IOBitwise::eEmEg1BDTTOB* tob : *tobs) {
90 ss << tob->to_string() << ' ' << std::boolalpha << " pass " << tob_pass[ind++] << '\n';
91 }
92 ss << "tob count " << N_pass_tobs << '\n';
93
94 std::ofstream out(name() + ".log", std::ios_base::app);
95 out << ss.str();
96 out.close();
97 }
98
99 return StatusCode::SUCCESS;
100 }
#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 102 of file eEmEg1BDTMultAlgTool.cxx.

102 {
103 std::stringstream ss;
104 ss <<name () << ": " <<m_menu_name << ' '
105 << "eEmEg1BDTMultAlgTool read, select, count and report number of related eEmEg1BDTTOBS\n"
106 << m_c_selector->to_string() << '\n'
107 << m_bdt_selector->to_string() << '\n'
108 << m_TIP_position << ' ' << m_TIP_width;
109
110 return ss.str();
111 }
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, dc, 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 &, const std::unique_ptr< IDataCollector > &dc, 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 50 of file eEmEg1BDTMultAlgTool.h.

50{nullptr};

◆ m_c_selector

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

Definition at line 49 of file eEmEg1BDTMultAlgTool.h.

49{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 53 of file eEmEg1BDTMultAlgTool.h.

53 {
54 this,
55 "eEmEg1BDTTOBContainerKey",
56 "eEmEg1BDTTOBContainer",
57 "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 102 of file eEmEg1BDTMultAlgTool.h.

102 {
103 this,
104 "Eg1BDT_op",
105 "unknown",
106 "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 96 of file eEmEg1BDTMultAlgTool.h.

96 {
97 this,
98 "Eg1BDT",
99 "0",
100 "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 115 of file eEmEg1BDTMultAlgTool.h.

115 {
116 this,
117 "enable_dump",
118 false,
119 "flag to enable debug dumps"
120 };

◆ 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 65 of file eEmEg1BDTMultAlgTool.h.

65 {
66 this,
67 "et_high",
68 "inf",
69 "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 59 of file eEmEg1BDTMultAlgTool.h.

59 {
60 this,
61 "et_low",
62 "0",
63 "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 77 of file eEmEg1BDTMultAlgTool.h.

77 {
78 this,
79 "eta_high",
80 "inf",
81 "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 71 of file eEmEg1BDTMultAlgTool.h.

71 {
72 this,
73 "eta_low",
74 "0",
75 "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 108 of file eEmEg1BDTMultAlgTool.h.

108 {
109 this,
110 "menu_name",
111 "unknown",
112 "name from json menu file"
113 };

◆ 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 89 of file eEmEg1BDTMultAlgTool.h.

89 {
90 this,
91 "phi_high",
92 "inf",
93 "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 83 of file eEmEg1BDTMultAlgTool.h.

83 {
84 this,
85 "phi_low",
86 "0",
87 "phi low for window selector"};

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