ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigMinBias
src
TrigZVertexHypoTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
TrigCompositeUtils/TrigCompositeUtils.h
"
5
#include "
TrigZVertexHypoTool.h
"
6
7
using
TrigCompositeUtils::addDecisionID
;
8
9
TrigZVertexHypoTool::TrigZVertexHypoTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
10
::
AthAlgTool
(
type
, name, parent),
11
m_decisionId
(
HLT
::
Identifier
::fromToolName(name)) {}
12
13
14
StatusCode
TrigZVertexHypoTool::initialize
() {
15
return
StatusCode::SUCCESS;
16
}
17
18
StatusCode
TrigZVertexHypoTool::decide
(
TrigZVertexHypoTool::ZVertexInfo
& info)
const
{
19
20
if
(info.previousDecisionIDs.count(
m_decisionId
.numeric()) == 0) {
21
ATH_MSG_DEBUG
(
"Already rejected"
);
22
return
StatusCode::SUCCESS;
23
}
24
25
int
count
= 0;
26
for
(
auto
vertex : *(info.vertices)) {
27
const
float
weight = vertex->getDetail<
float
>(
"zfinder_vtx_weight"
);
28
if
(
m_minWeight
<= weight and weight <=
m_maxWeight
) {
29
count
++;
30
}
31
ATH_MSG_DEBUG
(
"Found vertex of weight "
<< weight <<
" count is now "
<<
count
);
32
}
33
if
(
m_minNumVertices
<=
count
and
count
<=
m_maxNumVertices
) {
34
addDecisionID
(
m_decisionId
.numeric(), info.decision);
35
ATH_MSG_DEBUG
(
"Event accepted"
);
36
}
37
else
{
38
ATH_MSG_DEBUG
(
"Event rejected"
);
39
}
40
41
return
StatusCode::SUCCESS;
42
}
43
44
StatusCode
TrigZVertexHypoTool::finalize
() {
45
return
StatusCode::SUCCESS;
46
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TrigCompositeUtils.h
addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition
TrigCompositeUtilsRoot.cxx:59
TrigZVertexHypoTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
TrigZVertexHypoTool::initialize
virtual StatusCode initialize() override
Definition
TrigZVertexHypoTool.cxx:14
TrigZVertexHypoTool::TrigZVertexHypoTool
TrigZVertexHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TrigZVertexHypoTool.cxx:9
TrigZVertexHypoTool::finalize
virtual StatusCode finalize() override
Definition
TrigZVertexHypoTool.cxx:44
TrigZVertexHypoTool::m_maxNumVertices
Gaudi::Property< int > m_maxNumVertices
Definition
TrigZVertexHypoTool.h:37
TrigZVertexHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition
TrigZVertexHypoTool.h:35
TrigZVertexHypoTool::m_minWeight
Gaudi::Property< int > m_minWeight
Definition
TrigZVertexHypoTool.h:38
TrigZVertexHypoTool::m_maxWeight
Gaudi::Property< int > m_maxWeight
Definition
TrigZVertexHypoTool.h:39
TrigZVertexHypoTool::m_minNumVertices
Gaudi::Property< int > m_minNumVertices
Definition
TrigZVertexHypoTool.h:36
TrigZVertexHypoTool::decide
StatusCode decide(ZVertexInfo &decisions) const
Definition
TrigZVertexHypoTool.cxx:18
count
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Definition
hcg.cxx:148
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition
HLTResultReader.h:26
Identifier
Definition
IdentifierFieldParser.cxx:14
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition
TrigCompositeUtilsRoot.cxx:59
type
TrigZVertexHypoTool::ZVertexInfo
Definition
TrigZVertexHypoTool.h:24
Generated on
for ATLAS Offline Software by
1.17.0