ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
TimingCondition.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
./TimingCondition.h
"
6
#include "
./ITrigJetHypoInfoCollector.h
"
7
#include <sstream>
8
#include <stdexcept>
9
#include <TLorentzVector.h>
10
#include <limits>
11
#include <memory>
12
13
TimingCondition::TimingCondition
(
double
t_min,
14
double
t_max):
15
m_min
(t_min),
m_max
(t_max) {
16
}
17
18
19
bool
TimingCondition::isSatisfied
(
const
HypoJetVector
& ips,
const
std::unique_ptr<ITrigJetHypoInfoCollector>& collector)
const
{
20
21
if
(ips.size() != 1){
22
std::stringstream
ss
;
23
ss
<<
"TimingCondition::isSatisfied must see exactly 1 particle, but received "
24
<< ips.size()
25
<<
'\n'
;
26
throw
std::runtime_error(
ss
.str());
27
}
28
29
auto
jet
= ips[0];
30
31
float
timing {0.};
32
if
(!(
jet
->getAttribute(
"Timing"
,timing))){
33
throw
std::runtime_error(
"ERROR: TimingCondition cannot retrieve jet moment 'Timing'"
);
34
}
35
bool
pass = timing >=
m_min
and timing <
m_max
;
36
37
if
(collector){
38
std::stringstream ss0;
39
const
void
* address =
static_cast<
const
void
*
>
(
this
);
40
ss0 <<
"TimingCondition: ("
<< address
41
<<
") timing["
<<
m_min
<<
", "
<<
m_max
<<
"]"
42
<<
" pass: "
<<std::boolalpha << pass <<
'\n'
;
43
44
45
auto
j_addr =
static_cast<
const
void
*
>
(
jet
.get());
46
std::stringstream ss1;
47
48
ss1 <<
" jet : "
<< j_addr <<
") timing "
<< timing <<
'\n'
;
49
collector -> collect(ss0.str(), ss1.str());
50
}
51
return
pass;
52
53
}
54
55
std::string
TimingCondition::toString
()
const
{
56
57
std::stringstream
ss
;
58
59
const
void
* address =
static_cast<
const
void
*
>
(
this
);
60
ss
<<
"TimingCondition: ("
<< address <<
") Capacity: "
<<
s_capacity
61
<<
" timingMin "
<<
m_min
62
<<
" timingMax "
<<
m_max
63
<<
'\n'
;
64
65
return
ss
.str();
66
}
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition
HypoJetDefs.h:27
ITrigJetHypoInfoCollector.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
TimingCondition.h
TimingCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition
TimingCondition.cxx:19
TimingCondition::s_capacity
static const unsigned int s_capacity
Definition
TimingCondition.h:38
TimingCondition::m_min
double m_min
Definition
TimingCondition.h:36
TimingCondition::TimingCondition
TimingCondition(double t_min, double t_max)
Definition
TimingCondition.cxx:13
TimingCondition::toString
std::string toString() const override
Definition
TimingCondition.cxx:55
TimingCondition::m_max
double m_max
Definition
TimingCondition.h:37
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
Generated on
for ATLAS Offline Software by
1.17.0