CMS 3D CMS Logo

Public Member Functions | Static Private Member Functions | Private Attributes

SmartPropagator Class Reference

#include <SmartPropagator.h>

Inheritance diagram for SmartPropagator:
Propagator

List of all members.

Public Member Functions

virtual SmartPropagatorclone () const
 Virtual constructor (using copy c'tor)
PropagatorgetGenPropagator () const
 return the propagator used outside tracker
PropagatorgetTkPropagator () const
 return the propagator used inside tracker
bool insideTkVol (const Plane &plane) const
 true if a plane is inside tracker volume
bool insideTkVol (const FreeTrajectoryState &fts) const
 true if a fts is inside tracker volume
bool insideTkVol (const BoundCylinder &cylin) const
 true if a cylinder is inside tracker volume
bool insideTkVol (const Surface &surface) const
 true if a surface is inside tracker volume
virtual const MagneticFieldmagneticField () const
 return the magneticField
TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &tsos, const Surface &surface) const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Plane &plane) const
TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &tsos, const Plane &plane) const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Cylinder &cylinder) const
TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &tsos, const Cylinder &cylinder) const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Surface &surface) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &fts, const Plane &plane) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &tsos, const Plane &plane) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &fts, const Cylinder &cylinder) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &tsos, const Cylinder &cylinder) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &fts, const Surface &surface) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &tsos, const Surface &surface) const
void setPropagationDirection (PropagationDirection dir) const
 setting the direction fo both components
 SmartPropagator (const SmartPropagator &)
 Copy constructor.
 SmartPropagator (const Propagator &aTkProp, const Propagator &aGenProp, const MagneticField *field, PropagationDirection dir=alongMomentum, float epsilon=5)
 Defines which propagator is used inside Tk and which outside.
 SmartPropagator (Propagator *aTkProp, Propagator *aGenProp, const MagneticField *field, PropagationDirection dir=alongMomentum, float epsilon=5)
 Defines which propagator is used inside Tk and which outside.
virtual ~SmartPropagator ()

Static Private Member Functions

static void initTkVolume (float epsilon)
 build the tracker volume
static
ReferenceCountingPointer
< BoundCylinder > & 
theTkVolume ()

Private Attributes

const MagneticFieldtheField
PropagatortheGenProp
PropagatortheTkProp

Detailed Description

A propagator which use different algorithm to propagate inside or outside tracker

Author:
Stefano Lacaprara - INFN Padova author Chang Liu - Purdue University $Date $ $Revision $

Modification: 26-Jun-2002 SL: theTkVolume is now a static ReferenceCountingPointer<BoundCylinder> 28-Aug-2002 SL: added methods to unhide Propagator methods 29-Oct-2002 SL: fixed clone and copy constructor, and BoundCylinder are build with CylinderBuilder to enforce the referencePointer

Definition at line 37 of file SmartPropagator.h.


Constructor & Destructor Documentation

SmartPropagator::SmartPropagator ( Propagator aTkProp,
Propagator aGenProp,
const MagneticField field,
PropagationDirection  dir = alongMomentum,
float  epsilon = 5 
)

Defines which propagator is used inside Tk and which outside.

Definition at line 44 of file SmartPropagator.cc.

References initTkVolume(), and theTkVolume().

Referenced by clone().

                                                                          :
  Propagator(dir), theTkProp(aTkProp->clone()), theGenProp(aGenProp->clone()), theField(field) { 

  if (theTkVolume()==0) initTkVolume(epsilon);

}
SmartPropagator::SmartPropagator ( const Propagator aTkProp,
const Propagator aGenProp,
const MagneticField field,
PropagationDirection  dir = alongMomentum,
float  epsilon = 5 
)

Defines which propagator is used inside Tk and which outside.

Definition at line 53 of file SmartPropagator.cc.

References initTkVolume(), and theTkVolume().

                                                                          :
  Propagator(dir), theTkProp(aTkProp.clone()), theGenProp(aGenProp.clone()), theField(field) {

  if (theTkVolume()==0) initTkVolume(epsilon);

}
SmartPropagator::SmartPropagator ( const SmartPropagator aProp)

Copy constructor.

Definition at line 62 of file SmartPropagator.cc.

References Propagator::clone(), getGenPropagator(), getTkPropagator(), theGenProp, and theTkProp.

                                                             :
  Propagator(aProp.propagationDirection()), theTkProp(0), theGenProp(0) { 
    if (aProp.theTkProp)
      theTkProp=aProp.getTkPropagator()->clone();
    if (aProp.theGenProp)
      theTkProp=aProp.getGenPropagator()->clone();

    //SL since it's a copy constructor, then the TkVolume has been already
    //initialized
    //if (theTkVolume==0) initTkVolume(epsilon);

  }
SmartPropagator::~SmartPropagator ( ) [virtual]

virtual destructor

