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 //
20 //
21 
22 // system include files
23 #include <iostream>
24 #include <iomanip>
25 #include <vector>
26 
27 // ROOT include files
28 #include <TMath.h>
29 
30 // CMSSW include files
32 
35 
36 //
37 // constructors and destructor
38 //
39 
41  : ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(3)
42 {
43  theta0_ = 0.;
44  phi0_ = 0.;
45  alpha_ = 0.;
46 
48 }
49 
51 {
52  theta0_ = bluePrint.theta0_;
53  phi0_ = bluePrint.phi0_;
54  alpha_ = bluePrint.alpha_;
55 
56  fPhi_ = new IntegralOverPhiFunction(*bluePrint.fPhi_);
57 }
58 
60 {
61  delete fPhi_;
62 }
63 
64 //
65 // assignment operator
66 //
67 
69 {
70  theta0_ = bluePrint.theta0_;
71  phi0_ = bluePrint.phi0_;
72  alpha_ = bluePrint.alpha_;
73 
74  (*fPhi_) = (*bluePrint.fPhi_);
75 
76  return (*this);
77 }
78 
79 //
80 // member functions
81 //
82 
84 {
85  theta0_ = theta0;
86 }
87 
89 {
90  phi0_ = normalizedPhi(phi0); // map azimuth angle into interval [-pi,+pi]
91 }
92 
94 {
95  alpha_ = alpha;
96 }
97 
99 {
100  theta0_ = param[0];
101  phi0_ = param[1];
102  alpha_ = param[2];
103 }
104 
105 double IntegrandThetaFunction::DoEvalPar(double x, const double* param) const //FIXME: constness
106 {
107  theta0_ = param[0];
108  phi0_ = param[1];
109  alpha_ = param[2];
110 
111  return DoEval(x);
112 }
113 
114 double IntegrandThetaFunction::DoEval(double x) const
115 {
116 //--- return zero if theta either close to zero or close to Pi
117 // (numerical expressions might become "NaN"s)
118  const double epsilon = 1.e-3;
119  if ( x < epsilon || x > (TMath::Pi() - epsilon) ) return 0.;
120 
121 //--- calculate trigonometric expressions
122 // (dependend on angle theta;
123 // polar angle of point within cone)
124  double sinTheta = TMath::Sin(x);
125  double cscTheta = 1./sinTheta;
126 
127  double detJacobi = -cscTheta; // partial derrivative dEta/dTheta (for constant particle density in tau id. isolation cone)
128  //double detJacobi = 1.; // ordinary solid angle (FOR TESTING ONLY)
129 
130 //--- evaluate integral over angle phi
131 // (azimuth angle of point within cone)
135 
136  double integralOverPhi = (*fPhi_)(x);
137 
138  if ( debugLevel_ > 0 ) {
139  edm::LogVerbatim("") << "integralOverPhi = " << integralOverPhi << std::endl
140  << " theta0 = " << theta0_ << std::endl
141  << " phi0 = " << phi0_ << std::endl
142  << " alpha = " << alpha_ << std::endl
143  << " theta = " << x << std::endl
144  << std::endl;
145  }
146 
147 //--- integrand for integration over theta
148 // equals
149 // |dEta/dTheta| * integral over phi * sin(theta)
150 //
151 // (o the factor dEta/dTheta represents the particle density as function of theta,
152 // assuming that the particle density is flat in eta;
153 // o the factor sin(theta) originates from the solid angle surface element
154 // expressed in spherical polar coordinates)
155 //
156  //return TMath::Abs(detJacobi)*integralOverPhi*sinTheta;
157  return TMath::Abs(detJacobi)*integralOverPhi;
158 }
159 
161 {
162 //--- virtual function inherited from ROOT::Math::ParamFunction base class;
163 // not implemented, because not neccessary, but needs to be defined to make code compile...
164  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
165 
166  return 0.;
167 }
168 
169 double IntegrandThetaFunction::DoParameterDerivative(double, const double*, unsigned int) const
170 {
171 //--- virtual function inherited from ROOT::Math::ParamFunction base class;
172 // not implemented, because not neccessary, but needs to be defined to make code compile...
173  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
174 
175  return 0.;
176 }
177 
178 
179 
180 void IntegrandThetaFunction::DoParameterGradient(double x, double* paramGradient) const
181 {
182 //--- virtual function inherited from ROOT::Math::ParamFunction base class;
183 // not implemented, because not neccessary, but needs to be defined to make code compile...
184  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
185 }
186 
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
Definition: DDAxes.h:10
double normalizedPhi(double phi)
Definition: normalizedPhi.cc:5
void DoParameterGradient(double x, double *paramGradient) const
void SetParameterTheta0(double theta0)