| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Namespaces | Classes | Functions

# Gaudi::Utils Namespace Reference

## Namespaces
namespace | Histos

| Collection of useful utilities for manipulations with AIDA hisgograms.
namespace | RegEx

| RegeEx: nemspace to hold gaudi regular expression checking.
## Classes
class | AlgSelector
| Simple interface class for selection of algorithms. More...
class | AlgTypeSelector
| The trivial selector of algorithm by type. More...
class | AlgTypeSelector< TYPE * >
class | AlgTypeSelector< const TYPE * >
class | AlgTypeSelector< TYPE & >
class | AlgTypeSelector< const TYPE & >
class | AlgTypeSelector< const TYPE >
class | AlgNameSelector
| The trivial selector of algorithm by type. More...
struct | _GetType
| Helper structure to define the proper return type for "get"-functions. More...
struct | _GetType< TYPE * >
| the template specialization for pointers More...
struct | _GetType< TYPE & >
| the template specialization for references More...
struct | _GetType< Gaudi::Range_< CONTAINER > >
| the template specialization for "ranges" More...
struct | _GetType< Gaudi::NamedRange_< CONTAINER > >
| the template specialization for "named ranges" More...
struct | GetData
| Helper structure for implementation of "get"-functions for GaudiCommon<BASE> More...
struct | GetData< Gaudi::Range_< std::vector< const TYPE * > > >
| the template specialization for ranges More...
struct | GetData< Gaudi::NamedRange_< std::vector< const TYPE * > > >
| the template specialization for named ranges More...
struct | GetData< const TYPE >
| the template specialization for const types More...
struct | GetData< TYPE * >
| the template specialization for pointer types More...
struct | GetData< TYPE & >
| the template specialization for reference types More...
struct | CheckData
| Helper structure for implementation of "exists"-functions for GaudiCommon<BASE> More...
struct | CheckData< Gaudi::Range_< std::vector< const TYPE * > > >
| the template specialization for ranges More...
struct | CheckData< Gaudi::NamedRange_< std::vector< const TYPE * > > >
| the template specialization for ranges More...
struct | CheckData< TYPE * >
| the template specialization for pointer types More...
struct | CheckData< TYPE & >
| the template specialization for reference types More...
struct | CheckData< const TYPE >
| the template specialization for 'const'-type More...
struct | GetOrCreateData
| Helper structure for implementation of "getOrCreate"-functions for GaudiCommon<BASE> More...
struct | GetOrCreateData< Gaudi::Range_< std::vector< const TYPE * > >, TYPE2 >
struct | GetOrCreateData< Gaudi::NamedRange_< std::vector< const TYPE * > >, TYPE2 >
struct | GetOrCreateData< TYPE, TYPE2 * >
struct | GetOrCreateData< TYPE *, TYPE2 >
struct | GetOrCreateData< TYPE *, TYPE2 * >
struct | GetOrCreateData< TYPE, const TYPE2 >
struct | GetOrCreateData< const TYPE, TYPE2 >
struct | GetOrCreateData< const TYPE, const TYPE2 >
struct | GetOrCreateData< TYPE, TYPE2 & >
struct | GetOrCreateData< TYPE &, TYPE2 >
struct | GetOrCreateData< TYPE &, TYPE2 & >
struct | PropertyTypeTraits< boost::array< T, N > >
| the specialization of property-traits for class boost::array to take care the non-trivial assignements and constructors for this class More...
struct | PropertyTypeTraits< T(&)[N]>
struct | PropertyTypeTraits< T[N]>
| specialization for arrays More...
struct | PropertyTypeTraits< const T(&)[N]>
| specialiation for const-arrays More...
struct | PropertyTypeTraits< char(&)[N]>
| specialisation for C-strings More...
class | AlgContext
| Helper "sentry" class to automatize the safe register/unregister the algorithm's context. More...
class | LockedChrono
| Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g. More...
class | MapBase
| Helper base-class to allow the generic Python-decoration for all "map-like" classes in Gaudi. More...
struct | PropertyTypeTraits
| helper structure to define the types for properties More...
class | TypeNameString
| Helper class to parse a string of format "type/name". More...
class | Aida2ROOT
| Accessor to underlying ROOT-representation of transient histograms The actual code is imported from Bender project. More...
class | HistoStats
| The collection of trivial functions to access the statistical information for the histograms. More...
class | SignalMonitorSvc
| Implementation of Gaudi::ISignalMonitor. More...
class | StopSignalHandler
| Service that stop the processing if a signal is received. More...
## Functions
GAUDI_API IAlgorithm * | getAlgorithm (const IAlgContextSvc *svc, const AlgSelector &sel)
| simple function to get the algorithm from Context Service
GAUDI_API IAlgorithm * | getAlgorithm (const std::vector< IAlgorithm * > &lst, const AlgSelector &sel)
| simple function to get the algorithm from Context Service
GAUDI_API GaudiAlgorithm * | getGaudiAlg (const IAlgContextSvc *svc)
| simple function to extract the last active GaudiAlgorithm from the context
GAUDI_API GaudiHistoAlg * | getHistoAlg (const IAlgContextSvc *svc)
| simple function to extract the last active GaudiHistoAlg from the context
GAUDI_API GaudiTupleAlg * | getTupleAlg (const IAlgContextSvc *svc)
| simple function to extract the last active GaudiTupleAlg from the context
GAUDI_API GaudiSequencer * | getGaudiSequencer (const IAlgContextSvc *svc)
| simple function to extract the last active GaudiSequencer from the context
GAUDI_API Sequencer * | getSequencerAlg (const IAlgContextSvc *svc)
| simple function to extract the last active Sequencer from the context
GAUDI_API IAlgorithm * | getSequencer (const IAlgContextSvc *svc)
| simple function to extract the last active "Sequencer" () GaudiSequencer or simple Sequencer) from the context
template<class ITERATOR >
std::ostream & | toStream (ITERATOR first,ITERATOR last,std::ostream &s,const std::string &open,const std::string &close,const std::string &delim)
| the helper function to print the sequence
template<class TYPE , std::size_t N>
std::ostream & | toStream (const boost::array< TYPE, N > &obj, std::ostream &s)
| printout of class boost::array The format is "Python's tuple"
GAUDI_API bool | hasProperty (const IProperty *p, const std::string &name)
| simple function which check the existence of the property with the given name.
GAUDI_API bool | hasProperty (const IInterface *p, const std::string &name)
| simple function which check the existence of the property with the given name.
GAUDI_API Property * | getProperty (const IProperty *p, const std::string &name)
| simple function which gets the property with given name from the component
GAUDI_API Property * | getProperty (const IInterface *p, const std::string &name)
| simple function which gets the property with given name from the component
GAUDI_API bool | hasProperty (const std::vector< const Property * > *p, const std::string &name)
| check the property by name from the list of the properties
GAUDI_API const Property * | getProperty (const std::vector< const Property * > *p, const std::string &name)
| get the property by name from the list of the properties
template<class TYPE >
StatusCode | setProperty (IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
| simple function to set the property of the given object from the value
template<class TYPE >
StatusCode | setProperty (IProperty *component, const std::string &name, const TYPE &value)
| simple function to set the property of the given object from the value
GAUDI_API StatusCode | setProperty (IProperty *component, const std::string &name, const std::string &value, const std::string &doc="")
| the full specialization of the previous method setProperty( IProperty, std::string, const TYPE&) for standard strings
GAUDI_API StatusCode | setProperty (IProperty *component, const std::string &name, const char *value, const std::string &doc="")
| the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-strings
template<unsigned N>
StatusCode | setProperty (IProperty *component, const std::string &name, const char(&value)[N], const std::string &doc="")
| the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-arrays
GAUDI_API StatusCode | setProperty (IProperty *component, const std::string &name, const Property *property, const std::string &doc="")
| simple function to set the property of the given object from another property
GAUDI_API StatusCode | setProperty (IProperty *component, const std::string &name, const Property &property, const std::string &doc="")
| simple function to set the property of the given object from another property
template<class TYPE >
StatusCode | setProperty (IProperty *component, const std::string &name, const SimpleProperty< TYPE > &value, const std::string &doc="")
| simple function to set the property of the given object from another property
template<class TYPE >
StatusCode | setProperty (IInterface *component, const std::string &name, const TYPE &value, const std::string &doc="")
| simple function to set the property of the given object from the value
GAUDI_API StatusCode | setProperty (IInterface *component, const std::string &name, const std::string &value, const std::string &doc="")
| the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for standard strings
GAUDI_API StatusCode | setProperty (IInterface *component, const std::string &name, const char *value, const std::string &doc="")
| the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for C-strings
template<unsigned N>
StatusCode | setProperty (IInterface *component, const std::string &name, const char(&value)[N], const std::string &doc="")
| the full specialization of the method setProperty( IInterface, std::string, const TYPE&) for C-arrays
GAUDI_API StatusCode | setProperty (IInterface *component, const std::string &name, const Property *property, const std::string &doc="")
| simple function to set the property of the given object from another property
GAUDI_API StatusCode | setProperty (IInterface *component, const std::string &name, const Property &property, const std::string &doc="")
| simple function to set the property of the given object from another property
template<class TYPE >
StatusCode | setProperty (IInterface *component, const std::string &name, const SimpleProperty< TYPE > &value, const std::string &doc="")
| simple function to set the property of the given object from another property
GAUDI_API std::string | formatAsTableRow (const StatEntity &counter, const bool flag, const std::string &format1=" |%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |", const std::string &format2="*|%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |")
| print the counter in a form of the table row
GAUDI_API std::string | formatAsTableRow (const std::string &name, const StatEntity &counter, const bool flag=true, const std::string &format1=" %|-15.15s|%|17t||%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |", const std::string &format2="*%|-15.15s|%|17t||%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |")
| print the counter in a form of the table row
GAUDI_API std::string | formatAsTableRow (const std::string &name, const std::string &group, const StatEntity &entity, const bool flag=true, const std::string &format1=" %|15.15s|%|-15.15s|%|32t||%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |", const std::string &format2="*%|15.15s|%|-15.15s|%|32t||%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |")
| print the counter in a form of the table row
GAUDI_API std::ostream & | toStream (const Gaudi::StringKey &key, std::ostream &s)
| send the object to stream (needed to use it as property)
template<class SCALAR >
std::ostream & | toStream (const SCALAR &, std::ostream &)
template<class SCALAR , unsigned int N>
std::ostream & | toStream (const ROOT::Math::SVector< SCALAR, N > &obj, std::ostream &s)
| the general streaming function for SVector using python-tupel format
template<class TYPE >
std::ostream & | toStream (const TYPE &obj, std::ostream &s)
| the generic implementation of the printout to the std::ostream
std::ostream & | toStream (const std::string &obj, std::ostream &s)
| the printtout of the strings.
std::ostream & | toStream (const bool obj, std::ostream &s)
| the printout of boolean values "a'la Python"
std::ostream & | toStream (const float obj, std::ostream &s, const int prec=6)
| the printout of float values with the reasonable precision
std::ostream & | toStream (const double obj, std::ostream &s, const int prec=8)
| the printout of double values with the reasonable precision
std::ostream & | toStream (const long double obj, std::ostream &s, const int prec=10)
| the printout of long double values with the reasonable precision
template<class KTYPE , class VTYPE >
std::ostream & | toStream (const std::pair< KTYPE, VTYPE > &obj, std::ostream &s)
| the partial template specialization of `std::pair<KTYPE,VTYPE>` printout the pair is printed a'la Python tuple: " ( a , b )"
template<class TYPE , class ALLOCATOR >
std::ostream & | toStream (const std::vector< TYPE, ALLOCATOR > &obj, std::ostream &s)
| the partial template specialization of `std::vector<TYPE,ALLOCATOR>` printout.
template<class TYPE , class ALLOCATOR >
std::ostream & | toStream (const std::list< TYPE, ALLOCATOR > &obj, std::ostream &s)
| the partial template specialization of `std::list<TYPE,ALLOCATOR>` printout.
template<class TYPE , class CMP , class ALLOCATOR >
std::ostream & | toStream (const std::set< TYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
| the partial template specialization of `std::set<TYPE,CMP,ALLOCATOR>` printout.
template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostream & | toStream (const std::map< KTYPE, VTYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
| the partial template specialization of `std::map<KTYPE,VTYPE,CMP,ALLOCATOR>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"
template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >
std::ostream & | toStream (const GaudiUtils::VectorMap< KTYPE, VTYPE, CMP, ALLOCATOR > &obj, std::ostream &s)
| the partial template specialization of `GaudiUtils::VectorMap<KTYPE,VTYPE,CMP,ALLOCATOR>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"
template<class KTYPE , class VTYPE , class MAP >
std::ostream & | toStream (const GaudiUtils::Map< KTYPE, VTYPE, MAP > &obj, std::ostream &s)
| the partial template specialization of `GaudiUtils::Map<KTYPE,VTYPE,MAP>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"
template<class KTYPE , class VTYPE , class HASH , class MAP >
std::ostream & | toStream (const GaudiUtils::HashMap< KTYPE, VTYPE, HASH, MAP > &obj, std::ostream &s)
| the partial template specialization of `GaudiUtils::HashMap<KTYPE,VTYPE,HASH,MAP>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"
template<class TYPE , unsigned int N>
std::ostream & | toStream (TYPE(&obj)[N], std::ostream &s)
| the specialization for C-arrays, a'la python tuple
template<class TYPE , unsigned int N>
std::ostream & | toStream (const TYPE(&obj)[N], std::ostream &s)
| the specialization for C-arrays, a'la python tuple
template<unsigned int N>
std::ostream & | toStream (char(&obj)[N], std::ostream &s)
| the specialization for C-string, a'la python tuple
template<unsigned int N>
std::ostream & | toStream (const char(&obj)[N], std::ostream &s)
| the specialization for C-string, a'la python tuple
std::ostream & | toStream (const char *obj, std::ostream &s)
| the specialization for C-string, a'la python tuple
template<class TYPE >
std::string | toString (const TYPE &obj)
| the generic implementation of the type conversion to the string
GAUDI_API std::ostream & | toStream (const Gaudi::XYZPoint &obj, std::ostream &s)
| print XYZ point
GAUDI_API std::ostream & | toStream (const Gaudi::XYZVector &obj, std::ostream &s)
| print XYZ vector
GAUDI_API std::ostream & | toStream (const Gaudi::LorentzVector &obj, std::ostream &s)
| print Lorentz vector

## Function Documentation

std::string Gaudi::Utils::formatAsTableRow | ( | const StatEntity & | counter,
|  | const bool | flag,
|  | const std::string & | format1 = `" |%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |"`,
|  | const std::string & | format2 = `"*|%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |"`
| ) |  |

print the counter in a form of the table row

        // loop over counters:
        for ( ... )
         {
          const StatEntity&  counter = ... ;
          info() << formatAsTableRow( counter , true ) << endmsg ;
         }

The regular counter is printed as 6 fields

- number of entries (long)
- overal sum (double)
- mean value (double)
- RMS (double)
- minimal value (double)
- maximal value (double)

The printout is performed according to the format, described in optional "format1" parameter using Boost Format Library. The incredible flexibility of Boost Format Library allows to customize the overall layout of the table form minor change the format of individual columns to the overall reshuffling of the reformatted columns

If the parameter "flag" is set to `true`, AND the content of the counter allows the interpretation of the counter as binomial efficiency counter, the printout is performed in a form of 4 numbers:

- number of entries (long)
- overall sum (double)
- binomial efficiency [perCent] (double)
- uncertainty in binomial efficiency [perCent] (double)

The printout is performed according to format, specified by parameter "format2"

See also:
  http://boost.org/libs/format

Parameters:

  name | the name associated with the counter
  counter | counter to be printed
  flag | use the special format for "efficiency" rows
  format1 | row format for the regular rows
  format2 | special row format for the "efficiency" rows

Returns:
  formatted row in the table

Definition at line 302 of file StatEntity.cpp.

    {
      using namespace boost::io ;
      if ( flag && 0 <= counter.eff() && 0 <= counter.effErr() )
      {
        boost::format fmt( format2 ) ;
        fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
        fmt
          %   counter.nEntries ()
          %   counter.sum      ()
          % ( counter.eff      () * 100 )
          % ( counter.effErr   () * 100 ) ;
        return fmt.str() ;
      }
      boost::format fmt  ( format1 ) ;
      fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
      fmt
        %   counter.nEntries ()
        %   counter.sum      ()
        %   counter.mean     ()
        %   counter.rms      ()
        %   counter.min      ()
        %   counter.max      () ;
      return fmt.str() ;
    }

std::string Gaudi::Utils::formatAsTableRow | ( | const std::string & | name,
|  | const StatEntity & | counter,
|  | const bool | flag = `true`,
|  | const std::string & | format1 = `" %|-15.15s|%|17t||%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |"`,
|  | const std::string & | format2 = `"*%|-15.15s|%|17t||%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |"`
| ) |  |

print the counter in a form of the table row

      std::string header = "     Counter     |     #     |    sum     |" ;
      header += " mean/eff^* | rms/err^*  |     min     |     max     |" ;

       info() << header << endmsg ;

        // loop over counters:
        for ( ... )
         {
          const std::string& name    = ... ;
          const StatEntity&  counter = ... ;
          info() << formatAsTableRow( name , counter ) << endmsg ;
         }

The table row for the regular counter is printed as 7 fields

- counter name (string)
- number of entries (long)
- overal sum (double)
- mean value (double)
- RMS (double)
- minimal value (double)
- maximal value (double)

The printout is performed according to the format, described in optional "format1" parameter using Boost Format Library. The incredible flexibility of Boost Format Library allows to customize the overall layout of the table form minor change the format of individual columns to the overall reshuffling of the reformatted columns

If the parameter "flag" is set to `true` AND the counter name, converted to the lowercase constant one of the substrings: "eff","acc","fltr","filt","pass" AND (of course) the content of the counter allows the interpretation of the counter as the binomial efficiency counter, the printout is performed using 5 fields ("binomial efficiency format")

- counter name (string)
- number of entries (long)
- overall sum (double)
- binomial efficiency [perCent] (double)
- uncertainty in binomial efficiency [perCent] (double)

The printout is performed according to format, specified by parameter "format2"

See also:
  http://boost.org/libs/format

Parameters:

  name | the name associated with the counter
  counter | counter to be printed
  flag | use the special format for "efficiency" rows
  format1 | row format for the regular rows
  format2 | special row format for the "efficiency" rows

Returns:
  formatted row in the table

Definition at line 341 of file StatEntity.cpp.

    {
      using namespace boost::io ;
      if ( flag && effCounter ( name ) && 0 <= counter.eff() && 0 <= counter.effErr() )
      {
        boost::format fmt( format2 ) ;
        fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
        fmt
          % ( "\"" + name + "\"" )
          %   counter.nEntries ()
          %   counter.sum      ()
          % ( counter.eff      () * 100 )
          % ( counter.effErr   () * 100 ) ;
        return fmt.str() ;
      }
      boost::format fmt  ( format1 ) ;
      fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
      fmt
        % ( "\"" + name + "\"" )
        %   counter.nEntries ()
        %   counter.sum      ()
        %   counter.mean     ()
        %   counter.rms      ()
        %   counter.min      ()
        %   counter.max      () ;
      return fmt.str() ;
    }

std::string Gaudi::Utils::formatAsTableRow | ( | const std::string & | name,
|  | const std::string & | group,
|  | const StatEntity & | entity,
|  | const bool | flag = `true`,
|  | const std::string & | format1 = `" %|15.15s|%|-15.15s|%|32t||%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |"`,
|  | const std::string & | format2 = `"*%|15.15s|%|-15.15s|%|32t||%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |"`
| ) |  |

print the counter in a form of the table row

       std::string header = "       Counter :: Group         |     #     |";
       header += "    sum     | mean/eff^* | rms/err^*  |     min     |";
       header += "     max     |") ;

       info() << header << endmsg ;

        // loop over counters:
        for ( ... )
         {
          const std::string& name    = ... ;
          const std::string& group   = .. ;
          const StatEntity&  counter = ... ;
          info() << formatAsTableRow ( name , group , counter ) << endmsg ;
         }

The table row for the regular counter is printed as 8 fields

- counter name (string)
- counter group (string)
- number of entries (long)
- overall sum (double)
- mean value (double)
- RMS (double)
- minimal value (double)
- maximal value (double)

The printout is performed according to the format, described in optional "format1" parameter using Boost Format Library. The incredible flexibility of Boost Format Library allows to customize the overall layout of the table form minor change the format of individual columns to the overall reshuffling of the reformatted columns

If the parameter "flag" is set to `true` AND either the counter name or counter group, converted to the lowercase contains one of the substrings: "eff","acc","fltr","filt","pass" AND (of course) the content of the counter allows the interpretation of the counter as the binomial efficiency counter, the printout is performed using 6 fields ("binomial efficiency format")

- counter name (string)
- counter group (string)
- number of entries (long)
- overall sum (double)
- binomial efficiency [perCent] (double)
- uncertainty in binomial efficiency [perCent] (double)

The printout is performed according to format, specified by parameter "format2"

See also:
  http://boost.org/libs/format

Parameters:

  name | the name associated with the counter
  group | the group associated with the counter
  counter | counter to be printed
  flag | use the special format for "efficiency" rows
  format1 | row format for the regular rows
  format2 | the special row format for the "efficiency" rows

Returns:
  formatted row in the table

Definition at line 384 of file StatEntity.cpp.

    {
      using namespace boost::io ;
      if ( flag && ( effCounter ( name ) || effCounter ( group ) )
           && 0 <= counter.eff() && 0 <= counter.effErr() )
      {
        boost::format fmt( format2 ) ;
        fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
        fmt
          % ( "\"" + name  + ":"  )
          % ( ":"  + group + "\"" )
          %   counter.nEntries ()
          %   counter.sum      ()
          % ( counter.eff      () * 100 )
          % ( counter.effErr   () * 100 ) ;
        return fmt.str() ;
      }
      boost::format fmt  ( format1 ) ;
      fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
      fmt
        % ( "\""  + name  + ":"  )
        % ( ":"   + group + "\"" )
        %   counter.nEntries ()
        %   counter.sum      ()
        %   counter.mean     ()
        %   counter.rms      ()
        %   counter.min      ()
        %   counter.max      () ;
      return fmt.str() ;
    }

IAlgorithm * Gaudi::Utils::getAlgorithm | ( | const IAlgContextSvc * | svc,
|  | const AlgSelector & | sel
| ) |  |

simple function to get the algorithm from Context Service

      // get the selector
      const AlgSelector& selector = ... ;

      // get the context service:
      const IAlgContextSvc* svc = ... ;

      // get the appropriate algorithm:
      IAlgorithm* alg = getAlgorithm ( svc , selector ) ;

See also:
  IAlgContextSvc
  Gaudi::Utils::AlgSelector

Parameters:

  svc | pointer to Algororithm Contetx Service
  sel | the selection functor

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 29 of file GetAlg.cpp.

    {
      if ( 0 == svc ) { return  0 ; } // RETURN
      return getAlgorithm ( svc->algorithms() , sel ) ;
    }

IAlgorithm * Gaudi::Utils::getAlgorithm | ( | const std::vector< IAlgorithm * > & | lst,
|  | const AlgSelector & | sel
| ) |  |

simple function to get the algorithm from Context Service

      // get the selector
      const AlgSelector& selector = ... ;

      // get the list of algorithms:
      const std::vector<IAlgorithm*>& algs = ... ;

      // get the appropriate algorithm:
      IAlgorithm* alg = getAlgorithm ( algs  , selector ) ;

See also:
  IAlgContextSvc
  Gaudi::Utils::AlgSelector

Parameters:

  lst | list of the algorithms
  sel | the selection functor

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 40 of file GetAlg.cpp.

    {
      for ( std::vector<IAlgorithm*>::const_reverse_iterator it = lst.rbegin() ;
            lst.rend() != it ; ++it )
      {
        // use the selector:
        if ( sel ( *it ) ) { return *it ; }  // return
      }
      return 0 ;
    }

GaudiAlgorithm * Gaudi::Utils::getGaudiAlg | ( | const IAlgContextSvc * | svc ) |

simple function to extract the last active GaudiAlgorithm from the context

      // get the context service:
      const IAlgContextSvc* svc = ... ;

      GaudiAlgorithm* ga = getGaudiAlg ( svc ) ;

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 67 of file GetAlgs.cpp.

    { return getAlg<GaudiAlgorithm> ( svc ) ; }

GaudiSequencer * Gaudi::Utils::getGaudiSequencer | ( | const IAlgContextSvc * | svc ) |

simple function to extract the last active GaudiSequencer from the context

      // get the context service:
      const IAlgContextSvc* svc = ... ;

      GaudiSequencer* sa = getGaudiSequencer ( svc ) ;

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 127 of file GetAlgs.cpp.

    { return getAlg<GaudiSequencer> ( svc ) ; }

GaudiHistoAlg * Gaudi::Utils::getHistoAlg | ( | const IAlgContextSvc * | svc ) |

simple function to extract the last active GaudiHistoAlg from the context

      // get the context service:
      const IAlgContextSvc* svc = ... ;

      GaudiHistoAlg* ha = getHistoAlg ( svc ) ;

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 87 of file GetAlgs.cpp.

    { return getAlg<GaudiHistoAlg> ( svc ) ; }

const Property * Gaudi::Utils::getProperty | ( | const std::vector< const Property * > * | p,
|  | const std::string & | name
| ) |  |

get the property by name from the list of the properties

       IJobOptionsSvc* svc = ... ;

       const std::string client = ... ;

      // get the property:
      const Property* context =
          getProperty ( svc->getProperties( client ) , "Context" )

See also:
  IJobOptionsSvc

Parameters:

  p | list of properties
  name | property name (case insensitive)

Returns:
  property with the given name (if exists), NULL otherwise

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 441 of file Property.cpp.

    {
      // trivial check
      if ( 0 == p             ) { return 0 ; }                 // RETURN
      std::vector<const Property*>::const_iterator ifound =
        std::find_if ( p->begin() , p->end() , _ByName_( name ) ) ;
      if ( p->end() == ifound ) { return 0 ; }                 // RETURN
      // OK
      return *ifound ;
    }

Property * Gaudi::Utils::getProperty | ( | const IProperty * | p,
|  | const std::string & | name
| ) |  |

simple function which gets the property with given name from the component

      const IProperty* p = ... ;

      const Property* pro = getProperty( p , "Context" ) ;

Parameters:

  p | pointer to IProperty object
  name | property name (case insensitive)

Returns:
  property with the given name (if exists), NULL otherwise

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 338 of file Property.cpp.

    {
      // trivial check
      if ( 0 == p      ) { return 0 ; }                          // RETURN
      // get all properties
      typedef std::vector<Property*> List ;
      const List& lst = p->getProperties() ;
      if ( lst.empty() ) { return 0 ; }                          // RETURN
      // comparison criteria:
      List::const_iterator ifound =
        std::find_if ( lst.begin() , lst.end() , _ByName_( name ) ) ;
      if ( lst.end() == ifound ) { return 0 ; }                  // RETURN
      // OK
      return *ifound ;
    }

Property * Gaudi::Utils::getProperty | ( | const IInterface * | p,
|  | const std::string & | name
| ) |  |

simple function which gets the property with given name from the component

      const IInterface* p = ... ;

      const Property* pro = getProperty( p , "Context" ) ;

Parameters:

  p | pointer to IInterface object
  name | property name (case insensitive)

Returns:
  property with the given name (if exists), NULL otherwise

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 374 of file Property.cpp.

    {
      // trivial check
      if ( 0 ==  p        ) { return 0 ; }                                // RETURN
      // remove const-qualifier
      IInterface* _i = const_cast<IInterface*>( p ) ;
      if ( 0 == _i        ) { return 0 ; }                                // RETURN
      SmartIF<IProperty> property ( _i ) ;
      if ( !property      ) { return 0 ; }                                // RETURN
      return getProperty ( property , name ) ;
    }

IAlgorithm * Gaudi::Utils::getSequencer | ( | const IAlgContextSvc * | svc ) |

simple function to extract the last active "Sequencer" () GaudiSequencer or simple Sequencer) from the context

      // get the context service:
      const IAlgContextSvc* svc = ... ;

      IAlgorithm* a = getSequencer ( svc ) ;

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 167 of file GetAlgs.cpp.

    {
      if ( 0 == svc            ) { return 0 ; }  // RETURN
      //
      typedef IAlgContextSvc::Algorithms ALGS ;
      const ALGS& algs = svc->algorithms() ;
      AlgTypeSelector<GaudiSequencer> sel1 ;
      AlgTypeSelector<Sequencer>      sel2 ;
      for ( ALGS::const_reverse_iterator it = algs.rbegin() ;
            algs.rend() != it ; ++it )
      {
        if ( sel1 ( *it ) ) { return *it ; }
        if ( sel2 ( *it ) ) { return *it ; }
      }
      return 0 ;                                    // RETURN ;
    }

Sequencer * Gaudi::Utils::getSequencerAlg | ( | const IAlgContextSvc * | svc ) |

simple function to extract the last active Sequencer from the context

      // get the context service:
      const IAlgContextSvc* svc = ... ;

      Sequencer* sa = getSequencerAlg ( svc ) ;

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 146 of file GetAlgs.cpp.

    { return getAlg<Sequencer> ( svc ) ; }

GaudiTupleAlg * Gaudi::Utils::getTupleAlg | ( | const IAlgContextSvc * | svc ) |

simple function to extract the last active GaudiTupleAlg from the context

      // get the context service:
      const IAlgContextSvc* svc = ... ;

      GaudiTupleAlg* ta = getTupleAlg ( svc ) ;

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-09-07

Definition at line 107 of file GetAlgs.cpp.

    { return getAlg<GaudiTupleAlg> ( svc ) ; }

bool Gaudi::Utils::hasProperty | ( | const IProperty * | p,
|  | const std::string & | name
| ) |  |

simple function which check the existence of the property with the given name.

      const IProperty* p = ... ;

      const bool = hasProperty( p , "Context" ) ;

Parameters:

  p | pointer to IProperty object
  name | property name (case insensitive)

Returns:
  true if "p" has a property with such name

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 232 of file Property.cpp.

    {
      if ( 0 == p ) { return false ; }
      // delegate the actual work to another method ;
      return 0 != getProperty ( p , name ) ;
    }

bool Gaudi::Utils::hasProperty | ( | const IInterface * | p,
|  | const std::string & | name
| ) |  |

simple function which check the existence of the property with the given name.

      IInterface* p = .

      const bool = hasProperty( p , "Context" ) ;

Parameters:

  p | pointer to IInterface object (any component)
  name | property name (case insensitive)

Returns:
  true if "p" has a property with such name

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 204 of file Property.cpp.

    {
      // trivial check
      if ( 0 ==  p ) { return false ; }                                // RETURN
      // gelegate to another method
      return 0 != getProperty ( p , name ) ;
    }

bool Gaudi::Utils::hasProperty | ( | const std::vector< const Property * > * | p,
|  | const std::string & | name
| ) |  |

check the property by name from the list of the properties

       IJobOptionsSvc* svc = ... ;

       const std::string client = ... ;

      // get the property:
      bool context =
          hasProperty ( svc->getProperties( client ) , "Context" )

See also:
  IJobOptionsSvc

Parameters:

  p | list of properties
  name | property name (case insensitive)

Returns:
  true if the property exists

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 410 of file Property.cpp.

    {
      // delegate to another method
      return 0 != getProperty ( p , name ) ;
    }

template<class TYPE >

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const TYPE & | value,
|  | const std::string & | doc
| ) |  |

