ATLAS Offline Software
Loading...
Searching...
No Matches
CleanCondition.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "./CleanCondition.h"
8
9#include <sstream>
10#include <cmath>
11#include <TLorentzVector.h>
12
13CleanCondition::CleanCondition(const std::string& cName) : m_cName(cName)
14{
15
16}
17
19 const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
20
21 bool momentValue;
22
23 if (!(ip->getAttribute(m_cName, momentValue)))
24 {
25
26 if (collector)
27 {
28 auto j_addr = static_cast<const void *>(ip.get());
29
30 std::stringstream ss0;
31 ss0 << "CleanCondition: "
32 << " unable to retrieve " << m_cName << '\n';
33 std::stringstream ss1;
34 ss1 << " jet : (" << j_addr << ")";
35 collector->collect(ss0.str(), ss1.str());
36 }
37 return false;
38 }
39
40 bool pass = momentValue;
41
42 if (collector)
43 {
44 const void *address = static_cast<const void *>(this);
45
46 std::stringstream ss0;
47 ss0 << "CleanCondition: (" << address
48 << ")"
49 << " moment " << m_cName
50 << " pass: " << std::boolalpha << pass << '\n';
51
52 auto j_addr = static_cast<const void *>(ip.get());
53 std::stringstream ss1;
54 ss1 << " jet : (" << j_addr << ") "
55 "moment "
56 << m_cName << " value: " << momentValue << '\n';
57
58 collector->collect(ss0.str(), ss1.str());
59 }
60
61 return pass;
62}
63
64
65bool
67 const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const {
68 auto result = isSatisfied(ips[0], c);
69 return result;
70}
71
72
73std::string CleanCondition::toString() const {
74 std::stringstream ss;
75 ss << "CleanCondition (" << this << ") "
76 << " Cleaning dec: "
77 << m_cName
78 <<'\n';
79
80 return ss.str();
81}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition HypoJetDefs.h:25
static Double_t ss
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
CleanCondition(const std::string &cName)
std::string toString() const override
std::string m_cName