00001 #ifndef LINEARCALIBRATOR_HH_ 00002 #define LINEARCALIBRATOR_HH_ 00003 00004 #include "RecoParticleFlow/PFClusterTools/interface/Calibrator.h" 00005 00006 00007 #include "TMatrixD.h" 00008 #include "TVectorD.h" 00009 00023 namespace pftools { 00024 class LinearCalibrator : public Calibrator { 00025 public: 00026 LinearCalibrator(); 00027 virtual ~LinearCalibrator(); 00028 00029 00030 /* 00031 * Note: covariant return type w.r.t. Calibrator class: the overloading has changed 00032 * the return type but this IS allowed with modern compilers. 00033 * See documentation in Calibrator.h 00034 */ 00035 LinearCalibrator* clone() const; 00036 LinearCalibrator* create() const; 00037 00038 protected: 00039 00040 virtual std::map<DetectorElementPtr, double> 00041 getCalibrationCoefficientsCore() throw(PFToolsException&); 00042 00043 00044 LinearCalibrator(const LinearCalibrator& lc); 00045 /* 00046 * Converts the particle deposits into a useful matrix formulation. 00047 */ 00048 virtual void initEijMatrix(TMatrixD& eij, TVectorD& truthE); 00049 00050 /* 00051 * Utility method to extract the unique number of detected elements. 00052 */ 00053 virtual void populateDetElIndex(); 00054 00055 virtual TVectorD& getProjections(const TMatrixD& eij, TVectorD& proj, 00056 const TVectorD& truthE) const; 00057 00058 virtual TMatrixD& getHessian(const TMatrixD& eij, TMatrixD& hess, 00059 const TVectorD& truthE) const; 00060 00061 /* 00062 * Map to convert detector element to array row/column index. 00063 */ 00064 std::map<DetectorElementPtr, unsigned> myDetElIndex; 00065 00066 }; 00067 } 00068 00069 #endif /*LINEARCALIBRATOR_HH_*/