1#ifndef __JAANET__JLORENTZBOOST__
2#define __JAANET__JLORENTZBOOST__
22#include "Math/Vector4D.h"
23#include "Math/GenVector/Boost.h"
24#include "Math/GenVector/LorentzVector.h"
39 using ROOT::Math::Boost;
40 using ROOT::Math::LorentzVector;
73 const double beta2 = this->BetaVector().Mag2();
75 return 1.0 / sqrt(1.0 - beta2);
85 template<
class CoordSystem>
86 LorentzVector<CoordSystem>
operator()(
const LorentzVector<CoordSystem>& x4)
const
88 return static_cast<const Boost&
>(*this)(x4);
100 using namespace ROOT::Math;
102 const XYZTVector x0(vertex.
getX(), vertex.
getY(), vertex.
getZ(), vertex.
getT() * getSpeedOfLight());
103 const XYZTVector x1 = (*this)(x0);
108 vertex.
setT(x1.T() / getSpeedOfLight());
119 const double mass)
const
122 using namespace ROOT::Math;
126 const XYZTVector x0(track.
getX(), track.
getY(), track.
getZ(), track.
getT() * getSpeedOfLight());
127 const XYZTVector x1 = (*this)(x0);
129 const PxPyPzEVector p0(Ekin * track.
getDX(), Ekin * track.
getDY(), Ekin * track.
getDZ(), track.
getE());
130 const PxPyPzEVector
p1 = (*this)(p0);
132 const JVector3D pos1(x1.X(), x1.Y(), x1.Z());
152 using namespace ROOT::Math;
161 const PxPyPzEVector p0(Ekin.
x, Ekin.
y, Ekin.
z, track.
E);
162 const PxPyPzEVector
p1 = (*this)(p0);
173 track.
t + track.
len / getSpeedOfLight());
178 track.
t = x0.
getT() / getSpeedOfLight();
197 const double dt = hit.
t - hit.
tdc;
203 hit.
t = vertex.
getT();
220 for (T i = __begin; i != __end; ++i) {
235 (*this)(
event.mc_trks.begin(), event.
mc_trks.end());
236 (*this)(
event.mc_hits.begin(), event.
mc_hits.end());
237 (*this)(
event.trks.begin(), event.
trks.end());
238 (*this)(
event.hits.begin(), event.
hits.end());
258 return Boost(beta.
x, beta.
y, beta.
z);
261 THROW(
JValueOutOfRange,
"getBoostToCOM(): Given event does not correspond to a neutrino interaction.");
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
void setDirection(const JDirection3D &dir)
Set direction.
Data structure for position in three dimensions.
void setPosition(const JVector3D &pos)
Set position.
void setT(const double time)
Set time.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
void setE(const double E)
Set energy.
double getE() const
Get energy.
Data structure for vector in three dimensions.
double getY() const
Get y position.
double getDistance(const JVector3D &pos) const
Get distance to point.
double getZ() const
Get z position.
double getX() const
Get x position.
Data structure for normalised vector in three dimensions.
double getDY() const
Get y direction.
double getDX() const
Get x direction.
double getDZ() const
Get z direction.
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
Exception for accessing a value in a collection that is outside of its range.
Extensions to Evt data format.
void boostToCOM(Evt &event)
Boost event to the Center of Mass (COM) frame.
double getKineticEnergy(const Trk &trk)
Get track kinetic energy.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
bool is_finalstate(const Trk &track)
Test whether given track corresponds to a final state particle.
double getE0(const Evt &evt)
Get initial state energy of a neutrino interaction.
bool is_initialstate(const Trk &track)
Test whether given track corresponds to an initial state particle.
JPosition3D getPosition(const Vec &pos)
Get position.
JLorentzBoost getBoostToCOM(const Evt &event)
Get Lorentz boost to the Center of Mass (COM) frame for a given neutrino interaction.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
std::vector< Hit > hits
list of hits
std::vector< Hit > mc_hits
MC: list of MC truth hits.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
unsigned int tdc
hit tdc (=time in ns)
double t
hit time (from tdc+calibration or MC truth)
Auxiliary class for performing Lorentz boosts.
void operator()(JTrack3E &track, const double mass) const
Lorentz boost operator.
void operator()(JVertex3D &vertex) const
Lorentz boost operator.
void operator()(Hit &hit) const
Lorentz boost operator.
void operator()(Trk &track) const
Lorentz boost operator.
double getGamma() const
Retrieve gamma factor.
void operator()(T __begin, T __end) const
Lorentz boost operator.
JLorentzBoost()
Default constructor.
LorentzVector< CoordSystem > operator()(const LorentzVector< CoordSystem > &x4) const
Lorentz boost operator.
void operator()(Evt &event) const
Lorentz boost operator.
JLorentzBoost(const Boost &boost)
Copy constructor.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
double E
Energy [GeV] (either MC truth or reconstructed)
double t
track time [ns] (when the particle is at pos )
double len
length, if applicable [m]
Vec pos
postion [m] of the track at time t
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Vec & normalize()
Normalise this vector.
double len() const
Get length.
static const int TRK_ST_ININUCLEI
Initial state nuclei (gseagen)