CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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

Protected Member Functions

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

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 34 of file ConeAreaFunction.h.

Constructor & Destructor Documentation

ConeAreaFunction::ConeAreaFunction ( )

Definition at line 41 of file ConeAreaFunction.cc.

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

Referenced by Clone().

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

Definition at line 53 of file ConeAreaFunction.cc.

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

54 {
55  theta0_ = bluePrint.theta0_;
56  phi0_ = bluePrint.phi0_;
57 
58  etaMax_ = bluePrint.etaMax_;
59 
60  fTheta_ = new IntegrandThetaFunction(*bluePrint.fTheta_);
61  integrator_ = new ROOT::Math::Integrator(*fTheta_);
62 }
ROOT::Math::Integrator * integrator_
IntegrandThetaFunction * fTheta_
ConeAreaFunction::~ConeAreaFunction ( )

Definition at line 64 of file ConeAreaFunction.cc.

References fTheta_, and integrator_.

65 {
66  delete fTheta_; // function gets deleted automatically by Integrator ?
67  delete integrator_;
68 }
ROOT::Math::Integrator * integrator_
IntegrandThetaFunction * fTheta_

Member Function Documentation

virtual ROOT::Math::IGenFunction* ConeAreaFunction::Clone ( ) const
inlinevirtual

Reimplemented in ConeAreaRootFunction.

Definition at line 48 of file ConeAreaFunction.h.

References ConeAreaFunction().

48 { return new ConeAreaFunction(*this); }
double ConeAreaFunction::DoDerivative ( double  x) const
protected

Definition at line 161 of file ConeAreaFunction.cc.

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 }
double ConeAreaFunction::DoEval ( double  x) const
protected

Definition at line 140 of file ConeAreaFunction.cc.

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

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

141 {
142 //--- calculate area covered by cone of opening angle alpha
143 // (measured from cone axis);
144 // evaluate integral over angle theta
145 // (polar angle of point within cone)
146 
150 
151  integrator_->SetFunction(*fTheta_); // set updated parameter values in Integrator
152 
153  double thetaMin = (etaMax_ > 0) ? 2*TMath::ATan(TMath::Exp(-etaMax_)) : 0.;
154  double thetaMax = TMath::Pi() - thetaMin;
155 
156  double integralOverTheta = integrator_->Integral(thetaMin, thetaMax);
157 
158  return integralOverTheta;
159 }
const double Pi
ROOT::Math::Integrator * integrator_
void SetParameterPhi0(double phi0)
void SetParameterAlpha(double alpha)
void SetParameterTheta0(double theta0)
IntegrandThetaFunction * fTheta_
x
Definition: VDTMath.h:216
double ConeAreaFunction::DoEvalPar ( double  x,
const double *  param 
) const
protectedvirtual

Definition at line 125 of file ConeAreaFunction.cc.

References DoEval(), phi0_, and theta0_.

126 {
127 //--- calculate area covered by cone of opening angle alpha
128 // (measured from cone axis);
129 // evaluate integral over angle theta
130 // (polar angle of point within cone)
131 // FIXME: the const above is actually not true as it is implemented now.
132 
133  theta0_ = param[0];
134  phi0_ = param[1];
135 
136  return DoEval(x);
137 }
double DoEval(double x) const
x
Definition: VDTMath.h:216
double ConeAreaFunction::DoParameterDerivative ( double  ,
const double *  ,
unsigned  int 
) const
protectedvirtual

Definition at line 170 of file ConeAreaFunction.cc.

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 }
void ConeAreaFunction::DoParameterGradient ( double  x,
double *  paramGradient 
) const
protected

Definition at line 181 of file ConeAreaFunction.cc.

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 }
ConeAreaFunction & ConeAreaFunction::operator= ( const ConeAreaFunction bluePrint)

Definition at line 74 of file ConeAreaFunction.cc.

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

Referenced by ConeAreaRootFunction::operator=().

75 {
76  theta0_ = bluePrint.theta0_;
77  phi0_ = bluePrint.phi0_;
78 
79  etaMax_ = bluePrint.etaMax_;
80 
81  (*fTheta_) = (*bluePrint.fTheta_);
82  integrator_->SetFunction(*fTheta_);
83 
84  return (*this);
85 }
ROOT::Math::Integrator * integrator_
IntegrandThetaFunction * fTheta_
void ConeAreaFunction::SetAcceptanceLimit ( double  etaMax)

Definition at line 113 of file ConeAreaFunction.cc.

References jptDQMConfig_cff::etaMax, and etaMax_.

Referenced by FixedAreaIsolationCone::setAcceptanceLimit().

114 {
115 //--- check that pseudo-rapidity given as function argument is positive
116 // (assume equal acceptance for positive and negative pseudo-rapidities)
117 
118  if ( etaMax > 0 ) {
119  etaMax_ = etaMax;
120  } else {
121  edm::LogError("") << "etaMax cannot be negative !" << std::endl;
122  }
123 }
void ConeAreaFunction::SetParameterPhi0 ( double  phi0)

Definition at line 96 of file ConeAreaFunction.cc.

References normalizedPhi(), and phi0_.

Referenced by FixedAreaIsolationCone::operator()().

97 {
98  phi0_ = normalizedPhi(phi0); // map azimuth angle into interval [-pi,+pi]
99 }
double normalizedPhi(double phi)
Definition: normalizedPhi.cc:5
void ConeAreaFunction::SetParameters ( double *  param)
protected

Definition at line 101 of file ConeAreaFunction.cc.

References debugLevel_, phi0_, and theta0_.

Referenced by ConeAreaRootFunction::SetParameters().

102 {
103  if ( debugLevel_ > 0 ) {
104  edm::LogVerbatim("") << "<ConeAreaFunction::SetParameters>:" << std::endl
105  << " theta0 = " << param[0] << std::endl
106  << " phi0 = " << param[1] << std::endl;
107  }
108 
109  theta0_ = param[0];
110  phi0_ = param[1];
111 }
static const unsigned int debugLevel_
void ConeAreaFunction::SetParameterTheta0 ( double  theta0)

Definition at line 91 of file ConeAreaFunction.cc.

References theta0_.

Referenced by FixedAreaIsolationCone::operator()().

92 {
93  theta0_ = theta0;
94 }

Member Data Documentation

const unsigned int ConeAreaFunction::debugLevel_ = 0
staticprivate

Definition at line 75 of file ConeAreaFunction.h.

Referenced by SetParameters().

double ConeAreaFunction::etaMax_
mutableprotected

Definition at line 62 of file ConeAreaFunction.h.

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

IntegrandThetaFunction* ConeAreaFunction::fTheta_
mutableprivate

Definition at line 72 of file ConeAreaFunction.h.

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

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

Definition at line 73 of file ConeAreaFunction.h.

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

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