Skip to content
Snippets Groups Projects
Commit 27164daa authored by Andreas Salzburger's avatar Andreas Salzburger Committed by Graeme Stewart
Browse files

Tagging as TrkDetDescrAthenaPool-01-00-06 (TrkDetDescrAthenaPool-01-00-06)

           * small change to ElementTable tlp
           * tagged as TrkDetDescrAthenaPool-01-00-06

2014-05-19 Andreas Salzburger < Andreas.Salzburger -at- cern.ch >
           * debug flag removded Geantino-File produciton versions
           * tagged as TrkDetDescrAthenaPool-01-00-05

2014-05-19 Andreas salzburger < Andreas.salzburger -at- cern.ch >
	   * added ElementTable and CompoundMaterial
           * tagged as TrkDetDescrAthenaPool-01-00-04
parent 5a8d22d9
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ use AthenaPoolUtilities AthenaPoolUtilities-* Database/AthenaPOOL
#use AthenaPoolCnvSvc AthenaPoolCnvSvc-00-* Database/AthenaPOOL
apply_pattern poolcnv files="-s=$(TrkGeometry_root)/TrkGeometry MaterialStepCollection.h LayerMaterialCollection.h LayerMaterialMap.h"
apply_pattern poolcnv files="-s=$(TrkGeometry_root)/TrkGeometry MaterialStepCollection.h LayerMaterialMap.h ElementTable.h"
private
#macro cppdebugflags '$(cppdebugflags_s)'
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
// ElementTableCnv.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#include "ElementTableCnv.h"
#include "GaudiKernel/MsgStream.h"
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
ElementTableCnv::ElementTableCnv( ISvcLocator *svcloc ) :
ElementTableCnvBase(svcloc),
m_msgSvc( msgSvc() ),
m_log( m_msgSvc, "ElementTableCnv" )
{}
//-----------------------------------------------------------------------------
// Destructor
//-----------------------------------------------------------------------------
ElementTableCnv::~ElementTableCnv()
{}
//-----------------------------------------------------------------------------
// Initializer
//-----------------------------------------------------------------------------
StatusCode ElementTableCnv::initialize()
{
if (ElementTableCnvBase::initialize().isFailure() )
{
m_log << MSG::FATAL << "Could not initialize ElementTableCnvBase" << endreq;
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
ElementTable_PERS* ElementTableCnv::createPersistent(Trk::ElementTable *etTrans) {
// Message stream handling
m_log.setLevel( m_msgSvc->outputLevel() );
updateLog();
// call to the converter
ElementTable_PERS * etPers = m_TPConverter.createPersistent(etTrans, m_log );
return etPers;
}//end of create persistent method
Trk::ElementTable* ElementTableCnv::createTransient()
{
// Message stream handling
m_log.setLevel( m_msgSvc->outputLevel() );
updateLog();
static pool::Guid p1_guid( "B157B642-94C0-11E3-B1C2-02163E00A511" );
Trk::ElementTable* tCollection = 0;
if( compareClassGuid( p1_guid ) ) {
std::auto_ptr< ElementTable_PERS > p_coll( poolReadObject< ElementTable_PERS >() );
tCollection = m_TPConverter.createTransient( p_coll.get(), m_log );
}
return tCollection;
}
void ElementTableCnv::updateLog(){
DataObject* dObj = getDataObject();
if (dObj==0) return; // Can't do much if this fails.
const std::string key = (dObj->name());
m_log.m_source="ElementTableCnv: "+key; // A hack - relies on getting access to private data of MsgStream via #define trick. EJWM.
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
// ElementTableCnv.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef ELELEMENTTABLE_CNV_H
#define ELELEMENTTABLE_CNV_H
// ATLAS persistency way:
#define protected public
#include "GaudiKernel/MsgStream.h"
#undef protected
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// the transient side
#include "TrkGeometry/ElementTable.h"
// the perisistent side
#include "TrkDetDescrTPCnv/TrkGeometry/ElementTableCnv_p1.h"
// useful typedefs to not change the code only once in case of schema evolution
typedef Trk::ElementTable_p1 ElementTable_PERS;
typedef T_AthenaPoolCustomCnv<Trk::ElementTable, ElementTable_PERS> ElementTableCnvBase;
class ElementTableCnv : public ElementTableCnvBase {
friend class CnvFactory<ElementTableCnv>;
protected:
ElementTableCnv( ISvcLocator *svcloc );
~ElementTableCnv();
virtual StatusCode initialize();
virtual ElementTable_PERS* createPersistent( Trk::ElementTable *transCont);
virtual Trk::ElementTable* createTransient();
private:
void updateLog(); //!< This method modifies m_log to indicate the current key being converted
IMessageSvc* m_msgSvc; //!< MsgStream svc
MsgStream m_log; //!< MsgStream
ElementTableCnv_p1 m_TPConverter;
};//end of class definitions
#endif // ELELEMENTTABLE_CNV_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
// LayerMaterialCollectionCollectionCnv.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#include "LayerMaterialCollectionCnv.h"
#include "GaudiKernel/IToolSvc.h"
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
LayerMaterialCollectionCnv::LayerMaterialCollectionCnv(ISvcLocator* svcloc):
LayerMaterialCollectionCnvBase(svcloc),
m_msgSvc( msgSvc() ),
m_log( m_msgSvc, "LayerMaterialCollectionCnv" )
{
}
//-----------------------------------------------------------------------------
// Destructor
//-----------------------------------------------------------------------------
LayerMaterialCollectionCnv::~LayerMaterialCollectionCnv() {}
//-----------------------------------------------------------------------------
// Initializer
//-----------------------------------------------------------------------------
StatusCode LayerMaterialCollectionCnv::initialize()
{
StatusCode sc = LayerMaterialCollectionCnvBase::initialize();
if( sc.isFailure() ) {
m_log << MSG::FATAL << "Could not initialize cnv base" << endreq;
return sc;
}
//-------------------------------------------------------------------------
// Set up the message stream
//-------------------------------------------------------------------------
m_log.setLevel( m_msgSvc->outputLevel() );
m_log << MSG::INFO << "LayerMaterialCollectionCnv::initialize()" << endreq;
return StatusCode::SUCCESS;
}
LayerMaterialCollection_PERS *
LayerMaterialCollectionCnv::createPersistent( Trk::LayerMaterialCollection *transCont)
{
m_log.setLevel( m_msgSvc->outputLevel() );
updateLog(); // Make m_log indicate the current key
return m_TPConverter_tlp1.createPersistent( transCont, m_log );
}
//-----------------------------------------------------------------------------
// Create transient collection
//-----------------------------------------------------------------------------
Trk::LayerMaterialCollection *LayerMaterialCollectionCnv::createTransient()
{
m_log.setLevel( m_msgSvc->outputLevel() );
static pool::Guid tlp1_guid( "DFB29CDE-4618-4712-AB60-FEFEDB071415" );
Trk::LayerMaterialCollection *p_collection = 0;
if( compareClassGuid( tlp1_guid ) ) {
poolReadObject< Trk::LayerMaterialCollection_tlp1 >( m_TPConverter_tlp1 );
p_collection = m_TPConverter_tlp1.createTransient( m_log );
} else
throw std::runtime_error( "Unsupported persistent version of Trk::LayerMaterialCollection (unknown GUID)" );
return p_collection;
}
void LayerMaterialCollectionCnv::updateLog(){
DataObject* dObj = getDataObject();
if (dObj==0) return; // Can't do much if this fails.
const std::string key = (dObj->name());
m_log.m_source="LayerMaterialCollectionCnv: "+key; // A hack - relies on getting access to private data of MsgStream via #define trick. EJWM.
}
\ No newline at end of file
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
// LayerMaterialCollection.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef TRK_LAYERMATERIALCOLLCETION_CNV_H
#define TRK_LAYERMATERIALCOLLECTION_CNV_H
// Hack so we can access the private data. EJWM
#define protected public
#include "GaudiKernel/MsgStream.h"
#undef protected
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
#include "AthenaPoolCnvSvc/AthenaPoolCnvTPExtension.h"
#include "TrkGeometry/LayerMaterialCollection.h"
#include "TrkDetDescrTPCnv/LayerMaterialCollectionCnv_tlp1.h"
//-----------------------------------------------------------------------------
// Base class definition
//-----------------------------------------------------------------------------
typedef Trk::LayerMaterialCollection_tlp1 LayerMaterialCollection_PERS;
typedef T_AthenaPoolCustomCnv<Trk::LayerMaterialCollection, LayerMaterialCollection_PERS> LayerMaterialCollectionCnvBase;
//-----------------------------------------------------------------------------
// Converter for TrackCollection object
//-----------------------------------------------------------------------------
class LayerMaterialCollectionCnv
: public LayerMaterialCollectionCnvBase,
public AthenaPoolCnvTPExtension
{
friend class CnvFactory<LayerMaterialCollectionCnv>;
protected:
LayerMaterialCollectionCnv( ISvcLocator *svcloc );
~LayerMaterialCollectionCnv();
virtual StatusCode initialize();
virtual LayerMaterialCollection_PERS *createPersistent( Trk::LayerMaterialCollection *transCont);
virtual Trk::LayerMaterialCollection *createTransient();
virtual AthenaPoolTopLevelTPCnvBase* getTopLevelTPCnv() { return &m_TPConverter_tlp1; }
private:
void updateLog(); //!< This method modifies m_log to indicate the current key being converted
IMessageSvc *m_msgSvc;
MsgStream m_log;
LayerMaterialCollectionCnv_tlp1 m_TPConverter_tlp1;
};
#endif // TRK_LAYERMATERIALCOLLECTION_CNV_H
......@@ -3,7 +3,7 @@
*/
//////////////////////////////////////////////////////////////////
// LayerMaterialMap.h, (c) ATLAS Detector software
// LayerMaterialMapCnv.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef TRK_LAYERMATERIALMAP_CNV_H
......@@ -52,7 +52,7 @@ private:
IMessageSvc *m_msgSvc;
MsgStream m_log;
LayerMaterialMapCnv_tlp1 m_TPConverter_tlp1;
LayerMaterialMapCnv_tlp1 m_TPConverter_tlp1;
};
#endif // TRK_LAYERMATERIALMAP_CNV_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment