CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/ElectroWeakAnalysis/ZMuMu/interface/ZMuTrackScaledFunction.h

Go to the documentation of this file.
00001 #ifndef ElectroWeakAnalysis_ZMuMu_ZMuTrackScaledFunction_h
00002 #define ElectroWeakAnalysis_ZMuMu_ZMuTrackScaledFunction_h
00003 #include "ElectroWeakAnalysis/ZMuMu/interface/ZMuTrackFunction.h"
00004 #include <boost/shared_ptr.hpp>
00005 
00006 namespace function {
00007   class ZMuTrackScaledFunction {
00008    public: 
00009     enum { arguments = 1 };
00010     enum { parameters = 9 };
00011     ZMuTrackScaledFunction(const ZMuTrackFunction & zmt, int bin): 
00012       binScaleFactor(bin), zmt_(zmt) {}
00013     ZMuTrackScaledFunction(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       zmt_(m, g, Ng, Ni, me, s, N, eff_tr, eff_sa) {}
00019     ZMuTrackScaledFunction(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       zmt_(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       zmt_.setParameters(m, g, Ng, Ni, me, s, N, eff_tr, eff_sa);
00039     }
00040     double operator()(double x) const {
00041       return binScaleFactor * zmt_(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     ZMuTrackFunction zmt_;
00048   };
00049 }
00050 
00051 #endif