CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
IntegrandThetaFunction Class Reference

#include <PhysicsTools/IsolationUtils/src/IntegrandThetaFunction.cc>

Inheritance diagram for IntegrandThetaFunction:

Public Member Functions

ROOT::Math::IGenFunction * Clone () const override
 
 IntegrandThetaFunction ()
 
 IntegrandThetaFunction (const IntegrandThetaFunction &bluePrint)
 
IntegrandThetaFunctionoperator= (const IntegrandThetaFunction &bluePrint)
 
void SetParameterAlpha (double alpha)
 
void SetParameterPhi0 (double phi0)
 
void SetParameterTheta0 (double theta0)
 
 ~IntegrandThetaFunction () override
 

Private Member Functions

double DoDerivative (double x) const
 
double DoEval (double x) const override
 
double DoEvalPar (double, const double *) const override
 
double DoParameterDerivative (double, const double *, unsigned int) const override
 
void DoParameterGradient (double x, double *paramGradient) const
 
void SetParameters (double const *param) override
 

Private Attributes

double alpha_
 
IntegralOverPhiFunctionfPhi_
 
double phi0_
 
double theta0_
 

Static Private Attributes

static const unsigned int debugLevel_ = 0
 

Detailed Description

Description: auxialiary class for fixed area isolation cone computation (this class performs the integration over the polar angle)

Implementation: imported into CMSSW on 05/18/2007

Definition at line 33 of file IntegrandThetaFunction.h.

Constructor & Destructor Documentation

◆ IntegrandThetaFunction() [1/2]

IntegrandThetaFunction::IntegrandThetaFunction ( )

Definition at line 40 of file IntegrandThetaFunction.cc.

References alpha_, fPhi_, phi0_, and theta0_.

Referenced by Clone().

41  : ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(3) {
42  theta0_ = 0.;
43  phi0_ = 0.;
44  alpha_ = 0.;
45 
47 }
IntegralOverPhiFunction * fPhi_

◆ IntegrandThetaFunction() [2/2]

IntegrandThetaFunction::IntegrandThetaFunction ( const IntegrandThetaFunction bluePrint)

Definition at line 49 of file IntegrandThetaFunction.cc.

References alpha_, fPhi_, phi0_, and theta0_.

50  : ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(bluePrint) {
51  theta0_ = bluePrint.theta0_;
52  phi0_ = bluePrint.phi0_;
53  alpha_ = bluePrint.alpha_;
54 
55  fPhi_ = new IntegralOverPhiFunction(*bluePrint.fPhi_);
56 }
IntegralOverPhiFunction * fPhi_

◆ ~IntegrandThetaFunction()

IntegrandThetaFunction::~IntegrandThetaFunction ( )
override

Definition at line 58 of file IntegrandThetaFunction.cc.

References fPhi_.

58 { delete fPhi_; }
IntegralOverPhiFunction * fPhi_

Member Function Documentation

◆ Clone()

ROOT::Math::IGenFunction* IntegrandThetaFunction::Clone ( ) const
inlineoverride

Definition at line 45 of file IntegrandThetaFunction.h.

References IntegrandThetaFunction().

45 { return new IntegrandThetaFunction(*this); }

◆ DoDerivative()

double IntegrandThetaFunction::DoDerivative ( double  x) const
private

Definition at line 148 of file IntegrandThetaFunction.cc.

148  {
149  //--- virtual function inherited from ROOT::Math::ParamFunction base class;
150  // not implemented, because not neccessary, but needs to be defined to make code compile...
151  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
152 
153  return 0.;
154 }
Log< level::Warning, false > LogWarning

◆ DoEval()

double IntegrandThetaFunction::DoEval ( double  x) const
overrideprivate

Definition at line 101 of file IntegrandThetaFunction.cc.

References alpha_, debugLevel_, geometryDiff::epsilon, fPhi_, phi0_, Pi, IntegralOverPhiFunction::SetParameterAlpha(), IntegralOverPhiFunction::SetParameterPhi0(), IntegralOverPhiFunction::SetParameterTheta0(), theta0_, and x.

