CMS 3D CMS Logo

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

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

Inheritance diagram for ConeAreaFunction:
ConeAreaRootFunction

Public Member Functions

ROOT::Math::IGenFunction * Clone () const override
 
 ConeAreaFunction ()
 
 ConeAreaFunction (const ConeAreaFunction &bluePrint)
 
ConeAreaFunctionoperator= (const ConeAreaFunction &bluePrint)
 
void SetAcceptanceLimit (double etaMax)
 
void SetParameterPhi0 (double phi0)
 
void SetParameterTheta0 (double theta0)
 
 ~ConeAreaFunction () override
 

Protected 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
 

Protected Attributes

double etaMax_
 
double phi0_
 
double theta0_
 

Private Attributes

IntegrandThetaFunctionfTheta_
 
ROOT::Math::Integrator * integrator_
 

Static Private Attributes

static const unsigned int debugLevel_ = 0
 

Detailed Description

Description: low level class to compute area of signal cone corresponding to three-dimensional opening angle alpha given as function argument

Implementation: imported into CMSSW on 05/18/2007

Definition at line 33 of file ConeAreaFunction.h.

Constructor & Destructor Documentation

ConeAreaFunction::ConeAreaFunction ( )

Definition at line 40 of file ConeAreaFunction.cc.

References etaMax_, fTheta_, integrator_, phi0_, and theta0_.

Referenced by Clone().

40  : ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(2) {
41  theta0_ = 0.;
42  phi0_ = 0.;
43 
44  etaMax_ = -1;
45 
47  integrator_ = new ROOT::Math::Integrator(*fTheta_);
48 }
ROOT::Math::Integrator * integrator_
IntegrandThetaFunction * fTheta_
ConeAreaFunction::ConeAreaFunction ( const ConeAreaFunction bluePrint)

Definition at line 50 of file ConeAreaFunction.cc.

References etaMax_, fTheta_, integrator_, phi0_, and theta0_.

51  : ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>(bluePrint) {
52  theta0_ = bluePrint.theta0_;
53  phi0_ = bluePrint.phi0_;
54 
55  etaMax_ = bluePrint.etaMax_;
56 
57  fTheta_ = new IntegrandThetaFunction(*bluePrint.fTheta_);
58  integrator_ = new ROOT::Math::Integrator(*fTheta_);
59 }
ROOT::Math::Integrator * integrator_
IntegrandThetaFunction * fTheta_
ConeAreaFunction::~ConeAreaFunction ( )
override

Definition at line 61 of file ConeAreaFunction.cc.

References fTheta_, and integrator_.

61  {
62  delete fTheta_; // function gets deleted automatically by Integrator ?
63  delete integrator_;
64 }
ROOT::Math::Integrator * integrator_
IntegrandThetaFunction * fTheta_

Member Function Documentation

ROOT::Math::IGenFunction* ConeAreaFunction::Clone ( ) const
inlineoverride
double ConeAreaFunction::DoDerivative ( double  x) const
protected

Definition at line 147 of file ConeAreaFunction.cc.

Referenced by Clone().

147  {
148  //--- virtual function inherited from ROOT::Math::ParamFunction base class;
149  // not implemented, because not neccessary, but needs to be defined to make code compile...
150  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
151 
152  return 0.;
153 }
double ConeAreaFunction::DoEval ( double  x) const
overrideprotected

Definition at line 127 of file ConeAreaFunction.cc.

References etaMax_, fTheta_, integrator_, phi0_, Pi, IntegrandThetaFunction::SetParameterAlpha(), IntegrandThetaFunction::SetParameterPhi0(), IntegrandThetaFunction::SetParameterTheta0(), theta0_, muonRecoAnalyzer_cfi::thetaMax, and muonRecoAnalyzer_cfi::thetaMin.

Referenced by Clone(), ConeAreaRootFunction::DoEval(), and DoEvalPar().

127  {
128  //--- calculate area covered by cone of opening angle alpha
129  // (measured from cone axis);
130  // evaluate integral over angle theta
131  // (polar angle of point within cone)
132 
136 
137  integrator_->SetFunction(*fTheta_); // set updated parameter values in Integrator
138 
139  double thetaMin = (etaMax_ > 0) ? 2 * TMath::ATan(TMath::Exp(-etaMax_)) : 0.;
140  double thetaMax = TMath::Pi() - thetaMin;
141 
142  double integralOverTheta = integrator_->Integral(thetaMin, thetaMax);
143 
144  return integralOverTheta;
145 }
const double Pi
ROOT::Math::Integrator * integrator_
void SetParameterPhi0(double phi0)
void SetParameterAlpha(double alpha)
void SetParameterTheta0(double theta0)
IntegrandThetaFunction * fTheta_
double ConeAreaFunction::DoEvalPar ( double  x,
const double *  param 
) const
overrideprotected

Definition at line 114 of file ConeAreaFunction.cc.

References DoEval(), phi0_, and theta0_.

