Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:15

0001 #ifndef RecoLocalTracker_PixelCluster_Parameter_Estimator_H
0002 #define RecoLocalTracker_PixelCluster_Parameter_Estimator_H
0003 
0004 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0005 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0006 
0007 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0008 #include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h"
0009 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0010 
0011 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
0012 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitQuality.h"
0013 #include <tuple>
0014 
0015 class PixelClusterParameterEstimator {
0016 public:
0017   virtual ~PixelClusterParameterEstimator() {}
0018 
0019   typedef std::pair<LocalPoint, LocalError> LocalValues;
0020   typedef std::vector<LocalValues> VLocalValues;
0021 
0022   using ReturnType = std::tuple<LocalPoint, LocalError, SiPixelRecHitQuality::QualWordType>;
0023 
0024   // here just to implement it in the clients;
0025   // to be properly implemented in the sub-classes in order to make them thread-safe
0026 
0027   virtual ReturnType getParameters(const SiPixelCluster& cl, const GeomDetUnit& det) const = 0;
0028 
0029   virtual ReturnType getParameters(const SiPixelCluster& cl,
0030                                    const GeomDetUnit& det,
0031                                    const LocalTrajectoryParameters& ltp) const = 0;
0032 
0033   virtual ReturnType getParameters(const SiPixelCluster& cl,
0034                                    const GeomDetUnit& det,
0035                                    const TrajectoryStateOnSurface& tsos) const {
0036     return getParameters(cl, det, tsos.localParameters());
0037   }
0038 
0039   virtual VLocalValues localParametersV(const SiPixelCluster& cluster, const GeomDetUnit& gd) const {
0040     VLocalValues vlp;
0041     ReturnType tuple = getParameters(cluster, gd);
0042     vlp.push_back(std::make_pair(std::get<0>(tuple), std::get<1>(tuple)));
0043     return vlp;
0044   }
0045   virtual VLocalValues localParametersV(const SiPixelCluster& cluster,
0046                                         const GeomDetUnit& gd,
0047                                         TrajectoryStateOnSurface& tsos) const {
0048     VLocalValues vlp;
0049     ReturnType tuple = getParameters(cluster, gd, tsos);
0050     vlp.push_back(std::make_pair(std::get<0>(tuple), std::get<1>(tuple)));
0051     return vlp;
0052   }
0053 
0054   PixelClusterParameterEstimator() : clusterProbComputationFlag_(0) {}
0055 
0056   //--- Flag to control how SiPixelRecHits compute clusterProbability().
0057   //--- Note this is set via the configuration file, and it's simply passed
0058   //--- to each TSiPixelRecHit.
0059   inline unsigned int clusterProbComputationFlag() const { return clusterProbComputationFlag_; }
0060 
0061 protected:
0062   //--- A flag that could be used to change the behavior of
0063   //--- clusterProbability() in TSiPixelRecHit (the *transient* one).
0064   //--- The problem is that the transient hits are made after the CPE runs
0065   //--- and they don't get the access to the PSet, so we pass it via the
0066   //--- CPE itself...
0067   //
0068   unsigned int clusterProbComputationFlag_;
0069 };
0070 
0071 #endif