|
ATLAS Offline Software
|
Go to the documentation of this file.
31 #include "TLorentzVector.h"
39 , m_expression1(
"true")
41 , m_mass1Hypothesis(0.0)
43 declareInterface<DerivationFramework::IAugmentationTool>(
this);
54 "No SG name provided for the output of the transverse mass tool!");
55 return StatusCode::FAILURE;
80 return StatusCode::SUCCESS;
86 const EventContext& ctx = Gaudi::Hive::currentContext();
90 auto masses = std::make_unique<std::vector<float>>();
96 return StatusCode::SUCCESS;
101 std::vector<float>&
masses)
const
104 const std::vector<float>* pt1 =
nullptr;
107 pt1 = readHandle.ptr();
109 const std::vector<float>* pt2 =
nullptr;
112 pt2 = readHandle.ptr();
115 const std::vector<float>* phi1 =
nullptr;
118 phi1 = readHandle.ptr();
120 const std::vector<float>* phi2 =
nullptr;
123 phi2 = readHandle.ptr();
135 if (particles2->
empty()) {
138 return StatusCode::SUCCESS;
142 return StatusCode::SUCCESS;
146 float MET = pt2 ? (*pt2)[0] : particles2->
at(0)->met();
147 float MET_phi = phi2 ? (*phi2)[0] : particles2->
at(0)->phi();
151 return StatusCode::SUCCESS;
154 std::vector<int> entries1 =
m_parser->evaluateAsVector();
155 unsigned int nEntries1 = entries1.size();
160 return StatusCode::SUCCESS;
163 if (particles1->
size() != nEntries1) {
165 return StatusCode::FAILURE;
167 if ((pt1 && pt1->size() != nEntries1) ||
168 (phi1 && phi1->size() != nEntries1)) {
170 return StatusCode::FAILURE;
175 for (iter = 0; iter < nEntries1; ++iter) {
176 if (entries1[iter] != 1)
178 float apt1 = pt1 ? (*pt1)[iter] : ((*particles1)[iter])->p4().Pt();
179 float aphi1 = phi1 ? (*phi1)[iter] : ((*particles1)[iter])->p4().Phi();
181 TLorentzVector v1,
v2;
183 v2.SetPtEtaPhiM(
MET, 0., MET_phi, 0.);
184 float mass = (v1 +
v2).M();
187 return StatusCode::SUCCESS;
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
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.
StatusCode initializeParser(const ExpressionParsing::SelectionArg< 1 > &selection_string)
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.