Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:40

0001 #ifndef _COMMONRECO_PROPAGATORWITHMATERIAL_H_
0002 #define _COMMONRECO_PROPAGATORWITHMATERIAL_H_
0003 
0004 /** \class PropagatorWithMaterial
0005  *  Propagation including material effects.
0006  *
0007  *  Propagates using a specific for the geometrical part
0008  *  and a MaterialEffectsUpdator to include multiple scattering and
0009  *  energy loss. By default material effects are included at the
0010  *  source in the case of forward propagation and at the destination
0011  *  for backward propagation. Material effects at the source can
0012  *  only be included when propagating from a TrajectoryStateOnSurface.
0013  *  Ported from ORCA.
0014  *
0015  *  \author todorov, cerati
0016  */
0017 
0018 #include "DataFormats/GeometryCommonDetAlgo/interface/DeepCopyPointerByClone.h"
0019 #include "TrackPropagation/RungeKutta/interface/defaultRKPropagator.h"
0020 
0021 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0022 #include "TrackingTools/MaterialEffects/interface/MaterialEffectsUpdator.h"
0023 
0024 class MagneticField;
0025 class PropagatorWithMaterial final : public Propagator {
0026 public:
0027   /** Constructor with PropagationDirection and mass hypothesis.
0028    *  Uses AnalyticalPropagator and CombinedMaterialEffectsUpdator
0029    *  with explicit mass hypothesis.MaxDPhi is a cut on the max change in
0030    *  phi during state propagation. For propagation of very low pt tracks
0031    *  (e.g. loopers), this cut can be loosened.
0032    *  If ptMin > 0, then multiple scattering calculations will take into
0033    *  account the uncertainty in the reconstructed track momentum, (by
0034    *  default neglected), but assuming that the track Pt will never fall
0035    *  below ptMin.
0036    */
0037   PropagatorWithMaterial(PropagationDirection dir,
0038                          const float mass,
0039                          const MagneticField* mf = nullptr,
0040                          const float maxDPhi = 1.6,
0041                          bool useRungeKutta = false,
0042                          float ptMin = -1.,
0043                          bool useOldGeoPropLogic = true);
0044 
0045   ~PropagatorWithMaterial() override;
0046 
0047   using Propagator::propagate;
0048   using Propagator::propagateWithPath;
0049 
0050 private:
0051   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0052                                                                 const Plane& plane) const override;
0053 
0054   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0055                                                                 const Plane& plane) const override;
0056 
0057   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface& tsos,
0058                                                                 const Cylinder& cylinder) const override;
0059 
0060   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState& fts,
0061                                                                 const Cylinder& cylinder) const override;
0062 
0063 public:
0064   /// Limit on change in azimuthal angle
0065   bool setMaxDirectionChange(float phiMax) override { return theGeometricalPropagator->setMaxDirectionChange(phiMax); }
0066   /// Propagation direction
0067   void setPropagationDirection(PropagationDirection dir) override;
0068 
0069   enum MaterialLocation { atSource, atDestination, fromDirection };
0070   /** Choice of location for including material effects:
0071    *  fromDirection is equivalent to atSource for propagation alongMomentum
0072    *  and to atDestination for propagation oppositeToMomentum.
0073    *  Inclusion of material effects at the source (either explicitely or
0074    *  implicitely) is not possible if propagating with anyDirection and
0075    *  will effectively disable material effects when propagating from
0076    *  a FreeTrajectoryState.
0077    */
0078   void setMaterialLocation(const MaterialLocation location) { theMaterialLocation = location; }
0079   /// Access to the geometrical propagator
0080   const Propagator& geometricalPropagator() const { return *theGeometricalPropagator; }
0081   /// Access to the MaterialEffectsUpdator
0082   const MaterialEffectsUpdator& materialEffectsUpdator() const { return *theMEUpdator; }
0083 
0084   const MagneticField* magneticField() const override { return field; }
0085 
0086   PropagatorWithMaterial* clone() const override { return new PropagatorWithMaterial(*this); }
0087 
0088 private:
0089   /// Inclusion of material at the source?
0090   bool materialAtSource() const dso_internal;
0091 
0092 private:
0093   // Geometrical propagator
0094 
0095   defaultRKPropagator::Product rkProduct;
0096   DeepCopyPointerByClone<Propagator> theGeometricalPropagator;
0097 
0098   // Material effects
0099   DeepCopyPointerByClone<MaterialEffectsUpdator> theMEUpdator;
0100   typedef std::pair<TrajectoryStateOnSurface, double> TsosWP;
0101   // Use material at source?
0102   MaterialLocation theMaterialLocation;
0103   const MagneticField* field;
0104   bool useRungeKutta_;
0105 };
0106 
0107 #endif