Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
FuncMinimum Class Reference

The simplest concrete implementation of IFuncMinimum interface. More...

#include <src/Components/FuncMinimum.h>

Inheritance diagram for FuncMinimum:
Collaboration diagram for FuncMinimum:

Classes

class  FuncMinimumMisc
 

Public Types

typedef std::vector< const GenFunc * > Gradient
 
- Public Types inherited from extends< GaudiTool, IFuncMinimum >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 

Public Member Functions

StatusCode minimum (const GenFunc &func, Arg &arg) const override
 Find minimum of the function "GenFunc". More...
 
StatusCode minimum (const GenFunc &func, Arg &arg, Covariance &covar) const override
 Find minimum of the function "GenFunc". More...
 
StatusCode initialize () override
 Overriding initialize. More...
 
- Public Member Functions inherited from extends< GaudiTool, IFuncMinimum >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from GaudiTool
StatusCode initialize () override
 standard initialization method More...
 
StatusCode finalize () override
 standard finalization method More...
 
INTupleSvcntupleSvc () const
 Access the standard N-Tuple. More...
 
INTupleSvcevtColSvc () const
 Access the standard event collection service. More...
 
IDataProviderSvcdetSvc () const
 accessor to detector service More...
 
IIncidentSvcincSvc () const
 accessor to Incident Service More...
 
IChronoStatSvcchronoSvc () const
 accessor to Chrono & Stat Service More...
 
IHistogramSvchistoSvc () const
 acessor to the histogram service More...
 
IAlgContextSvccontextSvc () const
 acessor to the Algorithm Context Service More...
 
void put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
void put (IDataProviderSvc *svc, std::unique_ptr< DataObject > object, const std::string &address, const bool useRootInTES=true) const
 
