ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
NNJVTCondition.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
./NNJVTCondition.h
"
6
#include "
./ITrigJetHypoInfoCollector.h
"
7
#include <sstream>
8
#include <stdexcept>
9
#include <memory>
10
11
NNJVTCondition::NNJVTCondition
(
const
std::string& nnjvt_name) :
12
m_nnjvt_name
(nnjvt_name)
13
{
14
m_nnjvt_acc
= std::make_unique<SG::ConstAccessor<float> >(
m_nnjvt_name
);
15
m_nnjvtpass_acc
= std::make_unique<SG::ConstAccessor<char> >(
m_nnjvt_name
+
"Pass"
);
16
}
17
18
bool
NNJVTCondition::isSatisfied
(
const
HypoJetVector
& ips,
const
std::unique_ptr<ITrigJetHypoInfoCollector>& collector)
const
{
19
20
if
(ips.size() != 1){
21
std::stringstream
ss
;
22
ss
<<
"NNJVTCondition::isSatisfied must see exactly 1 particle, but received "
23
<< ips.size()
24
<<
'\n'
;
25
throw
std::runtime_error(
ss
.str());
26
}
27
28
auto
jet
= ips[0];
29
auto
xJet = *
jet
->xAODJet();
30
31
// Rely on the pass decorations to assess the NNJVT decision
32
bool
pass = (*m_nnjvtpass_acc)(*xJet);
33
float
nnjvt = (*m_nnjvt_acc)(*xJet);
34
35
if
(collector){
36
std::stringstream ss0;
37
const
void
* address =
static_cast<
const
void
*
>
(
this
);
38
ss0 <<
"NNJVTCondition: ("
<< address
39
<<
") nnjvt "
<< nnjvt
40
<<
" pt "
<<
jet
->pt()
41
<<
" eta "
<<
jet
->eta()
42
<<
" pass: "
<<std::boolalpha << pass <<
" jet group: \n"
;
43
44
std::stringstream ss1;
45
46
for
(
const
auto
& ip : ips){
47
address =
static_cast<
const
void
*
>
(ip.get());
48
ss1 <<
" "
<< address <<
" "
<< ip->eta() <<
" pt "
<< ip->pt() <<
'\n'
;
49
}
50
ss1 <<
'\n'
;
51
collector -> collect(ss0.str(), ss1.str());
52
}
53
return
pass;
54
55
}
56
57
std::string
NNJVTCondition::toString
()
const
{
58
59
std::stringstream
ss
;
60
const
void
* address =
static_cast<
const
void
*
>
(
this
);
61
ss
<<
"NNJVTCondition: ("
<< address <<
") Capacity: "
<<
s_capacity
62
<<
" decoration name: "
<<
m_nnjvt_name
<<
'\n'
;
63
64
return
ss
.str();
65
}
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition
HypoJetDefs.h:27
ITrigJetHypoInfoCollector.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
NNJVTCondition.h
NNJVTCondition::m_nnjvt_name
std::string m_nnjvt_name
Definition
NNJVTCondition.h:36
NNJVTCondition::toString
std::string toString() const override
Definition
NNJVTCondition.cxx:57
NNJVTCondition::m_nnjvt_acc
std::unique_ptr< SG::ConstAccessor< float > > m_nnjvt_acc
Definition
NNJVTCondition.h:38
NNJVTCondition::NNJVTCondition
NNJVTCondition(const std::string &nnjvt_name)
Definition
NNJVTCondition.cxx:11
NNJVTCondition::m_nnjvtpass_acc
std::unique_ptr< SG::ConstAccessor< char > > m_nnjvtpass_acc
Definition
NNJVTCondition.h:39
NNJVTCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition
NNJVTCondition.cxx:18
NNJVTCondition::s_capacity
static const unsigned int s_capacity
Definition
NNJVTCondition.h:41
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
Generated on
for ATLAS Offline Software by
1.17.0