| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

GiGaCnvBase Class Reference

Base class for converters from Geant4 to Gaudi and vice versa. More...

#include <GiGaCnv/GiGaCnvBase.h>

Inheritance diagram for GiGaCnvBase:

[legend]
Collaboration diagram for GiGaCnvBase:
[legend]
List of all members.

Public Types

typedef std::vector< GiGaLeafLeaves
 INVALID_ADDRESS
 INVALID_OBJECT
 NO_MEMORY
 BAD_STORAGE_TYPE
 NO_SOURCE_OBJECT
 ICONVERSIONSVC_LAST_ERROR
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
enum  Status

Public Member Functions

long repSvcType () const
virtual StatusCode initialize ()
 initialization
virtual StatusCode finalize ()
 finalization
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
virtual unsigned long addRef ()
virtual unsigned long release ()
virtual StatusCode setDataProvider (IDataProviderSvc *svc)
virtual IDataProviderSvcdataProvider () const
virtual StatusCode setConversionSvc (IConversionSvc *svc)
virtual IConversionSvcconversionSvc () const
virtual StatusCode setAddressCreator (IAddressCreator *creator)
virtual IAddressCreatoraddressCreator () const
virtual const CLIDobjType () const
virtual long i_repSvcType () const
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
StatusCode service (const std::string &name, T *&psvc, bool createIf=false) const
StatusCode service (const std::string &type, const std::string &name, T *&psvc) const

Static Public Member Functions

static const InterfaceIDinterfaceID ()

Public Attributes

 INVALID_ADDRESS
 INVALID_OBJECT
 NO_MEMORY
 BAD_STORAGE_TYPE
 NO_SOURCE_OBJECT
 ICONVERSIONSVC_LAST_ERROR

Protected Member Functions

 GiGaCnvBase (const long StorageType, const CLID &ClassType, ISvcLocator *Locator)
 standard constructor
virtual ~GiGaCnvBase ()
 virtual destructor
ISvcLocatorsvcLoc () const
 acessor to teh service locator
IGiGaCnvSvccnvSvc () const
 accessor to own conversion service
IGiGaGeomCnvSvcgeoSvc () const
 accessor to geometry conversion service
IGiGaKineCnvSvckineSvc () const
 accessor to kinematics conversion service
IGiGaHitsCnvSvchitsSvc () const
 accessor to hits conversion service
IDataProviderSvcevtSvc () const
 accessor to event data service
IDataProviderSvcdetSvc () const
 accessor to detector data service
IChronoStatSvcchronoSvc () const
 accessor to Chrono & Stat service
IToolSvctoolSvc () const
 accessor to Tool Service
IGiGaSvcgigaSvc () const
 accessor to GiGa service
IGiGaSetUpSvcsetupSvc () const
 accessor to GiGa SetUp service
IParticlePropertySvcppSvc () const
 accessor to Particle Properties service
template<class TYPE>
TYPE * get (IDataProviderSvc *svc, const std::string &location, const TYPE *) const
 templated access to the data in Gaudi transient store
template<class TOOL>
TOOL * tool (const std::string &type, const std::string &name, TOOL *&Tool, const IInterface *parent=0, bool create=true) const
 the useful method for location of tools.
template<class TOOL>
TOOL * tool (const std::string &type, TOOL *&Tool, const IInterface *parent=0, bool create=true) const
 the useful method for location of tools.
StatusCode Error (const std::string &Message, const StatusCode &status=StatusCode::FAILURE, const size_t mx=10) const
 print and return the error
StatusCode Warning (const std::string &Message, const StatusCode &status=StatusCode::FAILURE, const size_t mx=10) const
 print and return warning
StatusCode Print (const std::string &Message, const StatusCode &Status=StatusCode::SUCCESS, const MSG::Level &level=MSG::INFO) const
 print the message and return status code
StatusCode Exception (const std::string &msg, const GaudiException &exc, const MSG::Level &lvl=MSG::FATAL, const StatusCode &sc=StatusCode::FAILURE) const
 (re)-throw exception and print error message
StatusCode Exception (const std::string &msg, const std::exception &exc, const MSG::Level &lvl=MSG::FATAL, const StatusCode &sc=StatusCode::FAILURE) const
 (re)-throw exception and print error message
StatusCode Exception (const std::string &msg, const MSG::Level &lvl=MSG::FATAL, const StatusCode &sc=StatusCode::FAILURE) const
 throw exception and print error message
