Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:01

0001 #ifndef RecoEgamma_ElectronTools_EgammaBDTOutputTransformer_h
0002 #define RecoEgamma_ElectronTools_EgammaBDTOutputTransformer_h
0003 
0004 //author: Sam Harper (RAL)
0005 //description:
0006 //  translates the raw value returned by the BDT output to the true value
0007 //  apparently its MINUIT-like, orginally taken from E/gamma regression applicator
0008 
0009 #include <vdt/vdtMath.h>
0010 
0011 class EgammaBDTOutputTransformer {
0012 public:
0013   EgammaBDTOutputTransformer(const double limitLow, const double limitHigh)
0014       : offset_(limitLow + 0.5 * (limitHigh - limitLow)), scale_(0.5 * (limitHigh - limitLow)) {}
0015 
0016   double operator()(const double rawVal) const { return offset_ + scale_ * vdt::fast_sin(rawVal); }
0017 
0018 private:
0019   double offset_;
0020   double scale_;
0021 };
0022 
0023 #endif