CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
FTSFromSimHitFactory Class Reference

#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
 

Detailed Description

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.

Member Function Documentation

TrackCharge FTSFromSimHitFactory::charge ( int  particleId) const
private

Definition at line 17 of file FTSFromSimHitFactory.cc.

References abs.

Referenced by operator()().

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 }
#define abs(x)
Definition: mlp_lapack.h:159
int TrackCharge
Definition: TrackCharge.h:4
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().

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 }
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
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