| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# 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 @580::histoAddr | ( | const DataObject * | obj,
|  | const std::string & | rel |
| ) |  |  | `[inline, static]`

Definition at line 41 of file HistogramSvc.cpp.

    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 @580::histoAddr | ( | const std::string & | name | ) | `[inline, static]`

Definition at line 34 of file HistogramSvc.cpp.

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

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

Definition at line 416 of file HistogramSvc.cpp.

    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   }