Definition at line 76 of file SmartPropagator.cc.

References theGenProp, and theTkProp.

                                  {

  delete theTkProp;
  delete theGenProp;

}

Member Function Documentation

virtual SmartPropagator* SmartPropagator::clone ( void  ) const [inline, virtual]

Virtual constructor (using copy c'tor)

Implements Propagator.

Definition at line 57 of file SmartPropagator.h.

References getGenPropagator(), getTkPropagator(), magneticField(), and SmartPropagator().

Propagator * SmartPropagator::getGenPropagator ( ) const

return the propagator used outside tracker

Definition at line 205 of file SmartPropagator.cc.

References theGenProp.

Referenced by clone(), propagate(), propagateWithPath(), setPropagationDirection(), and SmartPropagator().

                                                    {

  return theGenProp;

}
Propagator * SmartPropagator::getTkPropagator ( ) const

return the propagator used inside tracker

Definition at line 198 of file SmartPropagator.cc.

References theTkProp.

Referenced by clone(), propagate(), propagateWithPath(), setPropagationDirection(), and SmartPropagator().

                                                   {

  return theTkProp;

}
void SmartPropagator::initTkVolume ( float  epsilon) [static, private]

build the tracker volume

Definition at line 85 of file SmartPropagator.cc.

References newFWLiteAna::build, epsilon, TrackerBounds::halfLength(), pos, CosmicsPD_Skims::radius, and theTkVolume().

Referenced by SmartPropagator().

                                                {

  //
  // fill tracker dimensions
  //
  float radius = TrackerBounds::radius();
  float r_out  = radius + epsilon/2;
  float r_in   = r_out - epsilon;
  float z_max  = TrackerBounds::halfLength();
  float z_min  = - z_max;

  Surface::PositionType pos(0,0,0); // centered at the global origin
  Surface::RotationType rot; // unit matrix - barrel cylinder orientation

  theTkVolume() = BoundCylinder::build(pos, rot, radius, SimpleCylinderBounds(r_in, r_out, z_min, z_max));

}
bool SmartPropagator::insideTkVol ( const Surface surface) const

true if a surface is inside tracker volume

Definition at line 164 of file SmartPropagator.cc.

References TrackerBounds::halfLength(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), CosmicsPD_Skims::radius, and PV3DBase< T, PVType, FrameType >::z().

                                                              {

  GlobalPoint gp = surface.position();
 // LocalPoint lp = theTkVolume()->toLocal(gp);

 // return theTkVolume()->bounds().inside(lp);
  return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );


}
bool SmartPropagator::insideTkVol ( const BoundCylinder cylin) const

true if a cylinder is inside tracker volume

Definition at line 176 of file SmartPropagator.cc.

References BoundSurface::bounds(), TrackerBounds::halfLength(), Bounds::length(), PV3DBase< T, PVType, FrameType >::perp(), CosmicsPD_Skims::radius, Cylinder::radius(), and PV3DBase< T, PVType, FrameType >::z().

                                                                    {

  GlobalPoint gp(cylin.radius(),0.,(cylin.bounds().length())/2.);
//  LocalPoint lp = theTkVolume()->toLocal(gp);
//  return theTkVolume()->bounds().inside(lp);
  return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );


}
bool SmartPropagator::insideTkVol ( const Plane plane) const

true if a plane is inside tracker volume

Definition at line 187 of file SmartPropagator.cc.

References TrackerBounds::halfLength(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), CosmicsPD_Skims::radius, and PV3DBase< T, PVType, FrameType >::z().

                                                            {

  GlobalPoint gp = plane.position();
//  LocalPoint lp = theTkVolume()->toLocal(gp);
//  return theTkVolume()->bounds().inside(lp);
  return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );


}
bool SmartPropagator::insideTkVol ( const FreeTrajectoryState fts) const

true if a fts is inside tracker volume

Definition at line 154 of file SmartPropagator.cc.

References TrackerBounds::halfLength(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), CosmicsPD_Skims::radius, and PV3DBase< T, PVType, FrameType >::z().

Referenced by propagate(), and propagateWithPath().

                                                                      {

  GlobalPoint gp = fts.position();
//  LocalPoint lp = theTkVolume()->toLocal(gp);
//  return theTkVolume()->bounds().inside(lp);

  return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
}
virtual const MagneticField* SmartPropagator::magneticField ( ) const [inline, virtual]

return the magneticField

Implements Propagator.

Definition at line 141 of file SmartPropagator.h.

References theField.

Referenced by clone().

{return theField;}
TrajectoryStateOnSurface SmartPropagator::propagate ( const FreeTrajectoryState fts,
const Cylinder cylinder 
) const [virtual]

Implements Propagator.

