CMS 3D CMS Logo

FTSFromSimHitFactory Class Reference

Produces a FreeTrajectoryState from a SimHit. More...

#include <RecoTracker/DebugTools/interface/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 funct::abs().

Referenced by operator()().

00018 {
00019   if (std::abs( particleId) < 20) {
00020     // lepton 
00021     return TrackCharge( (particleId > 0) ? -1 : 1);
00022   }
00023   else {
00024     // only correct for stable mesoms and baryons
00025     return TrackCharge( (particleId > 0) ? 1 : -1);
00026   }
00027 }

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

00010 {
00011   GlobalVector momenta = det.toGlobal( hit.momentumAtEntry());
00012   TrackCharge ch = charge( hit.particleType());
00013   GlobalTrajectoryParameters param( det.toGlobal( hit.localPosition()), momenta, ch, &field);
00014   return FreeTrajectoryState( param);
00015 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:21:03 2009 for CMSSW by  doxygen 1.5.4