StatusCode Assert (bool assertion, const std::string &msg="GiGaCnvBase::unknown", const StatusCode &sc=StatusCode::FAILURE) const
 assertion
StatusCode Assert (bool assertion, const char *msg, const StatusCode &sc=StatusCode::FAILURE) const
 assertion
const std::string & name () const
 Retrieve name of converter.
void setNameOfGiGaConversionService (const std::string &CnvSvc)
 set name of own conversion service
void setConverterName (const std::string &ConverterName)
 set own name
StatusCode declareObject (const GiGaLeaf &leaf)
 declare the object to conversion service
ISvcLocatorserviceLocator () const
IMessageSvcmsgSvc () const
IMessageSvcmessageService () const
IDataManagerSvcdataManager () const

Protected Attributes

std::string m_NameOfGiGaConversionService
std::string m_ConverterName
Leaves m_leaves

Private Types

typedef std::map< std::string,
unsigned int > 
Counter

Private Attributes

IGiGaCnvSvcm_GiGaCnvSvc
IGiGaGeomCnvSvcm_GiGaGeomCnvSvc
IGiGaKineCnvSvcm_GiGaKineCnvSvc
IGiGaHitsCnvSvcm_GiGaHitsCnvSvc
IDataProviderSvcm_evtSvc
IDataProviderSvcm_detSvc
IChronoStatSvcm_chronoSvc
IToolSvcm_toolSvc
CLID m_local
Counter m_errors
 counter of errors
Counter m_warnings
 counter of warning
Counter m_exceptions
 counter of exceptions

Detailed Description

Base class for converters from Geant4 to Gaudi and vice versa.

Author:
Vanya Belyaev
Date:
21/02/2001

Definition at line 49 of file GiGaCnvBase.h.


Member Typedef Documentation

typedef std::vector<GiGaLeaf> GiGaCnvBase::Leaves

Definition at line 52 of file GiGaCnvBase.h.

typedef std::map<std::string,unsigned int> GiGaCnvBase::Counter [private]

Definition at line 439 of file GiGaCnvBase.h.


Constructor & Destructor Documentation

GiGaCnvBase::GiGaCnvBase ( const long  StorageType,
const CLID ClassType,
ISvcLocator Locator 
) [protected]

standard constructor

Parameters:
StorageType type identifier of external storage
ClassType class identifier
Locatopr pointer to service locator

virtual GiGaCnvBase::~GiGaCnvBase (  )  [protected, virtual]

virtual destructor


Member Function Documentation

long GiGaCnvBase::repSvcType (  )  const [inline, virtual]

Implements Converter.

Definition at line 70 of file GiGaCnvBase.h.

00071   { return i_repSvcType(); }

virtual StatusCode GiGaCnvBase::initialize (  )  [virtual]

initialization

See also:
Converter

IConverter

Returns:
status code

Reimplemented from Converter.

virtual StatusCode GiGaCnvBase::finalize (  )  [virtual]

finalization

See also:
Converter

IConverter

Returns:
status code

Reimplemented from Converter.

ISvcLocator* GiGaCnvBase::svcLoc (  )  const [inline, protected]

acessor to teh service locator

Returns:
pointer to service locator

Definition at line 92 of file GiGaCnvBase.h.

00093   { return serviceLocator ()                          ; }

IGiGaCnvSvc* GiGaCnvBase::cnvSvc (  )  const [inline, protected]

accessor to own conversion service

Returns:
pointer to own conversion service

Definition at line 98 of file GiGaCnvBase.h.

00099   { return m_GiGaCnvSvc                               ; } 

IGiGaGeomCnvSvc* GiGaCnvBase::geoSvc (  )  const [inline, protected]

accessor to geometry conversion service

Returns:
pointer to geometry conversion service

Definition at line 104 of file GiGaCnvBase.h.

00105   { return m_GiGaGeomCnvSvc                           ; } 

IGiGaKineCnvSvc* GiGaCnvBase::kineSvc (  )  const [inline, protected]

accessor to kinematics conversion service

Returns:
pointer to kinematics conversion service

Definition at line 110 of file GiGaCnvBase.h.

00111   { return m_GiGaKineCnvSvc                           ; } 

IGiGaHitsCnvSvc* GiGaCnvBase::hitsSvc (  )  const [inline, protected]

accessor to hits conversion service

Returns:
pointer to hits conversion service

Definition at line 116 of file GiGaCnvBase.h.

00117   { return m_GiGaHitsCnvSvc                           ; }

