ATLAS Offline Software
Loading...
Searching...
No Matches
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#
8
9#include <sstream>
10
11CompoundCondition::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 }
26}
27
28
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
57std::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}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
static Double_t ss
virtual bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
std::vector< Condition > m_elements
virtual unsigned int capacity() const override
std::string toString() const override
CompoundCondition(std::vector< Condition > &elements)
unsigned int m_capacity