101  {
102  //--- return zero if theta either close to zero or close to Pi
103  // (numerical expressions might become "NaN"s)
104  const double epsilon = 1.e-3;
105  if (x < epsilon || x > (TMath::Pi() - epsilon))
106  return 0.;
107 
108  //--- calculate trigonometric expressions
109  // (dependend on angle theta;
110  // polar angle of point within cone)
111  double sinTheta = TMath::Sin(x);
112  double cscTheta = 1. / sinTheta;
113 
114  double detJacobi =
115  -cscTheta; // partial derrivative dEta/dTheta (for constant particle density in tau id. isolation cone)
116  //double detJacobi = 1.; // ordinary solid angle (FOR TESTING ONLY)
117 
118  //--- evaluate integral over angle phi
119  // (azimuth angle of point within cone)
123 
124  double integralOverPhi = (*fPhi_)(x);
125 
126  if (debugLevel_ > 0) {
127  edm::LogVerbatim("") << "integralOverPhi = " << integralOverPhi << std::endl
128  << " theta0 = " << theta0_ << std::endl
129  << " phi0 = " << phi0_ << std::endl
130  << " alpha = " << alpha_ << std::endl
131  << " theta = " << x << std::endl
132  << std::endl;
133  }
134 
135  //--- integrand for integration over theta
136  // equals
137  // |dEta/dTheta| * integral over phi * sin(theta)
138  //
139  // (o the factor dEta/dTheta represents the particle density as function of theta,
140  // assuming that the particle density is flat in eta;
141  // o the factor sin(theta) originates from the solid angle surface element
142  // expressed in spherical polar coordinates)
143  //
144  //return TMath::Abs(detJacobi)*integralOverPhi*sinTheta;
145  return TMath::Abs(detJacobi) * integralOverPhi;
146 }
const double Pi
Log< level::Info, true > LogVerbatim
IntegralOverPhiFunction * fPhi_
static const unsigned int debugLevel_
void SetParameterAlpha(double alpha)
void SetParameterTheta0(double theta0)

◆ DoEvalPar()

double IntegrandThetaFunction::DoEvalPar ( double  x,
const double *  param 
) const
overrideprivate

Definition at line 92 of file IntegrandThetaFunction.cc.

References x.

93 {
94  theta0_ = param[0];
95  phi0_ = param[1];
96  alpha_ = param[2];
97 
98  return DoEval(x);
99 }
double DoEval(double x) const override

◆ DoParameterDerivative()

double IntegrandThetaFunction::DoParameterDerivative ( double  ,
const double *  ,
unsigned  int 
) const
overrideprivate

Definition at line 156 of file IntegrandThetaFunction.cc.

156  {
157  //--- virtual function inherited from ROOT::Math::ParamFunction base class;
158  // not implemented, because not neccessary, but needs to be defined to make code compile...
159  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
160 
161  return 0.;
162 }
Log< level::Warning, false > LogWarning

◆ DoParameterGradient()

void IntegrandThetaFunction::DoParameterGradient ( double  x,
double *  paramGradient 
) const
private

Definition at line 164 of file IntegrandThetaFunction.cc.

164  {
165  //--- virtual function inherited from ROOT::Math::ParamFunction base class;
166  // not implemented, because not neccessary, but needs to be defined to make code compile...
167  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
168 }
Log< level::Warning, false > LogWarning

◆ operator=()

IntegrandThetaFunction & IntegrandThetaFunction::operator= ( const IntegrandThetaFunction bluePrint)

Definition at line 64 of file IntegrandThetaFunction.cc.

References alpha_, fPhi_, phi0_, and theta0_.

64  {
65  theta0_ = bluePrint.theta0_;
66  phi0_ = bluePrint.phi0_;
67  alpha_ = bluePrint.alpha_;
68 
69  (*fPhi_) = (*bluePrint.fPhi_);
70 
71  return (*this);
72 }
IntegralOverPhiFunction * fPhi_

◆ SetParameterAlpha()

void IntegrandThetaFunction::SetParameterAlpha ( double  alpha)

◆ SetParameterPhi0()

void IntegrandThetaFunction::SetParameterPhi0 ( double  phi0)

Definition at line 80 of file IntegrandThetaFunction.cc.

References normalizedPhi(), and phi0_.

Referenced by ConeAreaFunction::DoEval().

80  {
81  phi0_ = normalizedPhi(phi0); // map azimuth angle into interval [-pi,+pi]
82 }
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8

◆ SetParameters()

void IntegrandThetaFunction::SetParameters ( double const *  param)
overrideprivate

Definition at line 86 of file IntegrandThetaFunction.cc.

References alpha_, phi0_, and theta0_.

86  {
87  theta0_ = param[0];
88  phi0_ = param[1];
89  alpha_ = param[2];
90 }

◆ SetParameterTheta0()

void IntegrandThetaFunction::SetParameterTheta0 ( double  theta0)

Definition at line 78 of file IntegrandThetaFunction.cc.

References theta0_.

Referenced by ConeAreaFunction::DoEval().

78 { theta0_ = theta0; }

Member Data Documentation

◆ alpha_

double IntegrandThetaFunction::alpha_
mutableprivate

◆ debugLevel_

const unsigned int IntegrandThetaFunction::debugLevel_ = 0
staticprivate

Definition at line 62 of file IntegrandThetaFunction.h.

Referenced by DoEval().

◆ fPhi_

IntegralOverPhiFunction* IntegrandThetaFunction::fPhi_
mutableprivate

◆ phi0_

double IntegrandThetaFunction::phi0_
mutableprivate

◆ theta0_

double IntegrandThetaFunction::theta0_
mutableprivate