CMS 3D CMS Logo

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

TrajectoryFactoryBase Class Reference

#include <TrajectoryFactoryBase.h>

Inheritance diagram for TrajectoryFactoryBase:
BzeroReferenceTrajectoryFactory CombinedTrajectoryFactory DualBzeroTrajectoryFactory DualKalmanFactory DualTrajectoryFactory ReferenceTrajectoryFactory TwoBodyDecayTrajectoryFactory

List of all members.

Public Types

typedef
AlignmentAlgorithmBase::ConstTrajTrackPair 
ConstTrajTrackPair
typedef
AlignmentAlgorithmBase::ConstTrajTrackPairCollection 
ConstTrajTrackPairCollection
typedef std::vector
< TrajectoryStateOnSurface
ExternalPredictionCollection
typedef
ReferenceTrajectoryBase::MaterialEffects 
MaterialEffects
typedef std::vector
< ReferenceTrajectoryPtr
ReferenceTrajectoryCollection
typedef
ReferenceTrajectoryBase::ReferenceTrajectoryPtr 
ReferenceTrajectoryPtr
typedef std::pair
< TrajectoryStateOnSurface,
TransientTrackingRecHit::ConstRecHitContainer
TrajectoryInput

Public Member Functions

virtual TrajectoryFactoryBaseclone (void) const =0
MaterialEffects materialEffects (void) const
PropagationDirection propagationDirection (void) const
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const =0
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const =0
 TrajectoryFactoryBase (const edm::ParameterSet &config)
virtual ~TrajectoryFactoryBase (void)

Protected Member Functions

