CMS 3D CMS Logo

Public Member Functions | Private Member Functions

FTSFromSimHitFactory Class Reference

#include <FTSFromSimHitFactory.h>

List of all members.

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()().

{
  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