IDataProviderSvc* GiGaCnvBase::evtSvc (  )  const [inline, protected]

accessor to event data service

Returns:
pointer to event data service

Definition at line 122 of file GiGaCnvBase.h.

00123   { return m_evtSvc                                   ; }   

IDataProviderSvc* GiGaCnvBase::detSvc (  )  const [inline, protected]

accessor to detector data service

Returns:
pointer to detector data service

Definition at line 128 of file GiGaCnvBase.h.

00129   { return m_detSvc                                   ; }

IChronoStatSvc* GiGaCnvBase::chronoSvc (  )  const [inline, protected]

accessor to Chrono & Stat service

Returns:
pointer to Chrono & Stat service

Definition at line 135 of file GiGaCnvBase.h.

00136   { return m_chronoSvc                                ; } 

IToolSvc* GiGaCnvBase::toolSvc (  )  const [inline, protected]

accessor to Tool Service

Returns:
pointer to Tool Service

Definition at line 141 of file GiGaCnvBase.h.

00142   { return m_toolSvc                                  ; } 

IGiGaSvc* GiGaCnvBase::gigaSvc (  )  const [inline, protected]

accessor to GiGa service

Returns:
pointer to GiGa service

Definition at line 147 of file GiGaCnvBase.h.

00148   { return 0 != cnvSvc () ? cnvSvc ()->gigaSvc () : 0 ; }

IGiGaSetUpSvc* GiGaCnvBase::setupSvc (  )  const [inline, protected]

accessor to GiGa SetUp service

Returns:
pointer to GiGa SetUp service

Definition at line 153 of file GiGaCnvBase.h.

00154   { return 0 != cnvSvc () ? cnvSvc ()->setupSvc() : 0 ; } 

IParticlePropertySvc* GiGaCnvBase::ppSvc (  )  const [inline, protected]

accessor to Particle Properties service

Returns:
pointer to Particle Properties service

Definition at line 159 of file GiGaCnvBase.h.

00160   { return 0 != kineSvc() ? kineSvc()->ppSvc   () : 0 ; }

template<class TYPE>
TYPE* GiGaCnvBase::get ( IDataProviderSvc svc,
const std::string &  location,
const TYPE *   
) const [inline, protected]

templated access to the data in Gaudi transient store

Quick and safe access to the data in Gaudi transient store. The method located the data at given address and perform the debug printout about located data

Usage:

Warning:
the third argument is artificial to please MicroSoft stupid compiler!
See also:
IDataProviderSvc

SmartDataPtr

Exceptions:
GiGaException for Invalid Data Provider Service
GiGaException for invalid/unavailable data
Parameters:
svc pointer to data service (data provider)
location data location/address in Gaudi Transient Store
type artificial algument (to please MicroSoft compiler)

Definition at line 193 of file GiGaCnvBase.h.

00196   {
00197     // check the environment 
00198     Assert( 0 != svc   , "  get():: IDataProvider* points to NULL!"      );
00199     SmartDataPtr<TYPE> object( svc, location ) ;
00200     Assert( !(!object) ,  " get():: No valid data at '" + location + "'" );
00201     TYPE* aux = object ;
00202     Assert( 0 != aux   ,  " get():: No valid data at '" + location + "'" );
00203     const std::string type( System::typeinfoName( typeid( *aux ) ) );
00204     // debug printout 
00205     // return located valid data 
00206     Print( " The data from address '"     + location + 
00207            "' are retrieved from TS "     ,
00208            StatusCode::SUCCESS ,  MSG::DEBUG ) ;
00209     Print( " [ The actual data type is '" + type     + 
00210            "' ] "                         ,
00211            StatusCode::SUCCESS  , MSG::DEBUG ) ;
00212     return aux ;
00213   };

template<class TOOL>
TOOL* GiGaCnvBase::tool ( const std::string &  type,
const std::string &  name,
TOOL *&  Tool,
const IInterface parent = 0,
bool  create = true 
) const [inline, protected]

the useful method for location of tools.

for empty "name" delegates to another method

See also:
IToolSvc

IAlgTool

Attention:
do not forget to 'release' tool after the usage!
Exceptions:
GiGaException for invalid Tool Service
GiGaException for error from Tool Service
GiGaException for invalid tool
Parameters:
type tool type
name tool name
Tool tool itself (return)
parent tool parent
create flag for creation of nonexisting tools
Returns:
pointer to the tool

Definition at line 233 of file GiGaCnvBase.h.

