Skip to content
Snippets Groups Projects
Commit d15945bb authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (ParticleEventTPCnv-00-04-18)

	* Tagging ParticleEventTPCnv-00-04-18.
	* test/ParticleEventTPCnv.xml: Add test xml file.

2015-11-17  scott snyder  <snyder@bnl.gov>

	* Tagging ParticleEventTPCnv-00-04-17.
	* DataModel -> AthLinks, AthAllocators

	* Tagging ParticleEventTPCnv-00-04-16.
	* Avoid #define private.

	* Tagging ParticleEventTPCnv-00-04-15.
	* ParticleEventTPCnv/ParticleShallowCloneCnv_p1.h: Fix forward
	declaration.
	* ParticleEventTPCnv/ParticleLinksCnv_p1.h: Rewrite to avoid
	referencing links.  Simplify.  Avoid #define private.

	* Add unit tests.

...
(Long ChangeLog diff - truncated)
parent cd95eb7e
No related branches found
No related tags found
No related merge requests found
Showing
with 175 additions and 24 deletions
################################################################################
# Package: ParticleEventTPCnv
################################################################################
# Declare the package name:
atlas_subdir( ParticleEventTPCnv )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
AtlasTest/TestTools
Control/AthLinks
Control/DataModelAthenaPool
Database/AthenaPOOL/AthenaPoolCnvSvc
Event/EventCommonTPCnv
GaudiKernel
PhysicsAnalysis/AnalysisCommon/ParticleEvent
Reconstruction/Particle
PRIVATE
Control/AthAllocators
Control/AthenaKernel
Control/CxxUtils
Control/SGTools
Tracking/TrkEvent/VxVertex )
# External dependencies:
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package:
atlas_add_tpcnv_library( ParticleEventTPCnv
src/*.cxx
PUBLIC_HEADERS ParticleEventTPCnv
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex )
atlas_add_dictionary( ParticleEventTPCnvDict
ParticleEventTPCnv/ParticleEventTPCnvDict.h
ParticleEventTPCnv/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( CompositeParticleCnv_p1_test
SOURCES
test/CompositeParticleCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( CompositeParticleContainerCnv_p1_test
SOURCES
test/CompositeParticleContainerCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( INav4MomToTrackParticleAssocsCnv_p1_test
SOURCES
test/INav4MomToTrackParticleAssocsCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( NeutrinoCnv_p1_test
SOURCES
test/NeutrinoCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( NeutrinoCnv_p2_test
SOURCES
test/NeutrinoCnv_p2_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( NeutrinoContainerCnv_p1_test
SOURCES
test/NeutrinoContainerCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( NeutrinoContainerCnv_p2_test
SOURCES
test/NeutrinoContainerCnv_p2_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( ParticleBaseCnv_p1_test
SOURCES
test/ParticleBaseCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( ParticleBaseCnv_p2_test
SOURCES
test/ParticleBaseCnv_p2_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( ParticleBaseLinksCnv_p1_test
SOURCES
test/ParticleBaseLinksCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( ParticleShallowCloneCnv_p1_test
SOURCES
test/ParticleShallowCloneCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( ParticleShallowCloneContainerCnv_p1_test
SOURCES
test/ParticleShallowCloneContainerCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( SelectedParticlesCnv_p1_test
SOURCES
test/SelectedParticlesCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
atlas_add_test( TrackParticleAssocsCnv_p1_test
SOURCES
test/TrackParticleAssocsCnv_p1_test.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools AthLinks DataModelAthenaPoolLib AthenaPoolCnvSvcLib EventCommonTPCnv GaudiKernel ParticleEvent Particle AthAllocators AthenaKernel CxxUtils SGTools VxVertex ParticleEventTPCnv )
......@@ -17,8 +17,7 @@
// Gaudi includes
// DataModel includes
#include "DataModel/ElementLink.h"
#include "AthLinks/ElementLink.h"
// DataModelAthenaPool includes
#include "DataModelAthenaPool/ElementLinkCnv_p3.h"
......
......@@ -17,14 +17,10 @@
// AthenaPoolCnvSvc includes
//#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" (in DataLinkCnv_p1.h)
#include "DataModelAthenaPool/DataLinkCnv_p1.h"
#include "DataModel/DataLink.h"
#include "AthLinks/DataLink.h"
#include "GaudiKernel/MsgStream.h"
#include "ParticleEvent/ParticleLinks.h"
#define private public
#define protected public
#include "ParticleEvent/SelectedParticles.h"
#undef private
#undef protected
#include "ParticleEventTPCnv/ParticleLinks_p1.h"
#include <string>
#include <iostream>
......@@ -86,7 +82,7 @@ void ParticleLinksCnv_p1<Container>::transToPers(const ParticleLinks<Container>*
std::string container_name=(&(*transObj)[0])->dataID();
msg<< MSG::DEBUG<<"Container name="<<container_name<<endreq;
selparts_p1.m_bits=selparts.m_bits;
selparts_p1.m_bits=selparts.AllBits();
persObj->setSelectedParticles_p1(selparts_p1);
DataLink<Container> dl(container_name);
DataLink_p1 dl_p1;
......@@ -104,20 +100,18 @@ void ParticleLinksCnv_p1<Container>::persToTrans(const ParticleLinks_p1* persObj
const DataLink_p1* dl_p1=persObj->dl_p1();
m_dl.persToTrans(dl_p1,&dl,msg);
dl.toTransient();
const Container *particles=dl.cptr();
//const Container *particles=dl.cptr();
const SelectedParticles_p1* selparts_p1=persObj->sel();
typename Container::const_iterator ipItr = particles->begin();
typename Container::const_iterator ipEnd = particles->end();
//typename Container::const_iterator ipItr = particles->begin();
//typename Container::const_iterator ipEnd = particles->end();
SelectedParticles selparts;
selparts.Set (selparts_p1->m_bits);
//SelectedParticles selparts(m_bits);
transObj->reserve(selparts.numGood());
selparts.m_bits=selparts_p1->m_bits;
unsigned ipart=0;
for(; ipItr != ipEnd; ++ipItr) {
if(selparts.isGood(ipart++)){
ElementLink<Container> el(*particles,ipart-1);
transObj->push_back(el);
}
std::vector<unsigned> goodparts;
selparts.goodParticles (goodparts);
transObj->reserve(goodparts.size());
for (unsigned index : goodparts) {
transObj->emplace_back (dl.key(), index);
}
msg << MSG::DEBUG << "Loading "<<typeid(*transObj).name()<<"from SelectedParticles"<<endreq;
......
......@@ -21,7 +21,9 @@
// Forward declaration
class MsgStream;
class ParticleShallowClone;
namespace Analysis {
class ParticleShallowClone;
}
class ParticleShallowCloneCnv_p1
: public T_AthenaPoolTPCnvBase<Analysis::ParticleShallowClone, ParticleShallowClone_p1>
......
......@@ -17,8 +17,7 @@
// Gaudi includes
// DataModel includes
#include "DataModel/ElementLink.h"
#include "AthLinks/ElementLink.h"
// DataModelAthenaPool includes
#include "DataModelAthenaPool/ElementLinkCnv_p3.h"
......
......@@ -8,16 +8,19 @@ use AtlasPolicy AtlasPolicy-*
use AtlasReflex AtlasReflex-* External
use AthenaPoolCnvSvc AthenaPoolCnvSvc-* Database/AthenaPOOL
use DataModel DataModel-* Control
use AthLinks AthLinks-* Control
use DataModelAthenaPool DataModelAthenaPool-* Control
use EventCommonTPCnv EventCommonTPCnv-* Event
use EventCommonTPCnv EventCommonTPCnv-* Event
use GaudiInterface GaudiInterface-* External
use ParticleEvent ParticleEvent-* PhysicsAnalysis/AnalysisCommon
use Particle Particle-* Reconstruction
private
use CxxUtils CxxUtils-* Control
use AthenaKernel AthenaKernel-* Control
use AthAllocators AthAllocators-* Control
use SGTools SGTools-* Control
use VxVertex VxVertex-* Tracking/TrkEvent
end_private
......@@ -31,3 +34,19 @@ apply_pattern tpcnv_library
# of transient classes
apply_pattern lcgdict dict=ParticleEventTPCnv selectionfile=selection.xml headerfiles="../ParticleEventTPCnv/ParticleEventTPCnvDict.h"
use TestTools TestTools-* AtlasTest
apply_pattern UnitTest_run unit_test=CompositeParticleCnv_p1
apply_pattern UnitTest_run unit_test=CompositeParticleContainerCnv_p1
apply_pattern UnitTest_run unit_test=INav4MomToTrackParticleAssocsCnv_p1
apply_pattern UnitTest_run unit_test=NeutrinoCnv_p1
apply_pattern UnitTest_run unit_test=NeutrinoCnv_p2
apply_pattern UnitTest_run unit_test=NeutrinoContainerCnv_p1
apply_pattern UnitTest_run unit_test=NeutrinoContainerCnv_p2
apply_pattern UnitTest_run unit_test=ParticleBaseCnv_p1
apply_pattern UnitTest_run unit_test=ParticleBaseCnv_p2
apply_pattern UnitTest_run unit_test=ParticleBaseLinksCnv_p1
apply_pattern UnitTest_run unit_test=ParticleShallowCloneCnv_p1
apply_pattern UnitTest_run unit_test=ParticleShallowCloneContainerCnv_p1
apply_pattern UnitTest_run unit_test=SelectedParticlesCnv_p1
apply_pattern UnitTest_run unit_test=TrackParticleAssocsCnv_p1
test1
test1
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