simple function to set the property of the given object from the value

      IProperty* component = ... ;

      std::vector<double> data = ... ;
      StatusCode sc = setProperty ( componet , "Data" ,  data ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

      IProperty* component = ... ;

      std::vector<double> data = ... ;
      StatusCode sc = setProperty ( component , "Data" ,  data ) ;

      std::map<std::string,double> cuts = ... ;
      sc = setProperty ( component , "Cuts" , cuts ) ;

      std::map<std::string,std::string> dict = ... ;
      sc = setProperty ( component , "Dictionary" , dict ) ;

Note: the native interface IProperty allows setting of the properties either directly from other properties or from strings only

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 1193 of file Property.h.

        {
          if ( 0 == component ) { return StatusCode::FAILURE ; }   // RETURN
          if ( !hasProperty ( component , name ) ) { return StatusCode::FAILURE ; }
          const std::string val = Gaudi::Utils::toString ( value ) ;
          return Gaudi::Utils::setProperty ( component , name , val , doc ) ;
        }

template<class TYPE >

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const TYPE & | value
| ) |  |

simple function to set the property of the given object from the value

      IProperty* component = ... ;

      std::vector<double> data = ... ;
      StatusCode sc = setProperty ( componet , "Data" ,  data ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 1093 of file Property.h.

        { return setProperty ( component , name , value , std::string() ) ; }

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const std::string & | value,
|  | const std::string & | doc = `""`
| ) |  |

