CMS 3D CMS Logo

ZMuTrackFunction.h

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

Generated on Tue Jun 9 17:34:18 2009 for CMSSW by  doxygen 1.5.4