00238   {
00239     // for empty names delegate to another method 
00240     if( name.empty() ) { return tool( type , Tool , parent , create ) ; }
00241     Assert( 0 != toolSvc() , "IToolSvc* points toNULL!" );
00242     // get the tool from Tool Service 
00243     StatusCode sc = toolSvc () 
00244       -> retrieveTool ( type , name , Tool, parent , create );
00245     Assert( sc.isSuccess() , 
00246             "Could not retrieve Tool'" + type + "'/'" + name + "'", sc ) ;
00247     Assert( 0 != Tool      , 
00248             "Could not retrieve Tool'" + type + "'/'" + name + "'"     ) ;
00249     // debug printout 
00250     Print( " The Tool of type '" + Tool->type() + 
00251            "'/'"                 + Tool->name() + 
00252            "' is retrieved from IToolSvc " , MSG::DEBUG  , sc ) ;
00253     // return located tool 
00254     return Tool ;
00255   };

template<class TOOL>
TOOL* GiGaCnvBase::tool ( const std::string &  type,
TOOL *&  Tool,
const IInterface parent = 0,
bool  create = true 
) const [inline, protected]

the useful method for location of tools.

See also:
IToolSvc

IAlgTool

Attention:
do not forget to 'release' tool after the usage!
Exceptions:
GiGaException for invalid Tool Service
GiGaException for error from Tool Service
GiGaException for invalid tool
Parameters:
type tool type, could be of "Type/Name" format
Tool tool itself (return)
parent tool parent
create flag for creation of nonexisting tools
Returns:
pointer to the tool

Definition at line 273 of file GiGaCnvBase.h.

00277   {
00278     // check the environment 
00279     Assert( 0 != toolSvc() , "IToolSvc* points toNULL!" );
00280     // "type" or "type/name" ?
00281     std::string::const_iterator it = 
00282       std::find( type.begin() , type.end () , '/' );
00283     // "type" is compound!
00284     if( type.end() != it ) 
00285       {
00286         std::string::size_type pos = it - type.begin()   ;
00287         const std::string ntype( type , 0       , pos               );
00288         const std::string nname( type , pos + 1 , std::string::npos );
00289         return tool( ntype , // new type 
00290                      nname , // new name 
00291                      Tool , parent , create            ) ;
00292       }
00293     // retrieve the tool from Tool Service 
00294     StatusCode sc = toolSvc () 
00295       -> retrieveTool ( type , Tool, parent , create   );
00296     Assert( sc.isSuccess() , "Could not retrieve Tool'" + type + "'" , sc ) ;
00297     Assert( 0 != Tool      , "Could not retrieve Tool'" + type + "'"      ) ;
00298     // debug printout 
00299     Print( " The Tool of type '" + Tool->type() + 
00300            "'/'"                 + Tool->name() + 
00301            "' is retrieved from IToolSvc " , MSG::DEBUG , sc ) ;
00302     // return located tool 
00303     return Tool ;
00304   };

StatusCode GiGaCnvBase::Error ( const std::string &  Message,
const StatusCode status = StatusCode::FAILURE,
const size_t  mx = 10 
) const [protected]

print and return the error

Parameters:
Message message to be printed
status status code to be returned
Returns:
status code

StatusCode GiGaCnvBase::Warning ( const std::string &  Message,
const StatusCode status = StatusCode::FAILURE,
const size_t  mx = 10 
) const [protected]

print and return warning

Parameters:
Message message to be printed
status status code to be returned
Returns:
status code

StatusCode GiGaCnvBase::Print ( const std::string &  Message,
const StatusCode Status = StatusCode::SUCCESS,
const MSG::Level level = MSG::INFO 
) const [protected]

print the message and return status code

Parameters:
msg error message
lvl print level
sc status code
Returns:
statsu code

StatusCode GiGaCnvBase::Exception ( const std::string &  msg,
const GaudiException exc,
const MSG::Level lvl = MSG::FATAL,
const StatusCode sc = StatusCode::FAILURE 
) const [protected]

(re)-throw exception and print error message

Parameters:
msg error message
exc previous exception
lvl print level
sc status code
Returns:
statsu code

StatusCode GiGaCnvBase::Exception ( const std::string &  msg,
const std::exception &  exc,
const MSG::Level lvl = MSG::FATAL,
const StatusCode sc = StatusCode::FAILURE 
) const [protected]

(re)-throw exception and print error message

Parameters:
msg error message
exc previous exception
lvl print level
sc status code
Returns:
statsu code