the full specialization of the previous method setProperty( IProperty, std::string, const TYPE&) for standard strings

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 491 of file Property.cpp.

    {
      if ( 0 == component ) { return StatusCode::FAILURE ; }   // RETURN
      if ( !hasProperty ( component , name ) ) { return StatusCode::FAILURE ; }
      StatusCode sc = component -> setProperty ( name , value ) ;
      if ( !doc.empty() )
      {
        Property* p = getProperty( component , name ) ;
        if ( 0 != p ) { p -> setDocumentation ( doc ) ; }
      }
      sc.ignore() ;
      return sc ;
    }

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const char * | value,
|  | const std::string & | doc = `""`
| ) |  |

the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-strings

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 468 of file Property.cpp.

    {
      const std::string val = std::string( value ) ;
      return Gaudi::Utils::setProperty ( component , name , val , doc ) ;
    }

template<unsigned N>

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const char(&) | value[N],
|  | const std::string & | doc = `""`
| ) |  |

the full specialization of the method setProperty( IProperty, std::string, const TYPE&) for C-arrays

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 1151 of file Property.h.

        {
          if ( 0 == component                    ) { return StatusCode::FAILURE ; }
          const std::string val = std::string ( value , value + N ) ;
          return setProperty ( component , name , val , doc ) ;
        }

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const Property * | property,
|  | const std::string & | doc = `""`
| ) |  |

