Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:39

0001 /** \class SiTrackerMultiRecHitUpdator
0002   *  Builds a SiTrackerMultiRecHit out of a vector of TrackingRecHit
0003   *  or updates an existing SiTrackerMultiRecHit given a tsos.
0004   *
0005   *  \author tropiano, genta
0006   *  \review in May 2014 by brondolin 
0007   */
0008 
0009 #ifndef SiTrackerMultiRecHitUpdator_h
0010 #define SiTrackerMultiRecHitUpdator_h
0011 
0012 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0013 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0014 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
0015 #include "RecoTracker/TransientTrackingRecHit/interface/TkClonerImpl.h"
0016 #include "TrackingTools/MeasurementDet/interface/MeasurementDetWithData.h"
0017 
0018 #include <vector>
0019 
0020 class SiTrackerMultiRecHit;
0021 class TrajectoryStateOnSurface;
0022 class TrackingRecHit;
0023 class TransientTrackingRecHitBuilder;
0024 class LocalError;
0025 class TrackingRecHitPropagator;
0026 
0027 class SiTrackerMultiRecHitUpdator {
0028 public:
0029   typedef std::pair<LocalPoint, LocalError> LocalParameters;
0030   SiTrackerMultiRecHitUpdator(const TransientTrackingRecHitBuilder* builder,
0031                               const TrackingRecHitPropagator* hitpropagator,
0032                               const float Chi2Cut1D,
0033                               const float Chi2Cut2D,
0034                               const std::vector<double>& anAnnealingProgram,
0035                               bool debug);
0036   virtual ~SiTrackerMultiRecHitUpdator(){};
0037 
0038   //calls the update method in order to build a SiTrackerMultiRecHit
0039   virtual TransientTrackingRecHit::RecHitPointer buildMultiRecHit(const std::vector<const TrackingRecHit*>& rhv,
0040                                                                   const TrajectoryStateOnSurface& tsos,
0041                                                                   MeasurementDetWithData& measDet,
0042                                                                   float annealing = 1.) const;
0043 
0044   //updates an existing SiTrackerMultiRecHit
0045   //in case a different kind of rechit is passed it returns clone(tsos)
0046   virtual TransientTrackingRecHit::RecHitPointer update(TransientTrackingRecHit::ConstRecHitPointer original,
0047                                                         const TrajectoryStateOnSurface& tsos,
0048                                                         MeasurementDetWithData& measDet,
0049                                                         double annealing = 1.) const;
0050 
0051   //returns a SiTrackerMultiRecHit out of the transient components
0052   TransientTrackingRecHit::RecHitPointer update(TransientTrackingRecHit::ConstRecHitContainer& tcomponents,
0053                                                 const TrajectoryStateOnSurface& tsos,
0054                                                 MeasurementDetWithData& measDet,
0055                                                 double annealing = 1.) const;
0056 
0057   //computes weights or the cut-off value (depending on CutWeight variable)
0058   double ComputeWeight(const TrajectoryStateOnSurface& tsos,
0059                        const TransientTrackingRecHit& aRecHit,
0060                        bool CutWeight,
0061                        double annealing = 1.) const;
0062   template <unsigned int N>
0063   double ComputeWeight(const TrajectoryStateOnSurface& tsos,
0064                        const TransientTrackingRecHit& aRecHit,
0065                        bool CutWeight,
0066                        double annealing = 1.) const;
0067 
0068   const std::vector<double>& annealingProgram() const { return theAnnealingProgram; }
0069   const std::vector<double>& getAnnealingProgram() const { return theAnnealingProgram; }
0070 
0071   const TransientTrackingRecHitBuilder* getBuilder() const { return theBuilder; }
0072 
0073 private:
0074   //computes parameters for 1 dim or 2 dim hits
0075   LocalParameters calcParameters(const TrajectoryStateOnSurface& tsos,
0076                                  std::vector<std::pair<const TrackingRecHit*, float> >& aHitMap) const;
0077   template <unsigned int N>
0078   LocalParameters calcParameters(const TrajectoryStateOnSurface& tsos,
0079                                  std::vector<std::pair<const TrackingRecHit*, float> >& aHitMap) const;
0080   bool TIDorTEChit(const TrackingRecHit* const& hit) const;
0081 
0082   const TransientTrackingRecHitBuilder* theBuilder;
0083   const TrackingRecHitPropagator* theHitPropagator;
0084   double theChi2Cut1D;
0085   double theChi2Cut2D;
0086   const std::vector<double> theAnnealingProgram;
0087   TkClonerImpl theHitCloner;
0088   bool debug_;
0089 };
0090 #endif