StatusCode GiGaCnvBase::Exception ( const std::string &  msg,
const MSG::Level lvl = MSG::FATAL,
const StatusCode sc = StatusCode::FAILURE 
) const [protected]

throw exception and print error message

Parameters:
msg error message
lvl print level
sc status code
Returns:
statsu code

StatusCode GiGaCnvBase::Assert ( bool  assertion,
const std::string &  msg = "GiGaCnvBase::unknown",
const StatusCode sc = StatusCode::FAILURE 
) const [inline, protected]

assertion

Parameters:
assertion assertion condition
msg assertion message
sc assertion status code
Returns:
status code

Definition at line 458 of file GiGaCnvBase.h.

00461 {  
00462   StatusCode status = StatusCode::SUCCESS ;
00463   return (assertion) ? status : Exception( msg , MSG::FATAL , sc ) ;
00464 };

StatusCode GiGaCnvBase::Assert ( bool  assertion,
const char *  msg,
const StatusCode sc = StatusCode::FAILURE 
) const [inline, protected]

assertion

Parameters:
assertion assertion condition
msg assertion message
sc assertion status code
Returns:
status code

Definition at line 475 of file GiGaCnvBase.h.

00478 { 
00479   StatusCode status = StatusCode::SUCCESS ;
00480   return (assertion) ? status : Exception( msg , MSG::FATAL , sc ) ;
00481 };

const std::string& GiGaCnvBase::name (  )  const [inline, protected]

Retrieve name of converter.

Returns:
converter name

Definition at line 400 of file GiGaCnvBase.h.

00400 { return m_ConverterName; } 

void GiGaCnvBase::setNameOfGiGaConversionService ( const std::string &  CnvSvc  )  [inline, protected]

set name of own conversion service

Definition at line 404 of file GiGaCnvBase.h.

00405   { m_NameOfGiGaConversionService = CnvSvc ; }                     

void GiGaCnvBase::setConverterName ( const std::string &  ConverterName  )  [inline, protected]

set own name

Definition at line 409 of file GiGaCnvBase.h.

00410   { m_ConverterName  = ConverterName ; } 

StatusCode GiGaCnvBase::declareObject ( const GiGaLeaf leaf  )  [protected]

declare the object to conversion service

Parameters:
leaf object leaf
Returns:
status code


Member Data Documentation

std::string GiGaCnvBase::m_NameOfGiGaConversionService [protected]

Definition at line 420 of file GiGaCnvBase.h.

std::string GiGaCnvBase::m_ConverterName [protected]

Definition at line 421 of file GiGaCnvBase.h.

Leaves GiGaCnvBase::m_leaves [protected]

Definition at line 423 of file GiGaCnvBase.h.

IGiGaCnvSvc* GiGaCnvBase::m_GiGaCnvSvc [private]

Definition at line 427 of file GiGaCnvBase.h.

IGiGaGeomCnvSvc* GiGaCnvBase::m_GiGaGeomCnvSvc [private]

Definition at line 428 of file GiGaCnvBase.h.

IGiGaKineCnvSvc* GiGaCnvBase::m_GiGaKineCnvSvc [private]

Definition at line 429 of file GiGaCnvBase.h.

IGiGaHitsCnvSvc* GiGaCnvBase::m_GiGaHitsCnvSvc [private]

Definition at line 430 of file GiGaCnvBase.h.

IDataProviderSvc* GiGaCnvBase::m_evtSvc [private]

Definition at line 432 of file GiGaCnvBase.h.

IDataProviderSvc* GiGaCnvBase::m_detSvc [private]

Definition at line 433 of file GiGaCnvBase.h.

IChronoStatSvc* GiGaCnvBase::m_chronoSvc [private]

Definition at line 434 of file GiGaCnvBase.h.

IToolSvc* GiGaCnvBase::m_toolSvc [private]

Definition at line 435 of file GiGaCnvBase.h.

CLID GiGaCnvBase::m_local [private]

Definition at line 437 of file GiGaCnvBase.h.

Counter GiGaCnvBase::m_errors [mutable, private]

counter of errors

Definition at line 441 of file GiGaCnvBase.h.

Counter GiGaCnvBase::m_warnings [mutable, private]

counter of warning

Definition at line 443 of file GiGaCnvBase.h.

Counter GiGaCnvBase::m_exceptions [mutable, private]

counter of exceptions

Definition at line 445 of file GiGaCnvBase.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:03:53 2011 for GiGaCnv by doxygen 1.4.7