 |
ATLAS Offline Software
|
Go to the documentation of this file.
31 #include "TLorentzVector.h"
39 , m_expression1(
"true")
41 , m_mass1Hypothesis(0.0)
53 "No SG name provided for the output of the transverse mass tool!");
54 return StatusCode::FAILURE;
79 return StatusCode::SUCCESS;
85 const EventContext& ctx = Gaudi::Hive::currentContext();
89 auto masses = std::make_unique<std::vector<float>>();
95 return StatusCode::SUCCESS;
100 std::vector<float>&
masses)
const
103 const std::vector<float>* pt1 =
nullptr;
106 pt1 = readHandle.ptr();
108 const std::vector<float>* pt2 =
nullptr;
111 pt2 = readHandle.ptr();
114 const std::vector<float>* phi1 =
nullptr;
117 phi1 = readHandle.ptr();
119 const std::vector<float>* phi2 =
nullptr;
122 phi2 = readHandle.ptr();
134 if (particles2->
empty()) {
137 return StatusCode::SUCCESS;
141 return StatusCode::SUCCESS;
145 float MET = pt2 ? (*pt2)[0] : particles2->
at(0)->met();
146 float MET_phi = phi2 ? (*phi2)[0] : particles2->
at(0)->phi();
150 return StatusCode::SUCCESS;
153 std::vector<int> entries1 = m_parser->evaluateAsVector();
154 unsigned int nEntries1 = entries1.size();
159 return StatusCode::SUCCESS;
162 if (particles1->
size() != nEntries1) {
164 return StatusCode::FAILURE;
166 if ((pt1 && pt1->size() != nEntries1) ||
167 (phi1 && phi1->size() != nEntries1)) {
169 return StatusCode::FAILURE;
175 if (entries1[
iter] != 1)
177 float apt1 = pt1 ? (*pt1)[
iter] : ((*particles1)[
iter])->p4().Pt();
178 float aphi1 = phi1 ? (*phi1)[
iter] : ((*particles1)[
iter])->p4().Phi();
180 TLorentzVector v1,
v2;
182 v2.SetPtEtaPhiM(
MET, 0., MET_phi, 0.);
183 float mass = (v1 +
v2).M();
186 return StatusCode::SUCCESS;
const std::string & key() const
Return the StoreGate ID for the referenced object.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Container for xAOD::MissingET_v1 objects.
#define ATH_MSG_WARNING(x)
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.