simple function to set the property of the given object from another property

      IProperty* component = ... ;

      const Property* prop = ... ;
      StatusCode sc = setProperty ( component , "Data" ,  prop  ) ;

Parameters:

  component | component which needs to be configured
  name | name of the property
  property | the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 531 of file Property.cpp.

    {
      if ( 0 == component || 0 == property   ) { return StatusCode::FAILURE ; }
      if ( !hasProperty ( component , name ) ) { return StatusCode::FAILURE ; }
      Property* p = getProperty ( component , name ) ;
      if ( 0 == p                            ) { return StatusCode::FAILURE ; }
      if ( !p->assign ( *property )          ) { return StatusCode::FAILURE ; }
      if ( !doc.empty()  ) { p->setDocumentation( doc ) ; }
      return StatusCode::SUCCESS ;
    }

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const Property & | property,
|  | const std::string & | doc = `""`
| ) |  |

simple function to set the property of the given object from another property

      IProperty* component = ... ;

      const Property& prop = ... ;
      StatusCode sc = setProperty ( component , "Data" ,  prop  ) ;

Parameters:

  component | component which needs to be configured
  name | name of the property
  property | the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 568 of file Property.cpp.

    { return setProperty ( component , name , &property , doc ) ; }

template<class TYPE >

StatusCode Gaudi::Utils::setProperty | ( | IProperty * | component,
|  | const std::string & | name,
|  | const SimpleProperty< TYPE > & | value,
|  | const std::string & | doc = `""`
| ) |  |

