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() [1/2]

ConeAreaFunction::ConeAreaFunction ( )

Definition at line 40 of file ConeAreaFunction.cc.

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 }

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

Referenced by Clone().

◆ ConeAreaFunction() [2/2]

ConeAreaFunction::ConeAreaFunction ( const ConeAreaFunction bluePrint)

Definition at line 50 of file ConeAreaFunction.cc.

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 }

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

◆ ~ConeAreaFunction()

ConeAreaFunction::~ConeAreaFunction ( )
override

Definition at line 61 of file ConeAreaFunction.cc.

61  {
62  delete fTheta_; // function gets deleted automatically by Integrator ?
63  delete integrator_;
64 }

References fTheta_, and integrator_.

Member Function Documentation

◆ Clone()

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

Definition at line 46 of file ConeAreaFunction.h.

46 { return new ConeAreaFunction(*this); }

References ConeAreaFunction().

◆ DoDerivative()

double ConeAreaFunction::DoDerivative ( double  x) const
protected

Definition at line 147 of file ConeAreaFunction.cc.

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 }

◆ DoEval()

double ConeAreaFunction::DoEval ( double  x) const
overrideprotected

Definition at line 127 of file ConeAreaFunction.cc.

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 }

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

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

◆ DoEvalPar()

double ConeAreaFunction::DoEvalPar ( double  x,
const double *  param 
) const
overrideprotected

Definition at line 114 of file ConeAreaFunction.cc.

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 }

References DoEval(), phi0_, theta0_, and x.

◆ DoParameterDerivative()

double ConeAreaFunction::DoParameterDerivative ( double  ,
const double *  ,
unsigned int   
) const
overrideprotected

Definition at line 155 of file ConeAreaFunction.cc.

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 }

◆ DoParameterGradient()

void ConeAreaFunction::DoParameterGradient ( double  x,
double *  paramGradient 
) const
protected

Definition at line 163 of file ConeAreaFunction.cc.

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 }

◆ operator=()

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

Definition at line 70 of file ConeAreaFunction.cc.

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 }

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

Referenced by ConeAreaRootFunction::operator=().

◆ SetAcceptanceLimit()

void ConeAreaFunction::SetAcceptanceLimit ( double  etaMax)

Definition at line 103 of file ConeAreaFunction.cc.

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 }

References ALCARECOTkAlBeamHalo_cff::etaMax, and etaMax_.

Referenced by FixedAreaIsolationCone::setAcceptanceLimit().

◆ SetParameterPhi0()

void ConeAreaFunction::SetParameterPhi0 ( double  phi0)

Definition at line 88 of file ConeAreaFunction.cc.

88  {
89  phi0_ = normalizedPhi(phi0); // map azimuth angle into interval [-pi,+pi]
90 }

References normalizedPhi(), and phi0_.

Referenced by FixedAreaIsolationCone::operator()().

◆ SetParameters()

void ConeAreaFunction::SetParameters ( double const *  param)
overrideprotected

Definition at line 92 of file ConeAreaFunction.cc.

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 }

References debugLevel_, phi0_, and theta0_.

Referenced by ConeAreaRootFunction::SetParameters().

◆ SetParameterTheta0()

void ConeAreaFunction::SetParameterTheta0 ( double  theta0)

Definition at line 86 of file ConeAreaFunction.cc.

86 { theta0_ = theta0; }

References theta0_.

Referenced by FixedAreaIsolationCone::operator()().

Member Data Documentation

◆ debugLevel_

const unsigned int ConeAreaFunction::debugLevel_ = 0
staticprivate

Definition at line 74 of file ConeAreaFunction.h.

Referenced by SetParameters().

◆ etaMax_

double ConeAreaFunction::etaMax_
mutableprotected

Definition at line 61 of file ConeAreaFunction.h.

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

◆ fTheta_

IntegrandThetaFunction* ConeAreaFunction::fTheta_
mutableprivate

Definition at line 71 of file ConeAreaFunction.h.

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

◆ integrator_

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

Definition at line 72 of file ConeAreaFunction.h.

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

◆ phi0_

double ConeAreaFunction::phi0_
mutableprotected

◆ theta0_

double ConeAreaFunction::theta0_
mutableprotected
IntegrandThetaFunction::SetParameterAlpha
void SetParameterAlpha(double alpha)
Definition: IntegrandThetaFunction.cc:84
IntegrandThetaFunction::SetParameterTheta0
void SetParameterTheta0(double theta0)
Definition: IntegrandThetaFunction.cc:78
IntegrandThetaFunction::SetParameterPhi0
void SetParameterPhi0(double phi0)
Definition: IntegrandThetaFunction.cc:80
DDAxes::x
ConeAreaFunction::theta0_
double theta0_
Definition: ConeAreaFunction.h:57
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
ConeAreaFunction::debugLevel_
static const unsigned int debugLevel_
Definition: ConeAreaFunction.h:74
normalizedPhi
constexpr T normalizedPhi(T phi)
Definition: normalizedPhi.h:8
IntegrandThetaFunction
Definition: IntegrandThetaFunction.h:33
ConeAreaFunction::DoEval
double DoEval(double x) const override
Definition: ConeAreaFunction.cc:127
ConeAreaFunction::fTheta_
IntegrandThetaFunction * fTheta_
Definition: ConeAreaFunction.h:71
muonRecoAnalyzer_cfi.thetaMin
thetaMin
Definition: muonRecoAnalyzer_cfi.py:22
ConeAreaFunction::ConeAreaFunction
ConeAreaFunction()
Definition: ConeAreaFunction.cc:40
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
ConeAreaFunction::phi0_
double phi0_
Definition: ConeAreaFunction.h:58
muonRecoAnalyzer_cfi.thetaMax
thetaMax
Definition: muonRecoAnalyzer_cfi.py:23
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
ConeAreaFunction::etaMax_
double etaMax_
Definition: ConeAreaFunction.h:61
ConeAreaFunction::integrator_
ROOT::Math::Integrator * integrator_
Definition: ConeAreaFunction.h:72