CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/ElectroWeakAnalysis/ZMuMu/interface/ZMuStandaloneFunction.h

Go to the documentation of this file.
00001 #ifndef ElectroWeakAnalysis_ZMuMu_ZMuStandaloneFunction_h
00002 #define ElectroWeakAnalysis_ZMuMu_ZMuStandaloneFunction_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 ZMuStandaloneFunction {
00011    public:
00012     static const unsigned int arguments = 1;
00013     ZMuStandaloneFunction(boost::shared_ptr<double> m, boost::shared_ptr<double> g, 
00014                           boost::shared_ptr<double> Ng, boost::shared_ptr<double> Ni, 
00015                           boost::shared_ptr<double> me, boost::shared_ptr<double> s, 
00016                           boost::shared_ptr<double> N, 
00017                           boost::shared_ptr<double> eff_tr, boost::shared_ptr<double> eff_sa):
00018       mass(m), width(g), 
00019       Ngamma(Ng), Nint(Ni), 
00020       mean(me), sigma(s), 
00021       numberOfEvents(N), 
00022       efficiencyTrack(eff_tr), efficiencyStandalone(eff_sa), 
00023       zls_(m, g, Ng, Ni), gau_(me, s), 
00024       cgz_(zls_, gau_, -3*s.value(), 3*s.value(), 200) {}
00025     ZMuStandaloneFunction(double m, double g, double Ng, double Ni, 
00026                           double me, double s, 
00027                           double N, double eff_tr, double eff_sa):
00028       mass(new double(m)), width(new double(g)), 
00029       Ngamma(new double(Ng)), Nint(new double(Ni)), 
00030       mean(new double(me)), sigma(new double(s)), 
00031       numberOfEvents(new double(N)), 
00032       efficiencyTrack(new double(eff_tr)), efficiencyStandalone(new double(eff_sa)), 
00033       zls_(m, g, Ng, Ni), gau_(me, s), 
00034       cgz_(zls_, gau_, -3*(*s), 3*(*s), 200) {}
00035     double operator()(double x) const {
00036       double eff_sa_2 = *efficiencyStandalone * (*efficiencyStandalone);
00037       double eff_tr_minus = *efficiencyTrack * ( 1. - *efficiencyTrack );
00038       return cgz_(x) * 2. * (*numberOfEvents) * eff_sa_2 * eff_tr_minus;
00039     } 
00040     boost::shared_ptr<double> mass, width, Ngamma, Nint, mean, sigma;
00041     boost::shared_ptr<double> numberOfEvents, efficiencyTrack, efficiencyStandalone;
00042   private:
00043     ZLineShape zls_;
00044     Gaussian gau_;
00045     Convolution<ZLineShape, Gaussian> cgz_;
00046   };
00047 }
00048 
00049 #endif