simple function to set the property of the given object from another property

      IProperty* component = ... ;

      SimpleProperty<std::vector<int> > m_data = ... ;

      StatusCode sc = setProperty ( component , "Data" ,  prop  ) ;

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 1282 of file Property.h.

        {
          const Property* property = &value ;
          return setProperty ( component , name , property , doc ) ;
        }

template<class TYPE >

StatusCode Gaudi::Utils::setProperty | ( | IInterface * | component,
|  | const std::string & | name,
|  | const TYPE & | value,
|  | const std::string & | doc = `""`
| ) |  |

simple function to set the property of the given object from the value

      IInterface* component = ... ;

      std::vector<double> data = ... ;
      StatusCode sc = setProperty ( component , "Data" ,  data ) ;

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 1313 of file Property.h.

        {
          if ( 0 == component ) { return StatusCode::FAILURE ; }
          SmartIF<IProperty> property ( component ) ;
          if ( !property      ) { return StatusCode::FAILURE ; }
          return setProperty ( property , name , value , doc ) ;
        }

StatusCode Gaudi::Utils::setProperty | ( | IInterface * | component,
|  | const std::string & | name,
|  | const std::string & | value,
|  | const std::string & | doc = `""`
| ) |  |

the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for standard strings

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 588 of file Property.cpp.

    {
      if ( 0 == component ) { return StatusCode::FAILURE ; }
      SmartIF<IProperty> property ( component ) ;
      if ( !property      ) { return StatusCode::FAILURE ; }
      return setProperty ( property , name , value , doc ) ;
    }

