CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/TrackingTools/MeasurementDet/interface/MeasurementDet.h

Go to the documentation of this file.
00001 #ifndef MeasurementDet_H
00002 #define MeasurementDet_H
00003 
00004 
00005 
00006 #include "TrackingTools/MeasurementDet/interface/TempMeasurements.h"
00007 
00008 
00009 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00010 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00011 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
00012 
00013 #include "FWCore/Utilities/interface/GCC11Compatibility.h"
00014 
00015 
00016 class TrajectoryStateOnSurface;
00017 class Propagator;
00018 class MeasurementEstimator;
00019 
00020 class MeasurementDet {
00021 public:
00022   typedef tracking::TempMeasurements TempMeasurements;
00023   typedef TransientTrackingRecHit::ConstRecHitContainer        RecHitContainer;
00024 
00025   MeasurementDet( const GeomDet* gdet) : theGeomDet(gdet) {}
00026 
00027   virtual RecHitContainer recHits( const TrajectoryStateOnSurface&) const = 0;
00028 
00029   // use a MeasurementEstimator to filter the hits (same algo as below..)
00030   // default as above 
00031   virtual bool recHits( const TrajectoryStateOnSurface& stateOnThisDet, const MeasurementEstimator&,
00032                         RecHitContainer & result, std::vector<float> &) const {
00033     result = recHits(stateOnThisDet);
00034     return !result.empty();
00035   }
00036 
00043   std::vector<TrajectoryMeasurement> 
00044   fastMeasurements( const TrajectoryStateOnSurface& stateOnThisDet, 
00045                     const TrajectoryStateOnSurface&, 
00046                     const Propagator&, 
00047                     const MeasurementEstimator& est) const {
00048 
00049     TempMeasurements tmps;
00050     measurements(stateOnThisDet, est, tmps);
00051     std::vector<TrajectoryMeasurement> result;
00052     result.reserve(tmps.size());
00053     int index[tmps.size()];  tmps.sortIndex(index);
00054     for (std::size_t i=0; i!=tmps.size(); ++i) {
00055        auto j=index[i];
00056        result.emplace_back(stateOnThisDet,std::move(tmps.hits[j]),tmps.distances[j]);
00057     }
00058     return result;
00059   }
00060 
00061   // return false if missing ( if inactive is true and one hit)
00062   virtual bool measurements( const TrajectoryStateOnSurface& stateOnThisDet,
00063                              const MeasurementEstimator& est,
00064                              TempMeasurements & result) const =0;
00065 
00066 
00067   const GeomDet& fastGeomDet() const { return *theGeomDet;}
00068   virtual const GeomDet& geomDet() const { return *theGeomDet;}
00069 
00070   const BoundSurface& surface() const {return  geomDet().surface();}
00071 
00072   const Surface::PositionType& position() const {return geomDet().position();}
00073 
00074   virtual bool isActive() const=0;
00075   virtual bool hasBadComponents(const TrajectoryStateOnSurface &tsos) const=0;
00076 
00077  private:
00078 
00079   const GeomDet* theGeomDet;
00080 
00081 };
00082 
00083 
00084 #endif