#### /ElectroWeakAnalysis/ZMuMu/interface/ZMuTrackFunction.h

https://github.com/aivanov-cern/cmssw
C Header | 49 lines | 47 code | 2 blank | 0 comment | 0 complexity | 4e326252e20e8e6ded5192d2cbd73883 MD5 | raw file
``` 1#ifndef ElectroWeakAnalysis_ZMuMu_ZMuTrackFunction_h
2#define ElectroWeakAnalysis_ZMuMu_ZMuTrackFunction_h
3#include "PhysicsTools/Utilities/interface/ConvGaussZLineShape.h"
4#include <boost/shared_ptr.hpp>
5
6namespace function {
7  class ZMuTrackFunction {
8   public:
9    enum{ arguments = 1 };
10    enum{ parameters = 9 };
11    ZMuTrackFunction(boost::shared_ptr<double> m, boost::shared_ptr<double> g, boost::shared_ptr<double> Ng, boost::shared_ptr<double> Ni,
12		     boost::shared_ptr<double> me, boost::shared_ptr<double> s,
13		     boost::shared_ptr<double> N, boost::shared_ptr<double> eff_tr, boost::shared_ptr<double> eff_sa):
14      mass(m), width(g), Ngamma(Ng), Nint(Ni), mean(me), sigma(s),
15      numberOfEvents(N), efficiencyTrack(eff_tr), efficiencyStandalone(eff_sa),
16      cgz_(m, g, Ng, Ni, me, s) {}
17    ZMuTrackFunction(double m, double g, double Ng, double Ni,
18		     double me, double s,
19		     double N, double eff_tr, double eff_sa):
20      mass(new double(m)), width(new double(g)), Ngamma(new double(Ng)), Nint(new double(Ni)), mean(new double(me)), sigma(new double(s)),
21      numberOfEvents(new double(N)), efficiencyTrack(new double(eff_tr)), efficiencyStandalone(new double(eff_sa)),
22      cgz_(m, g, Ng, Ni, me, s) {}
23    double operator()(double x) const {
24      double eff_tr_2 = *efficiencyTrack * (*efficiencyTrack);
25      double eff_sa_minus = *efficiencyStandalone * (1. - *efficiencyStandalone);
26      return cgz_(x) * 2. * (*numberOfEvents) * eff_tr_2 * eff_sa_minus;
27    }
28    void setParameters(double m, double g, double Ng, double Ni,
29		       double me, double s,
30		       double N, double eff_tr, double eff_sa) {
31      *mass = m;
32      *width = g;
33      *Ngamma = Ng;
34      *Nint = Ni;
35      *mean = me;
36      *sigma = s;
37      *numberOfEvents = N;
38      *efficiencyTrack = eff_tr;
39      *efficiencyStandalone = eff_sa;
40      cgz_.setParameters(m, g, Ng, Ni, me, s);
41    }
42    boost::shared_ptr<double> mass, width, Ngamma, Nint, mean, sigma;
43    boost::shared_ptr<double> numberOfEvents, efficiencyTrack, efficiencyStandalone;
44  private:
45    ConvGaussZLineShape cgz_;
46  };
47}
48
49#endif
```