Gaudi Framework, version v20r2

Generated: 18 Jul 2008

Gaudi::Utils Namespace Reference


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...
class  AlgContext
 Helper "sentry" class to automatize the safe register/unregister the algorithm's context. 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...

Namespaces

namespace  Histos
 Collection of useful utilities for manipulations with AIDA hisgograms.

Functions

IAlgorithmgetAlgorithm (const IAlgContextSvc *svc, const AlgSelector &sel)
 simple function to get the algorithm from Context Service
IAlgorithmgetAlgorithm (const std::vector< IAlgorithm * > &lst, const AlgSelector &sel)
 simple function to get the algorithm from Context Service
GaudiAlgorithmgetGaudiAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiAlgorithm from the context
GaudiHistoAlggetHistoAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiHistoAlg from the context
GaudiTupleAlggetTupleAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiTupleAlg from the context
GaudiSequencergetGaudiSequencer (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiSequencer from the context
SequencergetSequencerAlg (const IAlgContextSvc *svc)
 simple function to extract the last active Sequencer from the context
IAlgorithmgetSequencer (const IAlgContextSvc *svc)
 simple function to extract the last active "Sequencer" () GaudiSequencer or simple Sequencer) from the context
IAlgorithmgetAlgorithm (const IAlgContextSvc *svc, const AlgSelector &sel)
 simple function to get the algorithm from Context Service
IAlgorithmgetAlgorithm (const std::vector< IAlgorithm * > &lst, const AlgSelector &sel)
 simple function to get the algorithm from Context Service
GaudiAlgorithmgetGaudiAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiAlgorithm from the context
GaudiHistoAlggetHistoAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiHistoAlg from the context
GaudiTupleAlggetTupleAlg (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiTupleAlg from the context
GaudiSequencergetGaudiSequencer (const IAlgContextSvc *svc)
 simple function to extract the last active GaudiSequencer from the context
SequencergetSequencerAlg (const IAlgContextSvc *svc)
 simple function to extract the last active Sequencer from the context
IAlgorithmgetSequencer (const IAlgContextSvc *svc)
 simple function to extract the last active "Sequencer" () GaudiSequencer or simple Sequencer) from the context
bool hasProperty (const IProperty *p, const std::string &name)
 simple function which check the existence of the property with the given name.
bool hasProperty (const IInterface *p, const std::string &name)
 simple function which check the existence of the property with the given name.
PropertygetProperty (const IProperty *p, const std::string &name)
 simple function which gets the property with given name from the component
PropertygetProperty (const IInterface *p, const std::string &name)
 simple function which gets the property with given name from the component
bool hasProperty (const std::vector< const Property * > *p, const std::string &name)
 check the property by name from the list of the properties
