test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FixedAreaIsolationCone.cc
Go to the documentation of this file.
2 
3 // -*- C++ -*-
4 //
5 // Package:
6 // Class: FixedAreaIsolationCone
7 //
18 //
19 // Original Author: Christian Veelken, UC Davis
20 // Created: Wed May 16 13:47:40 CST 2007
21 //
22 //
23 
24 // C++ standard library include files
25 #include <string>
26 
27 // ROOT include files
28 #include <TMath.h>
29 
30 // CMSSW include files
32 
34  : areaFunctionSignalCone_(), areaRootFunctionIsolationCone_()
35 {
36 //--- nothing to be done yet
37 //
38 // WARNING: do NOT call ROOT::Math::RootFinder<ROOT::Math::Roots::Brent>::SetFunction here;
39 // this will cause the function to be evaluated before all function parameters are set,
40 // leading to an error message first and erroneous behaviour of the root-finding later on !!!
41 //
42 }
43 
45 {
46 //--- nothing to be done yet
47 }
48 
49 void FixedAreaIsolationCone::setAcceptanceLimit(double etaMaxTrackingAcceptance)
50 {
51  areaFunctionSignalCone_.SetAcceptanceLimit(etaMaxTrackingAcceptance);
52  areaRootFunctionIsolationCone_.SetAcceptanceLimit(etaMaxTrackingAcceptance);
53 }
54 
55 double FixedAreaIsolationCone::operator() (double coneAxisTheta, double coneAxisPhi,
56  double openingAngleSignalCone, double areaIsolationCone, int& error)
57 {
60  double areaSignalCone = areaFunctionSignalCone_(openingAngleSignalCone);
61 
64  areaRootFunctionIsolationCone_.SetParameterConeArea(areaIsolationCone + areaSignalCone);
66  int statusIsolationCone = areaRootFinderIsolationCone_.Solve();
67  double openingAngleIsolationCone = areaRootFinderIsolationCone_.Root();
68 
69  if ( debugLevel_ > 0 ) {
70  const std::string category = "FixedAreaIsolationCone::operator()";
71  edm::LogVerbatim(category) << "openingAngleSignalCone = " << openingAngleSignalCone << std::endl;
72  edm::LogVerbatim(category) << "areaSignalCone = " << areaSignalCone << std::endl;
73  edm::LogVerbatim(category) << "areaIsolationCone = " << areaIsolationCone << std::endl;
74  edm::LogVerbatim(category) << "openingAngleIsolationCone = " << openingAngleIsolationCone << std::endl;
75  edm::LogVerbatim(category) << "statusIsolationCone = " << statusIsolationCone << std::endl;
76  }
77 
78  if ( statusIsolationCone == 0 ) {
79  error = 0;
80  return openingAngleIsolationCone;
81  } else {
82  error = 1;
83  return 0.;
84  }
85 }
const double Pi
ConeAreaFunction areaFunctionSignalCone_
void SetAcceptanceLimit(double etaMax)
ConeAreaRootFunction areaRootFunctionIsolationCone_
void SetParameterPhi0(double phi0)
double operator()(double coneAxisTheta, double coneAxisPhi, double openingAngleSignalCone, double areaIsolationCone, int &error)
void setAcceptanceLimit(double etaMaxTrackingAcceptance)
void SetParameterConeArea(double coneArea)
static const unsigned int debugLevel_
void SetParameterTheta0(double theta0)
ROOT::Math::RootFinder areaRootFinderIsolationCone_