ATLAS Offline Software
Loading...
Searching...
No Matches
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
13TLACondition::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.;
23 m_ystarMax = std::numeric_limits<double>::max();
24
25 m_massMin = 0.;
26 m_massMax = std::numeric_limits<double>::max();
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
90std::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}
std::vector< pHypoJet > HypoJetVector
Definition HypoJetDefs.h:27
static Double_t ss
double m_etaMax
bool isSatisfied(const HypoJetVector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const override
double m_massMin
double m_ystarMax
double m_etaMin
std::string toString() const override
double m_ystarMin
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)
double m_massMax