CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/TrackingTools/GeomPropagators/src/BeamHaloPropagator.cc

Go to the documentation of this file.
00001 /******* \class BeamHaloPropagator *******
00002  *
00003  * Description: A propagator which use different algorithm to propagate 
00004  * within an endcap or to cross over to the other endcap
00005  *  
00006  *
00007  * \author : Jean-Roch VLIMANT UCSB
00008  *
00009  *********************************/
00010 
00011 /* This Class Header */
00012 #include "TrackingTools/GeomPropagators/interface/BeamHaloPropagator.h"
00013 
00014 /* Collaborating Class Header */
00015 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00016 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
00017 #include "DataFormats/GeometrySurface/interface/SimpleCylinderBounds.h"
00018 
00019 #include <DataFormats/GeometrySurface/interface/BoundCylinder.h>
00020 
00021 #include "TrackingTools/GeomPropagators/interface/TrackerBounds.h"
00022 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00023 
00024 /* Base Class Headers */
00025 
00026 /* C++ Headers */
00027 
00028 /* ====================================================================== */
00029 
00030 
00031 
00032 
00033 /* Constructor */ 
00034 void BeamHaloPropagator::directionCheck(PropagationDirection dir)const {
00035 
00036   //consistency check for direction
00037   if (getEndCapTkPropagator()->propagationDirection()!=dir && getEndCapTkPropagator()->propagationDirection()!=anyDirection){
00038     edm::LogError("BeamHaloPropagator")<<"composite propagator set with inconsistent direction components\n"
00039                                   <<"EndCap propagator is: "<<getEndCapTkPropagator()->propagationDirection()
00040                                   <<"\n to be set on: "<<dir;
00041     getEndCapTkPropagator()->setPropagationDirection(dir);
00042   }
00043 
00044   if (getCrossTkPropagator()->propagationDirection()!=dir && getCrossTkPropagator()->propagationDirection()!=anyDirection){
00045     edm::LogError("BeamHaloPropagator")<<"composite propagator set with inconsistent direction components\n"
00046                                   <<"Cross propagator is: "<<getCrossTkPropagator()->propagationDirection()
00047                                   <<"\n to be set on: "<<dir;
00048     getCrossTkPropagator()->setPropagationDirection(dir);
00049   }
00050   
00051 }
00052 
00053 BeamHaloPropagator::BeamHaloPropagator(Propagator* aEndCapTkProp, Propagator* aCrossTkProp, const MagneticField* field,
00054                                  PropagationDirection dir) :
00055   Propagator(dir), theEndCapTkProp(aEndCapTkProp->clone()), theCrossTkProp(aCrossTkProp->clone()), theField(field) { 
00056   directionCheck(dir);
00057 }
00058 
00059 
00060 BeamHaloPropagator::BeamHaloPropagator(const Propagator& aEndCapTkProp, const Propagator& aCrossTkProp,const MagneticField* field,
00061                                  PropagationDirection dir) :
00062   Propagator(dir), theEndCapTkProp(aEndCapTkProp.clone()), theCrossTkProp(aCrossTkProp.clone()), theField(field) {
00063   directionCheck(dir);
00064 }
00065 
00066 
00067 BeamHaloPropagator::BeamHaloPropagator(const BeamHaloPropagator& aProp) :
00068   Propagator(aProp.propagationDirection()), theEndCapTkProp(0), theCrossTkProp(0) { 
00069   if (aProp.theEndCapTkProp)
00070     theEndCapTkProp=aProp.getEndCapTkPropagator()->clone();
00071   if (aProp.theCrossTkProp)
00072     theCrossTkProp=aProp.getCrossTkPropagator()->clone();
00073 }
00074 
00075 /* Destructor */ 
00076 BeamHaloPropagator::~BeamHaloPropagator() {
00077 
00078   delete theEndCapTkProp;
00079   delete theCrossTkProp;
00080 
00081 }
00082 
00083 bool BeamHaloPropagator::crossingTk(const FreeTrajectoryState& fts, const Plane& plane)  const{
00084   LogDebug("BeamHaloPropagator")<<"going from: "<<fts.position()<<" to: "<<plane.position()<<"\n"
00085                                 <<"and hence "<<((fts.position().z()*plane.position().z()<0)?"crossing":"not crossing");
00086   return (fts.position().z()*plane.position().z()<0);}
00087 
00088 TrajectoryStateOnSurface BeamHaloPropagator::propagate(const FreeTrajectoryState& fts, 
00089                                                     const Surface& surface) const {
00090   return Propagator::propagate( fts, surface);
00091 }
00092 
00093 
00094 TrajectoryStateOnSurface BeamHaloPropagator::propagate(const FreeTrajectoryState& fts, 
00095                                                     const Plane& plane) const {
00096 
00097   if (crossingTk(fts,plane)){
00098     return getCrossTkPropagator()->propagate(fts, plane);}
00099   else{
00100     return getEndCapTkPropagator()->propagate(fts, plane);}
00101 }
00102 
00103 
00104 TrajectoryStateOnSurface BeamHaloPropagator::propagate(const FreeTrajectoryState& fts, 
00105                                                     const Cylinder& cylinder) const {
00106   return getCrossTkPropagator()->propagate(fts, cylinder);
00107 }
00108 
00109 std::pair<TrajectoryStateOnSurface,double> 
00110 BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts, 
00111                                    const Plane& plane) const 
00112 {
00113   if (crossingTk(fts,plane)){
00114     return getCrossTkPropagator()->propagateWithPath(fts, plane);}
00115   else{
00116     return getEndCapTkPropagator()->propagateWithPath(fts, plane);}
00117 }
00118 
00119 std::pair<TrajectoryStateOnSurface,double> 
00120 BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts, 
00121                                    const Cylinder& cylinder) const
00122 {  return getCrossTkPropagator()->propagateWithPath(fts, cylinder);}
00123 
00124 
00125 Propagator* BeamHaloPropagator::getEndCapTkPropagator() const {
00126   LogDebug("BeamHaloPropagator")<<"using the EndCap propagator";
00127   return theEndCapTkProp;}
00128 
00129 
00130 Propagator* BeamHaloPropagator::getCrossTkPropagator() const {
00131   LogDebug("BeamHaloPropagator")<<"using the Crossing propagator";
00132   return theCrossTkProp;}
00133 
00134