CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/ElectroWeakAnalysis/ZMuMu/interface/ZMuMuFunction.h

Go to the documentation of this file.
00001 #ifndef ElectroWeakAnalysis_ZMuMu_ZMuMuFunction_h
00002 #define ElectroWeakAnalysis_ZMuMu_ZMuMuFunction_h
00003 #include "PhysicsTools/Utilities/interface/Convolution.h"
00004 #include "PhysicsTools/Utilities/interface/ZLineShape.h"
00005 #include "PhysicsTools/Utilities/interface/Gaussian.h"
00006 #include "PhysicsTools/Utilities/interface/Parameter.h"
00007 #include <boost/shared_ptr.hpp>
00008 
00009 namespace function {
00010   class ZMuMuFunction {
00011    public:
00012     static const unsigned int arguments = 1;
00013     ZMuMuFunction(const Parameter & m, const Parameter & g, 
00014                   const Parameter & Ng, const Parameter & Ni, 
00015                   const Parameter & me, const Parameter & s, 
00016                   const Parameter & N, const Parameter & eff_tr, const Parameter & eff_sa):
00017       mass(m.ptr()), width(g.ptr()), 
00018       Ngamma(Ng.ptr()), Nint(Ni.ptr()), 
00019       mean(me.ptr()), sigma(s.ptr()), 
00020       numberOfEvents(N.ptr()), 
00021       efficiencyTrack(eff_tr.ptr()), efficiencyStandalone(eff_sa.ptr()), 
00022       zls_(m, g, Ng, Ni), gau_(me, s), 
00023       cgz_(zls_, gau_, -3*s.value(), 3*s.value(), 200) {}
00024     ZMuMuFunction(boost::shared_ptr<double> m, boost::shared_ptr<double> g, 
00025                   boost::shared_ptr<double> Ng, boost::shared_ptr<double> Ni, 
00026                   boost::shared_ptr<double> me, boost::shared_ptr<double> s, 
00027                   boost::shared_ptr<double> N, 
00028                   boost::shared_ptr<double> eff_tr, boost::shared_ptr<double> eff_sa):
00029       mass(m), width(g), 
00030       Ngamma(Ng), Nint(Ni), 
00031       mean(me), sigma(s), 
00032       numberOfEvents(N), 
00033       efficiencyTrack(eff_tr), efficiencyStandalone(eff_sa), 
00034       zls_(m, g, Ng, Ni), gau_(me, s), 
00035       cgz_(zls_, gau_, -3*(*s), 3*(*s), 200) {}
00036     double operator()(double x) const {
00037       double eff_tr_2 = *efficiencyTrack * (*efficiencyTrack);
00038       double eff_sa_2 = *efficiencyStandalone * (*efficiencyStandalone);
00039       return cgz_(x) * (*numberOfEvents) * eff_tr_2 * eff_sa_2;
00040     }
00041     boost::shared_ptr<double> mass, width, Ngamma, Nint, mean, sigma;
00042     boost::shared_ptr<double> numberOfEvents, efficiencyTrack, efficiencyStandalone;
00043   private:
00044     ZLineShape zls_;
00045     Gaussian gau_;
00046     Convolution<ZLineShape, Gaussian> cgz_;
00047   };
00048 }
00049 
00050 #endif