CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FTSFromSimHitFactory.cc
Go to the documentation of this file.
5 #include <algorithm>
6 
8  const GeomDetUnit& det,
9  const MagneticField& field) const
10 {
11  GlobalVector momenta = det.toGlobal( hit.momentumAtEntry());
12  TrackCharge ch = charge( hit.particleType());
13  GlobalTrajectoryParameters param( det.toGlobal( hit.localPosition()), momenta, ch, &field);
14  return FreeTrajectoryState( param);
15 }
16 
18 {
19  if (std::abs( particleId) < 20) {
20  // lepton
21  return TrackCharge( (particleId > 0) ? -1 : 1);
22  }
23  else {
24  // only correct for stable mesoms and baryons
25  return TrackCharge( (particleId > 0) ? 1 : -1);
26  }
27 }
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
FreeTrajectoryState operator()(const PSimHit &hit, const GeomDetUnit &det, const MagneticField &field) const
#define abs(x)
Definition: mlp_lapack.h:159
int TrackCharge
Definition: TrackCharge.h:4
Local3DPoint localPosition() const
Definition: PSimHit.h:44
TrackCharge charge(int particleId) const
int particleType() const
Definition: PSimHit.h:85