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#include <cmath>
11#include <TLorentzVector.h>
12
13CompoundCondition::CompoundCondition(std::vector<Condition>& elements){
14
15 for(auto& el : elements){
16 if(el != nullptr) {
17 m_elements.push_back(std::move(el));
18 }
19 }
20 unsigned int capacity{0};
21
22 // mis-configuration of elemental Conditions with differing capacities
23 // not caught...
24 if(!m_elements.empty()){
25 capacity = (m_elements.front())->capacity();
26 }
28}
29
30
32 const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
33
34 bool pass{true};
35 for(const auto& el : m_elements){
36 pass = pass and (el->isSatisfied(ips, collector));
37 if(!pass){break;}
38 }
39
40
41 if(collector){
42 const void* address = static_cast<const void*>(this);
43
44 std::stringstream ss0;
45 ss0 << "CompoundCondition: (" << address << ") "
46 << " pass: " << std::boolalpha << pass << '\n';
47
48 std::stringstream ss1;
49 for(const auto& ip : ips){
50 auto j_addr = static_cast<const void*>(ip.get());
51 ss1 << " jet : ("<< j_addr << ")\n";
52 }
53 collector->collect(ss0.str(), ss1.str());
54 }
55 return pass;
56}
57
58
59std::string CompoundCondition::toString() const {
60 std::stringstream ss;
61 ss << "CompoundCondition (" << this << ") Capacity: " << m_capacity << '\n';
62 for(const auto& el :m_elements){
63 ss << el->toString() + '\n';
64 }
65 return ss.str();
66}
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