CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ZMuMuScaledFunction.h
Go to the documentation of this file.
1 #ifndef ElectroWeakAnalysis_ZMuMu_ZMuMuScaledFunction_h
2 #define ElectroWeakAnalysis_ZMuMu_ZMuMuScaledFunction_h
5 #include <boost/shared_ptr.hpp>
6 
7 namespace function {
9  public:
10  static const unsigned int arguments = 1;
12  binScaleFactor(bin), zmm_(zmm) {}
13  ZMuMuScaledFunction(const Parameter & m, const Parameter & g,
14  const Parameter & Ng, const Parameter & Ni,
15  const Parameter & me, const Parameter & s,
16  const Parameter & N,
17  const Parameter & eff_tr, const Parameter & eff_sa,
18  int bin):
19  mass(m.ptr()), width(g.ptr()),
20  Ngamma(Ng.ptr()), Nint(Ni.ptr()),
21  mean(me.ptr()), sigma(s.ptr()),
22  numberOfEvents(N.ptr()),
23  efficiencyTrack(eff_tr.ptr()), efficiencyStandalone(eff_sa.ptr()),
24  binScaleFactor(bin),
25  zmm_(m, g, Ng, Ni, me, s, N, eff_tr, eff_sa) {}
26  ZMuMuScaledFunction(boost::shared_ptr<double> m, boost::shared_ptr<double> g,
27  boost::shared_ptr<double> Ng, boost::shared_ptr<double> Ni,
28  boost::shared_ptr<double> me, boost::shared_ptr<double> s,
29  boost::shared_ptr<double> N,
30  boost::shared_ptr<double> eff_tr, boost::shared_ptr<double> eff_sa,
31  int bin):
32  mass(m), width(g),
33  Ngamma(Ng), Nint(Ni),
34  mean(me), sigma(s),
35  numberOfEvents(N),
36  efficiencyTrack(eff_tr), efficiencyStandalone(eff_sa),
37  binScaleFactor(bin),
38  zmm_(m, g, Ng, Ni, me, s, N, eff_tr, eff_sa) {}
39  double operator()(double x) const {
40  return binScaleFactor * zmm_(x);
41  }
42  boost::shared_ptr<double> mass, width, Ngamma, Nint, mean, sigma;
45  private:
47  };
48 }
49 
50 #endif
51 
52 /*template<typename F, int arguments = F::arguments, int parameters = F::parameters>
53 class ScaleFactor{
54  ScaleFactor(const int);
55  void setParameters(const double *);
56  double operator()(const double *) const;
57  private:
58  int bin_;
59  F f_;
60 };
61 
62 template <typename F>
63 double scaleFunction(const double * x, const double * par, const int bin) {
64  static ScaleFunction<F> f(bin);
65  f.setParameters(par);
66  return f(x);
67 }
68 
69 template<typename F, int arguments, int parameters>
70 ScaleFunction<F, arguments, parameters>::ScaleFunction(const double bin) :
71  bin_(bin) {
72 }
73 
74 template<typename F, int arguments>
75 void ScaleFactor<F, arguments, 1>::setParameters(const double * par) {
76  f_.setParameters(par[0]);
77 }
78 
79 template<typename F, int arguments>
80 void ScaleFactor<F, arguments, 2>::setParameters(const double * par) {
81  f_.setParameters(par[0], par[1]);
82 }
83 
84 template<typename F, int arguments>
85 void ScaleFactor<F, arguments, 3>::setParameters(const double * par) {
86  f_.setParameters(par[0], par[1], par[2]);
87 }
88 
89 template<typename F, int arguments>
90 void ScaleFactor<F, arguments, 4>::setParameters(const double * par) {
91  f_.setParameters(par[0], par[1], par[2], par[3]);
92 }
93 
94 template<typename F, int arguments>
95 void ScaleFactor<F, arguments, 5>::setParameters(const double * par) {
96  f_.setParameters(par[0], par[1], par[2], par[3], par[4]);
97 }
98 
99 template<typename F, int arguments>
100 void ScaleFactor<F, arguments, 6>::setParameters(const double * par) {
101  f_.setParameters(par[0], par[1], par[2], par[3], par[4], par[5]);
102 }
103 
104 template<typename F, int arguments>
105 void ScaleFactor<F, arguments, 7>::setParameters(const double * par) {
106  f_.setParameters(par[0], par[1], par[2], par[3], par[4], par[5], par[6]);
107 }
108 
109 template<typename F, int arguments>
110 void ScaleFactor<F, arguments, 8>::setParameters(const double * par) {
111  f_.setParameters(par[0], par[1], par[2], par[3], par[4], par[5], par[6], par[7]);
112 }
113 
114 template<typename F, int arguments>
115 void ScaleFactor<F, arguments, 9>::setParameters(const double * par) {
116  f_.setParameters(par[0], par[1], par[2], par[3], par[4], par[5], par[6], par[7], par[8]);
117 }
118 
119 template<typename F, int arguments>
120 void ScaleFunction<F, arguments, 10>::setParameters(const double * par) {
121  f_.setParameters(par[0], par[1], par[2], par[3], par[4], par[5], par[6], par[7], par[8], par[9]);
122 }
123 
124 template<typename F, int arguments>
125 void ScaleFactor<F, arguments, 11>::setParameters(const double * par) {
126  f_.setParameters(par[0], par[1], par[2], par[3], par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
127 }
128 
129 template<typename F, int parameters>
130 double ScaleFactor<F, 1, parameters>::operator()(const double * x) const{
131  return f_(x[0]);
132 }
133 
134 template<typename F, int parameters>
135 double ScaleFactor<F, 2, parameters>::operator()(const double * x) const{
136  return f_(x[0], x[1]);
137 }
138 */
Definition: vlib.h:257
boost::shared_ptr< double > efficiencyTrack
boost::shared_ptr< double > mass
boost::shared_ptr< double > efficiencyStandalone
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
boost::shared_ptr< double > Nint
double operator()(double x) const
boost::shared_ptr< double > numberOfEvents
ZMuMuScaledFunction(const ZMuMuFunction &zmm, int bin)
static const unsigned int arguments
boost::shared_ptr< double > mean
#define N
Definition: blowfish.cc:9
boost::shared_ptr< double > width
boost::shared_ptr< double > sigma
boost::shared_ptr< double > Ngamma
ZMuMuScaledFunction(boost::shared_ptr< double > m, boost::shared_ptr< double > g, boost::shared_ptr< double > Ng, boost::shared_ptr< double > Ni, boost::shared_ptr< double > me, boost::shared_ptr< double > s, boost::shared_ptr< double > N, boost::shared_ptr< double > eff_tr, boost::shared_ptr< double > eff_sa, int bin)
Definition: DDAxes.h:10
ZMuMuScaledFunction(const Parameter &m, const Parameter &g, const Parameter &Ng, const Parameter &Ni, const Parameter &me, const Parameter &s, const Parameter &N, const Parameter &eff_tr, const Parameter &eff_sa, int bin)