ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
QjetMassCondition.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 "
./QjetMassCondition.h
"
6
#include "
./ITrigJetHypoInfoCollector.h
"
7
#include <sstream>
8
#include <stdexcept>
9
#include <TLorentzVector.h>
10
#include <limits>
11
#include <memory>
12
13
QjetMassCondition::QjetMassCondition
(
double
massMin,
14
double
massMax):
m_min
(massMin),
15
m_max
(massMax){
16
}
17
18
19
bool
20
QjetMassCondition::isSatisfied
(
const
HypoJetVector
& ips,
21
const
std::unique_ptr<ITrigJetHypoInfoCollector>& collector)
const
{
22
23
if
(ips.size() != 4){
24
std::stringstream
ss
;
25
ss
<<
"QjetMassCondition::isSatisfied must see exactly 4 particles, but received "
26
<< ips.size()
27
<<
'\n'
;
28
29
throw
std::runtime_error(
ss
.str());
30
}
31
32
auto
j0 = ips[0];
33
auto
j1 = ips[1];
34
auto
j2 = ips[2];
35
auto
j3 = ips[3];
36
37
auto
rj0 = j0 -> p4();
38
auto
rj1 = j1 -> p4();
39
auto
rj2 = j2 -> p4();
40
auto
rj3 = j3 -> p4();
41
42
auto
mass = (rj0 + rj1 + rj2 + rj3).M();
43
44
bool
pass = mass >=
m_min
and mass <
m_max
;
45
46
if
(collector){
47
std::stringstream ss0;
48
const
void
* address =
static_cast<
const
void
*
>
(
this
);
49
ss0 <<
"QjetMassCondition: ("
<< address <<
") "
50
<< mass <<
" "
<< std::boolalpha << pass <<
" jet group: \n"
;
51
52
std::stringstream ss1;
53
54
for
(
const
auto
& ip : ips){
55
address =
static_cast<
const
void
*
>
(ip.get());
56
ss1 <<
" "
<< address <<
" eta "
<< ip->eta()
57
<<
" e "
<< ip->e() <<
" et: "
<< ip->et() <<
'\n'
;
58
}
59
ss1 <<
'\n'
;
60
collector -> collect(ss0.str(), ss1.str());
61
}
62
return
pass;
63
64
}
65
66
std::string
QjetMassCondition::toString
()
const
{
67
68
69
std::stringstream
ss
;
70
const
void
* address =
static_cast<
const
void
*
>
(
this
);
71
ss
<<
"QjetMassCondition: ("
<< address <<
") Capacity: "
<<
s_capacity
72
73
<<
" mass min: "
<<
m_min
74
<<
" mass max: "
<<
m_max
<<
'\n'
;
75
76
return
ss
.str();
77
}
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition
HypoJetDefs.h:27
ITrigJetHypoInfoCollector.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
QjetMassCondition.h
QjetMassCondition::s_capacity
static const unsigned int s_capacity
Definition
QjetMassCondition.h:47
QjetMassCondition::m_min
double m_min
Definition
QjetMassCondition.h:44
QjetMassCondition::toString
std::string toString() const override
Definition
QjetMassCondition.cxx:66
QjetMassCondition::QjetMassCondition
QjetMassCondition(double massMin, double massMax)
Definition
QjetMassCondition.cxx:13
QjetMassCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition
QjetMassCondition.cxx:20
QjetMassCondition::m_max
double m_max
Definition
QjetMassCondition.h:45
Generated on
for ATLAS Offline Software by
1.17.0