ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigMinBias
src
TrackCountHypoTool.cxx
Go to the documentation of this file.
1
2
/*
3
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4
*/
5
6
#include "
TrigCompositeUtils/HLTIdentifier.h
"
7
#include "
AthenaMonitoringKernel/Monitored.h
"
8
9
#include "
TrackCountHypoTool.h
"
10
11
using namespace
TrigCompositeUtils
;
12
13
TrackCountHypoTool::TrackCountHypoTool
(
const
std::string &
type
,
const
std::string &name,
const
IInterface *parent)
14
:
AthCheckedComponent
<
AthAlgTool
>(
type
, name, parent),
15
m_decisionId
(
HLT
::
Identifier
::fromToolName(name)) {}
16
17
18
StatusCode
TrackCountHypoTool::decide
(
TrkCountsInfo
&trkinfo)
const
19
{
20
if
(trkinfo.
previousDecisionIDs
.count(
m_decisionId
.numeric()) == 0)
21
{
22
ATH_MSG_DEBUG
(
"Already rejected"
);
23
return
StatusCode::SUCCESS;
24
}
25
if
(
m_acceptAll
) {
26
addDecisionID
(
m_decisionId
.numeric(), trkinfo.
decision
);
27
ATH_MSG_DEBUG
(
"REGTEST event accepted because of acceptAll"
);
28
}
29
30
std::vector<int> counts;
31
trkinfo.
counts
->
getDetail
<std::vector<int>>(
"counts"
, counts);
32
if
(
m_exclusive
) {
33
if
( counts[0] >
m_exclusivityThreshold
) {
34
ATH_MSG_DEBUG
(
"Lowest pt tracks count "
<< counts[0] <<
" exceeds exclusivity cut, "
<<
m_exclusivityThreshold
<<
" rejecting"
);
35
return
StatusCode::SUCCESS;
36
}
37
}
38
std::vector<float> pTcuts;
39
std::vector<float> z0cuts;
40
std::vector<float> vertexZcuts;
41
trkinfo.
counts
->
getDetail
<std::vector<float>>(
"pTcuts"
, pTcuts);
42
trkinfo.
counts
->
getDetail
<std::vector<float>>(
"z0cuts"
, z0cuts);
43
trkinfo.
counts
->
getDetail
<std::vector<float>>(
"vertexZcuts"
, vertexZcuts);
44
45
46
float
countForConfiguredPtThreshold{};
47
bool
found{
false
};
48
// find the right counter
49
for
(
size_t
i = 0; i < counts.size(); ++i)
50
{
51
if
(std::abs(pTcuts[i] -
m_minPt
) < 0.001
52
&& std::abs(z0cuts[i] -
m_maxZ0
) < 0.001
53
&& std::abs(vertexZcuts[i] -
m_maxVertexZ
) < 0.001)
54
{
55
found =
true
;
56
countForConfiguredPtThreshold = counts[i];
57
}
58
}
59
60
if
(!found)
61
{
62
ATH_MSG_ERROR
(
"Unable to find tracks count for requested: "
63
<<
" min pT "
<<
m_minPt
64
<<
" nax z0 "
<<
m_maxZ0
65
<<
" vertex Z "
<<
m_maxVertexZ
66
<<
" need to fix hypo tool configuration or add new threshold in tracks counting"
);
67
for
(
size_t
i = 0; i < counts.size(); ++i)
68
{
69
ATH_MSG_ERROR
(
"Count of tracks of pTcuts "
<< pTcuts[i] <<
" z0Cuts "
<< z0cuts[i] <<
" vertexZcuts "
<< vertexZcuts[i] <<
" that are available"
);
70
}
71
return
StatusCode::FAILURE;
72
}
73
else
74
{
75
ATH_MSG_DEBUG
(
"REGTEST found "
<< countForConfiguredPtThreshold <<
" tracks for "
<<
m_minPt
);
76
}
77
78
79
80
const
bool
minTrkPassed = (
m_minNtrks
== -1) or (countForConfiguredPtThreshold >=
m_minNtrks
);
81
const
bool
maxTrkPassed = (
m_maxNtrks
== -1) or (countForConfiguredPtThreshold <
m_maxNtrks
);
82
83
if
( minTrkPassed and maxTrkPassed ) {
84
addDecisionID
(
m_decisionId
.numeric(), trkinfo.
decision
);
85
ATH_MSG_DEBUG
(
"REGTEST event accepted"
);
86
}
87
return
StatusCode::SUCCESS;
88
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
TrackCountHypoTool.h
HLTIdentifier.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCheckedComponent
Mixin class to perform additional checks on a component.
Definition
AthCheckedComponent.h:25
TrackCountHypoTool::TrackCountHypoTool
TrackCountHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TrackCountHypoTool.cxx:13
TrackCountHypoTool::m_minNtrks
Gaudi::Property< float > m_minNtrks
Definition
TrackCountHypoTool.h:35
TrackCountHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition
TrackCountHypoTool.h:39
TrackCountHypoTool::m_maxVertexZ
Gaudi::Property< float > m_maxVertexZ
Definition
TrackCountHypoTool.h:34
TrackCountHypoTool::m_maxNtrks
Gaudi::Property< float > m_maxNtrks
Definition
TrackCountHypoTool.h:36
TrackCountHypoTool::m_maxZ0
Gaudi::Property< float > m_maxZ0
Definition
TrackCountHypoTool.h:33
TrackCountHypoTool::m_exclusivityThreshold
const int m_exclusivityThreshold
Definition
TrackCountHypoTool.h:37
TrackCountHypoTool::m_exclusive
Gaudi::Property< bool > m_exclusive
Definition
TrackCountHypoTool.h:38
TrackCountHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition
TrackCountHypoTool.h:31
TrackCountHypoTool::m_minPt
Gaudi::Property< float > m_minPt
Definition
TrackCountHypoTool.h:32
TrackCountHypoTool::decide
StatusCode decide(TrkCountsInfo &decisions) const
Definition
TrackCountHypoTool.cxx:18
xAOD::TrigComposite_v1::getDetail
bool getDetail(const std::string &name, TYPE &value) const
Get an TYPE detail from the object.
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
Definition
TrigComposite.h:19
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition
TrigCompositeUtilsRoot.cxx:59
type
TrackCountHypoTool::TrkCountsInfo
Definition
TrackCountHypoTool.h:21
TrackCountHypoTool::TrkCountsInfo::previousDecisionIDs
const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs
Definition
TrackCountHypoTool.h:24
TrackCountHypoTool::TrkCountsInfo::counts
const xAOD::TrigComposite * counts
Definition
TrackCountHypoTool.h:23
TrackCountHypoTool::TrkCountsInfo::decision
TrigCompositeUtils::Decision * decision
Definition
TrackCountHypoTool.h:22
Generated on
for ATLAS Offline Software by
1.17.0