Skip to content
Snippets Groups Projects
Commit 560d0197 authored by Nicholas Styles's avatar Nicholas Styles Committed by Graeme Stewart
Browse files

reinstating InDetSimData (InDetEventAthenaPool-00-10-01)

	* Reinstating InDetSimData (SDOs)
	* Tagged as InDetEventAthenaPool-00-10-01

2015-06-08 Nick Styles
	* First try factorising out Sim Hits (go into InDetSimEventAthenaPool)
	* Tagged as InDetEventAthenaPool-00-10-00
parent aef71687
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,7 @@ author Davide Costanzo <Davide.Costanzo@cern.ch>
use AtlasPolicy AtlasPolicy-*
use Identifier Identifier-* DetectorDescription
use GeneratorObjectsTPCnv GeneratorObjectsTPCnv-* Generators
use GeneratorObjectsTPCnv GeneratorObjectsTPCnv-* Generators
private
......@@ -19,14 +18,11 @@ use InDetLowBetaInfo InDetLowBetaInfo-* InnerDetector/InDetRecEvent
use InDetPrepRawData InDetPrepRawData-* InnerDetector/InDetRecEvent
use InDetRawData InDetRawData-* InnerDetector/InDetRawEvent
use InDetReadoutGeometry InDetReadoutGeometry-* InnerDetector/InDetDetDescr
use InDetSimEvent InDetSimEvent-* InnerDetector
use InDetSimData InDetSimData-* InnerDetector/InDetRawEvent
use StoreGate StoreGate-* Control
use TrkTrack TrkTrack-* Tracking/TrkEvent
use AthenaPoolUtilities AthenaPoolUtilities-* Database/AthenaPOOL
use AtlasReflex AtlasReflex-* External
use InDetSimData InDetSimData-* InnerDetector/InDetRawEvent
use AtlasReflex AtlasReflex-* External
use AthenaBaseComps AthenaBaseComps-* Control
......@@ -35,19 +31,16 @@ apply_pattern poolcnv typesWithNamespace="InDet::PixelGangedClusterAmbiguities"
typesWithNamespace="InDet::InDetLowBetaCandidate" \
files="-s=${InDetRawData_root}/InDetRawData PixelRDO_Container.h SCT_RDO_Container.h TRT_RDO_Container.h \
-s=${InDetPrepRawData_root}/InDetPrepRawData TRT_DriftCircleContainer.h PixelClusterContainer.h SCT_ClusterContainer.h PixelGangedClusterAmbiguities.h \
-s=${InDetSimEvent_root}/InDetSimEvent SiHitCollection.h TRTUncompressedHitCollection.h \
-s=${InDetSimData_root}/InDetSimData InDetSimDataCollection.h \
-s=${InDetEventAthenaPool_root}/src InDetTrack.h \
-s=${InDetSimData_root}/InDetSimData InDetSimDataCollection.h \
-s=${InDetLowBetaInfo_root}/InDetLowBetaInfo InDetLowBetaCandidate.h \
-s=${InDetLowBetaInfo_root}/InDetLowBetaInfo InDetLowBetaContainer.h"
macro_append InDetEventAthenaPoolPoolCnv_shlibflags "$(InDetEventAthenaPool_linkopts)"
macro_append InDetEventAthenaPoolPoolCnvGen_dependencies " InDetEventAthenaPoolCnvDict "
apply_pattern lcgdict dict=InDetEventAthenaPoolCnv selectionfile=selection.xml headerfiles="../InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h"
macro_append InDetEventAthenaPoolPoolCnvGen_dependencies " InDetEventAthenaPoolCnvDict "
apply_pattern lcgdict dict=InDetEventAthenaPoolCnv selectionfile=selection.xml headerfiles="../InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h"
private
use AthenaPoolCnvSvc AthenaPoolCnvSvc-* Database/AthenaPOOL
use AtlasSealCLHEP AtlasSealCLHEP-* Database
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "InDetEventTPCnv/InDetHits/SiHitCollectionCnv_p1.h"
#include "InDetEventTPCnv/InDetHits/SiHitCollectionCnv_p2.h"
#include "InDetEventTPCnv/InDetHits/SiHit_p1.h"
#include "SiHitCollectionCnv.h"
SiHitCollection_PERS* SiHitCollectionCnv::createPersistent(SiHitCollection* transCont) {
MsgStream mlog(messageService(), "SiHitCollectionConverter" );
SiHitCollectionCnv_PERS converter;
SiHitCollection_PERS *persObj = converter.createPersistent( transCont, mlog );
return persObj;
}
SiHitCollection* SiHitCollectionCnv::createTransient() {
MsgStream mlog(messageService(), "SiHitCollectionConverter" );
SiHitCollectionCnv_p1 converter_p1;
SiHitCollectionCnv_p2 converter_p2;
static const pool::Guid p1_guid("36D1FF8E-5734-4A93-A133-F286CF47DB72");
static const pool::Guid p2_guid("BD1469C5-C904-40B8-82B9-43D25888D884");
static const pool::Guid old_guid("1EC39DA3-14F9-4901-88C7-F6909B064574");
SiHitCollection *trans_cont(0);
if( this->compareClassGuid(p1_guid)) {
std::auto_ptr< SiHitCollection_p1 > col_vect( this->poolReadObject< SiHitCollection_p1 >() );
trans_cont = converter_p1.createTransient( col_vect.get(), mlog );
}
else if( this->compareClassGuid(p2_guid)) { // version p2
std::auto_ptr< SiHitCollection_p2 > col_vect( this->poolReadObject< SiHitCollection_p2 >() );
trans_cont = converter_p2.createTransient( col_vect.get(), mlog );
}
else if( this->compareClassGuid(old_guid)) {
// old version from before TP separation, just return it
AthenaHitsVector<SiHit>* oldColl = this->poolReadObject< AthenaHitsVector<SiHit> >();
size_t size = oldColl->size();
trans_cont=new SiHitCollection("DefaultCollectionName",size);
//do the copy
AthenaHitsVector<SiHit>::const_iterator it = oldColl->begin(), itEnd=oldColl->end();
for (;it!=itEnd;++it) {
trans_cont->push_back(**it);
}
delete oldColl;
} else {
throw std::runtime_error("Unsupported persistent version of Data container");
}
return trans_cont;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SIHITCOLLECTIONCNV
#define SIHITCOLLECTIONCNV
#include "InDetSimEvent/SiHitCollection.h"
#include "InDetEventTPCnv/InDetHits/SiHitCollection_p1.h"
#include "InDetEventTPCnv/InDetHits/SiHitCollectionCnv_p1.h"
#include "InDetEventTPCnv/InDetHits/SiHitCollection_p2.h"
#include "InDetEventTPCnv/InDetHits/SiHitCollectionCnv_p2.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// Gaudi
#include "GaudiKernel/MsgStream.h"
// typedef to the latest persistent version
//typedef SiHitCollection_p1 SiHitCollection_PERS;
//typedef SiHitCollectionCnv_p1 SiHitCollectionCnv_PERS;
typedef SiHitCollection_p2 SiHitCollection_PERS;
typedef SiHitCollectionCnv_p2 SiHitCollectionCnv_PERS;
class SiHitCollectionCnv : public T_AthenaPoolCustomCnv<SiHitCollection, SiHitCollection_PERS > {
friend class CnvFactory<SiHitCollectionCnv>;
protected:
SiHitCollectionCnv(ISvcLocator* svcloc) :
T_AthenaPoolCustomCnv<SiHitCollection, SiHitCollection_PERS >( svcloc) {}
SiHitCollection_PERS* createPersistent(SiHitCollection* transCont);
SiHitCollection* createTransient ();
};
#endif
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "InDetEventTPCnv/InDetHits/TRT_HitCollectionCnv_p1.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollectionCnv_p2.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollectionCnv_p3.h"
#include "TRTUncompressedHitCollectionCnv.h"
#include "InDetEventTPCnv/InDetHits/TRT_Hit_p1.h"
TRT_HitCollection_PERS* TRTUncompressedHitCollectionCnv::createPersistent(TRTUncompressedHitCollection* transCont) {
MsgStream mlog(messageService(), "TRT_HitCollectionConverter" );
TRT_HitCollectionCnv_PERS converter;
TRT_HitCollection_PERS *persObj = converter.createPersistent( transCont, mlog );
return persObj;
}
TRTUncompressedHitCollection* TRTUncompressedHitCollectionCnv::createTransient() {
MsgStream mlog(messageService(), "TRT_HitCollectionConverter" );
TRT_HitCollectionCnv_p1 converter_p1;
TRT_HitCollectionCnv_p2 converter_p2;
TRT_HitCollectionCnv_p3 converter_p3;
static const pool::Guid p1_guid("6688E934-157E-421A-B6D1-A35FC8BD651C");
static const pool::Guid p2_guid("473FF621-3466-4D87-9469-4780A6A77023");
static const pool::Guid p3_guid("FB5F5BFC-43E5-44E1-B79C-C330C1480E2E");
static const pool::Guid old_guid("35722E01-C4E3-420E-8A7E-E375C5E7989D");
TRTUncompressedHitCollection *trans_cont(0);
if( this->compareClassGuid(p1_guid)) {
std::auto_ptr< TRT_HitCollection_p1 > col_vect( this->poolReadObject< TRT_HitCollection_p1 >() );
trans_cont = converter_p1.createTransient( col_vect.get(), mlog );
}
else if( this->compareClassGuid(p2_guid)) {
std::auto_ptr< TRT_HitCollection_p2 > col_vect( this->poolReadObject< TRT_HitCollection_p2 >() );
trans_cont = converter_p2.createTransient( col_vect.get(), mlog );
}
else if( this->compareClassGuid(p3_guid)) {
std::auto_ptr< TRT_HitCollection_p3 > col_vect( this->poolReadObject< TRT_HitCollection_p3 >() );
trans_cont = converter_p3.createTransient( col_vect.get(), mlog );
}
else if( this->compareClassGuid(old_guid)) {
// old version from before TP separation - convert to new transient format
AthenaHitsVector<TRTUncompressedHit>* oldColl = this->poolReadObject< AthenaHitsVector<TRTUncompressedHit> >();
size_t size = oldColl->size();
trans_cont=new TRTUncompressedHitCollection("DefaultCollectionName",size);
//do the copy
AthenaHitsVector<TRTUncompressedHit>::const_iterator it = oldColl->begin(), itEnd=oldColl->end();
for (;it!=itEnd;++it) {
trans_cont->push_back(**it);
}
delete oldColl;
} else {
throw std::runtime_error("Unsupported persistent version of Data container");
}
return trans_cont;
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRT_HITCOLLECTIONCNV
#define TRT_HITCOLLECTIONCNV
#include "InDetSimEvent/TRTUncompressedHitCollection.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollection_p1.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollectionCnv_p1.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollection_p2.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollection_p3.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollectionCnv_p2.h"
#include "InDetEventTPCnv/InDetHits/TRT_HitCollectionCnv_p3.h"
#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h"
// Gaudi
#include "GaudiKernel/MsgStream.h"
// typedef to the latest persistent version
//typedef TRT_HitCollection_p1 TRT_HitCollection_PERS;
//typedef TRT_HitCollectionCnv_p1 TRT_HitCollectionCnv_PERS;
//typedef TRT_HitCollection_p2 TRT_HitCollection_PERS;
//typedef TRT_HitCollectionCnv_p2 TRT_HitCollectionCnv_PERS;
typedef TRT_HitCollection_p3 TRT_HitCollection_PERS;
typedef TRT_HitCollectionCnv_p3 TRT_HitCollectionCnv_PERS;
class TRTUncompressedHitCollectionCnv : public T_AthenaPoolCustomCnv<TRTUncompressedHitCollection, TRT_HitCollection_PERS > {
friend class CnvFactory<TRTUncompressedHitCollectionCnv>;
protected:
TRTUncompressedHitCollectionCnv(ISvcLocator* svcloc) :
T_AthenaPoolCustomCnv<TRTUncompressedHitCollection, TRT_HitCollection_PERS >( svcloc) {}
TRT_HitCollection_PERS* createPersistent(TRTUncompressedHitCollection* transCont);
TRTUncompressedHitCollection* createTransient ();
};
#endif
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