CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IntegrandThetaFunction.cc
Go to the documentation of this file.
2 
3 // -*- C++ -*-
4 //
5 // Package: IntegrandThetaFunction
6 // Class: IntegrandThetaFunction
7 //
16 //
17 // Original Author: Christian Veelken, UC Davis
18 // Created: Thu Nov 2 13:47:40 CST 2006
19 // $Id: IntegrandThetaFunction.cc,v 1.3 2009/01/14 10:53:15 hegner Exp $
20 //
21 //
22 
23 // system include files
24 #include <iostream>
25 #include <iomanip>
26 #include <vector>
27 
28 // ROOT include files
29 #include <TMath.h>
30 
31 // CMSSW include files
33 
36 
37 //
38 // constructors and destructor
39 //
40 
42  : ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(3)
43 {
44  theta0_ = 0.;
45  phi0_ = 0.;
46  alpha_ = 0.;
47 
49 }
50 
52 {
53  theta0_ = bluePrint.theta0_;
54  phi0_ = bluePrint.phi0_;
55  alpha_ = bluePrint.alpha_;
56 
57  fPhi_ = new IntegralOverPhiFunction(*bluePrint.fPhi_);
58 }
59 
61 {
62  delete fPhi_;
63 }
64 
65 //
66 // assignment operator
67 //
68 
70 {
71  theta0_ = bluePrint.theta0_;
72  phi0_ = bluePrint.phi0_;
73  alpha_ = bluePrint.alpha_;
74 
75  (*fPhi_) = (*bluePrint.fPhi_);
76 
77  return (*this);
78 }
79 
80 //
81 // member functions
82 //
83 
85 {
86  theta0_ = theta0;
87 }
88 
90 {
91  phi0_ = normalizedPhi(phi0); // map azimuth angle into interval [-pi,+pi]
92 }
93 
95 {
96  alpha_ = alpha;
97 }
98 
100 {
101  theta0_ = param[0];
102  phi0_ = param[1];
103  alpha_ = param[2];
104 }
105 
106 double IntegrandThetaFunction::DoEvalPar(double x, const double* param) const //FIXME: constness
107 {
108  theta0_ = param[0];
109  phi0_ = param[1];
110  alpha_ = param[2];
111 
112  return DoEval(x);
113 }
114 
115 double IntegrandThetaFunction::DoEval(double x) const
116 {
117 //--- return zero if theta either close to zero or close to Pi
118 // (numerical expressions might become "NaN"s)
119  const double epsilon = 1.e-3;
120  if ( x < epsilon || x > (TMath::Pi() - epsilon) ) return 0.;
121 
122 //--- calculate trigonometric expressions
123 // (dependend on angle theta;
124 // polar angle of point within cone)
125  double sinTheta = TMath::Sin(x);
126  double cscTheta = 1./sinTheta;
127 
128  double detJacobi = -cscTheta; // partial derrivative dEta/dTheta (for constant particle density in tau id. isolation cone)
129  //double detJacobi = 1.; // ordinary solid angle (FOR TESTING ONLY)
130 
131 //--- evaluate integral over angle phi
132 // (azimuth angle of point within cone)
136 
137  double integralOverPhi = (*fPhi_)(x);
138 
139  if ( debugLevel_ > 0 ) {
140  edm::LogVerbatim("") << "integralOverPhi = " << integralOverPhi << std::endl
141  << " theta0 = " << theta0_ << std::endl
142  << " phi0 = " << phi0_ << std::endl
143  << " alpha = " << alpha_ << std::endl
144  << " theta = " << x << std::endl
145  << std::endl;
146  }
147 
148 //--- integrand for integration over theta
149 // equals
150 // |dEta/dTheta| * integral over phi * sin(theta)
151 //
152 // (o the factor dEta/dTheta represents the particle density as function of theta,
153 // assuming that the particle density is flat in eta;
154 // o the factor sin(theta) originates from the solid angle surface element
155 // expressed in spherical polar coordinates)
156 //
157  //return TMath::Abs(detJacobi)*integralOverPhi*sinTheta;
158  return TMath::Abs(detJacobi)*integralOverPhi;
159 }
160 
162 {
163 //--- virtual function inherited from ROOT::Math::ParamFunction base class;
164 // not implemented, because not neccessary, but needs to be defined to make code compile...
165  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
166 
167  return 0.;
168 }
169 
170 double IntegrandThetaFunction::DoParameterDerivative(double, const double*, unsigned int) const
171 {
172 //--- virtual function inherited from ROOT::Math::ParamFunction base class;
173 // not implemented, because not neccessary, but needs to be defined to make code compile...
174  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
175 
176  return 0.;
177 }
178 
179 
180 
181 void IntegrandThetaFunction::DoParameterGradient(double x, double* paramGradient) const
182 {
183 //--- virtual function inherited from ROOT::Math::ParamFunction base class;
184 // not implemented, because not neccessary, but needs to be defined to make code compile...
185  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
186 }
187 
const double Pi
IntegralOverPhiFunction * fPhi_
float alpha
Definition: AMPTWrapper.h:95
virtual double DoEvalPar(double, const double *) const
static const unsigned int debugLevel_
IntegrandThetaFunction & operator=(const IntegrandThetaFunction &bluePrint)
double DoDerivative(double x) const
void SetParameterAlpha(double alpha)
void SetParameterPhi0(double phi0)
void SetParameterAlpha(double alpha)
double DoEval(double x) const
void SetParameterTheta0(double theta0)
virtual double DoParameterDerivative(double, const double *, unsigned int) const
void SetParameters(double *param)
const double epsilon
x
Definition: VDTMath.h:216
double normalizedPhi(double phi)
Definition: normalizedPhi.cc:5
void DoParameterGradient(double x, double *paramGradient) const
void SetParameterTheta0(double theta0)