31#include "TLorentzVector.h"
40 "No SG name provided for the output of the transverse mass tool!");
41 return StatusCode::FAILURE;
66 return StatusCode::SUCCESS;
75 auto masses = std::make_unique<std::vector<float>>();
81 return StatusCode::SUCCESS;
86 std::vector<float>& masses)
const
89 const std::vector<float>* pt1 =
nullptr;
92 pt1 = readHandle.
ptr();
94 const std::vector<float>* pt2 =
nullptr;
97 pt2 = readHandle.
ptr();
100 const std::vector<float>* phi1 =
nullptr;
103 phi1 = readHandle.
ptr();
105 const std::vector<float>* phi2 =
nullptr;
108 phi2 = readHandle.
ptr();
120 if (particles2->
empty()) {
123 return StatusCode::SUCCESS;
127 return StatusCode::SUCCESS;
131 float MET = pt2 ? (*pt2)[0] : particles2->
at(0)->met();
132 float MET_phi = phi2 ? (*phi2)[0] : particles2->
at(0)->phi();
136 return StatusCode::SUCCESS;
139 std::vector<int> entries1 = m_parser->evaluateAsVector();
140 unsigned int nEntries1 = entries1.size();
145 return StatusCode::SUCCESS;
148 if (particles1->
size() != nEntries1) {
150 return StatusCode::FAILURE;
152 if ((pt1 && pt1->size() != nEntries1) ||
153 (phi1 && phi1->size() != nEntries1)) {
155 return StatusCode::FAILURE;
160 for (iter = 0; iter < nEntries1; ++iter) {
161 if (entries1[iter] != 1)
163 float apt1 = pt1 ? (*pt1)[iter] : ((*particles1)[iter])->p4().Pt();
164 float aphi1 = phi1 ? (*phi1)[iter] : ((*particles1)[iter])->p4().Phi();
166 TLorentzVector v1, v2;
168 v2.SetPtEtaPhiM(
MET, 0., MET_phi, 0.);
169 float mass = (v1 + v2).M();
170 masses.push_back(mass);
172 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#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.
const_pointer_type ptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
::StatusCode StatusCode
StatusCode definition for legacy code.
MissingETContainer_v1 MissingETContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.