#include <FTSFromSimHitFactory.h>
Public Member Functions | |
FreeTrajectoryState | operator() (const PSimHit &hit, const GeomDetUnit &det, const MagneticField &field) const |
Private Member Functions | |
TrackCharge | charge (int particleId) const |
Produces a FreeTrajectoryState from a SimHit. the FreeTrajectoryState position coinsides with the SimHit position, and direction, momenta and charge are deduced from the SimHit itself, without any access to the SimTrack that produced the SimHit.
Definition at line 17 of file FTSFromSimHitFactory.h.
TrackCharge FTSFromSimHitFactory::charge | ( | int | particleId | ) | const [private] |
Definition at line 17 of file FTSFromSimHitFactory.cc.
References abs.
Referenced by operator()().
{ if (std::abs( particleId) < 20) { // lepton return TrackCharge( (particleId > 0) ? -1 : 1); } else { // only correct for stable mesoms and baryons return TrackCharge( (particleId > 0) ? 1 : -1); } }
FreeTrajectoryState FTSFromSimHitFactory::operator() | ( | const PSimHit & | hit, |
const GeomDetUnit & | det, | ||
const MagneticField & | field | ||
) | const |
Definition at line 7 of file FTSFromSimHitFactory.cc.
References charge(), PSimHit::localPosition(), PSimHit::momentumAtEntry(), PSimHit::particleType(), and GeomDet::toGlobal().
{ GlobalVector momenta = det.toGlobal( hit.momentumAtEntry()); TrackCharge ch = charge( hit.particleType()); GlobalTrajectoryParameters param( det.toGlobal( hit.localPosition()), momenta, ch, &field); return FreeTrajectoryState( param); }