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 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().

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

Definition at line 52 of file ConeAreaFunction.cc.

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

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

Definition at line 63 of file ConeAreaFunction.cc.

References fTheta_, and integrator_.

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

Member Function Documentation

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

Reimplemented in ConeAreaRootFunction.

Definition at line 47 of file ConeAreaFunction.h.

References ConeAreaFunction().

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

Definition at line 160 of file ConeAreaFunction.cc.

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

Definition at line 139 of file ConeAreaFunction.cc.

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

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

140 {
141 //--- calculate area covered by cone of opening angle alpha
142 // (measured from cone axis);
143 // evaluate integral over angle theta
144 // (polar angle of point within cone)
145 
149 
150  integrator_->SetFunction(*fTheta_); // set updated parameter values in Integrator
151 
152  double thetaMin = (etaMax_ > 0) ? 2*TMath::ATan(TMath::Exp(-etaMax_)) : 0.;
153  double thetaMax = TMath::Pi() - thetaMin;
154 
155  double integralOverTheta = integrator_->Integral(thetaMin, thetaMax);
156 
157  return integralOverTheta;
158 }
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
protectedvirtual

Definition at line 124 of file ConeAreaFunction.cc.

References DoEval(), phi0_, and theta0_.

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

Definition at line 169 of file ConeAreaFunction.cc.

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

Definition at line 180 of file ConeAreaFunction.cc.

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

Definition at line 73 of file ConeAreaFunction.cc.

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

Referenced by ConeAreaRootFunction::operator=().

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

Definition at line 112 of file ConeAreaFunction.cc.

References HLT_25ns14e33_v1_cff::etaMax, and etaMax_.

Referenced by FixedAreaIsolationCone::setAcceptanceLimit().

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

Definition at line 95 of file ConeAreaFunction.cc.

References normalizedPhi(), and phi0_.

Referenced by FixedAreaIsolationCone::operator()().

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

Definition at line 100 of file ConeAreaFunction.cc.

References debugLevel_, phi0_, and theta0_.

Referenced by ConeAreaRootFunction::SetParameters().

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

Definition at line 90 of file ConeAreaFunction.cc.

References theta0_.

Referenced by FixedAreaIsolationCone::operator()().

91 {
92  theta0_ = theta0;
93 }

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