17#include "CLHEP/Vector/LorentzVector.h"
18#include "TLorentzVector.h"
33 const std::string& name,
34 const IInterface* parent)
48 declareProperty (
"WriteE",
m_do_E =
false);
49 declareProperty (
"WriteP",
m_do_p =
false);
50 declareProperty (
"WriteEt",
m_do_Et =
false);
51 declareProperty (
"WritePt",
m_do_pt =
true);
52 declareProperty (
"WriteM",
m_do_m =
true);
54 declareProperty (
"WriteTanTh",
m_do_tanth =
false);
55 declareProperty (
"WriteEtaPhi",
m_do_etaphi =
true);
56 declareProperty (
"WriteRect",
m_do_rect =
false);
84 return StatusCode::SUCCESS;
88#define FILL_BODY(P, PT, TANTH) \
90 if (m_do_E) *m_E = static_cast<float> (p.e()); \
91 if (m_do_p) *m_p = static_cast<float> (P); \
92 if (m_do_Et) *m_Et = static_cast<float> (p.et()); \
93 if (m_do_pt) *m_pt = static_cast<float> (PT); \
94 if (m_do_m) *m_m = static_cast<float> (p.m()); \
95 if (m_do_rapidity) *m_y = static_cast<float> (p.rapidity()); \
96 if (m_do_tanth) *m_tanth = static_cast<float> (TANTH); \
99 *m_eta = static_cast<float> (p.eta()); \
100 *m_phi = static_cast<float> (p.phi()); \
104 *m_px = static_cast<float> (p.px()); \
105 *m_py = static_cast<float> (p.py()); \
106 *m_pz = static_cast<float> (p.pz()); \
119 return StatusCode::SUCCESS;
139 FILL_BODY(p.mag(), p.perp(), std::tan(p.theta()));
141 return StatusCode::SUCCESS;
151 return fill (p.p4());
163 if (
m_do_E) *
m_E =
static_cast<float> (p.E());
164 if (
m_do_p) *
m_p =
static_cast<float> (p.P());
167 if (
m_do_m) *
m_m =
static_cast<float> (p.M());
179 *
m_eta =
static_cast<float> (p.Eta());
180 *
m_phi =
static_cast<float> (p.Phi());
184 *
m_px =
static_cast<float> (p.Px());
185 *
m_py =
static_cast<float> (p.Py());
186 *
m_pz =
static_cast<float> (p.Pz());
189 return StatusCode::SUCCESS;
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
I4Momentum is an abstract base class providing 4-momentum behavior.
Class providing the definition of the 4-vector interface.
Block filler tool for noisy FEB information.