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 // $Id: FixedAreaIsolationCone.cc,v 1.0 2006/11/30 17:07:28 veelken Exp $
22 //
23 //
24 
25 // C++ standard library include files
26 #include <string>
27 
28 // ROOT include files
29 #include <TMath.h>
30 
31 // CMSSW include files
33 
35  : areaFunctionSignalCone_(), areaRootFunctionIsolationCone_()
36 {
37 //--- nothing to be done yet
38 //
39 // WARNING: do NOT call ROOT::Math::RootFinder<ROOT::Math::Roots::Brent>::SetFunction here;
40 // this will cause the function to be evaluated before all function parameters are set,
41 // leading to an error message first and erroneous behaviour of the root-finding later on !!!
42 //
43 }
44 
46 {
47 //--- nothing to be done yet
48 }
49 
50 void FixedAreaIsolationCone::setAcceptanceLimit(double etaMaxTrackingAcceptance)
51 {
52  areaFunctionSignalCone_.SetAcceptanceLimit(etaMaxTrackingAcceptance);
53  areaRootFunctionIsolationCone_.SetAcceptanceLimit(etaMaxTrackingAcceptance);
54 }
55 
56 double FixedAreaIsolationCone::operator() (double coneAxisTheta, double coneAxisPhi,
57  double openingAngleSignalCone, double areaIsolationCone, int& error)
58 {
61  double areaSignalCone = areaFunctionSignalCone_(openingAngleSignalCone);
62 
65  areaRootFunctionIsolationCone_.SetParameterConeArea(areaIsolationCone + areaSignalCone);
67  int statusIsolationCone = areaRootFinderIsolationCone_.Solve();
68  double openingAngleIsolationCone = areaRootFinderIsolationCone_.Root();
69 
70  if ( debugLevel_ > 0 ) {
71  const std::string category = "FixedAreaIsolationCone::operator()";
72  edm::LogVerbatim(category) << "openingAngleSignalCone = " << openingAngleSignalCone << std::endl;
73  edm::LogVerbatim(category) << "areaSignalCone = " << areaSignalCone << std::endl;
74  edm::LogVerbatim(category) << "areaIsolationCone = " << areaIsolationCone << std::endl;
75  edm::LogVerbatim(category) << "openingAngleIsolationCone = " << openingAngleIsolationCone << std::endl;
76  edm::LogVerbatim(category) << "statusIsolationCone = " << statusIsolationCone << std::endl;
77  }
78 
79  if ( statusIsolationCone == 0 ) {
80  error = 0;
81  return openingAngleIsolationCone;
82  } else {
83  error = 1;
84  return 0.;
85  }
86 }
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_
static const std::string category("Muon|RecoMuon|L3MuonCandidateProducerFromMuons")