| # Gaudi Framework, version v21r8 |

Home |  | Generated: 17 Mar 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 @602::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 @602::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 @602::removeLeading | ( | HistogramSvc::Histo1DMap & | m,
|  | const std::string & | lead = `"/stat/"` |
| ) |  |  | `[inline, static]`

Definition at line 405 of file HistogramSvc.cpp.

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