virtual const TrajectoryInput innermostStateAndRecHits (const ConstTrajTrackPair &track) const
virtual const
Trajectory::DataContainer 
orderedTrajectoryMeasurements (const Trajectory &trajectory) const
bool sameSurface (const Surface &s1, const Surface &s2) const
bool useRecHit (const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const

Protected Attributes

bool theUseBeamSpot

Private Member Functions

MaterialEffects materialEffects (const std::string &strME) const
PropagationDirection propagationDirection (const std::string &strPD) const

Private Attributes

MaterialEffects theMaterialEffects
PropagationDirection thePropDir
bool theUseInvalidHits
bool theUseProjectedHits
bool theUseWithoutDet

Detailed Description

Definition at line 17 of file TrajectoryFactoryBase.h.


Member Typedef Documentation

Definition at line 24 of file TrajectoryFactoryBase.h.

Definition at line 25 of file TrajectoryFactoryBase.h.

Definition at line 28 of file TrajectoryFactoryBase.h.

Definition at line 23 of file TrajectoryFactoryBase.h.

Definition at line 26 of file TrajectoryFactoryBase.h.

Definition at line 22 of file TrajectoryFactoryBase.h.

Definition at line 27 of file TrajectoryFactoryBase.h.


Constructor & Destructor Documentation

TrajectoryFactoryBase::TrajectoryFactoryBase ( const edm::ParameterSet config)

Definition at line 10 of file TrajectoryFactoryBase.cc.

References edm::ParameterSet::getParameter(), materialEffects(), propagationDirection(), theMaterialEffects, thePropDir, theUseBeamSpot, theUseInvalidHits, theUseProjectedHits, and theUseWithoutDet.

{
  const std::string strMaterialEffects = config.getParameter< std::string >( "MaterialEffects" );
  theMaterialEffects = this->materialEffects( strMaterialEffects );
  
  const std::string strPropagationDirection = config.getParameter< std::string >( "PropagationDirection" );
  thePropDir = this->propagationDirection( strPropagationDirection );

  theUseWithoutDet = config.getParameter< bool >( "UseHitWithoutDet" );
  theUseInvalidHits = config.getParameter< bool >( "UseInvalidHits" );
  theUseProjectedHits = config.getParameter< bool >( "UseProjectedHits" );
  theUseBeamSpot = config.getParameter< bool >( "UseBeamSpot" );
}
TrajectoryFactoryBase::~TrajectoryFactoryBase ( void  ) [virtual]

Definition at line 25 of file TrajectoryFactoryBase.cc.

{}

Member Function Documentation

virtual TrajectoryFactoryBase* TrajectoryFactoryBase::clone ( void  ) const [pure virtual]
const TrajectoryFactoryBase::TrajectoryInput TrajectoryFactoryBase::innermostStateAndRecHits ( const ConstTrajTrackPair track) const [protected, virtual]

Definition at line 29 of file TrajectoryFactoryBase.cc.

References orderedTrajectoryMeasurements(), query::result, and useRecHit().

Referenced by TwoBodyDecayTrajectoryFactory::constructTrajectories(), BzeroReferenceTrajectoryFactory::trajectories(), and ReferenceTrajectoryFactory::trajectories().

{
  TrajectoryInput result;

  // get the trajectory measurements in the correct order, i.e. reverse if needed
  Trajectory::DataContainer trajectoryMeasurements 
    = this->orderedTrajectoryMeasurements( *track.first );
  Trajectory::DataContainer::iterator itM = trajectoryMeasurements.begin();

  // get the innermost valid trajectory state - the corresponding hit must be o.k. as well
  while ( itM != trajectoryMeasurements.end() )
  {
    if ( ( *itM ).updatedState().isValid() && useRecHit( ( *itM ).recHit() ) ) break;
    ++itM;
  }
  if ( itM != trajectoryMeasurements.end() ) result.first = ( *itM ).updatedState();

  // get the valid RecHits
  while ( itM != trajectoryMeasurements.end() )
  {
    TransientTrackingRecHit::ConstRecHitPointer aRecHit = ( *itM ).recHit();
    if ( useRecHit( aRecHit ) ) result.second.push_back( aRecHit );
    ++itM;
  }

  return result;
}
MaterialEffects TrajectoryFactoryBase::materialEffects ( void  ) const [inline]
TrajectoryFactoryBase::MaterialEffects TrajectoryFactoryBase::materialEffects ( const std::string &  strME) const [private]

Definition at line 112 of file TrajectoryFactoryBase.cc.

References ReferenceTrajectoryBase::breakPoints, ReferenceTrajectoryBase::brokenLinesCoarse, ReferenceTrajectoryBase::brokenLinesFine, runregparse::combined, ReferenceTrajectoryBase::energyLoss, Exception, ReferenceTrajectoryBase::multipleScattering, and btau_dummy::none.

{
  if ( strME == "MultipleScattering" ) return ReferenceTrajectoryBase::multipleScattering;
  if ( strME == "EnergyLoss" ) return ReferenceTrajectoryBase::energyLoss;
  if ( strME == "Combined" ) return ReferenceTrajectoryBase::combined;
  if ( strME == "None" ) return ReferenceTrajectoryBase::none;
  if ( strME == "BreakPoints" ) return ReferenceTrajectoryBase::breakPoints;
  if ( strME == "BrokenLines" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
  if ( strME == "BrokenLinesCoarse" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
  if ( strME == "BrokenLinesFine" ) return ReferenceTrajectoryBase::brokenLinesFine;
          
  throw cms::Exception("BadConfig")
    << "[TrajectoryFactoryBase::materialEffects] Unknown parameter: " << strME;
}
const Trajectory::DataContainer TrajectoryFactoryBase::orderedTrajectoryMeasurements ( const Trajectory trajectory) const [protected, virtual]

Definition at line 59 of file TrajectoryFactoryBase.cc.

References anyDirection, dir, Trajectory::direction(), Trajectory::measurements(), and thePropDir.

Referenced by innermostStateAndRecHits(), DualBzeroTrajectoryFactory::referenceStateAndRecHits(), DualTrajectoryFactory::referenceStateAndRecHits(), and DualKalmanFactory::referenceStateAndRecHits().

{
  const PropagationDirection dir = trajectory.direction();
  const bool hitsAreReverse = ( ( dir == thePropDir || thePropDir == anyDirection ) ? false : true );

  const Trajectory::DataContainer & original = trajectory.measurements();

  if ( hitsAreReverse )
  {
    // Simply use this line instead of the copying by hand?
    // const Trajectory::DataContainer reordered(original.rbegin(), original.rend());
    Trajectory::DataContainer reordered;
    reordered.reserve( original.size() );

    Trajectory::DataContainer::const_reverse_iterator itM;
    for ( itM = original.rbegin(); itM != original.rend(); ++itM )
    {
      reordered.push_back( *itM );
    }
    return reordered;
  }

  return original;
}
PropagationDirection TrajectoryFactoryBase::propagationDirection ( void  ) const [inline]
PropagationDirection TrajectoryFactoryBase::propagationDirection ( const std::string &  strPD) const [private]

Definition at line 129 of file TrajectoryFactoryBase.cc.

References alongMomentum, anyDirection, Exception, and oppositeToMomentum.

{
  if ( strPD == "oppositeToMomentum" ) return oppositeToMomentum;
  if ( strPD == "alongMomentum" ) return alongMomentum;
  if ( strPD == "anyDirection" ) return anyDirection;

  throw cms::Exception("BadConfig")
    << "[TrajectoryFactoryBase::propagationDirection] Unknown parameter: " << strPD;
}
bool TrajectoryFactoryBase::sameSurface ( const Surface s1,
const Surface s2 
) const [protected]

Definition at line 85 of file TrajectoryFactoryBase.cc.

References GloballyPositioned< T >::eta(), GloballyPositioned< T >::phi(), and GloballyPositioned< T >::position().

Referenced by BzeroReferenceTrajectoryFactory::trajectories(), and ReferenceTrajectoryFactory::trajectories().

{
  // - Should use perp2() instead of perp()
  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
  return ( s1.eta() == s2.eta() ) && ( s1.phi() == s2.phi() ) && ( s1.position().perp() == s2.position().perp() );
}
virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const [pure virtual]
virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const [pure virtual]
bool TrajectoryFactoryBase::useRecHit ( const TransientTrackingRecHit::ConstRecHitPointer hitPtr) const [protected]

Definition at line 94 of file TrajectoryFactoryBase.cc.

References theUseInvalidHits, theUseProjectedHits, and theUseWithoutDet.

Referenced by innermostStateAndRecHits(), DualBzeroTrajectoryFactory::referenceStateAndRecHits(), DualTrajectoryFactory::referenceStateAndRecHits(), and DualKalmanFactory::referenceStateAndRecHits().

{
  const GeomDet* det = hitPtr->det();
  if ( !det && !theUseWithoutDet ) return false;
  
  if ( !( theUseInvalidHits || hitPtr->isValid() ) ) return false;

  if ( !theUseProjectedHits )
  {
    const ProjectedRecHit2D* projectedHit = dynamic_cast< const ProjectedRecHit2D* >( hitPtr.get() );
    if ( projectedHit != 0 ) return false;
  }

  return true;
}

Member Data Documentation

Definition at line 59 of file TrajectoryFactoryBase.h.

Referenced by materialEffects(), and TrajectoryFactoryBase().

Definition at line 63 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

Definition at line 64 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

Definition at line 62 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().