Definition at line 122 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagate().

                                                                                    {
  if (insideTkVol(fts) && insideTkVol(cylinder)) {
    return getTkPropagator()->propagate(fts, cylinder);
  } else {
    return getGenPropagator()->propagate(fts, cylinder);
  }

}
TrajectoryStateOnSurface SmartPropagator::propagate ( const TrajectoryStateOnSurface state,
const Surface sur 
) const [inline, virtual]

The following three methods are equivalent to the corresponding methods above, but if the starting state is a TrajectoryStateOnSurface, it's better to use it as such rather than use just the FreeTrajectoryState part. It may help some concrete propagators. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Reimplemented from Propagator.

Definition at line 74 of file SmartPropagator.h.

References propagate().

                                                                     {
      return Propagator::propagate(tsos,surface);
    }
TrajectoryStateOnSurface SmartPropagator::propagate ( const TrajectoryStateOnSurface tsos,
const Cylinder cylinder 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 90 of file SmartPropagator.h.

References propagate().

                                                                       {
      return Propagator::propagate(tsos, cylinder);
    }
TrajectoryStateOnSurface SmartPropagator::propagate ( const FreeTrajectoryState fts,
const Plane plane 
) const [virtual]

Implements Propagator.

Definition at line 110 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagate().

                                                                              {

  if (insideTkVol(fts) && insideTkVol(plane)) {
    return getTkPropagator()->propagate(fts, plane);
  } else {
    return getGenPropagator()->propagate(fts, plane);
  }

}
TrajectoryStateOnSurface SmartPropagator::propagate ( const TrajectoryStateOnSurface tsos,
const Plane plane 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 82 of file SmartPropagator.h.

References propagate().

                                                                 {
      return Propagator::propagate(tsos, plane);
    }
TrajectoryStateOnSurface SmartPropagator::propagate ( const FreeTrajectoryState state,
const Surface sur 
) const [virtual]

Propagate from a free state (e.g. position and momentum in in global cartesian coordinates) to a surface. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Reimplemented from Propagator.

Definition at line 104 of file SmartPropagator.cc.

Referenced by propagate().

                                                                                  {
  return Propagator::propagate( fts, surface);
}
std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface tsos,
const Cylinder cylinder 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 122 of file SmartPropagator.h.

References propagateWithPath().

                                                        {
        return Propagator::propagateWithPath(tsos, cylinder);
      }
std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface state,
const Surface sur 
) const [inline, virtual]

The following three methods are equivalent to the corresponding methods above, but if the starting state is a TrajectoryStateOnSurface, it's better to use it as such rather than use just the FreeTrajectoryState part. It may help some concrete propagators. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Reimplemented from Propagator.

Definition at line 102 of file SmartPropagator.h.

References propagateWithPath().

                                                      {
        return Propagator::propagateWithPath(tsos,surface);
      }
std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Plane plane 
) const [virtual]

Implements Propagator.

Definition at line 133 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagateWithPath().

{
  if (insideTkVol(fts) && insideTkVol(plane)) {
    return getTkPropagator()->propagateWithPath(fts, plane);
  } else {
    return getGenPropagator()->propagateWithPath(fts, plane);
  }
}
std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface tsos,
const Plane plane 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 112 of file SmartPropagator.h.

References propagateWithPath().

                                                  {
        return Propagator::propagateWithPath(tsos, plane);
      }
std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Cylinder cylinder 
) const [virtual]

Implements Propagator.

Definition at line 144 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagateWithPath().

{
  if (insideTkVol(fts) && insideTkVol(cylinder)) {
    return getTkPropagator()->propagateWithPath(fts, cylinder);
  } else {
    return getGenPropagator()->propagateWithPath(fts, cylinder);
  }
}
std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const FreeTrajectoryState state,
const Surface sur 
) const [inline, virtual]

The methods propagateWithPath() are identical to the corresponding methods propagate() in what concerns the resulting TrajectoryStateOnSurface, but they provide in addition the exact path length along the trajectory. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Reimplemented from Propagator.

Definition at line 96 of file SmartPropagator.h.

Referenced by propagateWithPath().

                                                      {
        return Propagator::propagateWithPath(fts,surface);
      }
void SmartPropagator::setPropagationDirection ( PropagationDirection  dir) const [inline, virtual]
ReferenceCountingPointer< BoundCylinder > & SmartPropagator::theTkVolume ( ) [static, private]

Definition at line 36 of file SmartPropagator.cc.

Referenced by initTkVolume(), and SmartPropagator().

                                                                       {
  static ReferenceCountingPointer<BoundCylinder> local=0;
  return local;
}

Member Data Documentation

Definition at line 149 of file SmartPropagator.h.

Referenced by magneticField().

Definition at line 148 of file SmartPropagator.h.

Referenced by getGenPropagator(), SmartPropagator(), and ~SmartPropagator().

Definition at line 147 of file SmartPropagator.h.

Referenced by getTkPropagator(), SmartPropagator(), and ~SmartPropagator().