00001 #ifndef CALIBRATIONRESULTWRAPPER_H_ 00002 #define CALIBRATIONRESULTWRAPPER_H_ 00003 00004 //#include <boost/shared_ptr.hpp> 00005 00006 #include "DataFormats/ParticleFlowReco/interface/CalibrationProvenance.h" 00007 00008 namespace pftools { 00009 00018 class CalibrationResultWrapper { 00019 public: 00020 00021 // typedef boost::shared_ptr<CalibrationResultWrapper> 00022 // CalibrationResultWrapperPtr; 00023 00024 CalibrationResultWrapper() { 00025 reset(); 00026 } 00027 00028 virtual ~CalibrationResultWrapper() { 00029 } 00030 00031 00032 void reset() { 00033 resetCore(); 00034 } 00035 00036 00037 void compute() { 00038 computeCore(); 00039 } 00040 00041 double bias() const { 00042 return (particleEnergy_ - truthEnergy_) / truthEnergy_; 00043 } 00044 00045 double ratio() const { 00046 return(particleEnergy_/truthEnergy_); 00047 } 00048 00049 /* 00050 * Which calibrator made this? 00051 */ 00052 CalibrationProvenance provenance_; 00053 /* 00054 * What energy was this particle optimised to? 00055 */ 00056 double truthEnergy_; 00057 00058 /* 00059 * Calibrated ecal deposition 00060 */ 00061 double ecalEnergy_; 00062 00063 /* 00064 * Calibrated hcal deposition 00065 */ 00066 double hcalEnergy_; 00067 00068 /* 00069 * Calibrated particle energy (not necessarily ecal + hcal!) 00070 */ 00071 double particleEnergy_; 00072 00073 /* 00074 * What objects did this optimise on? 00075 */ 00076 CalibrationTarget target_; 00077 00078 /* 00079 * (reco - truth)/truth 00080 */ 00081 double bias_; 00082 00083 /* 00084 * reco/truth 00085 */ 00086 double ratio_; 00087 00088 /* 00089 * Target function contribution 00090 */ 00091 double targetFuncContrib_; 00092 00093 double a_; 00094 double b_; 00095 double c_; 00096 00097 private: 00098 00099 virtual void computeCore() { 00100 bias_ = bias(); 00101 ratio_ = ratio(); 00102 } 00103 00104 virtual void resetCore() { 00105 truthEnergy_ = 0; 00106 ecalEnergy_ = 0; 00107 hcalEnergy_ = 0; 00108 particleEnergy_ = 0; 00109 provenance_ = UNCALIBRATED; 00110 target_ = UNDEFINED; 00111 bias_ = 0; 00112 ratio_ = 1.0; 00113 targetFuncContrib_ = 0; 00114 a_ = 0.0; 00115 b_ = 1.0; 00116 c_ = 1.0; 00117 } 00118 00119 }; 00120 00121 } 00122 00123 #endif /*CALIBRATIONRESULTWRAPPER_H_*/