StatusCode Gaudi::Utils::setProperty | ( | IInterface * | component,
|  | const std::string & | name,
|  | const char * | value,
|  | const std::string & | doc = `""`
| ) |  |

the full specialization of the method setProperty( IInterface , std::string, const TYPE&) for C-strings

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 613 of file Property.cpp.

    {
      const std::string val = std::string( value ) ;
      return setProperty ( component , name , val , doc ) ;
    }

template<unsigned N>

StatusCode Gaudi::Utils::setProperty | ( | IInterface * | component,
|  | const std::string & | name,
|  | const char(&) | value[N],
|  | const std::string & | doc = `""`
| ) |  |

the full specialization of the method setProperty( IInterface, std::string, const TYPE&) for C-arrays

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | value of the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 1375 of file Property.h.

        {
          if ( 0 == component ) { return StatusCode::FAILURE ; }
          const std::string val = std::string ( value , value + N ) ;
          return setProperty ( component , name , val , doc ) ;
        }

StatusCode Gaudi::Utils::setProperty | ( | IInterface * | component,
|  | const std::string & | name,
|  | const Property * | property,
|  | const std::string & | doc = `""`
| ) |  |

simple function to set the property of the given object from another property

      IInterface* component = ... ;

      const Property* prop = ... ;
      StatusCode sc = setProperty ( component , "Data" ,  prop  ) ;

Parameters:

  component | component which needs to be configured
  name | name of the property
  property | the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 645 of file Property.cpp.

    {
      if ( 0 == component ) { return StatusCode::FAILURE ; }
      SmartIF<IProperty> prop  ( component ) ;
      if ( !prop          ) { return StatusCode::FAILURE ; }
      return setProperty ( prop  , name , property , doc ) ;
    }

StatusCode Gaudi::Utils::setProperty | ( | IInterface * | component,
|  | const std::string & | name,
|  | const Property & | property,
|  | const std::string & | doc = `""`
| ) |  |

simple function to set the property of the given object from another property

      IInterface* component = ... ;

      const Property& prop = ... ;
      StatusCode sc = setProperty ( component , "Data" ,  prop  ) ;

Parameters:

  component | component which needs to be configured
  name | name of the property
  property | the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 679 of file Property.cpp.

    { return setProperty ( component , name , &property , doc ) ; }

template<class TYPE >

StatusCode Gaudi::Utils::setProperty | ( | IInterface * | component,
|  | const std::string & | name,
|  | const SimpleProperty< TYPE > & | value,
|  | const std::string & | doc = `""`
| ) |  |

simple function to set the property of the given object from another property

      IInterface* component = ... ;

      SimpleProperty<std::vector<int> > m_data = ... ;

      StatusCode sc = setProperty ( component , "Data" ,  prop  ) ;

Parameters:

  component | component which needs to be configured
  name | name of the property
  value | the property
  doc | the new documentation string

See also:
  IProperty

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-05-13

Definition at line 1464 of file Property.h.

        {
          const Property* property = &value ;
          return setProperty ( component , name , property , doc ) ;
        }

template<class TYPE , class ALLOCATOR >

