Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:05:33

0001 #ifndef GeomPropagators_SmartPropagator_H
0002 #define GeomPropagators_SmartPropagator_H
0003 
0004 /** \class SmartPropagator
0005  *
0006  * A propagator which use different algorithm to propagate inside or outside
0007  * tracker
0008  *
0009  * \author  Stefano Lacaprara - INFN Padova
0010  * \porting author Chang Liu - Purdue University
0011  *
0012  * Modification:
0013  *    26-Jun-2002 SL: theTkVolume is now a static
0014  *        ReferenceCountingPointer<BoundCylinder>
0015  *    28-Aug-2002 SL: added methods to unhide Propagator methods
0016  *    29-Oct-2002 SL: fixed clone and copy constructor, and BoundCylinder are
0017  *        build with CylinderBuilder to enforce the referencePointer
0018  *
0019  */
0020 
0021 /* Collaborating Class Declarations */
0022 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0023 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0024 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0025 #include "MagneticField/Engine/interface/MagneticField.h"
0026 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0027 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0028 
0029 class Cylinder;
0030 class Plane;
0031 
0032 /* Class SmartPropagator Interface */
0033 
0034 class SmartPropagator final : public Propagator {
0035 public:
0036   /* Constructor */
0037   ///Defines which propagator is used inside Tk and which outside
0038   SmartPropagator(const Propagator* aTkProp,
0039                   const Propagator* aGenProp,
0040                   const MagneticField* field,
0041                   PropagationDirection dir = alongMomentum,
0042                   float epsilon = 5);
0043 
0044   ///Defines which propagator is used inside Tk and which outside
0045   SmartPropagator(const Propagator& aTkProp,
0046                   const Propagator& aGenProp,
0047                   const MagneticField* field,
0048                   PropagationDirection dir = alongMomentum,
0049                   float epsilon = 5);
0050 
0051   ///Copy constructor
0052   SmartPropagator(const SmartPropagator&);
0053 
0054   /** virtual destructor */
0055   ~SmartPropagator() override;
0056 
0057   ///Virtual constructor (using copy c'tor)
0058   SmartPropagator* clone() const override {
0059     return new SmartPropagator(getTkPropagator(), getGenPropagator(), magneticField());
0060   }
0061 
0062   ///setting the direction fo both components
0063   void setPropagationDirection(PropagationDirection dir) override {
0064     Propagator::setPropagationDirection(dir);
0065     theTkProp->setPropagationDirection(dir);
0066     theGenProp->setPropagationDirection(dir);
0067   }
0068 
0069   using Propagator::propagate;
0070   using Propagator::propagateWithPath;
0071 
0072 private:
0073   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0074                                                                 const Plane& plane) const override;
0075 
0076   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0077                                                                 const Cylinder& cylinder) const override;
0078 
0079   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0080                                                                 const Plane& sur) const override;
0081 
0082   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0083                                                                 const Cylinder& sur) const override;
0084 
0085 public:
0086   ///true if a fts is inside tracker volume
0087   bool insideTkVol(const FreeTrajectoryState& fts) const;
0088   ///true if a surface is inside tracker volume
0089   bool insideTkVol(const Surface& surface) const;
0090   ///true if a cylinder is inside tracker volume
0091   bool insideTkVol(const Cylinder& cylin) const;
0092   ///true if a plane is inside tracker volume
0093   bool insideTkVol(const Plane& plane) const;
0094 
0095   ///return the propagator used inside tracker
0096   const Propagator* getTkPropagator() const;
0097   ///return the propagator used outside tracker
0098   const Propagator* getGenPropagator() const;
0099   ///return the magneticField
0100   const MagneticField* magneticField() const override { return theField; }
0101 
0102 private:
0103   ///build the tracker volume
0104   void initTkVolume(float epsilon);
0105 
0106   Propagator* theTkProp;
0107   Propagator* theGenProp;
0108   const MagneticField* theField;
0109   ReferenceCountingPointer<Cylinder> theTkVolume;
0110 
0111 protected:
0112 };
0113 
0114 #endif  // SMARTPROPAGATOR_H