Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DetLayers_GeometricSearchDet_h
0002 #define DetLayers_GeometricSearchDet_h
0003 
0004 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0005 #include "DataFormats/GeometrySurface/interface/BoundSurface.h"
0006 
0007 #include "TrackingTools/DetLayers/interface/DetGroup.h"
0008 #include "DataFormats/GeometrySurface/interface/Surface.h"
0009 #include "TrackingTools/DetLayers/interface/GeomDetCompatibilityChecker.h"
0010 
0011 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0012 
0013 #include <vector>
0014 
0015 class MeasurementEstimator;
0016 
0017 class GeometricSearchDet {
0018 public:
0019   typedef std::pair<const GeomDet*, TrajectoryStateOnSurface> DetWithState;
0020   typedef BoundSurface::PositionType PositionType;
0021   typedef BoundSurface::RotationType RotationType;
0022   typedef TrajectoryStateOnSurface TrajectoryState;
0023 
0024   GeometricSearchDet(bool doHaveGroups) : haveGroups(doHaveGroups) {}
0025   virtual ~GeometricSearchDet();
0026 
0027   /// The surface of the GeometricSearchDet
0028   virtual const BoundSurface& surface() const = 0;
0029 
0030   /// Returns position of the surface
0031   virtual const Surface::PositionType& position() const { return surface().position(); }
0032 
0033   /// Returns basic components, if any
0034   //virtual std::vector< const GeomDet*> basicComponents() const = 0;
0035 
0036   /// Returns direct components, if any
0037   virtual const std::vector<const GeometricSearchDet*>& components() const = 0;
0038 
0039   /* Returns basic components. For the moment they are GeomDet, 
0040    * but they could become MeasurementDet
0041    */
0042   virtual const std::vector<const GeomDet*>& basicComponents() const = 0;
0043 
0044   /** tests the geometrical compatibility of the Det with the predicted state.
0045    *  The  FreeTrajectoryState argument is propagated to the Det surface using
0046    *  the Propagator argument. The resulting TrajectoryStateOnSurface is
0047    *  tested for compatibility with the surface bounds.
0048    *  If compatible, a std::pair< true, propagatedState> is returned.
0049    *  If the propagation fails, or if the state is not compatible,
0050    *  a std::pair< false, propagatedState> is returned.
0051    */
0052   virtual std::pair<bool, TrajectoryStateOnSurface> compatible(const TrajectoryStateOnSurface& ts,
0053                                                                const Propagator&,
0054                                                                const MeasurementEstimator&) const = 0;
0055 
0056   /** Returns all Dets compatible with a trajectory state 
0057    *  according to the estimator est.
0058    *  The startingState should be propagated to the surface of each compatible 
0059    *  Det using the Propagator passed as an argument. 
0060    *  The default implementation should be overridden in dets with
0061    *  specific surface types to avoid propagation to a generic Surface
0062    */
0063   virtual std::vector<DetWithState> compatibleDets(const TrajectoryStateOnSurface& startingState,
0064                                                    const Propagator& prop,
0065                                                    const MeasurementEstimator& est) const;
0066   virtual void compatibleDetsV(const TrajectoryStateOnSurface& startingState,
0067                                const Propagator& prop,
0068                                const MeasurementEstimator& est,
0069                                std::vector<DetWithState>& result) const;  //=0;
0070 
0071   /** Similar to compatibleDets(), but the compatible Dets are grouped in 
0072    *  one or more groups.
0073    *  Dets are put in the same group if they are mutually exclusive for track crossing,
0074    *  i.e. a reconstructible track cannot cross more than one Det from a group.
0075    *  Pathological tracks (spirals etc.) can of course violate this rule. 
0076    *  <BR>
0077    *  The DetGroups are sorted in the sequence of crossing by a track.
0078    *  In order to define the direction of crossing the Propagator used in this method 
0079    *  should have a defined direction() : either "alongMomentum" or 
0080    *  "oppositeToMomentum" but not "anyDirection".
0081    *  <BR> 
0082    *  The three signatures of this method differ by the input trajectory state arguments:
0083    *  the starting state can be a TrajectoryStateOnSurface or a FreeTrajectoryState,
0084    *  and the state on this CompositeDet may be already known or not.
0085    *  The last two arguments are as for the method compatibleDets().
0086    *  <BR>
0087    *  First signature: The first argument is a TrajectoryStateOnSurface, usually not 
0088    *  on the surface of this CompositeDet.
0089    */
0090   virtual std::vector<DetGroup> groupedCompatibleDets(const TrajectoryStateOnSurface& startingState,
0091                                                       const Propagator& prop,
0092                                                       const MeasurementEstimator& est) const;
0093 
0094   virtual void groupedCompatibleDetsV(const TrajectoryStateOnSurface& startingState,
0095                                       const Propagator& prop,
0096                                       const MeasurementEstimator& est,
0097                                       std::vector<DetGroup>& result) const;  // = 0;
0098 
0099   bool hasGroups() const { return haveGroups; }
0100 
0101 protected:
0102   GeomDetCompatibilityChecker theCompatibilityChecker;
0103   bool haveGroups;
0104 };
0105 
0106 #endif