CMS 3D CMS Logo

Public Member Functions | Private Attributes

StateOnTrackerBound Class Reference

#include <StateOnTrackerBound.h>

List of all members.

Public Member Functions

TrajectoryStateOnSurface operator() (const TrajectoryStateOnSurface &tsos) const
TrajectoryStateOnSurface operator() (const FreeTrajectoryState &fts) const
 StateOnTrackerBound (const Propagator *prop)
 ~StateOnTrackerBound ()

Private Attributes

PropagatorthePropagator

Detailed Description

Propagates to the Tracker bounds, i.e. either to the barrel cylinder or to one of the forward disks that constitute the envelope of the sensitive Tracker volumes. Ported from ORCA

Date:
2007/01/31 17:31:32
Revision:
1.4

Definition at line 15 of file StateOnTrackerBound.h.


Constructor & Destructor Documentation

StateOnTrackerBound::StateOnTrackerBound ( const Propagator prop)

Definition at line 13 of file StateOnTrackerBound.cc.

                                                                :
  thePropagator( prop->clone())
{}
StateOnTrackerBound::~StateOnTrackerBound ( )

Definition at line 17 of file StateOnTrackerBound.cc.

References thePropagator.

{
  delete thePropagator;
}

Member Function Documentation

TrajectoryStateOnSurface StateOnTrackerBound::operator() ( const TrajectoryStateOnSurface tsos) const

Definition at line 23 of file StateOnTrackerBound.cc.

References TrajectoryStateOnSurface::freeState().

{
  return operator()(*tsos.freeState());
}
TrajectoryStateOnSurface StateOnTrackerBound::operator() ( const FreeTrajectoryState fts) const

Definition at line 29 of file StateOnTrackerBound.cc.

References TrackerBounds::barrelBound(), TrajectoryStateOnSurface::globalPosition(), TrackerBounds::halfLength(), TrajectoryStateOnSurface::isValid(), FreeTrajectoryState::momentum(), TrackerBounds::negativeEndcapDisk(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), TrackerBounds::positiveEndcapDisk(), Propagator::propagate(), CosmicsPD_Skims::radius, thePropagator, and PV3DBase< T, PVType, FrameType >::z().

{
  // try to guess if propagation should be first to cylinder or first to disk
  float tanTheta = (fts.position().perp() > 70 ) ? fts.position().perp()/fts.position().z() : fts.momentum().perp()/fts.momentum().z();
  float corner = TrackerBounds::radius() / TrackerBounds::halfLength();

  TrajectoryStateOnSurface firstTry;
  if (tanTheta < 0 && fabs(tanTheta) < corner) {
     firstTry = 
     thePropagator->propagate( fts, TrackerBounds::negativeEndcapDisk());

     if (!firstTry.isValid()) {
       return thePropagator->propagate( fts, TrackerBounds::barrelBound());
      }
     if (firstTry.globalPosition().perp() > TrackerBounds::radius()) {
        // the propagation should have gone to the cylinder
        return thePropagator->propagate( fts, TrackerBounds::barrelBound());
      }
      else return firstTry;
  }
  else if (tanTheta > 0 && fabs(tanTheta) < corner) {
      firstTry = 
      thePropagator->propagate( fts, TrackerBounds::positiveEndcapDisk());
      if (!firstTry.isValid()) {
        return thePropagator->propagate( fts, TrackerBounds::barrelBound());
      }
      if (firstTry.globalPosition().perp() > TrackerBounds::radius()) {
        return thePropagator->propagate( fts, TrackerBounds::barrelBound());
      }
      else return firstTry;
  }
  else {
    // barrel
    firstTry = 
    thePropagator->propagate( fts, TrackerBounds::barrelBound());
    if (!firstTry.isValid()) {
       if (tanTheta < 0 ) return thePropagator->propagate( fts,TrackerBounds::negativeEndcapDisk());
       if (tanTheta >= 0 ) return thePropagator->propagate( fts,TrackerBounds::positiveEndcapDisk());
       return firstTry;
     }
     if (firstTry.globalPosition().z() < -TrackerBounds::halfLength()) {
        // the propagation should have gone to the negative disk
        return thePropagator->propagate( fts,
                                         TrackerBounds::negativeEndcapDisk());
     }
     else if (firstTry.globalPosition().z() > TrackerBounds::halfLength()) {
        // the propagation should have gone to the positive disk
        return thePropagator->propagate( fts,
                                         TrackerBounds::positiveEndcapDisk());
     }
     else return firstTry;
  }    
  return firstTry;
}

Member Data Documentation

Definition at line 30 of file StateOnTrackerBound.h.

Referenced by operator()(), and ~StateOnTrackerBound().