Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:35

0001 #ifndef RecoLocalFastTime_MTDCluster_Parameter_Estimator_H
0002 #define RecoLocalFastTime_MTDCluster_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/FTLRecHit/interface/FTLCluster.h"
0012 
0013 #include <tuple>
0014 
0015 class MTDClusterParameterEstimator {
0016 public:
0017   virtual ~MTDClusterParameterEstimator() {}
0018 
0019   typedef std::pair<LocalPoint, LocalError> LocalValues;
0020   typedef std::vector<LocalValues> VLocalValues;
0021 
0022   typedef float TimeValue;
0023   typedef float TimeValueError;
0024 
0025   using ReturnType = std::tuple<LocalPoint, LocalError, TimeValue, TimeValueError>;
0026 
0027   // here just to implement it in the clients;
0028   // to be properly implemented in the sub-classes in order to make them thread-safe
0029 
0030   virtual ReturnType getParameters(const FTLCluster& cl, const GeomDetUnit& det) const = 0;
0031 
0032   virtual ReturnType getParameters(const FTLCluster& cl,
0033                                    const GeomDetUnit& det,
0034                                    const LocalTrajectoryParameters& ltp) const = 0;
0035 
0036   virtual ReturnType getParameters(const FTLCluster& cl,
0037                                    const GeomDetUnit& det,
0038                                    const TrajectoryStateOnSurface& tsos) const {
0039     return getParameters(cl, det, tsos.localParameters());
0040   }
0041 
0042   virtual VLocalValues localParametersV(const FTLCluster& cluster, const GeomDetUnit& gd) const {
0043     VLocalValues vlp;
0044     ReturnType tuple = getParameters(cluster, gd);
0045     vlp.emplace_back(std::get<0>(tuple), std::get<1>(tuple));
0046     return vlp;
0047   }
0048   virtual VLocalValues localParametersV(const FTLCluster& cluster,
0049                                         const GeomDetUnit& gd,
0050                                         TrajectoryStateOnSurface& tsos) const {
0051     VLocalValues vlp;
0052     ReturnType tuple = getParameters(cluster, gd, tsos);
0053     vlp.emplace_back(std::get<0>(tuple), std::get<1>(tuple));
0054     return vlp;
0055   }
0056 
0057   MTDClusterParameterEstimator(){};
0058 };
0059 
0060 #endif