Referenced by Clone().

114  {
115  //--- calculate area covered by cone of opening angle alpha
116  // (measured from cone axis);
117  // evaluate integral over angle theta
118  // (polar angle of point within cone)
119  // FIXME: the const above is actually not true as it is implemented now.
120 
121  theta0_ = param[0];
122  phi0_ = param[1];
123 
124  return DoEval(x);
125 }
double DoEval(double x) const override
double ConeAreaFunction::DoParameterDerivative ( double  ,
const double *  ,
unsigned  int 
) const
overrideprotected

Definition at line 155 of file ConeAreaFunction.cc.

Referenced by Clone().

155  {
156  //--- virtual function inherited from ROOT::Math::ParamFunction base class;
157  // not implemented, because not neccessary, but needs to be defined to make code compile...
158  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
159 
160  return 0.;
161 }
void ConeAreaFunction::DoParameterGradient ( double  x,
double *  paramGradient 
) const
protected

Definition at line 163 of file ConeAreaFunction.cc.

Referenced by Clone().

163  {
164  //--- virtual function inherited from ROOT::Math::ParamFunction base class;
165  // not implemented, because not neccessary, but needs to be defined to make code compile...
166  edm::LogWarning("") << "Function not implemented yet !" << std::endl;
167 }
ConeAreaFunction & ConeAreaFunction::operator= ( const ConeAreaFunction bluePrint)

Definition at line 70 of file ConeAreaFunction.cc.

References etaMax_, fTheta_, integrator_, phi0_, and theta0_.

Referenced by ConeAreaRootFunction::operator=().

70  {
71  theta0_ = bluePrint.theta0_;
72  phi0_ = bluePrint.phi0_;
73 
74  etaMax_ = bluePrint.etaMax_;
75 
76  (*fTheta_) = (*bluePrint.fTheta_);
77  integrator_->SetFunction(*fTheta_);
78 
79  return (*this);
80 }
ROOT::Math::Integrator * integrator_
IntegrandThetaFunction * fTheta_
void ConeAreaFunction::SetAcceptanceLimit ( double  etaMax)

Definition at line 103 of file ConeAreaFunction.cc.

References ALCARECOTkAlBeamHalo_cff::etaMax, and etaMax_.

Referenced by FixedAreaIsolationCone::setAcceptanceLimit().

103  {
104  //--- check that pseudo-rapidity given as function argument is positive
105  // (assume equal acceptance for positive and negative pseudo-rapidities)
106 
107  if (etaMax > 0) {
108  etaMax_ = etaMax;
109  } else {
110  edm::LogError("") << "etaMax cannot be negative !" << std::endl;
111  }
112 }
void ConeAreaFunction::SetParameterPhi0 ( double  phi0)

Definition at line 88 of file ConeAreaFunction.cc.

References normalizedPhi(), and phi0_.

Referenced by FixedAreaIsolationCone::operator()().

88  {
89  phi0_ = normalizedPhi(phi0); // map azimuth angle into interval [-pi,+pi]
90 }
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
void ConeAreaFunction::SetParameters ( double const *  param)
overrideprotected

Definition at line 92 of file ConeAreaFunction.cc.

References debugLevel_, phi0_, and theta0_.

Referenced by Clone(), and ConeAreaRootFunction::SetParameters().

92  {
93  if (debugLevel_ > 0) {
94  edm::LogVerbatim("") << "<ConeAreaFunction::SetParameters>:" << std::endl
95  << " theta0 = " << param[0] << std::endl
96  << " phi0 = " << param[1] << std::endl;
97  }
98 
99  theta0_ = param[0];
100  phi0_ = param[1];
101 }
static const unsigned int debugLevel_
void ConeAreaFunction::SetParameterTheta0 ( double  theta0)

Definition at line 86 of file ConeAreaFunction.cc.

References theta0_.

Referenced by FixedAreaIsolationCone::operator()().

86 { theta0_ = theta0; }

Member Data Documentation

const unsigned int ConeAreaFunction::debugLevel_ = 0
staticprivate

Definition at line 74 of file ConeAreaFunction.h.

Referenced by SetParameters().

double ConeAreaFunction::etaMax_
mutableprotected

Definition at line 61 of file ConeAreaFunction.h.

Referenced by ConeAreaFunction(), DoEval(), operator=(), and SetAcceptanceLimit().

IntegrandThetaFunction* ConeAreaFunction::fTheta_
mutableprivate

Definition at line 71 of file ConeAreaFunction.h.

Referenced by ConeAreaFunction(), DoEval(), operator=(), and ~ConeAreaFunction().

ROOT::Math::Integrator* ConeAreaFunction::integrator_
mutableprivate

Definition at line 72 of file ConeAreaFunction.h.

Referenced by ConeAreaFunction(), DoEval(), operator=(), and ~ConeAreaFunction().

double ConeAreaFunction::phi0_
mutableprotected
double ConeAreaFunction::theta0_
mutableprotected