ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
TrigJetEJsHypoTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// ********************************************************************
6
//
7
// NAME: TrigJetEJsHypoTool.cxx
8
// PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo
9
//
10
//
11
// ********************************************************************
12
13
#include "
TrigJetEJsHypoTool.h
"
14
#include "GaudiKernel/StatusCode.h"
15
16
#include "
TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJetFactory.h
"
17
#include "
TrigHLTJetHypo/TrigHLTJetHypoUtils/lineSplitter.h
"
18
#include "
./DebugInfoCollector.h
"
19
#include "
./xAODJetCollector.h
"
20
21
#include "
TrigCompositeUtils/HLTIdentifier.h
"
22
#include "
TrigCompositeUtils/TrigCompositeUtils.h
"
23
#include "
xAODTrigger/TrigCompositeContainer.h
"
24
25
using
TrigCompositeUtils::DecisionID
;
26
using
TrigCompositeUtils::Decision
;
27
using
TrigCompositeUtils::DecisionContainer
;
28
using
TrigCompositeUtils::DecisionIDContainer
;
29
using
TrigCompositeUtils::decisionIDs
;
30
31
using namespace
TrigCompositeUtils
;
32
33
TrigJetEJsHypoTool::TrigJetEJsHypoTool
(
const
std::string&
type
,
34
const
std::string& name,
35
const
IInterface* parent) :
36
AthAlgTool
(
type
, name, parent),
37
m_decisionId
(
HLT
::
Identifier
::fromToolName(name)){
38
39
}
40
41
42
TrigJetEJsHypoTool::~TrigJetEJsHypoTool
(){
43
}
44
45
StatusCode
TrigJetEJsHypoTool::initialize
(){
46
47
if
(
m_visitDebug
){
48
49
DebugInfoCollector
collector(name());
50
CHECK
(
m_helper
->getDescription(collector));
51
auto
s = collector.
toString
();
52
53
for
(
const
auto
& l :
lineSplitter
(s)){
54
ATH_MSG_INFO
(l);
55
}
56
}
57
58
return
StatusCode::SUCCESS;
59
}
60
61
StatusCode
TrigJetEJsHypoTool::finalize
(){
62
return
StatusCode::SUCCESS;
63
}
64
65
StatusCode
66
TrigJetEJsHypoTool::decide
( std::vector<JetInfo>& input )
const
{
67
68
for
(
auto
i: input ) {
69
70
if
( i.previousDecisionsIDs.count(
m_decisionId
.numeric() ) == 0 ) {
71
continue
;
72
}
73
74
ATH_MSG_DEBUG
(
"starting exotic/trackless jet chain"
);
75
76
bool
objDecision =
true
;
77
78
// start with cut on jet pT
79
auto
jetPt= (i.jet)->pt();
80
if
((
m_trackless
== 0 && jetPt <
m_jetPtCut_Exotics
) || \
81
(
m_trackless
== 1 && jetPt <
m_jetPtCut_Trackless
)) {
82
objDecision =
false
;
83
}
84
85
// cut on jet eta
86
auto
jetEta=std::abs( (i.jet)->p4().Eta() );
87
if
( (
m_trackless
== 0 && jetEta >
m_jetEtaCut_Exotics
) || \
88
(
m_trackless
== 1 && jetEta >
m_jetEtaCut_Trackless
) || \
89
(jetPt <= 0.0) ) {
90
objDecision =
false
;
91
}
92
93
float
promptTrackFrac = -2.0;
94
95
if
(objDecision ==
true
) {
96
97
// Exotics (emerging jets) chain decision
98
if
(
m_trackless
== 0) {
99
promptTrackFrac = 0.0;
100
for
(
auto
trackIter = i.AllTracks->begin(); trackIter != i.AllTracks->end(); ++trackIter){
101
float
trackPt = (*trackIter)->pt();
102
if
(std::abs((*trackIter)->z0() + (*trackIter)->vz() - i.PV->z()) >
m_PV_z
|| trackPt <
m_trackPtCut_Exotics
|| \
103
std::abs((*trackIter)->eta()) >
m_trackEtaCut_Exotics
|| (i.jet)->p4().DeltaR((*trackIter)->p4()) >
m_dr
)
104
continue
;
105
106
float
sigma = 1e6;
107
// Definition of promptTrackFrac background jet d0 RMS
108
if
(trackPt > 0.0) sigma = 1000.0 * 0.0463 / trackPt + 0.0195;
109
110
// if d0 greater than a multiple of sigma, is not a prompt track
111
if
(std::abs((*trackIter)->d0()) >
m_PTFSigmaCut
*sigma)
continue
;
112
promptTrackFrac += trackPt;
113
114
// Exit track loop if PTF is greater than cut, no need to continue loop
115
if
(promptTrackFrac/jetPt >
m_ptf
)
break
;
116
}
117
118
promptTrackFrac /= jetPt;
119
120
ATH_MSG_DEBUG
(
"exotics jets chain promptTrackFrac: "
<< promptTrackFrac);
121
if
(promptTrackFrac < -0.5 || promptTrackFrac >
m_ptf
) objDecision =
false
;
122
}
123
124
// Trackless chain decision
125
else
if
(
m_trackless
== 1) {
126
int
matchedtracks = 0;
127
// Loop over tracks, selection ones passing pT, eta, and dR cuts to jet
128
for
(
auto
trackIter = i.AllTracks->begin(); trackIter != i.AllTracks->end(); ++trackIter){
129
if
((*trackIter)->pt() <
m_trackPtCut_Trackless
|| std::abs((*trackIter)->eta()) >
m_trackEtaCut_Trackless
\
130
|| (i.jet)->p4().DeltaR((*trackIter)->p4()) >
m_dr
)
131
continue
;
132
matchedtracks++;
133
if
(matchedtracks >
m_matchedTracksCut_Trackless
) {
134
objDecision =
false
;
135
break
;
136
}
137
138
}
139
ATH_MSG_DEBUG
(
"Number of matched tracks ("
<< matchedtracks <<
") greater than cutoff - in trackless jet chain"
);
140
}
141
142
}
// end if objDecision == true
143
144
if
( objDecision ==
true
) {
145
ATH_MSG_DEBUG
(
"passed exotics/trackless jet chain decision with PTF: "
<< promptTrackFrac <<
"\ttrackless: "
<<
m_trackless
<<
"\tpt: "
<< jetPt <<
"\teta: "
<< jetEta);
146
addDecisionID
(
m_decisionId
.numeric(), i.decision );
147
}
148
149
}
// end loop over inputs
150
151
return
StatusCode::SUCCESS;
152
}
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DebugInfoCollector.h
TrigCompositeContainer.h
HLTIdentifier.h
TrigCompositeUtils.h
TrigJetEJsHypoTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
DebugInfoCollector
Definition
DebugInfoCollector.h:13
DebugInfoCollector::toString
virtual std::string toString() const override
Definition
DebugInfoCollector.cxx:70
TrigJetEJsHypoTool::m_dr
Gaudi::Property< double > m_dr
Definition
TrigJetEJsHypoTool.h:82
TrigJetEJsHypoTool::m_trackEtaCut_Exotics
double m_trackEtaCut_Exotics
Definition
TrigJetEJsHypoTool.h:86
TrigJetEJsHypoTool::m_jetEtaCut_Exotics
double m_jetEtaCut_Exotics
Definition
TrigJetEJsHypoTool.h:98
TrigJetEJsHypoTool::m_jetPtCut_Exotics
double m_jetPtCut_Exotics
Definition
TrigJetEJsHypoTool.h:93
TrigJetEJsHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition
TrigJetEJsHypoTool.h:70
TrigJetEJsHypoTool::finalize
StatusCode finalize()
Definition
TrigJetEJsHypoTool.cxx:61
TrigJetEJsHypoTool::~TrigJetEJsHypoTool
~TrigJetEJsHypoTool()
Definition
TrigJetEJsHypoTool.cxx:42
TrigJetEJsHypoTool::m_PV_z
double m_PV_z
Definition
TrigJetEJsHypoTool.h:107
TrigJetEJsHypoTool::m_jetEtaCut_Trackless
double m_jetEtaCut_Trackless
Definition
TrigJetEJsHypoTool.h:99
TrigJetEJsHypoTool::initialize
StatusCode initialize()
Definition
TrigJetEJsHypoTool.cxx:45
TrigJetEJsHypoTool::m_matchedTracksCut_Trackless
int m_matchedTracksCut_Trackless
Definition
TrigJetEJsHypoTool.h:105
TrigJetEJsHypoTool::m_ptf
Gaudi::Property< double > m_ptf
Definition
TrigJetEJsHypoTool.h:81
TrigJetEJsHypoTool::m_PTFSigmaCut
double m_PTFSigmaCut
Definition
TrigJetEJsHypoTool.h:102
TrigJetEJsHypoTool::m_trackless
Gaudi::Property< int > m_trackless
Definition
TrigJetEJsHypoTool.h:83
TrigJetEJsHypoTool::decide
StatusCode decide(std::vector< JetInfo > &decisions) const
Definition
TrigJetEJsHypoTool.cxx:66
TrigJetEJsHypoTool::TrigJetEJsHypoTool
TrigJetEJsHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TrigJetEJsHypoTool.cxx:33
TrigJetEJsHypoTool::m_jetPtCut_Trackless
double m_jetPtCut_Trackless
Definition
TrigJetEJsHypoTool.h:94
TrigJetEJsHypoTool::m_trackPtCut_Exotics
double m_trackPtCut_Exotics
Definition
TrigJetEJsHypoTool.h:89
TrigJetEJsHypoTool::m_helper
ToolHandle< ITrigJetHypoToolHelper > m_helper
Definition
TrigJetEJsHypoTool.h:72
TrigJetEJsHypoTool::m_trackPtCut_Trackless
double m_trackPtCut_Trackless
Definition
TrigJetEJsHypoTool.h:90
TrigJetEJsHypoTool::m_visitDebug
Gaudi::Property< bool > m_visitDebug
Definition
TrigJetEJsHypoTool.h:76
TrigJetEJsHypoTool::m_trackEtaCut_Trackless
double m_trackEtaCut_Trackless
Definition
TrigJetEJsHypoTool.h:87
lineSplitter
std::vector< std::string > lineSplitter(const std::string &s, char delimiter)
Definition
lineSplitter.cxx:8
lineSplitter.h
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::DecisionID
unsigned int DecisionID
Definition
TrigComposite_v1.h:27
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition
TrigComposite.h:20
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition
TrigComposite_v1.h:28
TrigCompositeUtils::DecisionContainer
xAOD::TrigCompositeContainer DecisionContainer
Definition
TrigCompositeContainer.h:21
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition
TrigCompositeUtilsRoot.cxx:59
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition
TrigCompositeUtilsRoot.cxx:65
type
xAODJetAsIJetFactory.h
xAODJetCollector.h
Generated on
for ATLAS Offline Software by
1.17.0