const PropertygetProperty (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
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
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
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
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
template<class TYPE>
StatusCode setProperty (IInterface *component, const std::string &name, const TYPE &value)
 simple function to set the property of the given object from the value
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
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
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
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
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
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
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
template<class TYPE>
std::ostreamtoStream (const TYPE &obj, std::ostream &s)
 the generic implementation of the printout to the std::ostream
std::ostreamtoStream (const std::string &obj, std::ostream &s)
 the printtout of the strings.
std::ostreamtoStream (const bool obj, std::ostream &s)
 the printout of boolean values "a'la Python"
std::ostreamtoStream (const float obj, std::ostream &s)
 the printout of float values with the reasonable precision
std::ostreamtoStream (const double obj, std::ostream &s)
 the printout of double values with the reasonable precision
std::ostreamtoStream (const long double obj, std::ostream &s)
 the printout of long double values with the reasonable precision
template<class TYPE, class ALLOCATOR>
std::ostreamtoStream (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::ostreamtoStream (const std::list< TYPE, ALLOCATOR > &obj, std::ostream &s)
 the partial template specialization of std::list<TYPE,ALLOCATOR> printout.
template<class KTYPE, class VTYPE>
std::ostreamtoStream (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 CMP, class ALLOCATOR>
std::ostreamtoStream (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::ostreamtoStream (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::ostreamtoStream (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::ostreamtoStream (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::ostreamtoStream (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>
std::string toString (const TYPE &obj)
 the generic implementation of the type conversion to the string
bool hasProperty (const IInterface *p, const std::string &name)
 simple function which check the existence of the property with the given name.
bool hasProperty (const IProperty *p, const std::string &name)
 simple function which check the existence of the property with the given name.
PropertygetProperty (const IProperty *p, const std::string &name)
 simple function which gets the property with given name from the component
PropertygetProperty (const IInterface *p, const std::string &name)
 simple function which gets the property with given name from the component
bool hasProperty (const std::vector< const Property * > *p, const std::string &name)
 check the property by name from the list of the properties
const PropertygetProperty (const std::vector< const Property * > *p, const std::string &name)
 get the property by name from the list of the properties
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
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
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
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
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
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
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
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
std::string formatAsTableRow (const StatEntity &counter, const bool flag, const std::string &format1, const std::string &format2)
 print the counter in a form of the table row
std::string formatAsTableRow (const std::string &name, const StatEntity &counter, const bool flag, const std::string &format1, const std::string &format2)
 print the counter in a form of the table row
std::string formatAsTableRow (const std::string &name, const std::string &group, const StatEntity &counter, const bool flag, const std::string &format1, const std::string &format2)
 print the counter in a form of the table row


Function Documentation

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 << endreq ;

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

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

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 overal 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")

The printout is performed according to format, specifed 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 372 of file StatEntity.cpp.

References counter(), effCounter(), format(), and name.

00378 {
00379   using namespace boost::io ;
00380   if ( flag && ( effCounter ( name ) || effCounter ( group ) ) 
00381        && 0 <= counter.eff() && 0 <= counter.effErr() ) 
00382   {
00383     boost::format fmt( format2 ) ;
00384     fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00385     fmt 
00386       % ( "\"" + name  + ":"  ) 
00387       % ( ":"  + group + "\"" ) 
00388       %   counter.nEntries () 
00389       %   counter.flag     () 
00390       % ( counter.eff      () * 100 ) 
00391       % ( counter.effErr   () * 100 ) ;
00392     return fmt.str() ;
00393   }
00394   boost::format fmt  ( format1 ) ;
00395   fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00396   fmt 
00397     % ( "\""  + name  + ":"  ) 
00398     % ( ":"   + group + "\"" ) 
00399     %   counter.nEntries () 
00400     %   counter.flag     () 
00401     %   counter.flagMean () 
00402     %   counter.flagRMS  ()  
00403     %   counter.flagMin  () 
00404     %   counter.flagMax  () ;
00405   return fmt.str() ;
00406 }

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 << endreq ;

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

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

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 overal reshuffling of the reformatted columns

If the parameter "flag" is set to true AND the counter name, converted to the lowercase constains 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")

The printout is performed according to format, specifed 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 329 of file StatEntity.cpp.

References counter(), effCounter(), format(), and name.

00334 {
00335   using namespace boost::io ;
00336   if ( flag && effCounter ( name ) && 0 <= counter.eff() && 0 <= counter.effErr() ) 
00337   {
00338     boost::format fmt( format2 ) ;
00339     fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00340     fmt 
00341       % ( "\"" + name + "\"" ) 
00342       %   counter.nEntries ()       
00343       %   counter.flag     () 
00344       % ( counter.eff      () * 100 ) 
00345       % ( counter.effErr   () * 100 ) ;
00346     return fmt.str() ;
00347   }
00348   boost::format fmt  ( format1 ) ;
00349   fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00350   fmt 
00351     % ( "\"" + name + "\"" ) 
00352     %   counter.nEntries () 
00353     %   counter.flag     () 
00354     %   counter.flagMean () 
00355     %   counter.flagRMS  ()  
00356     %   counter.flagMin  () 
00357     %   counter.flagMax  () ;
00358   return fmt.str() ;
00359 }

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 ) << endreq ;
     }

The regular counter is printed as 6 fields

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 overal 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:

The printout is performed according to format, specifed 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 290 of file StatEntity.cpp.

References counter(), and format().

00294 {
00295   using namespace boost::io ;
00296   if ( flag && 0 <= counter.eff() && 0 <= counter.effErr() ) 
00297   {
00298     boost::format fmt( format2 ) ;
00299     fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00300     fmt 
00301       %   counter.nEntries ()       
00302       %   counter.flag     () 
00303       % ( counter.eff      () * 100 ) 
00304       % ( counter.effErr   () * 100 ) ;
00305     return fmt.str() ;
00306   }
00307   boost::format fmt  ( format1 ) ;
00308   fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00309   fmt 
00310     %   counter.nEntries () 
00311     %   counter.flag     () 
00312     %   counter.flagMean () 
00313     %   counter.flagRMS  ()  
00314     %   counter.flagMin  () 
00315     %   counter.flagMax  () ;
00316   return fmt.str() ;
00317 }

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 << endreq ;

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

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

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 overal 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")

The printout is performed according to format, specifed 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 372 of file StatEntity.cpp.

References counter(), effCounter(), format(), and name.

00378 {
00379   using namespace boost::io ;
00380   if ( flag && ( effCounter ( name ) || effCounter ( group ) ) 
00381        && 0 <= counter.eff() && 0 <= counter.effErr() ) 
00382   {
00383     boost::format fmt( format2 ) ;
00384     fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00385     fmt 
00386       % ( "\"" + name  + ":"  ) 
00387       % ( ":"  + group + "\"" ) 
00388       %   counter.nEntries () 
00389       %   counter.flag     () 
00390       % ( counter.eff      () * 100 ) 
00391       % ( counter.effErr   () * 100 ) ;
00392     return fmt.str() ;
00393   }
00394   boost::format fmt  ( format1 ) ;
00395   fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00396   fmt 
00397     % ( "\""  + name  + ":"  ) 
00398     % ( ":"   + group + "\"" ) 
00399     %   counter.nEntries () 
00400     %   counter.flag     () 
00401     %   counter.flagMean () 
00402     %   counter.flagRMS  ()  
00403     %   counter.flagMin  () 
00404     %   counter.flagMax  () ;
00405   return fmt.str() ;
00406 }

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 << endreq ;

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

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

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 overal reshuffling of the reformatted columns

If the parameter "flag" is set to true AND the counter name, converted to the lowercase constains 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")

The printout is performed according to format, specifed 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 329 of file StatEntity.cpp.

00334 {
00335   using namespace boost::io ;
00336   if ( flag && effCounter ( name ) && 0 <= counter.eff() && 0 <= counter.effErr() ) 
00337   {
00338     boost::format fmt( format2 ) ;
00339     fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00340     fmt 
00341       % ( "\"" + name + "\"" ) 
00342       %   counter.nEntries ()       
00343       %   counter.flag     () 
00344       % ( counter.eff      () * 100 ) 
00345       % ( counter.effErr   () * 100 ) ;
00346     return fmt.str() ;
00347   }
00348   boost::format fmt  ( format1 ) ;
00349   fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00350   fmt 
00351     % ( "\"" + name + "\"" ) 
00352     %   counter.nEntries () 
00353     %   counter.flag     () 
00354     %   counter.flagMean () 
00355     %   counter.flagRMS  ()  
00356     %   counter.flagMin  () 
00357     %   counter.flagMax  () ;
00358   return fmt.str() ;
00359 }

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 ) << endreq ;
     }

The regular counter is printed as 6 fields

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 overal 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:

The printout is performed according to format, specifed 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 290 of file StatEntity.cpp.

Referenced by CounterSvc::print(), GaudiAlg::PrintStat::print(), GaudiCommon< PBASE >::printStat(), and ChronoStatSvc::printStats().

00294 {
00295   using namespace boost::io ;
00296   if ( flag && 0 <= counter.eff() && 0 <= counter.effErr() ) 
00297   {
00298     boost::format fmt( format2 ) ;
00299     fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00300     fmt 
00301       %   counter.nEntries ()       
00302       %   counter.flag     () 
00303       % ( counter.eff      () * 100 ) 
00304       % ( counter.effErr   () * 100 ) ;
00305     return fmt.str() ;
00306   }
00307   boost::format fmt  ( format1 ) ;
00308   fmt.exceptions ( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) ) ;
00309   fmt 
00310     %   counter.nEntries () 
00311     %   counter.flag     () 
00312     %   counter.flagMean () 
00313     %   counter.flagRMS  ()  
00314     %   counter.flagMin  () 
00315     %   counter.flagMax  () ;
00316   return fmt.str() ;
00317 }

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.

References std::vector< _Tp, _Alloc >::rbegin(), and std::vector< _Tp, _Alloc >::rend().

00042 {
00043   for ( std::vector<IAlgorithm*>::const_reverse_iterator it = lst.rbegin() ; 
00044         lst.rend() != it ; ++it ) 
00045   {
00046     // use the selector:
00047     if ( sel ( *it ) ) { return *it ; }  // return 
00048   }
00049   return 0 ;
00050 }

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.

References IAlgContextSvc::algorithms(), and getAlgorithm().

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

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.

References std::vector< _Tp, _Alloc >::rbegin(), and std::vector< _Tp, _Alloc >::rend().

00042 {
00043   for ( std::vector<IAlgorithm*>::const_reverse_iterator it = lst.rbegin() ; 
00044         lst.rend() != it ; ++it ) 
00045   {
00046     // use the selector:
00047     if ( sel ( *it ) ) { return *it ; }  // return 
00048   }
00049   return 0 ;
00050 }

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.

Referenced by getAlgorithm().

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

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.

00068 { return getAlg<GaudiAlgorithm> ( svc ) ; }

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.

00068 { 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.

00128 { return getAlg<GaudiSequencer> ( 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.

00128 { 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.

00088 { return getAlg<GaudiHistoAlg> ( 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.

00088 { 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 439 of file Property.cpp.

References std::vector< _Tp, _Alloc >::begin(), std::vector< _Tp, _Alloc >::end(), std::find_if(), and name.

Referenced by RootHistCnv::RConverter::convertId(), getProperty(), hasProperty(), and setProperty().

00441 {
00442   // trivial check 
00443   if ( 0 == p             ) { return 0 ; }                 // RETURN 
00444   std::vector<const Property*>::const_iterator ifound = 
00445     std::find_if ( p->begin() , p->end() , _ByName_( name ) ) ;
00446   if ( p->end() == ifound ) { return 0 ; }                 // RETURN 
00447   // OK 
00448   return *ifound ;
00449 }

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 372 of file Property.cpp.

References getProperty(), and name.

00373 {
00374   // trivial check 
00375   if ( 0 ==  p        ) { return 0 ; }                                // RETURN 
00376   // remove const-qualifier 
00377   IInterface* _i = const_cast<IInterface*>( p ) ;
00378   if ( 0 == _i        ) { return 0 ; }                                // RETURN
00379   SmartIF<IProperty> property ( _i ) ;
00380   if ( !property      ) { return 0 ; }                                // RETURN
00381   return getProperty ( property , name ) ;
00382 } 

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 336 of file Property.cpp.

References std::find_if(), IProperty::getProperties(), List, and name.

00338 {
00339   // trivial check 
00340   if ( 0 == p      ) { return 0 ; }                          // RETURN 
00341   // get all properties 
00342   typedef std::vector<Property*> List ;
00343   const List& lst = p->getProperties() ;
00344   if ( lst.empty() ) { return 0 ; }                          // RETURN 
00345   // comparison criteria:
00346   List::const_iterator ifound = 
00347     std::find_if ( lst.begin() , lst.end() , _ByName_( name ) ) ;
00348   if ( lst.end() == ifound ) { return 0 ; }                  // RETURN 
00349   // OK 
00350   return *ifound ;
00351 } 

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 439 of file Property.cpp.

References std::vector< _Tp, _Alloc >::begin(), std::vector< _Tp, _Alloc >::end(), std::find_if(), and name.

Referenced by RootHistCnv::RConverter::convertId(), getProperty(), hasProperty(), and setProperty().

00441 {
00442   // trivial check 
00443   if ( 0 == p             ) { return 0 ; }                 // RETURN 
00444   std::vector<const Property*>::const_iterator ifound = 
00445     std::find_if ( p->begin() , p->end() , _ByName_( name ) ) ;
00446   if ( p->end() == ifound ) { return 0 ; }                 // RETURN 
00447   // OK 
00448   return *ifound ;
00449 }

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 372 of file Property.cpp.

00373 {
00374   // trivial check 
00375   if ( 0 ==  p        ) { return 0 ; }                                // RETURN 
00376   // remove const-qualifier 
00377   IInterface* _i = const_cast<IInterface*>( p ) ;
00378   if ( 0 == _i        ) { return 0 ; }                                // RETURN
00379   SmartIF<IProperty> property ( _i ) ;
00380   if ( !property      ) { return 0 ; }                                // RETURN
00381   return getProperty ( property , name ) ;
00382 } 

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 336 of file Property.cpp.

Referenced by AlgTool::AlgTool(), and HistogramSvc::HistogramSvc().

00338 {
00339   // trivial check 
00340   if ( 0 == p      ) { return 0 ; }                          // RETURN 
00341   // get all properties 
00342   typedef std::vector<Property*> List ;
00343   const List& lst = p->getProperties() ;
00344   if ( lst.empty() ) { return 0 ; }                          // RETURN 
00345   // comparison criteria:
00346   List::const_iterator ifound = 
00347     std::find_if ( lst.begin() , lst.end() , _ByName_( name ) ) ;
00348   if ( lst.end() == ifound ) { return 0 ; }                  // RETURN 
00349   // OK 
00350   return *ifound ;
00351 } 

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.

References IAlgContextSvc::algorithms().

00168 {
00169   if ( 0 == svc            ) { return 0 ; }  // RETURN
00170   //
00171   typedef IAlgContextSvc::Algorithms ALGS ;
00172   const ALGS& algs = svc->algorithms() ;
00173   AlgTypeSelector<GaudiSequencer> sel1 ;
00174   AlgTypeSelector<Sequencer>      sel2 ;
00175   for ( ALGS::const_reverse_iterator it = algs.rbegin() ; 
00176         algs.rend() != it ; ++it ) 
00177   {
00178     if ( sel1 ( *it ) ) { return *it ; }
00179     if ( sel2 ( *it ) ) { return *it ; }
00180   }
00181   return 0 ;                                    // RETURN ;
00182 }

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.

References IAlgContextSvc::algorithms().

00168 {
00169   if ( 0 == svc            ) { return 0 ; }  // RETURN
00170   //
00171   typedef IAlgContextSvc::Algorithms ALGS ;
00172   const ALGS& algs = svc->algorithms() ;
00173   AlgTypeSelector<GaudiSequencer> sel1 ;
00174   AlgTypeSelector<Sequencer>      sel2 ;
00175   for ( ALGS::const_reverse_iterator it = algs.rbegin() ; 
00176         algs.rend() != it ; ++it ) 
00177   {
00178     if ( sel1 ( *it ) ) { return *it ; }
00179     if ( sel2 ( *it ) ) { return *it ; }
00180   }
00181   return 0 ;                                    // RETURN ;
00182 }

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.

00147 { return getAlg<Sequencer> ( svc ) ; }

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.

00147 { 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.

00108 { return getAlg<GaudiTupleAlg> ( 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.

00108 { return getAlg<GaudiTupleAlg> ( svc ) ; }

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 408 of file Property.cpp.

References getProperty(), and name.

Referenced by setProperty().

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

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 226 of file Property.cpp.

References getProperty(), and name.

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

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 198 of file Property.cpp.

References getProperty(), and name.

00200 {
00201   // trivial check 
00202   if ( 0 ==  p ) { return false ; }                                // RETURN 
00203   // gelegate to another method 
00204   return 0 != getProperty ( p , name ) ;
00205 } 

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 408 of file Property.cpp.

References getProperty(), and name.

Referenced by setProperty().

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

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 198 of file Property.cpp.

00200 {
00201   // trivial check 
00202   if ( 0 ==  p ) { return false ; }                                // RETURN 
00203   // gelegate to another method 
00204   return 0 != getProperty ( p , name ) ;
00205 } 

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 226 of file Property.cpp.

Referenced by setProperty().

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

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 677 of file Property.cpp.

References name.

Referenced by setProperty().

00681 { return setProperty ( component , 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 643 of file Property.cpp.

References StatusCode::FAILURE, name, and setProperty().

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

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 611 of file Property.cpp.

References name, and setProperty().

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

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 586 of file Property.cpp.

References StatusCode::FAILURE, name, and setProperty().

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

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 566 of file Property.cpp.

References name, and setProperty().

00570 { return setProperty ( component , name , &property , 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 529 of file Property.cpp.

References Property::assign(), std::basic_string< _CharT, _Traits, _Alloc >::empty(), StatusCode::FAILURE, getProperty(), hasProperty(), name, Property::setDocumentation(), and StatusCode::SUCCESS.

00533 {
00534   if ( 0 == component || 0 == property   ) { return StatusCode::FAILURE ; }
00535   if ( !hasProperty ( component , name ) ) { return StatusCode::FAILURE ; }
00536   Property* p = getProperty ( component , name ) ;
00537   if ( 0 == p                            ) { return StatusCode::FAILURE ; }
00538   if ( !p->assign ( *property )          ) { return StatusCode::FAILURE ; }
00539   if ( !doc.empty()  ) { p->setDocumentation( doc ) ; }
00540   return StatusCode::SUCCESS ;
00541 }

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 489 of file Property.cpp.

References std::basic_string< _CharT, _Traits, _Alloc >::empty(), StatusCode::FAILURE, getProperty(), hasProperty(), StatusCode::ignore(), name, and setProperty().

00493 {
00494   if ( 0 == component ) { return StatusCode::FAILURE ; }   // RETURN
00495   if ( !hasProperty ( component , name ) ) { return StatusCode::FAILURE ; }
00496   StatusCode sc = component -> setProperty ( name , value ) ;
00497   if ( !doc.empty() ) 
00498   {
00499     Property* p = getProperty( component , name ) ;
00500     if ( 0 != p ) { p -> setDocumentation ( doc ) ; }
00501   }
00502   sc.ignore() ;
00503   return sc ;
00504 }

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 466 of file Property.cpp.

References name, and setProperty().

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

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 1484 of file Property.h.

References name, and setProperty().

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

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 677 of file Property.cpp.

References name.

Referenced by setProperty().

00681 { return setProperty ( component , 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 643 of file Property.cpp.

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

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 1360 of file Property.h.

References StatusCode::FAILURE, name, and setProperty().

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

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 611 of file Property.cpp.

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

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 586 of file Property.cpp.

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

template<class TYPE>
StatusCode Gaudi::Utils::setProperty ( IInterface component,
const std::string name,
const TYPE &  value 
)

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
Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2007-05-13

Definition at line 1302 of file Property.h.

References name, and setProperty().

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

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
Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2007-05-13

Definition at line 1392 of file Property.h.

References StatusCode::FAILURE, name, and setProperty().

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

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 1247 of file Property.h.

References name, and setProperty().

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

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 566 of file Property.cpp.

00570 { return setProperty ( component , name , &property , 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 529 of file Property.cpp.

00533 {
00534   if ( 0 == component || 0 == property   ) { return StatusCode::FAILURE ; }
00535   if ( !hasProperty ( component , name ) ) { return StatusCode::FAILURE ; }
00536   Property* p = getProperty ( component , name ) ;
00537   if ( 0 == p                            ) { return StatusCode::FAILURE ; }
00538   if ( !p->assign ( *property )          ) { return StatusCode::FAILURE ; }
00539   if ( !doc.empty()  ) { p->setDocumentation( doc ) ; }
00540   return StatusCode::SUCCESS ;
00541 }

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 1113 of file Property.h.

References StatusCode::FAILURE, name, and setProperty().

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

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 466 of file Property.cpp.

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

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 489 of file Property.cpp.

00493 {
00494   if ( 0 == component ) { return StatusCode::FAILURE ; }   // RETURN
00495   if ( !hasProperty ( component , name ) ) { return StatusCode::FAILURE ; }
00496   StatusCode sc = component -> setProperty ( name , value ) ;
00497   if ( !doc.empty() ) 
00498   {
00499     Property* p = getProperty( component , name ) ;
00500     if ( 0 != p ) { p -> setDocumentation ( doc ) ; }
00501   }
00502   sc.ignore() ;
00503   return sc ;
00504 }

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 1055 of file Property.h.

References name, and setProperty().

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

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

Definition at line 1155 of file Property.h.

References StatusCode::FAILURE, hasProperty(), name, and toString().

Referenced by Service::setProperty(), setProperty(), Auditor::setProperty(), AlgTool::setProperty(), and Algorithm::setProperty().

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

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 255 of file ToStream.h.

References GaudiUtils::Map< K, T, M >::begin(), GaudiUtils::Map< K, T, M >::end(), Gaudi::Units::s, second, and toStream().

00256     {
00257       s << "{ ";
00258       for ( typename GaudiUtils::HashMap<KTYPE,VTYPE,HASH,MAP>::const_iterator cur = obj.begin() ;
00259             obj.end() != cur ; ++cur )
00260       {
00261         if ( obj.begin() != cur ) { s << " , " ; }
00262         toStream ( cur -> first  , s ) ;
00263         s << " : " ;
00264         toStream ( cur -> second , s ) ;
00265       }
00266       return s << " }";
00267     }

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 231 of file ToStream.h.

References GaudiUtils::Map< K, T, M >::begin(), GaudiUtils::Map< K, T, M >::end(), Gaudi::Units::s, second, and toStream().

00232     {
00233       s << "{ ";
00234       for ( typename GaudiUtils::Map<KTYPE,VTYPE,MAP>::const_iterator cur = obj.begin() ;
00235             obj.end() != cur ; ++cur )
00236       {
00237         if ( obj.begin() != cur ) { s << " , " ; }
00238         toStream ( cur -> first  , s ) ;
00239         s << " : " ;
00240         toStream ( cur -> second , s ) ;
00241       }
00242       return s << " }";
00243     } 

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 207 of file ToStream.h.

References GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::begin(), GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR >::end(), Gaudi::Units::s, second, and toStream().

00208     {
00209       s << "{ ";
00210       for ( typename GaudiUtils::VectorMap<KTYPE,VTYPE,CMP,ALLOCATOR>::const_iterator cur = obj.begin() ;
00211             obj.end() != cur ; ++cur )
00212       {
00213         if ( obj.begin() != cur ) { s << " , " ; }
00214         toStream ( cur -> first  , s ) ;
00215         s << " : " ;
00216         toStream ( cur -> second , s ) ;
00217       }
00218       return s << " }";
00219     } 

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 183 of file ToStream.h.

References Gaudi::Units::s, second, and toStream().

00184     {
00185       s << "{ ";
00186       for ( typename std::map<KTYPE,VTYPE,CMP,ALLOCATOR>::const_iterator cur = 
00187               obj.begin() ; obj.end() != cur ; ++cur )
00188       {
00189         if ( obj.begin() != cur ) { s << " , " ; }
00190         toStream ( cur -> first  , s ) ;
00191         s << " : " ;
00192         toStream ( cur -> second , s ) ;
00193       }
00194       return s << " }";
00195     } 

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 162 of file ToStream.h.

References std::set< _Key, _Compare, _Alloc >::begin(), std::set< _Key, _Compare, _Alloc >::end(), Gaudi::Units::s, and toStream().

00163     {
00164       s << "[ ";
00165       for ( typename std::set<TYPE,CMP,ALLOCATOR>::const_iterator cur = obj.begin() ;
00166             obj.end() != cur ; ++cur )
00167       {
00168         if ( obj.begin() != cur ) { s << " , "; }
00169         toStream ( *cur , s ) ;
00170       }
00171       return s << " ]";
00172     }

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 145 of file ToStream.h.

References std::pair< _T1, _T2 >::first, Gaudi::Units::s, std::pair< _T1, _T2 >::second, and toStream().

00146     {
00147       s << "( "  ; 
00148       toStream ( obj.first  , s ) ;
00149       s << " , " ;
00150       toStream ( obj.second , s ) ;
00151       return s << " )" ;
00152     }

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 124 of file ToStream.h.

References std::list< _Tp, _Alloc >::begin(), std::list< _Tp, _Alloc >::end(), Gaudi::Units::s, and toStream().

00125     {
00126       s << "[ ";
00127       for ( typename std::list<TYPE,ALLOCATOR>::const_iterator cur = obj.begin() ;
00128             obj.end() != cur ; ++cur )
00129       {
00130         if ( obj.begin() != cur ) { s << " , "; }
00131         toStream ( *cur , s ) ;
00132       }
00133       return s << " ]";
00134     }

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 104 of file ToStream.h.

References std::vector< _Tp, _Alloc >::begin(), std::vector< _Tp, _Alloc >::end(), Gaudi::Units::s, and toStream().

00105     {
00106       s << "[ ";
00107       for ( typename std::vector<TYPE,ALLOCATOR>::const_iterator cur = obj.begin() ;
00108             obj.end() != cur ; ++cur )
00109       {
00110         if ( obj.begin() != cur ) { s << " , "; }
00111         toStream ( *cur , s ) ;
00112       }
00113       return s << " ]";
00114     }

std::ostream& Gaudi::Utils::toStream ( const long double  obj,
std::ostream s 
) [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 90 of file ToStream.h.

References Gaudi::Units::s, and std::setprecision().

00091     { 
00092       const int p = s.precision() ;
00093       return s << std::setprecision ( 10 ) << obj << std::setprecision ( p ) ;
00094     }

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

the printout of double values with the reasonable precision

Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2006-09-09

Definition at line 80 of file ToStream.h.

References Gaudi::Units::s, and std::setprecision().

00081     { 
00082       const int p = s.precision() ;
00083       return s << std::setprecision (  8 ) << obj << std::setprecision ( p ) ;
00084     }

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

the printout of float values with the reasonable precision

Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2006-09-09

Definition at line 70 of file ToStream.h.

References Gaudi::Units::s, and std::setprecision().

00071     { 
00072       const int  p = s.precision() ;
00073       return s << std::setprecision (  6 ) << obj << std::setprecision ( p ) ;
00074     }

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 63 of file ToStream.h.

References Gaudi::Units::s.

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

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 50 of file ToStream.h.

References std::basic_string< _CharT, _Traits, _Alloc >::find(), std::basic_string< _CharT, _Traits, _Alloc >::npos, and Gaudi::Units::s.

00051     {
00052       if ( std::string::npos == obj.find('\'') )
00053       { s << "\'" << obj << "\'" ; }
00054       else 
00055       { s << "\"" << obj << "\"" ; }
00056       return s ;
00057     }

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 276 of file ToStream.h.

References Gaudi::Units::s.

Referenced by toStream(), and toString().

00277     { return s << obj ; } 

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 288 of file ToStream.h.

References Gaudi::Units::s, and toStream().

Referenced by Gaudi::Histo1DDef::fillStream(), ParticlePropertySvc::finalize(), ParticlePropertySvc::initialize(), Gaudi::Parsers::RealUnitsGrammar::matchRealUnits(), GaudiAlg::Print2DProf::print(), GaudiAlg::Print1DProf::print(), GaudiAlg::Print3D::print(), GaudiAlg::Print2D::print(), GaudiAlg::Print1D::print(), GaudiTuples< PBASE >::printEvtCols(), setProperty(), GaudiHandleArrayProperty::toString(), and PropertyWithValue< TYPE >::toString().

00289     {
00290       std::ostringstream s;
00291       toStream ( obj , s);
00292       return s.str();
00293     }


Generated at Fri Jul 18 12:10:27 2008 for Gaudi Framework, version v20r2 by Doxygen version 1.5.1 written by Dimitri van Heesch, © 1997-2004