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

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

#include <CommonMultAlgTool.h>

Inheritance diagram for GlobalSim::CommonMultAlgTool:
Collaboration diagram for GlobalSim::CommonMultAlgTool:

Public Member Functions

 CommonMultAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~CommonMultAlgTool () 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 EventContext &) const override

Private Attributes

std::unique_ptr< ICommonSelectorm_c_selector {nullptr}
SG::ReadHandleKey< IOBitwise::CommonTOBContainerm_CommonTOBContainerKey
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_menu_name
Gaudi::Property< bool > m_enableDump

Detailed Description

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

Cutting on the et/eta/phi values

Definition at line 24 of file CommonMultAlgTool.h.

Constructor & Destructor Documentation

◆ CommonMultAlgTool()

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

Definition at line 12 of file CommonMultAlgTool.cxx.

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

◆ ~CommonMultAlgTool()

virtual GlobalSim::CommonMultAlgTool::~CommonMultAlgTool ( )
overridevirtualdefault

Member Function Documentation

◆ countPassingTOBs()

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

Definition at line 39 of file CommonMultAlgTool.cxx.

39 {
40 auto tobs =
41 SG::ReadHandle<GlobalSim::IOBitwise::CommonTOBContainer>(m_CommonTOBContainerKey,
42 ctx);
43
44 CHECK(tobs.isValid());
45
46 // check if any of the incoming tobs is selected.
47 N_pass_tobs = 0;
48 std::vector<bool> tob_pass(tobs->size(), false);
49 for (int tob_it = 0; const GlobalSim::IOBitwise::CommonTOB* t : *tobs){
50 if (m_c_selector->select(*t)) {
51 tob_pass[tob_it] = true;
52 if (++N_pass_tobs == m_maxtob){
53 break;
54 }
55 }
56 tob_it++;
57 }
58
59 if (m_enableDump) {
60 std::stringstream ss;
61 ss << "\nRun " << ctx << '\n';
62 std::size_t ind{0};
63 for (const GlobalSim::IOBitwise::CommonTOB* tob : *tobs) {
64 ss << tob->to_string() << ' ' << std::boolalpha << " pass " << tob_pass[ind++] << '\n';
65 }
66 ss << "tob count " << N_pass_tobs << '\n';
67
68 std::ofstream out(name() + ".log", std::ios_base::app);
69 out << ss.str();
70 out.close();
71 }
72
73 return StatusCode::SUCCESS;
74 }
#define CHECK(...)
Evaluate an expression and check for errors.
static Double_t ss
SG::ReadHandleKey< IOBitwise::CommonTOBContainer > m_CommonTOBContainerKey
Gaudi::Property< bool > m_enableDump
std::unique_ptr< ICommonSelector > m_c_selector

◆ initialize()

StatusCode GlobalSim::CommonMultAlgTool::initialize ( )
overridevirtual

Initialize function running before first event.

Definition at line 20 of file CommonMultAlgTool.cxx.

20 {
21
23
24 CHECK(m_CommonTOBContainerKey.initialize());
25
26 // create the necessary selector objects
27 m_c_selector = std::make_unique<CommonSelector>(m_et_low_str,
33 );
34
35 return StatusCode::SUCCESS;
36 }
#define ATH_CHECK
Evaluate an expression and check for errors.
Gaudi::Property< std::string > m_et_high_str
Gaudi::Property< std::string > m_eta_low_str
Gaudi::Property< std::string > m_et_low_str
Gaudi::Property< std::string > m_phi_low_str
Gaudi::Property< std::string > m_eta_high_str
Gaudi::Property< std::string > m_phi_high_str
virtual StatusCode initialize() override
Initialize function running before first event.

◆ toString()

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

Definition at line 76 of file CommonMultAlgTool.cxx.

76 {
77 std::stringstream ss;
78 ss <<name () << ": " <<m_menu_name << ' '
79 << "CommonMultAlgTool read, select, count and report number of related CommonTOBS\n"
80 << m_c_selector->to_string() << '\n'
81 << m_TIP_position << ' ' << m_TIP_width;
82
83 return ss.str();
84 }
Gaudi::Property< std::string > m_menu_name

◆ updateTIP()

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

Definition at line 34 of file TIPWriterAlgTool.cxx.

41 {
42
43 unsigned int N_pass_tobs{0};
44 ATH_CHECK( countPassingTOBs(ctx, N_pass_tobs) );
45 ATH_MSG_DEBUG("no of passing TOBS" << N_pass_tobs);
46
47 auto count_bits = std::bitset<s_nbits_TIP>(N_pass_tobs);
48 word |= (count_bits << m_TIP_position);
49
50 ATH_MSG_DEBUG("TIP word " << word);
51
52 return StatusCode::SUCCESS;
53 }
#define ATH_MSG_DEBUG(x)
virtual StatusCode countPassingTOBs(const EventContext &, unsigned int &N_pass_tobs) const override

Member Data Documentation

◆ m_c_selector

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

Definition at line 44 of file CommonMultAlgTool.h.

44{nullptr};

◆ m_CommonTOBContainerKey

SG::ReadHandleKey<IOBitwise::CommonTOBContainer> GlobalSim::CommonMultAlgTool::m_CommonTOBContainerKey
private
Initial value:
{
this,
"CommonTOBsKey",
"CommonTOBs",
"Key for GlobalSim CommonTOB container"}

Definition at line 46 of file CommonMultAlgTool.h.

46 {
47 this,
48 "CommonTOBsKey",
49 "CommonTOBs",
50 "Key for GlobalSim CommonTOB container"};

◆ m_enableDump

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

Definition at line 95 of file CommonMultAlgTool.h.

95 {
96 this,
97 "enable_dump",
98 false,
99 "flag to enable debug dumps"
100 };

◆ m_et_high_str

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

Definition at line 58 of file CommonMultAlgTool.h.

58 {
59 this,
60 "et_high",
61 "inf",
62 "et high for window selector"};

◆ m_et_low_str

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

Definition at line 52 of file CommonMultAlgTool.h.

52 {
53 this,
54 "et_low",
55 "0",
56 "et low for window selector"};

◆ m_eta_high_str

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

Definition at line 70 of file CommonMultAlgTool.h.

70 {
71 this,
72 "eta_high",
73 "inf",
74 "eta high for window selector"};

◆ m_eta_low_str

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

Definition at line 64 of file CommonMultAlgTool.h.

64 {
65 this,
66 "eta_low",
67 "0",
68 "eta low for window selector"};

◆ m_menu_name

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

Definition at line 88 of file CommonMultAlgTool.h.

88 {
89 this,
90 "menu_name",
91 "unknown",
92 "name from json menu file"
93 };

◆ m_phi_high_str

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

Definition at line 82 of file CommonMultAlgTool.h.

82 {
83 this,
84 "phi_high",
85 "inf",
86 "phi high for window selector"};

◆ m_phi_low_str

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

Definition at line 76 of file CommonMultAlgTool.h.

76 {
77 this,
78 "phi_low",
79 "0",
80 "phi low for window selector"};

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