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:52
int TrackCharge
Definition: TrackCharge.h:4
Local3DPoint localPosition() const
Definition: PSimHit.h:44
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackCharge charge(int particleId) const
int particleType() const
Definition: PSimHit.h:85
FreeTrajectoryState operator()(const PSimHit &hit, const GeomDet &det, const MagneticField &field) const