Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:32

0001 #include "PhysicsTools/IsolationUtils/interface/ConeAreaRootFunction.h"
0002 
0003 // -*- C++ -*-
0004 //
0005 // Package:    ConeAreaRootFunction
0006 // Class:      ConeAreaRootFunction
0007 //
0008 /**\class ConeAreaRootFunction ConeAreaRootFunction.cc PhysicsTools/IsolationUtils/src/ConeAreaRootFunction.cc
0009 
0010  Description: low level class to compute three-dimensional opening angle of isolation cone
0011               corresponding to area given as function argument
0012 
0013  Implementation:
0014      imported into CMSSW on 05/18/2007
0015 */
0016 //
0017 // Original Author:  Christian Veelken, UC Davis
0018 //         Created:  Thu Nov  2 13:47:40 CST 2006
0019 //
0020 //
0021 
0022 // C++ standard library include files
0023 #include <iostream>
0024 #include <iomanip>
0025 #include <string>
0026 
0027 // ROOT include files
0028 #include <TMath.h>
0029 
0030 // CMSSW include files
0031 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0032 
0033 //
0034 // constructors and destructor
0035 //
0036 
0037 ConeAreaRootFunction::ConeAreaRootFunction() : ConeAreaFunction() { coneArea_ = 0; }
0038 
0039 ConeAreaRootFunction::ConeAreaRootFunction(const ConeAreaRootFunction& bluePrint) : ConeAreaFunction(bluePrint) {
0040   coneArea_ = bluePrint.coneArea_;
0041 }
0042 
0043 ConeAreaRootFunction::~ConeAreaRootFunction() {
0044   //--- nothing to be done yet...
0045 }
0046 
0047 //
0048 // assignment operator
0049 //
0050 
0051 ConeAreaRootFunction& ConeAreaRootFunction::operator=(const ConeAreaRootFunction& bluePrint) {
0052   ConeAreaFunction::operator=(bluePrint);
0053 
0054   coneArea_ = bluePrint.coneArea_;
0055 
0056   return (*this);
0057 }
0058 
0059 //
0060 // member functions
0061 //
0062 
0063 void ConeAreaRootFunction::SetParameterConeArea(double coneArea) { coneArea_ = coneArea; }
0064 
0065 void ConeAreaRootFunction::SetParameters(const double* param) {
0066   if (debugLevel_ > 0) {
0067     edm::LogVerbatim("") << "<ConeAreaRootFunction::SetParameters>:" << std::endl
0068                          << " theta0 = " << param[0] << std::endl
0069                          << " phi0 = " << param[1] << std::endl
0070                          << " coneArea = " << param[2] << std::endl;
0071   }
0072 
0073   ConeAreaFunction::SetParameters(param);
0074 
0075   coneArea_ = param[2];
0076 }
0077 
0078 double ConeAreaRootFunction::DoEval(double x) const {
0079   //--- calculate difference between area covered by cone of opening angle alpha
0080   //    (given as function argument and measured from cone axis)
0081   //    and cone area set as parameter
0082 
0083   return ConeAreaFunction::DoEval(x) - coneArea_;
0084 }