CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
33 FixedAreaIsolationCone::FixedAreaIsolationCone() : areaFunctionSignalCone_(), areaRootFunctionIsolationCone_() {
34  //--- nothing to be done yet
35  //
36  // WARNING: do NOT call ROOT::Math::RootFinder<ROOT::Math::Roots::Brent>::SetFunction here;
37  // this will cause the function to be evaluated before all function parameters are set,
38  // leading to an error message first and erroneous behaviour of the root-finding later on !!!
39  //
40 }
41 
43  //--- nothing to be done yet
44 }
45 
46 void FixedAreaIsolationCone::setAcceptanceLimit(double etaMaxTrackingAcceptance) {
47  areaFunctionSignalCone_.SetAcceptanceLimit(etaMaxTrackingAcceptance);
48  areaRootFunctionIsolationCone_.SetAcceptanceLimit(etaMaxTrackingAcceptance);
49 }
50 
52  double coneAxisTheta, double coneAxisPhi, double openingAngleSignalCone, double areaIsolationCone, int& error) {
55  double areaSignalCone = areaFunctionSignalCone_(openingAngleSignalCone);
56 
59  areaRootFunctionIsolationCone_.SetParameterConeArea(areaIsolationCone + areaSignalCone);
61  int statusIsolationCone = areaRootFinderIsolationCone_.Solve();
62  double openingAngleIsolationCone = areaRootFinderIsolationCone_.Root();
63 
64  if (debugLevel_ > 0) {
65  const std::string category = "FixedAreaIsolationCone::operator()";
66  edm::LogVerbatim(category) << "openingAngleSignalCone = " << openingAngleSignalCone << std::endl;
67  edm::LogVerbatim(category) << "areaSignalCone = " << areaSignalCone << std::endl;
68  edm::LogVerbatim(category) << "areaIsolationCone = " << areaIsolationCone << std::endl;
69  edm::LogVerbatim(category) << "openingAngleIsolationCone = " << openingAngleIsolationCone << std::endl;
70  edm::LogVerbatim(category) << "statusIsolationCone = " << statusIsolationCone << std::endl;
71  }
72 
73  if (statusIsolationCone == 0) {
74  error = 0;
75  return openingAngleIsolationCone;
76  } else {
77  error = 1;
78  return 0.;
79  }
80 }
const double Pi
Log< level::Info, true > LogVerbatim
ConeAreaFunction areaFunctionSignalCone_
static const char category[]
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_