std::ostream& Gaudi::Utils::toStream | ( | const std::list< TYPE, ALLOCATOR > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `std::list<TYPE,ALLOCATOR>` printout.

The vector is printed a'la Python list: "[ a, b, c ]"

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2007-04-08

Definition at line 163 of file ToStream.h.

        {
          return toStream ( obj.begin() , obj.end () , s , "[ " , " ]" , " , " ) ;
        }

template<class TYPE , unsigned int N>

std::ostream& Gaudi::Utils::toStream | ( | TYPE(&) | obj[N],
|  | std::ostream & | s
| ) |  |

the specialization for C-arrays, a'la python tuple

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhenf.nl

Date:
  2009-10-05

Definition at line 281 of file ToStream.h.

        {
          return toStream ( obj , obj + N , s , "( " , " )" , " , " ) ;
        }

template<class SCALAR , unsigned int N>

std::ostream& Gaudi::Utils::toStream | ( | const ROOT::Math::SVector< SCALAR, N > & | obj,
|  | std::ostream & | s
| ) |  |

the general streaming function for SVector using python-tupel format

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-10-07

Definition at line 87 of file SVectorAsProperty.h.

        {
          s << "( ";
          for ( typename ROOT::Math::SVector<SCALAR,N>::const_iterator cur = obj.begin() ;
                obj.end() != cur ; ++cur )
          {
            if ( obj.begin() != cur ) { s << " , "; }
            toStream ( *cur , s ) ;
          }
          return s << " )";
        }

std::ostream& Gaudi::Utils::toStream | ( | const char * | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the specialization for C-string, a'la python tuple

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhenf.nl

Date:
  2009-10-05

Definition at line 316 of file ToStream.h.

        { return toStream ( std::string ( obj ) , s ) ; }

template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >

std::ostream& Gaudi::Utils::toStream | ( | const GaudiUtils::VectorMap< KTYPE, VTYPE, CMP, ALLOCATOR > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `GaudiUtils::VectorMap<KTYPE,VTYPE,CMP,ALLOCATOR>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

See also:
  GaudiUtils::VectorMap

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 214 of file ToStream.h.

        {
          s << "{ ";
          for ( typename GaudiUtils::VectorMap<KTYPE,VTYPE,CMP,ALLOCATOR>::const_iterator cur = obj.begin() ;
                obj.end() != cur ; ++cur )
          {
            if ( obj.begin() != cur ) { s << " , " ; }
            toStream ( cur -> first  , s ) ;
            s << " : " ;
            toStream ( cur -> second , s ) ;
          }
          return s << " }";
        }

template<class TYPE >

std::ostream & Gaudi::Utils::toStream | ( | const TYPE & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the generic implementation of the printout to the std::ostream

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 325 of file ToStream.h.

        { return s << obj ; }

std::ostream& Gaudi::Utils::toStream | ( | const float | obj,
|  | std::ostream & | s,
|  | const int | prec = `6`
| ) |  | `[inline]`

the printout of float values with the reasonable precision

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 98 of file ToStream.h.

        {
          const int  p = s.precision() ;
          return s << std::setprecision (  prec ) << obj << std::setprecision ( p ) ;
        }

template<class KTYPE , class VTYPE , class MAP >

std::ostream& Gaudi::Utils::toStream | ( | const GaudiUtils::Map< KTYPE, VTYPE, MAP > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `GaudiUtils::Map<KTYPE,VTYPE,MAP>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

See also:
  GaudiUtils::VectorMap

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 238 of file ToStream.h.

        {
          s << "{ ";
          for ( typename GaudiUtils::Map<KTYPE,VTYPE,MAP>::const_iterator cur = obj.begin() ;
                obj.end() != cur ; ++cur )
          {
            if ( obj.begin() != cur ) { s << " , " ; }
            toStream ( cur -> first  , s ) ;
            s << " : " ;
            toStream ( cur -> second , s ) ;
          }
          return s << " }";
        }

template<class KTYPE , class VTYPE , class CMP , class ALLOCATOR >

std::ostream& Gaudi::Utils::toStream | ( | const std::map< KTYPE, VTYPE, CMP, ALLOCATOR > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `std::map<KTYPE,VTYPE,CMP,ALLOCATOR>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 190 of file ToStream.h.

        {
          s << "{ ";
          for ( typename std::map<KTYPE,VTYPE,CMP,ALLOCATOR>::const_iterator cur =
                  obj.begin() ; obj.end() != cur ; ++cur )
          {
            if ( obj.begin() != cur ) { s << " , " ; }
            toStream ( cur -> first  , s ) ;
            s << " : " ;
            toStream ( cur -> second , s ) ;
          }
          return s << " }";
        }

template<class TYPE , std::size_t N>

std::ostream& Gaudi::Utils::toStream | ( | const boost::array< TYPE, N > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

printout of class boost::array The format is "Python's tuple"

Parameters:

  obj | (INPUT) the arary to be printed
  s | (UPDATE) the actual stream

Returns:
  the updated stream

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhef.nl

Date:
  2009-09-16

Definition at line 53 of file BoostArrayAsProperty.h.

        {
          return toStream
            ( obj.begin () , obj.end   () , s , "( "  , " )"   , " , "  ) ;
        }

template<class TYPE , class CMP , class ALLOCATOR >

std::ostream& Gaudi::Utils::toStream | ( | const std::set< TYPE, CMP, ALLOCATOR > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `std::set<TYPE,CMP,ALLOCATOR>` printout.

The vector is printed a'la Python list: "[ a, b, c ]"

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 176 of file ToStream.h.

        {
          return toStream ( obj.begin() , obj.end () , s , "[ " , " ]" , " , " ) ;
        }

template<class ITERATOR >

std::ostream & Gaudi::Utils::toStream | ( | ITERATOR | first,
|  | ITERATOR | last,
|  | std::ostream & | s,
|  | const std::string & | open,
|  | const std::string & | close,
|  | const std::string & | delim
| ) |  | `[inline]`

the helper function to print the sequence

Parameters:

  first | (INPUT) begin-iterator for the sequence
  last | (INPUT) end-iterator for the sequence
  s | (UPDATE) the stream itself
  open | (INPUT) "open"-symbol
  close | (INPUT) "close"-symbol
  delim | (INPUT) "delimiter"-symbol

Returns:
  the stream

Author:
  Vanya BELYAEV Ivan.BElyaev@nikhef.nl

Date:
  2009-09-15

Definition at line 341 of file ToStream.h.

        {
          s << open ;
          for ( ITERATOR curr = first ; curr != last ; ++curr )
          {
            if ( first != curr ) { s << delim ; }
            toStream ( *curr , s ) ;
          }
          s << close ;
          //
          return s ;
        }

template<unsigned int N>

std::ostream& Gaudi::Utils::toStream | ( | char(&) | obj[N],
|  | std::ostream & | s
| ) |  |

the specialization for C-string, a'la python tuple

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhenf.nl

Date:
  2009-10-05

Definition at line 301 of file ToStream.h.

        { return toStream ( std::string ( obj , obj+N ) , s ) ; }

std::ostream& Gaudi::Utils::toStream | ( | const long double | obj,
|  | std::ostream & | s,
|  | const int | prec = `10`
| ) |  | `[inline]`

the printout of long double values with the reasonable precision

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 118 of file ToStream.h.

        {
          const int p = s.precision() ;
          return s << std::setprecision ( prec ) << obj << std::setprecision ( p ) ;
        }

template<class KTYPE , class VTYPE , class HASH , class MAP >

std::ostream& Gaudi::Utils::toStream | ( | const GaudiUtils::HashMap< KTYPE, VTYPE, HASH, MAP > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `GaudiUtils::HashMap<KTYPE,VTYPE,HASH,MAP>` printout the map is printed a'la Python dict: " ( a : b , c: d , e : f )"

See also:
  GaudiUtils::VectorMap

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 262 of file ToStream.h.

        {
          s << "{ ";
          for ( typename GaudiUtils::HashMap<KTYPE,VTYPE,HASH,MAP>::const_iterator cur = obj.begin() ;
                obj.end() != cur ; ++cur )
          {
            if ( obj.begin() != cur ) { s << " , " ; }
            toStream ( cur -> first  , s ) ;
            s << " : " ;
            toStream ( cur -> second , s ) ;
          }
          return s << " }";
        }

std::ostream & Gaudi::Utils::toStream | ( | const Gaudi::LorentzVector & | obj,
|  | std::ostream & | s
| ) |  |

print Lorentz vector

Definition at line 275 of file ParseVct.cpp.

    {

      s << "( " ;
      toStream ( obj.Px () , s , 12 ) ;
      s << " , " ;
      toStream ( obj.Py () , s , 12 ) ;
      s << " , " ;
      toStream ( obj.Pz () , s , 13 ) ;
      s << " , "  ;
      toStream ( obj.E  () , s , 14 ) ;
      s << " )"  ;

      return s ;
    }

template<class SCALAR >

std::ostream& Gaudi::Utils::toStream | ( | const SCALAR & | ,
|  | std::ostream & |
| ) |  |

template<unsigned int N>

std::ostream& Gaudi::Utils::toStream | ( | const char(&) | obj[N],
|  | std::ostream & | s
| ) |  |

the specialization for C-string, a'la python tuple

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhenf.nl

Date:
  2009-10-05

Definition at line 309 of file ToStream.h.

        { return toStream ( std::string ( obj , obj+N ) , s ) ; }

std::ostream& Gaudi::Utils::toStream | ( | const bool | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the printout of boolean values "a'la Python"

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 91 of file ToStream.h.

        { return s << ( obj ? "True" : "False" ) ; }

std::ostream& Gaudi::Utils::toStream | ( | const double | obj,
|  | std::ostream & | s,
|  | const int | prec = `8`
| ) |  | `[inline]`

the printout of double values with the reasonable precision

Author:
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-09-09

Definition at line 108 of file ToStream.h.

        {
          const int p = s.precision() ;
          return s << std::setprecision ( prec ) << obj << std::setprecision ( p ) ;
        }

template<class KTYPE , class VTYPE >

std::ostream& Gaudi::Utils::toStream | ( | const std::pair< KTYPE, VTYPE > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `std::pair<KTYPE,VTYPE>` printout the pair is printed a'la Python tuple: " ( a , b )"

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 133 of file ToStream.h.

        {
          s << "( "  ;
          toStream ( obj.first  , s ) ;
          s << " , " ;
          toStream ( obj.second , s ) ;
          return s << " )" ;
        }

template<class TYPE , unsigned int N>

std::ostream& Gaudi::Utils::toStream | ( | const TYPE(&) | obj[N],
|  | std::ostream & | s
| ) |  |

the specialization for C-arrays, a'la python tuple

Author:
  Vanya BELYAEV Ivan.Belyaev@nikhenf.nl

Date:
  2009-10-05

Definition at line 291 of file ToStream.h.

        {
          return toStream ( obj , obj + N , s , "( " , " )" , " , " ) ;
        }

std::ostream & Gaudi::Utils::toStream | ( | const Gaudi::XYZVector & | obj,
|  | std::ostream & | s
| ) |  |

print XYZ vector

Definition at line 259 of file ParseVct.cpp.

    {
      s << "( "  ;
      toStream ( obj.X () , s ) ;
      s << " , " ;
      toStream ( obj.Y () , s ) ;
      s << " , " ;
      toStream ( obj.Z () , s ) ;
      s << " )"  ;

      return s ;
    }

template<class TYPE , class ALLOCATOR >

std::ostream& Gaudi::Utils::toStream | ( | const std::vector< TYPE, ALLOCATOR > & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the partial template specialization of `std::vector<TYPE,ALLOCATOR>` printout.

The vector is printed a'la Python list: "[ a, b, c ]"

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 150 of file ToStream.h.

        {
          return toStream ( obj.begin() , obj.end () , s , "[ " , " ]" , " , " ) ;
        }

std::ostream& Gaudi::Utils::toStream | ( | const std::string & | obj,
|  | std::ostream & | s
| ) |  | `[inline]`

the printtout of the strings.

the string is printed a'la Python using the quotes

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

Definition at line 78 of file ToStream.h.

        {
          if ( std::string::npos == obj.find('\'') )
          { s << "\'" << obj << "\'" ; }
          else
          { s << "\"" << obj << "\"" ; }
          return s ;
        }

std::ostream & Gaudi::Utils::toStream | ( | const Gaudi::XYZPoint & | obj,
|  | std::ostream & | s
| ) |  |

print XYZ point

Definition at line 244 of file ParseVct.cpp.

    {
      s << "( "  ;
      toStream ( obj.X () , s ) ;
      s << " , " ;
      toStream ( obj.Y () , s ) ;
      s << " , " ;
      toStream ( obj.Z () , s ) ;
      s << " )"  ;
      return s ;
    }

std::ostream & Gaudi::Utils::toStream | ( | const Gaudi::StringKey & | key,
|  | std::ostream & | s
| ) |  |

send the object to stream (needed to use it as property)

See also:
  Gaudi::StringKey
  Gaudi::Utils::toString
  Gaudi::Utils::toStream

Parameters:

  key | (INPUT) the object to be printed
  s | (OUTPUT) the stream

Returns:
  the stream

Author:
  Vanya BELYAEV Iavn.Belyaev@nikhef.nl

Date:
  2009-10-07

Definition at line 68 of file StringKey.cpp.

    { return Gaudi::Utils::toStream ( key.str() , s ) ; }

template<class TYPE >

std::string Gaudi::Utils::toString | ( | const TYPE & | obj ) | `[inline]`

the generic implementation of the type conversion to the string

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-12

See also:
  Gaudi::Utils::toStream

Todo:
  need to be compared with boost::lexical_cast

Definition at line 367 of file ToStream.h.

        {
          std::ostringstream s;
          toStream ( obj , s);
          return s.str();
        }

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines