| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

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

Definition at line 46 of file HistogramSvc.cpp.

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

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

Definition at line 39 of file HistogramSvc.cpp.

    00040   {
    00041     if ( 0 == name.find ( "/stat/" ) ){ return std::string( name , 6 ) ; }
    00042     return name ;
    00043   }

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

Definition at line 410 of file HistogramSvc.cpp.

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