| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- File List
- File Members

# HistogramSvc.cpp File Reference

`#include <cstdlib>`
`#include <stdexcept>`
`#include "GaudiKernel/xtoa.h"`
`#include "GaudiKernel/Property.h"`
`#include "GaudiKernel/Tokenizer.h"`
`#include "GaudiKernel/MsgStream.h"`
`#include "GaudiKernel/SvcFactory.h"`
`#include "GaudiKernel/DataObject.h"`
`#include "GaudiKernel/IConversionSvc.h"`
`#include "GaudiKernel/GenericAddress.h"`
`#include "HistogramSvc.h"`

Include dependency graph for HistogramSvc.cpp:

Go to the source code of this file.

## Functions
std::string | histoAddr (const std::string &name)
std::string | histoAddr (const DataObject *obj, const std::string &rel)
size_t | removeLeading (HistogramSvc::Histo1DMap &m, const std::string &lead="/stat/")

## Function Documentation

std::string @574::histoAddr | ( | const DataObject * | obj,
|  | const std::string & | rel |
| ) |  |  | `[inline, static]`

Definition at line 41 of file HistogramSvc.cpp.

References histoAddr(), IRegistry::identifier(), name, DataObject::registry(), and std::basic_string< _CharT, _Traits, _Alloc >::size().

    00043   {
    00044     if ( 0 == obj      ) { return rel  ; }
    00045     IRegistry* reg = obj->registry() ;
    00046     if ( 0 == reg      ) { return rel  ; }
    00047     const std::string& name = reg->identifier() ;
    00048     //
    00049     if ( rel  .empty() ) { return histoAddr ( name ) ; }
    00050     if ( '/' == name[name.size()-1] ||
    00051          '/' == rel[0] ) { return histoAddr ( name + rel ) ; }
    00052     return histoAddr ( name + "/" + rel ) ;
    00053   }

std::string @574::histoAddr | ( | const std::string & | name | ) | `[inline, static]`

Definition at line 34 of file HistogramSvc.cpp.

References std::basic_string< _CharT, _Traits, _Alloc >::find(), and name.

Referenced by HistogramSvc::book(), and histoAddr().

    00035   {
    00036     if ( 0 == name.find ( "/stat/" ) ){ return std::string( name , 6 ) ; }
    00037     return name ;
    00038   }

size_t @574::removeLeading | ( | HistogramSvc::Histo1DMap & | m,
|  | const std::string & | lead = `"/stat/"` |
| ) |  |  | `[inline, static]`

Definition at line 416 of file HistogramSvc.cpp.

References Gaudi::Units::m.

Referenced by HistogramSvc::update1Ddefs().

    00417   {
    00418     for ( HistogramSvc::Histo1DMap::iterator it = m.begin() ;
    00419           m.end() != it ; ++it )
    00420     {
    00421       if ( 0 == it->first.find ( lead ) )
    00422       {
    00423         std::string       addr = std::string( it->first , lead.size() ) ;
    00424         Gaudi::Histo1DDef hdef = it->second ;
    00425         m.erase ( it ) ;                            // remove
    00426         m[addr] = hdef ;                            // insert
    00427         return 1 + removeLeading ( m , lead ) ;     // return
    00428       }
    00429     }
    00430     return 0 ;
    00431   }