ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHLTJetHypo
src
CompoundCondition.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 "
./CompoundCondition.h
"
6
#include "
./ITrigJetHypoInfoCollector.h
"
7
#include "
TrigHLTJetHypo/TrigHLTJetHypoUtils/IJet.h
"
8
9
#include <sstream>
10
11
CompoundCondition::CompoundCondition
(std::vector<Condition>& elements){
12
13
for
(
auto
& el : elements){
14
if
(el !=
nullptr
) {
15
m_elements
.push_back(std::move(el));
16
}
17
}
18
unsigned
int
capacity
{0};
19
20
// mis-configuration of elemental Conditions with differing capacities
21
// not caught...
22
if
(!
m_elements
.empty()){
23
capacity
= (
m_elements
.front())->capacity();
24
}
25
m_capacity
=
capacity
;
26
}
27
28
29
bool
CompoundCondition::isSatisfied
(
const
HypoJetVector
& ips,
30
const
std::unique_ptr<ITrigJetHypoInfoCollector>& collector)
const
{
31
32
bool
pass{
true
};
33
for
(
const
auto
& el :
m_elements
){
34
pass = pass and (el->isSatisfied(ips, collector));
35
if
(!pass){
break
;}
36
}
37
38
39
if
(collector){
40
const
void
* address =
static_cast<
const
void
*
>
(
this
);
41
42
std::stringstream ss0;
43
ss0 <<
"CompoundCondition: ("
<< address <<
") "
44
<<
" pass: "
<< std::boolalpha << pass <<
'\n'
;
45
46
std::stringstream ss1;
47
for
(
const
auto
& ip : ips){
48
auto
j_addr =
static_cast<
const
void
*
>
(ip.get());
49
ss1 <<
" jet : ("
<< j_addr <<
")\n"
;
50
}
51
collector->collect(ss0.str(), ss1.str());
52
}
53
return
pass;
54
}
55
56
57
std::string
CompoundCondition::toString
()
const
{
58
std::stringstream
ss
;
59
ss
<<
"CompoundCondition ("
<<
this
<<
") Capacity: "
<<
m_capacity
<<
'\n'
;
60
for
(
const
auto
& el :
m_elements
){
61
ss
<< el->toString() +
'\n'
;
62
}
63
return
ss
.str();
64
}
CompoundCondition.h
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition
HypoJetDefs.h:27
IJet.h
ITrigJetHypoInfoCollector.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
CompoundCondition::isSatisfied
virtual bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition
CompoundCondition.cxx:29
CompoundCondition::m_elements
std::vector< Condition > m_elements
Definition
CompoundCondition.h:39
CompoundCondition::capacity
virtual unsigned int capacity() const override
Definition
CompoundCondition.h:33
CompoundCondition::toString
std::string toString() const override
Definition
CompoundCondition.cxx:57
CompoundCondition::CompoundCondition
CompoundCondition(std::vector< Condition > &elements)
Definition
CompoundCondition.cxx:11
CompoundCondition::m_capacity
unsigned int m_capacity
Definition
CompoundCondition.h:41
Generated on
for ATLAS Offline Software by
1.17.0