CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/ElectroWeakAnalysis/ZMuMu/interface/ZMuStandaloneScaledFunction.h

Go to the documentation of this file.
00001 #ifndef ElectroWeakAnalysis_ZMuMu_ZMuStandaloneScaledFunction_h
00002 #define ElectroWeakAnalysis_ZMuMu_ZMuStandaloneScaledFunction_h
00003 #include "ElectroWeakAnalysis/ZMuMu/interface/ZMuStandaloneFunction.h"
00004 #include <boost/shared_ptr.hpp>
00005 
00006 namespace function {
00007   class ZMuStandaloneScaledFunction {
00008    public: 
00009     enum { arguments = 1 };
00010     enum { parameters = 9 };
00011     ZMuStandaloneScaledFunction(const ZMuStandaloneFunction & zms, int bin): 
00012       binScaleFactor(bin), zms_(zms) {}
00013     ZMuStandaloneScaledFunction(boost::shared_ptr<double> m, boost::shared_ptr<double> g, boost::shared_ptr<double> Ng, boost::shared_ptr<double> Ni, 
00014                                 boost::shared_ptr<double> me, boost::shared_ptr<double> s, 
00015                                 boost::shared_ptr<double> N, boost::shared_ptr<double> eff_tr, boost::shared_ptr<double> eff_sa, int bin):
00016       mass(m), width(g), Ngamma(Ng), Nint(Ni), mean(me), sigma(s), 
00017       numberOfEvents(N), efficiencyTrack(eff_tr), efficiencyStandalone(eff_sa), binScaleFactor(bin), 
00018       zms_(m, g, Ng, Ni, me, s, N, eff_tr, eff_sa) {}
00019     ZMuStandaloneScaledFunction(double m, double g, double Ng, double Ni, 
00020                                 double me, double s, 
00021                                 double N, double eff_tr, double eff_sa, 
00022                                 int bin): 
00023       mass(new double(m)), width(new double(g)), Ngamma(new double(Ng)), Nint(new double(Ni)), mean(new double(me)), sigma(new double(s)), 
00024       numberOfEvents(new double(N)), efficiencyTrack(new double(eff_tr)), efficiencyStandalone(new double(eff_sa)), binScaleFactor(bin), 
00025       zms_(m, g, Ng, Ni, me, s, N, eff_tr, eff_sa) {}
00026     void setParameters(double m, double g, double Ng, double Ni, 
00027                        double me, double s, 
00028                        double N, double eff_tr, double eff_sa) { 
00029       *mass = m; 
00030       *width = g; 
00031       *Ngamma = Ng; 
00032       *Nint = Ni; 
00033       *mean = me; 
00034       *sigma = s; 
00035       *numberOfEvents = N; 
00036       *efficiencyTrack = eff_tr; 
00037       *efficiencyStandalone = eff_sa; 
00038       zms_.setParameters(m, g, Ng, Ni, me, s, N, eff_tr, eff_sa);
00039     }
00040     double operator()(double x) const {
00041       return binScaleFactor * zms_(x);
00042     }
00043     boost::shared_ptr<double> mass, width, Ngamma, Nint, mean, sigma;
00044     boost::shared_ptr<double> numberOfEvents, efficiencyTrack, efficiencyStandalone;
00045     int binScaleFactor;
00046   private:
00047     ZMuStandaloneFunction zms_;
00048   };
00049 }  
00050 
00051 #endif
00052