ATLAS Offline Software
TLACondition.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 "./TLACondition.h"
7 
8 #include <sstream>
9 #include <stdexcept>
10 #include <TLorentzVector.h>
11 #include <limits>
12 
13 TLACondition::TLACondition(const std::vector<double>& etaMins,
14  const std::vector<double>& etaMaxs,
15  const std::vector<double>& ystarMins,
16  const std::vector<double>& ystarMaxs,
17  const std::vector<double>& massMins,
18  const std::vector<double>& massMaxs) {
19  m_etaMin = etaMins[0];
20  m_etaMax = etaMaxs[0];
21 
22  m_ystarMin = 0.;
24 
25  m_massMin = 0.;
27 
28  if (!ystarMins.empty()){
29  m_ystarMin = ystarMins[0];
30  }
31 
32 
33  if (!ystarMaxs.empty()){
34  m_ystarMax = ystarMaxs[0];
35  }
36 
37  if (!massMins.empty()){
38  m_massMin = massMins[0];
39  }
40 
41  if (!massMaxs.empty()){
42  m_massMax = massMaxs[0];
43  }
44 
45 }
46 
48  double etaMax,
49  double ystarMin,
50  double ystarMax,
51  double massMin,
52  double massMax):
53  m_etaMin(etaMin), m_etaMax(etaMax),
54  m_ystarMin(ystarMin), m_ystarMax(ystarMax),
55  m_massMin(massMin),m_massMax(massMax){
56 }
57 
59  const std::unique_ptr<ITrigJetHypoInfoCollector>&) const{
60  if(ips.size() != 2){
61  std::stringstream ss;
62  ss << "TLA::isSatisfied must see exactly 2 particles, but recieved "
63  << ips.size()
64  << '\n';
65 
66  throw std::runtime_error(ss.str());
67  }
68 
69  auto p4_0 = ips[0]->p4();
70  auto p4_1 = ips[1]->p4();
71  auto mass = (p4_0 + p4_1).M();
72  auto eta0 = ips[0]->eta();
73  auto eta1 = ips[1]->eta();
74  auto rap0 = ips[0]->rapidity();
75  auto rap1 = ips[1]->rapidity();
76  auto ystar = 0.5*std::abs(rap0 - rap1);
77 
78 
79  return
80  m_etaMin <= eta0 and
81  m_etaMin <= eta1 and
82  m_etaMax > eta0 and
83  m_etaMax > eta1 and
84  m_ystarMin <= ystar and
85  m_ystarMax > ystar and
86  m_massMin <= mass and
87  m_massMax > mass;
88 }
89 
90 std::string TLACondition::toString() const {
91  std::stringstream ss;
92  ss << "TLACondition: etaMin "
93  << m_etaMin
94  << " etaMax "
95  << m_etaMax
96  << " ystar min: "
97  << m_ystarMin
98  << " ystar max: "
99  << m_ystarMax
100  << " mass min: "
101  << m_massMin
102  << " mass max: "
103  << m_massMax
104  <<'\n';
105 
106  return ss.str();
107 }
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
TLACondition::m_massMin
double m_massMin
Definition: TLACondition.h:52
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
TLACondition.h
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TLACondition::toString
std::string toString() const override
Definition: TLACondition.cxx:90
TLACondition::m_massMax
double m_massMax
Definition: TLACondition.h:53
TLACondition::isSatisfied
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
Definition: TLACondition.cxx:58
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
TLACondition::m_ystarMin
double m_ystarMin
Definition: TLACondition.h:50
TLACondition::m_etaMin
double m_etaMin
Definition: TLACondition.h:48
ITrigJetHypoInfoCollector.h
TLACondition::m_etaMax
double m_etaMax
Definition: TLACondition.h:49
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
TLACondition::m_ystarMax
double m_ystarMax
Definition: TLACondition.h:51
TLACondition::TLACondition
TLACondition(const std::vector< double > &etaMins, const std::vector< double > &etaMaxs, const std::vector< double > &ystarMins, const std::vector< double > &ystarMaxs, const std::vector< double > &massMins, const std::vector< double > &massMaxs)
Definition: TLACondition.cxx:13