const DataObjectput (DataObject *object, const std::string &address, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
const DataObjectput (std::unique_ptr< DataObject > object, const std::string &address, const bool useRootInTES=true) const
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type get (const std::string &location, const bool useRootInTES=true) const
 Templated access to the data from Gaudi Event Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
template<class TYPE >
TYPE * getDet (IDataProviderSvc *svc, const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getDetIfExists (IDataProviderSvc *svc, const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
TYPE * getDet (const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type getDetIfExists (const std::string &location) const
 Templated access to the detector data from the Gaudi Detector Transient Store. More...
 
template<class TYPE >
bool exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
template<class TYPE >
bool exist (const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
template<class TYPE >
bool existDet (IDataProviderSvc *svc, const std::string &location) const
 Check the existence of detector objects in the Gaudi Transient Detector Store. More...
 
template<class TYPE >
bool existDet (const std::string &location) const
 Check the existence of detector objects in the Gaudi Transient Detector Store. More...
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
StatusCode Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the error message and return with the given StatusCode. More...
 
StatusCode Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the warning message and return with the given StatusCode. More...
 
StatusCode Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
 Print the info message and return with the given StatusCode. More...
 
 GaudiTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
 ~GaudiTool () override
 destructor, virtual and protected More...
 
- Public Member Functions inherited from GaudiCommon< CounterHolder< AlgTool > >
Gaudi::Utils::GetData< TYPE >::return_type get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Templated access to the data in Gaudi Transient Store. More...
 
Gaudi::Utils::GetData< TYPE >::return_type getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Quicker version of the get function which bypasses the check on the retrieved data. More...
 
bool exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Check the existence of a data object or container in the Gaudi Transient Event Store. More...
 
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
 Get the existing data object from Gaudi Event Transient store. More...
 
DataObjectput (IDataProviderSvc *svc, std::unique_ptr< DataObject > object, const std::string &location, const bool useRootInTES=true) const
 Register a data object or container into Gaudi Event Transient Store. More...
 
DataObjectput (IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
 
TOOL * tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
 Useful method for the easy location of tools. More...
 
TOOL * tool (const std::string &type, const IInterface *parent=0, bool create=true) const
 A useful method for the easy location of tools. More...
 
SmartIF< SERVICE > svc (const std::string &name, const bool create=true) const
 A useful method for the easy location of services. More...
 
IUpdateManagerSvcupdMgrSvc () const
 Short-cut to locate the Update Manager Service. More...
 
WARN_UNUSED StatusCode Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the error message and return with the given StatusCode. More...
 
WARN_UNUSED StatusCode Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
 Print the warning message and return with the given StatusCode. More...
 
WARN_UNUSED StatusCode Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
 Print the info message and return with the given StatusCode. More...
 
WARN_UNUSED StatusCode Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
 Print the message and return with the given StatusCode. More...
 
void Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Assertion - throw exception if the given condition is not fulfilled. More...
 
void Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Assertion - throw exception if the given condition is not fulfilled. More...
 
void Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and (re)-throw a given GaudiException. More...
 
void Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and (re)-throw a given exception. More...
 
void Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
 Create and throw an exception with the given message. More...
 
StatEntitycounter (const std::string &tag) const
 accessor to certain counter by name More...
 
StatEntitycounter (const std::string &tag)
 
bool typePrint () const
 Insert the actual C++ type of the algorithm/tool in the messages ? More...
 
bool propsPrint () const
 Print properties at initialization ? More...
 
bool statPrint () const
 Print statistical counters at finalization ? More...
 
bool errorsPrint () const
 Print error counters at finalization ? More...
 
long printStat (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of statistical counters More...
 
long printErrors (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of error counters More...
 
long printProps (const MSG::Level level=MSG::ALWAYS) const
 perform the actual printout of properties More...
 
void registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=nullptr)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
void registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
void registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
 just to avoid conflicts with the version using a pointer to a template class. More...
 
void registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL)
 register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
 
StatusCode runUpdate ()
 asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident. More...
 
 GaudiCommon (const std::string &name, ISvcLocator *pSvcLocator)
 Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if PBASE derives from Algorithm. More...
 
 GaudiCommon (const std::string &type, const std::string &name, const IInterface *ancestor)
 Tool constructor - SFINAE-ed to insure this constructor is only defined if PBASE derives from AlgTool. More...
 
StatusCode initialize () override
 standard initialization method More...
 
StatusCode finalize () override
 standard finalization method More...
 
StatusCode release (const IInterface *interface) const
 Manual forced (and 'safe') release of the active tool or service. More...
 
const Servicesservices () const
 get the list of aquired services More...
 
const std::stringcontext () const
 Returns the "context" string. Used to identify different processing states. More...
 
const std::stringrootInTES () const
 Returns the "rootInTES" string. More...
 
const std::string fullTESLocation (const std::string &location, const bool useRootInTES) const
 Returns the full correct event location given the rootInTes settings. More...
 
- Public Member Functions inherited from CounterHolder< BASE >
void declareCounter (const std::string &tag, Gaudi::Accumulators::PrintableCounter &r)
 
const Gaudi::Accumulators::PrintableCounterfindCounter (const std::string &tag) const
 
template<typename Callable >
void forEachCounter (Callable &&f) const
 
int nCounters () const
 
void clearCounters ()
 

Private Member Functions

 FuncMinimum ()=delete
 default constructor is private More...
 
 FuncMinimum (const FuncMinimum &)=delete
 copy constructor is private More...
 
FuncMinimumoperator= (const FuncMinimum &)=delete
 assignment operator is More...
 

Private Attributes

Gaudi::Property< std::stringm_algType
 
Gaudi::Property< double > m_max_iter {this, "Iteration", 200, "maximum of iteration"}
 
Gaudi::Property< double > m_norm_gradient
 
Gaudi::Property< double > m_step_size {this, "Step_size", 0.01, "size of the first trial step"}
 
Gaudi::Property< double > m_tol {this, "Tol", 1e-10, "accuracy of the line minimization"}
 
const gsl_multimin_fdfminimizer_type * m_type = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from GaudiTool
static bool enableSummary (bool)
 enable/disable summary More...
 
static bool summaryEnabled ()
 is summary enabled? More...
 
- Protected Types inherited from GaudiCommon< CounterHolder< AlgTool > >
using base_class = CounterHolder< AlgTool >
 
typedef std::map< std::string, StatEntityStatisticsOwn
 the actual type of general counters More...
 
typedef std::map< std::string, std::reference_wrapper< Gaudi::Accumulators::PrintableCounter > > Statistics
 
typedef std::map< std::string, unsigned int > Counter
 the actual type error/warning counter More...
 
typedef std::vector< IAlgTool * > AlgTools
 storage for active tools More...
 
typedef std::vector< SmartIF< IService > > Services
 storage for active services More...
 
- Protected Member Functions inherited from GaudiCommon< CounterHolder< AlgTool > >
StatusCode releaseTool (const IAlgTool *tool) const
 manual forced (and 'safe') release of the tool More...
 
StatusCode releaseSvc (const IInterface *svc) const
 manual forced (and 'safe') release of the service More...
 
- Protected Attributes inherited from GaudiCommon< CounterHolder< AlgTool > >
SmartIF< ICounterSummarySvcm_counterSummarySvc
 a pointer to the CounterSummarySvc More...
 
- Static Protected Attributes inherited from GaudiCommon< CounterHolder< AlgTool > >
static const bool IgnoreRootInTES
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 
static const bool UseRootInTES
 Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
 

Detailed Description

The simplest concrete implementation of IFuncMinimum interface.

See also
GaudiGSL/IFuncMinimum.h
Author
Kirill Miklyaev kiril.nosp@m.lm@i.nosp@m.ris1..nosp@m.itep.nosp@m..ru
Date
2002-09-14

Definition at line 24 of file FuncMinimum.h.

Member Typedef Documentation

typedef std::vector<const GenFunc*> FuncMinimum::Gradient

Definition at line 26 of file FuncMinimum.h.

Constructor & Destructor Documentation

FuncMinimum::FuncMinimum ( )
privatedelete

default constructor is private

FuncMinimum::FuncMinimum ( const FuncMinimum )
privatedelete

copy constructor is private

Member Function Documentation

StatusCode FuncMinimum::initialize ( )
override

Overriding initialize.

The algorithm for multidimensional minimization

Definition at line 173 of file FuncMinimum.cpp.

175 {
177 
178  if ( sc.isFailure() ) { return Error( "Could not initialize base class GaudiTool", sc ); }
179 
181  if ( "conjugate_fr" == m_algType ) {
182  m_type = gsl_multimin_fdfminimizer_conjugate_fr;
183  debug() << "Minimization algorithm to be used: "
184  << "'gsl_multimin_fdfminimizer_conjugate_fr'" << endmsg;
185  } else if ( "conjugate_pr" == m_algType ) {
186  m_type = gsl_multimin_fdfminimizer_conjugate_pr;
187  debug() << "Minimization algorithm to be used: "
188  << "'gsl_multimin_fdfminimizer_conjugate_pr'" << endmsg;
189  } else if ( "vector_bfgs" == m_algType ) {
190  m_type = gsl_multimin_fdfminimizer_vector_bfgs;
191  debug() << "Minimization algorithm to be used: "
192  << "'gsl_multimin_fdfminimizer_vector_bfgs'" << endmsg;
193  } else if ( "steepest_descent" == m_algType ) {
194  m_type = gsl_multimin_fdfminimizer_steepest_descent;
195  debug() << "Minimization algorithm to be used: "
196  << "'gsl_multimin_fdfminimizer_steepest_descent'" << endmsg;
197  } else {
198  return Error( " Unknown algorithm type '" + m_algType + "'" );
199  }
200 
201  return StatusCode::SUCCESS;
202 }
Gaudi::Property< std::string > m_algType
Definition: FuncMinimum.h:83
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
const gsl_multimin_fdfminimizer_type * m_type
Definition: FuncMinimum.h:91
bool isFailure() const
Definition: StatusCode.h:130
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
Definition: GaudiTool.h:663
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
StatusCode initialize() override
standard initialization method
Definition: GaudiTool.cpp:144
StatusCode FuncMinimum::minimum ( const GenFunc &  func,
Arg &  arg 
) const
override

Find minimum of the function "GenFunc".

See also
IFuncMinimum.h
Returns
StatusCode
StatusCode FuncMinimum::minimum ( const GenFunc &  func,
Arg &  arg,
Covariance &  covar 
) const
override

Find minimum of the function "GenFunc".

See also
IFuncMinimum.h
Returns
StatusCode
FuncMinimum& FuncMinimum::operator= ( const FuncMinimum )
privatedelete

assignment operator is

Member Data Documentation

Gaudi::Property<std::string> FuncMinimum::m_algType
private
Initial value:
{this, "Algorithm", "conjugate_fr",
"type of the algorithm for multidimensional minimization"}

Definition at line 83 of file FuncMinimum.h.

Gaudi::Property<double> FuncMinimum::m_max_iter {this, "Iteration", 200, "maximum of iteration"}
private

Definition at line 85 of file FuncMinimum.h.

Gaudi::Property<double> FuncMinimum::m_norm_gradient
private
Initial value:
{this, "Gradient", 1.0e-10,
"absolute tolerance for the Euclidean norm of the gradient"}

Definition at line 86 of file FuncMinimum.h.

Gaudi::Property<double> FuncMinimum::m_step_size {this, "Step_size", 0.01, "size of the first trial step"}
private

Definition at line 88 of file FuncMinimum.h.

Gaudi::Property<double> FuncMinimum::m_tol {this, "Tol", 1e-10, "accuracy of the line minimization"}
private

Definition at line 89 of file FuncMinimum.h.

const gsl_multimin_fdfminimizer_type* FuncMinimum::m_type = nullptr
private

Definition at line 91 of file FuncMinimum.h.


The documentation for this class was generated from the following files: