ATLAS Offline Software
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 
13 CleanCondition::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 
65 bool
67  const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const {
68  auto result = isSatisfied(ips[0], c);
69  return result;
70 }
71 
72 
73 std::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 }
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
IJet.h
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
CleanCondition.h
pHypoJet
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition: HypoJetDefs.h:25
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
CleanCondition::toString
std::string toString() const override
Definition: CleanCondition.cxx:73
CleanCondition::m_cName
std::string m_cName
Definition: CleanCondition.h:38
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
ITrigJetHypoInfoCollector.h
CleanCondition::CleanCondition
CleanCondition(const std::string &cName)
Definition: CleanCondition.cxx:13
CleanCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: CleanCondition.cxx:66
python.compressB64.c
def c
Definition: compressB64.py:93