ATLAS Offline Software
MomentCondition.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 "./MomentCondition.h"
8 
9 #include <sstream>
10 #include <cmath>
11 #include <TLorentzVector.h>
12 
14  double mMax,
15  const std::string& moment) :
16 m_min(mMin), m_max(mMax), m_moment(moment) {
17 }
18 
19 
21  const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const {
22 
23  float momentValue;
24 
25  if (!(ip -> getAttribute(m_moment, momentValue))){
26 
27  if(collector){
28  auto j_addr = static_cast<const void*>(ip.get());
29 
30  std::stringstream ss0;
31  ss0 << "MomentCondition: "
32  << " unable to retrieve " << m_moment << '\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 = m_min <= momentValue and m_max > momentValue;
41 
42  if(collector){
43  const void* address = static_cast<const void*>(this);
44 
45  std::stringstream ss0;
46  ss0 << "MomentCondition: ("<< address
47  << ") min cut value " << m_min
48  << " max cut value " << m_max
49  << " moment " << m_moment
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 " << m_moment << " value: " << momentValue<< '\n';
56 
57  collector->collect(ss0.str(), ss1.str());
58 
59  }
60  return pass;
61 }
62 
63 bool
65  const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const {
66  auto result = isSatisfied(ips[0], c);
67  return result;
68 }
69 
70 
71 std::string MomentCondition::toString() const {
72  std::stringstream ss;
73  ss << "MomentCondition (" << this << ") "
74  << " moment: " << m_moment
75  << " min " << m_min
76  << " max " << m_max
77  <<'\n';
78 
79  return ss.str();
80 }
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
IJet.h
MomentCondition::MomentCondition
MomentCondition(double mMin, double mMax, const std::string &moment)
Definition: MomentCondition.cxx:13
ITrigJetHypoInfoCollector::collect
virtual void collect(const std::string &, const std::string &)=0
MomentCondition::m_min
double m_min
Definition: MomentCondition.h:38
pHypoJet
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition: HypoJetDefs.h:25
MomentCondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: MomentCondition.cxx:64
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
MomentCondition.h
RTTAlgmain.address
address
Definition: RTTAlgmain.py:55
ITrigJetHypoInfoCollector.h
MomentCondition::m_max
double m_max
Definition: MomentCondition.h:39
MomentCondition::toString
std::string toString() const override
Definition: MomentCondition.cxx:71
python.compressB64.c
def c
Definition: compressB64.py:93
MomentCondition::m_moment
std::string m_moment
Definition: MomentCondition.h:40