From 87fe62cfa1374313e5d9b8abe5d12be2e3e28d0f Mon Sep 17 00:00:00 2001 From: John Derek Chapman <chapman@hep.phy.cam.ac.uk> Date: Mon, 18 Mar 2024 12:12:56 +0100 Subject: [PATCH] TrkTruthTPCnv and TrkTruthAthenaPool: add persistent classes based on HepMcParticleLink_p3 Add DetailedTrackTruthCollection_p4, DetailedTrackTruth_p4 and TruthTrajectory_p3 based on HepMcParticleLink_p3 --- .../src/DetailedTrackTruthCollectionCnv.cxx | 17 +++- .../src/DetailedTrackTruthCollectionCnv.h | 12 ++- .../src/PRD_MultiTruthCollectionCnv.cxx | 17 +++- .../src/PRD_MultiTruthCollectionCnv.h | 13 ++- .../src/TrackTruthCollectionCnv.cxx | 17 +++- .../src/TrackTruthCollectionCnv.h | 12 ++- .../TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt | 17 +++- .../TrkTruthTPCnv/DetailedTrackTruthCnv_p4.h | 45 +++++++++ .../DetailedTrackTruthCollectionCnv_p4.h | 44 +++++++++ .../DetailedTrackTruthCollection_p4.h | 45 +++++++++ .../TrkTruthTPCnv/DetailedTrackTruth_p4.h | 32 +++++++ .../PRD_MultiTruthCollectionCnv_p4.h | 41 ++++++++ .../PRD_MultiTruthCollection_p4.h | 35 +++++++ .../TrackTruthCollectionCnv_p3.h | 43 +++++++++ .../TrkTruthTPCnv/TrackTruthCollection_p3.h | 44 +++++++++ .../TrkTruthTPCnv/TruthTrajectoryCnv_p3.h | 47 +++++++++ .../TrkTruthTPCnv/TruthTrajectory_p3.h | 27 ++++++ .../TrkTruthTPCnv/TrkTruthTPCnv/selection.xml | 19 +++- .../PRD_MultiTruthCollectionCnv_p4_test.ref | 8 ++ .../share/TrackTruthCollectionCnv_p3_test.ref | 8 ++ .../share/TruthTrajectoryCnv_p3_test.ref | 8 ++ .../src/DetailedTrackTruthCnv_p4.cxx | 50 ++++++++++ .../DetailedTrackTruthCollectionCnv_p4.cxx | 65 +++++++++++++ .../src/PRD_MultiTruthCollectionCnv_p4.cxx | 51 ++++++++++ .../src/TrackTruthCollectionCnv_p3.cxx | 63 ++++++++++++ .../TrkTruthTPCnv/src/TrkTruthTPCnv.cxx | 9 +- .../TrkTruthTPCnv/src/TrkTruthTPCnvDict.h | 14 ++- .../src/TruthTrajectoryCnv_p3.cxx | 37 +++++++ .../PRD_MultiTruthCollectionCnv_p2_test.cxx | 4 +- .../PRD_MultiTruthCollectionCnv_p3_test.cxx | 4 +- .../PRD_MultiTruthCollectionCnv_p4_test.cxx | 93 ++++++++++++++++++ .../test/TrackTruthCollectionCnv_p1_test.cxx | 4 +- .../test/TrackTruthCollectionCnv_p2_test.cxx | 4 +- .../test/TrackTruthCollectionCnv_p3_test.cxx | 96 +++++++++++++++++++ .../test/TruthTrajectoryCnv_p1_test.cxx | 4 +- .../test/TruthTrajectoryCnv_p2_test.cxx | 4 +- .../test/TruthTrajectoryCnv_p3_test.cxx | 91 ++++++++++++++++++ 37 files changed, 1105 insertions(+), 39 deletions(-) create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCnv_p4.h create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p4.h create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruth_p4.h create mode 100755 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h create mode 100755 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h create mode 100755 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h create mode 100755 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollection_p3.h create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectoryCnv_p3.h create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectory_p3.h create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p4_test.ref create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p3_test.ref create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p3_test.ref create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p4.cxx create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p4.cxx create mode 100755 Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p4.cxx create mode 100755 Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p3.cxx create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p3.cxx create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p4_test.cxx create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p3_test.cxx create mode 100644 Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p3_test.cxx diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx index bbc05ae5ac7c..5cbcfc3b01cc 100755 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "DetailedTrackTruthCollectionCnv.h" @@ -9,6 +9,7 @@ #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p1.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p2.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p3.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h" #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/MsgStream.h" @@ -22,9 +23,10 @@ const pool::Guid DetailedTrackTruthCollectionCnv::s_p0_guid("8F573396-F26F-47FD- const pool::Guid DetailedTrackTruthCollectionCnv::s_p1_guid("1BA26DEE-BACE-43D6-8F19-E9490CDE8BB8"); const pool::Guid DetailedTrackTruthCollectionCnv::s_p2_guid("B30AE3A0-F34E-45B6-A8A1-B9CB5E669EB2"); const pool::Guid DetailedTrackTruthCollectionCnv::s_p3_guid("F5A1DC75-C3FB-4575-8178-905223CF1277"); +const pool::Guid DetailedTrackTruthCollectionCnv::s_p4_guid("018E422D-E420-7894-9245-A824C0ECE535"); //================================================================ -DetailedTrackTruthCollectionCnv::DetailedTrackTruthCollectionCnv(ISvcLocator* svcLoc) : +DetailedTrackTruthCollectionCnv::DetailedTrackTruthCollectionCnv(ISvcLocator* svcLoc) : DetailedTrackTruthCollectionCnvBase(svcLoc) {} @@ -45,7 +47,14 @@ DetailedTrackTruthCollection* DetailedTrackTruthCollectionCnv::createTransient() MsgStream log(msgSvc(), "DetailedTrackTruthCollectionCnv" ); DetailedTrackTruthCollection *trans(nullptr); - if (compareClassGuid(s_p3_guid)) { + if (compareClassGuid(s_p4_guid)) { + trans = new DetailedTrackTruthCollection(); + log<<MSG::DEBUG<<"Read DetailedTrackTruthCollection_p4. GUID="<<m_classID.toString()<<endmsg; + Trk::DetailedTrackTruthCollection_p4* pers=poolReadObject<Trk::DetailedTrackTruthCollection_p4>(); + m_converter_p4.persToTrans(pers, trans, log); + delete pers; + } + else if (compareClassGuid(s_p3_guid)) { trans = new DetailedTrackTruthCollection(); log<<MSG::DEBUG<<"Read DetailedTrackTruthCollection_p3. GUID="<<m_classID.toString()<<endmsg; Trk::DetailedTrackTruthCollection_p3* pers=poolReadObject<Trk::DetailedTrackTruthCollection_p3>(); @@ -71,7 +80,7 @@ DetailedTrackTruthCollection* DetailedTrackTruthCollectionCnv::createTransient() log<<MSG::FATAL<<info<<endmsg; throw std::runtime_error(info); } - + return trans; } diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h index 75ef69d7cca2..919f291bb4d1 100644 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/DetailedTrackTruthCollectionCnv.h @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // Dear emacs, this is -*-c++-*- -#ifndef DETAILEDTRACKTRUTHCOLLECTIONCNV_H -#define DETAILEDTRACKTRUTHCOLLECTIONCNV_H +#ifndef TRKTRUTHATHENAPOOL_DETAILEDTRACKTRUTHCOLLECTIONCNV_H +#define TRKTRUTHATHENAPOOL_DETAILEDTRACKTRUTHCOLLECTIONCNV_H #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" @@ -12,8 +12,10 @@ #include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p1.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p2.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p3.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p4.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p2.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p3.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h" typedef Trk::DetailedTrackTruthCollection_p3 DetailedTrackTruthCollectionPERS; @@ -33,9 +35,11 @@ private: static const pool::Guid s_p1_guid; static const pool::Guid s_p2_guid; static const pool::Guid s_p3_guid; + static const pool::Guid s_p4_guid; DetailedTrackTruthCollectionCnv_p1 m_converter_p1; DetailedTrackTruthCollectionCnv_p2 m_converter_p2; DetailedTrackTruthCollectionCnv_p3 m_converter_p3; + DetailedTrackTruthCollectionCnv_p4 m_converter_p4; }; -#endif/*DETAILEDTRACKTRUTHCOLLECTIONCNV_H*/ +#endif/*TRKTRUTHATHENAPOOL_DETAILEDTRACKTRUTHCOLLECTIONCNV_H*/ diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx index 51362e5f44d9..92cc1f393f8c 100755 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.cxx @@ -1,23 +1,26 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "PRD_MultiTruthCollectionCnv.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollection_p1.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollection_p2.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollection_p3.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p1.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p2.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p3.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h" #include "TrkTruthData/PRD_MultiTruthCollection.h" const pool::Guid PRD_MultiTruthCollectionCnv::s_p0_guid("30794FF9-F003-44A6-8553-ED61E2039882"); const pool::Guid PRD_MultiTruthCollectionCnv::s_p1_guid("6649A9D1-719F-4954-A385-D01BCA8E41EF"); const pool::Guid PRD_MultiTruthCollectionCnv::s_p2_guid("714F2E4A-419D-4BDB-8080-BEEB6CDBA0DA"); const pool::Guid PRD_MultiTruthCollectionCnv::s_p3_guid("68703476-9D09-4504-B492-E5E4DC933E71"); +const pool::Guid PRD_MultiTruthCollectionCnv::s_p4_guid("018E41E8-F175-7EB8-AF1D-5CA0794CAF9B"); //================================================================ -PRD_MultiTruthCollectionCnv::PRD_MultiTruthCollectionCnv(ISvcLocator* svcLoc) : +PRD_MultiTruthCollectionCnv::PRD_MultiTruthCollectionCnv(ISvcLocator* svcLoc) : PRD_MultiTruthCollectionCnvBase(svcLoc) {} @@ -35,7 +38,13 @@ PRD_MultiTruthCollection* PRD_MultiTruthCollectionCnv::createTransient() { MsgStream log(msgSvc(), "PRD_MultiTruthCollectionCnv" ); std::unique_ptr<PRD_MultiTruthCollection> trans(new PRD_MultiTruthCollection()); - if (compareClassGuid(s_p3_guid)) { + if (compareClassGuid(s_p4_guid)) { + log<<MSG::DEBUG<<"Read PRD_MultiTruthCollection_p4. GUID="<<m_classID.toString()<<endmsg; + Trk::PRD_MultiTruthCollection_p4* pers=poolReadObject<Trk::PRD_MultiTruthCollection_p4>(); + m_converter_p4.persToTrans(pers, trans.get(), log); + delete pers; + } + else if (compareClassGuid(s_p3_guid)) { log<<MSG::DEBUG<<"Read PRD_MultiTruthCollection_p3. GUID="<<m_classID.toString()<<endmsg; Trk::PRD_MultiTruthCollection_p3* pers=poolReadObject<Trk::PRD_MultiTruthCollection_p3>(); m_converter_p3.persToTrans(pers, trans.get(), log); @@ -62,7 +71,7 @@ PRD_MultiTruthCollection* PRD_MultiTruthCollectionCnv::createTransient() { <<m_classID.toString()<<endmsg; throw std::runtime_error("Unsupported persistent version of Data Collection"); } - + return trans.release(); } diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h index 7904ad43766a..c1eea6f01b89 100644 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/PRD_MultiTruthCollectionCnv.h @@ -1,15 +1,16 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // Dear emacs, this is -*-c++-*- -#ifndef PRD_MULTITRUTHCOLLECTIONCNV_H -#define PRD_MULTITRUTHCOLLECTIONCNV_H +#ifndef TRKTRUTHATHENAPOOL_PRD_MULTITRUTHCOLLECTIONCNV_H +#define TRKTRUTHATHENAPOOL_PRD_MULTITRUTHCOLLECTIONCNV_H #include "TrkTruthData/PRD_MultiTruthCollection.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p1.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p2.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p3.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h" #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" namespace Trk { class PRD_MultiTruthCollection_p3; } @@ -19,7 +20,7 @@ typedef Trk::PRD_MultiTruthCollection_p3 PRD_MultiTruthCollectionPERS; typedef T_AthenaPoolCustomCnv<PRD_MultiTruthCollection,PRD_MultiTruthCollectionPERS> PRD_MultiTruthCollectionCnvBase; -class PRD_MultiTruthCollectionCnv : public PRD_MultiTruthCollectionCnvBase +class PRD_MultiTruthCollectionCnv : public PRD_MultiTruthCollectionCnvBase { friend class CnvFactory<PRD_MultiTruthCollectionCnv>; protected: @@ -32,10 +33,12 @@ private: PRD_MultiTruthCollectionCnv_p1 m_converter_p1; PRD_MultiTruthCollectionCnv_p2 m_converter_p2; PRD_MultiTruthCollectionCnv_p3 m_converter_p3; + PRD_MultiTruthCollectionCnv_p4 m_converter_p4; static const pool::Guid s_p0_guid; static const pool::Guid s_p1_guid; static const pool::Guid s_p2_guid; static const pool::Guid s_p3_guid; + static const pool::Guid s_p4_guid; }; -#endif/*CALOATHENAPOOL_CALOCELLLINKCONTAINERCNV_H*/ +#endif // TRKTRUTHATHENAPOOL_PRD_MULTITRUTHCOLLECTIONCNV_H diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx index d13c48e58de3..d68d6eb03249 100755 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "TrackTruthCollectionCnv.h" @@ -8,8 +8,10 @@ #include "TrkTruthTPCnv/TrackTruthCollection_p0.h" #include "TrkTruthTPCnv/TrackTruthCollection_p1.h" #include "TrkTruthTPCnv/TrackTruthCollection_p2.h" +#include "TrkTruthTPCnv/TrackTruthCollection_p3.h" #include "TrkTruthTPCnv/TrackTruthCollectionCnv_p1.h" #include "TrkTruthTPCnv/TrackTruthCollectionCnv_p2.h" +#include "TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h" #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/MsgStream.h" @@ -22,10 +24,11 @@ const pool::Guid TrackTruthCollectionCnv::s_p0_guid("8BC86D69-DBC4-4B34-8273-513D9BE771D5"); const pool::Guid TrackTruthCollectionCnv::s_p1_guid("ED2B4B64-7CF6-48B3-8C40-29F8501A6090"); const pool::Guid TrackTruthCollectionCnv::s_p2_guid("44F35B21-838A-4C4E-B09B-971CEA0EB70A"); +const pool::Guid TrackTruthCollectionCnv::s_p3_guid("018E41F8-0857-7D8C-A062-A3947683EB99"); //================================================================ -TrackTruthCollectionCnv::TrackTruthCollectionCnv(ISvcLocator* svcLoc) : +TrackTruthCollectionCnv::TrackTruthCollectionCnv(ISvcLocator* svcLoc) : TrackTruthCollectionCnvBase(svcLoc) {} @@ -43,7 +46,13 @@ TrackTruthCollection* TrackTruthCollectionCnv::createTransient() { MsgStream log(msgSvc(), "TrackTruthCollectionCnv" ); std::unique_ptr<TrackTruthCollection> trans(new TrackTruthCollection()); - if (compareClassGuid(s_p2_guid)) { + if (compareClassGuid(s_p3_guid)) { + log<<MSG::DEBUG<<"Read TrackTruthCollection_p3. GUID="<<m_classID.toString()<<endmsg; + Trk::TrackTruthCollection_p3* pers=poolReadObject<Trk::TrackTruthCollection_p3>(); + m_converter_p3.persToTrans(pers, trans.get(), log); + delete pers; + } + else if (compareClassGuid(s_p2_guid)) { log<<MSG::DEBUG<<"Read TrackTruthCollection_p2. GUID="<<m_classID.toString()<<endmsg; Trk::TrackTruthCollection_p2* pers=poolReadObject<Trk::TrackTruthCollection_p2>(); m_converter_p2.persToTrans(pers, trans.get(), log); @@ -66,7 +75,7 @@ TrackTruthCollection* TrackTruthCollectionCnv::createTransient() { <<m_classID.toString()<<endmsg; throw std::runtime_error("Unsupported persistent version of Data Collection"); } - + return trans.release(); } diff --git a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h index a78c41f2c368..1602f9980855 100644 --- a/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h +++ b/Tracking/TrkEventCnv/TrkTruthAthenaPool/src/TrackTruthCollectionCnv.h @@ -1,16 +1,18 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // Dear emacs, this is -*-c++-*- -#ifndef TRACKTRUTHCOLLECTIONCNV_H -#define TRACKTRUTHCOLLECTIONCNV_H +#ifndef TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTIONCNV_H +#define TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTIONCNV_H #include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" #include "TrkTruthData/TrackTruthCollection.h" +#include "TrkTruthTPCnv/TrackTruthCollection_p3.h" #include "TrkTruthTPCnv/TrackTruthCollection_p2.h" #include "TrkTruthTPCnv/TrackTruthCollection_p1.h" +#include "TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h" #include "TrkTruthTPCnv/TrackTruthCollectionCnv_p2.h" #include "TrkTruthTPCnv/TrackTruthCollectionCnv_p1.h" #include "TrkTruthTPCnv/TrackTruthCollectionCnv_p0.h" @@ -34,10 +36,12 @@ private: TrackTruthCollectionCnv_p0 m_converter_p0; TrackTruthCollectionCnv_p1 m_converter_p1; TrackTruthCollectionCnv_p2 m_converter_p2; + TrackTruthCollectionCnv_p3 m_converter_p3; static const pool::Guid s_p0_guid; static const pool::Guid s_p1_guid; static const pool::Guid s_p2_guid; + static const pool::Guid s_p3_guid; }; -#endif +#endif // TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTIONCNV_H diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt b/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt index 748cc4918e5b..438bda367f5c 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( TrkTruthTPCnv ) @@ -26,6 +26,11 @@ atlas_add_test( TrackTruthCollectionCnv_p2_test test/TrackTruthCollectionCnv_p2_test.cxx LINK_LIBRARIES AtlasHepMCLib GeneratorObjectsTPCnv SGTools TrkTruthData TrkTruthTPCnv ) +atlas_add_test( TrackTruthCollectionCnv_p3_test + SOURCES + test/TrackTruthCollectionCnv_p3_test.cxx + LINK_LIBRARIES AtlasHepMCLib GeneratorObjectsTPCnv SGTools TrkTruthData TrkTruthTPCnv ) + atlas_add_test( TruthTrajectoryCnv_p1_test SOURCES test/TruthTrajectoryCnv_p1_test.cxx @@ -36,6 +41,11 @@ atlas_add_test( TruthTrajectoryCnv_p2_test test/TruthTrajectoryCnv_p2_test.cxx LINK_LIBRARIES AtlasHepMCLib GeneratorObjectsTPCnv SGTools TrkTruthData TrkTruthTPCnv ) +atlas_add_test( TruthTrajectoryCnv_p3_test + SOURCES + test/TruthTrajectoryCnv_p3_test.cxx + LINK_LIBRARIES AtlasHepMCLib GeneratorObjectsTPCnv SGTools TrkTruthData TrkTruthTPCnv ) + atlas_add_test( PRD_MultiTruthCollectionCnv_p2_test SOURCES test/PRD_MultiTruthCollectionCnv_p2_test.cxx @@ -45,3 +55,8 @@ atlas_add_test( PRD_MultiTruthCollectionCnv_p3_test SOURCES test/PRD_MultiTruthCollectionCnv_p3_test.cxx LINK_LIBRARIES AtlasHepMCLib GeneratorObjectsTPCnv SGTools StoreGateLib TrkTruthData TrkTruthTPCnv ) + +atlas_add_test( PRD_MultiTruthCollectionCnv_p4_test + SOURCES + test/PRD_MultiTruthCollectionCnv_p4_test.cxx + LINK_LIBRARIES AtlasHepMCLib GeneratorObjectsTPCnv SGTools StoreGateLib TrkTruthData TrkTruthTPCnv ) diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCnv_p4.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCnv_p4.h new file mode 100644 index 000000000000..360be1571841 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCnv_p4.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2008 +// Olivier.Arnaez@cern.ch, 2015 + + +#ifndef TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCNV_P4_H +#define TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCNV_P4_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +class MsgStream; +class DetailedTrackTruth; +namespace Trk { class DetailedTrackTruth_p4; } + + +class DetailedTrackTruthCnv_p4 + : public T_AthenaPoolTPCnvConstBase<DetailedTrackTruth, + Trk::DetailedTrackTruth_p4> +{ +public: + using base_class::persToTrans; + using base_class::transToPers; + + /** Method creating the transient representation of @c Analysis::DetailedTrackTruth + * from its persistent representation @c DetailedTrackTruth_p4 + */ + virtual void persToTrans( const Trk::DetailedTrackTruth_p4* persObj, + DetailedTrackTruth* transObj, + MsgStream& msg ) const override; + + /** Method creating the persistent representation @c DetailedTrackTruth_p4 + * from its transient representation @c Analysis::DetailedTrackTruth + */ + virtual void transToPers( const DetailedTrackTruth* transObj, + Trk::DetailedTrackTruth_p4* persObj, + MsgStream& msg ) const override; + +}; + +#endif // TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCNV_P4_H diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p4.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p4.h new file mode 100644 index 000000000000..aa87faf87710 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p4.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2008 +// Olivier.Arnaez@cern.ch, 2015 + + +#ifndef TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCOLLECTIONCNV_P4_H +#define TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCOLLECTIONCNV_P4_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h" + +class StoreGateSvc; +class MsgStream; +class DetailedTrackTruthCollection; +// namespace Trk { class DetailedTrackTruthCollection_p4; } + + +class DetailedTrackTruthCollectionCnv_p4 + : public T_AthenaPoolTPCnvBase<DetailedTrackTruthCollection, + Trk::DetailedTrackTruthCollection_p4> +{ +public: + /** Method creating the transient representation of @c Analysis::DetailedTrackTruthCollection + * from its persistent representation @c DetailedTrackTruthCollection_p4 + */ + virtual void persToTrans( const Trk::DetailedTrackTruthCollection_p4* persObj, + DetailedTrackTruthCollection* transObj, + MsgStream& msg ); + + /** Method creating the persistent representation @c DetailedTrackTruthCollection_p4 + * from its transient representation @c Analysis::DetailedTrackTruthCollection + */ + virtual void transToPers( const DetailedTrackTruthCollection* transObj, + Trk::DetailedTrackTruthCollection_p4* persObj, + MsgStream& msg ); + +}; + +#endif/*TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCOLLECTIONCNV_P4_H*/ diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h new file mode 100644 index 000000000000..c9e295b4367b --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2008 +// Olivier.Arnaez@cern.ch, 2015 + +#ifndef TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCOLLECTION_P4_H +#define TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCOLLECTION_P4_H + +#include "TrkTruthTPCnv/TrackTruthKey_p0.h" +#include "TrkTruthTPCnv/DetailedTrackTruth_p4.h" +#include "DataModelAthenaPool/DataLink_p1.h" +#include "TrkTrack/TrackCollection.h" + +#include "AthenaKernel/CLASS_DEF.h" + +#include <vector> + +namespace Trk { + + class DetailedTrackTruthCollection_p4 { + public: + + DataLink_p1 m_trackCollectionLink; + + // Perhaps can use here a 32 bit unsigned instead of the 64 bit one? + typedef TrackCollection::size_type size_type; + + struct Entry { + TrackTruthKey_p0 key; + DetailedTrackTruth_p4 detailedTruth; + }; + + typedef std::vector<Entry> CollectionType; + CollectionType m_entries; + }; + +} + +CLASS_DEF( Trk::DetailedTrackTruthCollection_p4 , 1321426764 , 1 ) + +#endif/*TRKTRUTHTPCNV_DETAILEDTRACKTRUTHCOLLECTION_P4_H*/ diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruth_p4.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruth_p4.h new file mode 100644 index 000000000000..5acfd21ac72e --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/DetailedTrackTruth_p4.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2008 +// Olivier.Arnaez@cern.ch, 2015 + + +#ifndef TRKTRUTHTPCNV_DETAILEDTRACKTRUTH_P4_H +#define TRKTRUTHTPCNV_DETAILEDTRACKTRUTH_P4_H + +#include "TrkTruthTPCnv/SubDetHitStatistics_p0.h" +#include "TrkTruthTPCnv/TruthTrajectory_p3.h" + +#include "AthenaKernel/CLASS_DEF.h" + +namespace Trk { + + class DetailedTrackTruth_p4 { + public: + SubDetHitStatistics_p0 m_hitsCommon; + SubDetHitStatistics_p0 m_hitsTrack; + SubDetHitStatistics_p0 m_hitsTruth; + TruthTrajectory_p3 m_trajectory; + }; +} + +CLASS_DEF( Trk::DetailedTrackTruth_p4 , 104029962 , 1 ) + +#endif/*TRKTRUTHTPCNV_DETAILEDTRACKTRUTH_P4_H*/ diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h new file mode 100755 index 000000000000..866cf5725ab6 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2007 +// Olivier.Arnaez@cern.ch, 2015 + +#ifndef TRKTRUTHTPCNV_PRD_MULTITRUTHCOLLECTIONCNV_P4_H +#define TRKTRUTHTPCNV_PRD_MULTITRUTHCOLLECTIONCNV_P4_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h" + +class MsgStream; +class PRD_MultiTruthCollection; + +class PRD_MultiTruthCollectionCnv_p4 + : public T_AthenaPoolTPCnvBase<PRD_MultiTruthCollection, + Trk::PRD_MultiTruthCollection_p4> +{ +public: + + /** Method creating the transient representation of @c Analysis::PRD_MultiTruthCollection + * from its persistent representation @c PRD_MultiTruthCollection_p4 + */ + virtual void persToTrans( const Trk::PRD_MultiTruthCollection_p4* persObj, + PRD_MultiTruthCollection* transObj, + MsgStream& msg ); + + /** Method creating the persistent representation @c PRD_MultiTruthCollection_p4 + * from its transient representation @c Analysis::PRD_MultiTruthCollection + */ + virtual void transToPers( const PRD_MultiTruthCollection* transObj, + Trk::PRD_MultiTruthCollection_p4* persObj, + MsgStream& msg ); + +}; + +#endif // TRKTRUTHTPCNV_PRD_MULTITRUTHCOLLECTIONCNV_P4_H diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h new file mode 100755 index 000000000000..65fbc960fe92 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2007 +// Olivier.Arnaez@cern.ch, 2015 + + +#ifndef TRKTRUTHTPCNV_PRD_MULTITRUTHCOLLECTION_P4_H +#define TRKTRUTHTPCNV_PRD_MULTITRUTHCOLLECTION_P4_H + +#include "GeneratorObjectsTPCnv/HepMcParticleLink_p3.h" + +#include <vector> + +namespace Trk { + class PRD_MultiTruthCollection_p4 { + public: + // the lore is that Root does not split std::pair, so make our own class + struct Entry { + unsigned long long id; // the Identifier + HepMcParticleLink_p3 particle; + Entry(unsigned long long i, const HepMcParticleLink_p3& p) : id(i), particle(p) {} + + Entry() : id(0) {} // stupid call required by reflex dicts + }; + + typedef std::vector<Entry> CollectionType; + CollectionType m_entries; + }; +} + +#endif // TRKTRUTHTPCNV_PRD_MULTITRUTHCOLLECTION_P4_H diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h new file mode 100755 index 000000000000..23ecf5f65d84 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2007 +// Olivier.Arnaez@cern.ch, 2015 + + +#ifndef TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTIONCNV_P3_H +#define TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTIONCNV_P3_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +class StoreGateSvc; +class MsgStream; +class TrackTruthCollection; +namespace Trk { class TrackTruthCollection_p3; } + + +class TrackTruthCollectionCnv_p3 + : public T_AthenaPoolTPCnvBase<TrackTruthCollection, + Trk::TrackTruthCollection_p3> +{ +public: + /** Method creating the transient representation of @c Analysis::TrackTruthCollection + * from its persistent representation @c TrackTruthCollection_p3 + */ + virtual void persToTrans( const Trk::TrackTruthCollection_p3* persObj, + TrackTruthCollection* transObj, + MsgStream& msg ); + + /** Method creating the persistent representation @c TrackTruthCollection_p3 + * from its transient representation @c Analysis::TrackTruthCollection + */ + virtual void transToPers( const TrackTruthCollection* transObj, + Trk::TrackTruthCollection_p3* persObj, + MsgStream& msg ); + +}; + +#endif // TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTIONCNV_P3_H diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollection_p3.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollection_p3.h new file mode 100755 index 000000000000..9fbfa9df898c --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TrackTruthCollection_p3.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2007 +// Olivier.Arnaez@cern.ch, 2015 + +#ifndef TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTION_P3_H +#define TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTION_P3_H + +#include "DataModelAthenaPool/DataLink_p1.h" +#include "TrkTrack/TrackCollection.h" +#include "GeneratorObjectsTPCnv/HepMcParticleLink_p3.h" + +#include <vector> + + +namespace Trk { + class TrackTruthCollection_p3 { + public: + + DataLink_p1 m_trackCollectionLink; + + // Perhaps can use here a 32 bit unsigned instead of the 64 bit one? + typedef TrackCollection::size_type size_type; + + struct Entry { + size_type index; + + // Do TrackTruth here instead of introducing a separate converer for it. + // TrackTruth::m_flag is not used, don't store it. + float probability; + HepMcParticleLink_p3 particle; + }; + + typedef std::vector<Entry> CollectionType; + CollectionType m_entries; + }; + +} + +#endif // TRACKTRUTHTPCNV_TRACKTRUTHCOLLECTION_P3_H diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectoryCnv_p3.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectoryCnv_p3.h new file mode 100644 index 000000000000..b5b801c37e45 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectoryCnv_p3.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2007 +// Olivier.Arnaez@cern.ch, 2015 + +#ifndef TRKTRUTHTPCNV_TRUTHTRAJECTORYCNV_P3_H +#define TRKTRUTHTPCNV_TRUTHTRAJECTORYCNV_P3_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +class MsgStream; + +class TruthTrajectory; +namespace Trk { + class TruthTrajectory_p3; +} + + +class TruthTrajectoryCnv_p3 + : public T_AthenaPoolTPCnvConstBase<TruthTrajectory, + Trk::TruthTrajectory_p3> +{ +public: + using base_class::persToTrans; + using base_class::transToPers; + + /** Method creating the transient representation of @c Analysis::TruthTrajectory + * from its persistent representation @c TruthTrajectory_p3 + */ + virtual void persToTrans( const Trk::TruthTrajectory_p3* persObj, + TruthTrajectory* transObj, + MsgStream& msg ) const override; + + /** Method creating the persistent representation @c TruthTrajectory_p3 + * from its transient representation @c Analysis::TruthTrajectory + */ + virtual void transToPers( const TruthTrajectory* transObj, + Trk::TruthTrajectory_p3* persObj, + MsgStream& msg ) const override; + +}; + +#endif/*TRKTRUTHTPCNV_TRUTHTRAJECTORYCNV_P3_H*/ diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectory_p3.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectory_p3.h new file mode 100644 index 000000000000..3a3893a34158 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/TruthTrajectory_p3.h @@ -0,0 +1,27 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// Dear emacs, this is -*-c++-*- + +// Andrei.Gaponenko@cern.ch, 2007 +// Olivier.Arnaez@cern.ch, 2015 + + +#ifndef TRKTRUTHTPCNV_TRUTHTRAJECTORY_P3_H +#define TRKTRUTHTPCNV_TRUTHTRAJECTORY_P3_H + +#include <vector> +#include "GeneratorObjectsTPCnv/HepMcParticleLink_p3.h" +#include "AthenaKernel/CLASS_DEF.h" + + +// Use T/P separated HepMcParticleLink + +namespace Trk { + class TruthTrajectory_p3 : public std::vector<HepMcParticleLink_p3> {}; +} + +CLASS_DEF( Trk::TruthTrajectory_p3 , 185011230 , 1 ) + +#endif/*TRKTRUTHTPCNV_TRUTHTRAJECTORY_P3_H*/ diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/selection.xml b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/selection.xml index 68af5ce41745..e815fd921eda 100755 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/selection.xml +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/TrkTruthTPCnv/selection.xml @@ -10,11 +10,14 @@ <class name="Trk::PRD_MultiTruthCollection_p3" id="68703476-9D09-4504-B492-E5E4DC933E71" /> <class name="std::vector<Trk::PRD_MultiTruthCollection_p3::Entry>" /> <class name="Trk::PRD_MultiTruthCollection_p3::Entry" /> + <class name="Trk::PRD_MultiTruthCollection_p4" id="018E41E8-F175-7EB8-AF1D-5CA0794CAF9B" /> + <class name="std::vector<Trk::PRD_MultiTruthCollection_p4::Entry>" /> + <class name="Trk::PRD_MultiTruthCollection_p4::Entry" /> <!-- Track Truth p0 --> <class name="TrackTruthVector" id="8BC86D69-DBC4-4B34-8273-513D9BE771D5" /> - <class name="std::vector<std::pair<ElementLink<TrackCollection>,TrackTruth> >" /> - <class name="std::pair<ElementLink<TrackCollection >,TrackTruth>" /> + <class name="std::vector<std::pair<ElementLink<TrackCollection>,TrackTruth> >" /> + <class name="std::pair<ElementLink<TrackCollection >,TrackTruth>" /> <!-- Track Truth p1 --> <class name="Trk::TrackTruthCollection_p1" id="ED2B4B64-7CF6-48B3-8C40-29F8501A6090" /> @@ -24,6 +27,10 @@ <class name="Trk::TrackTruthCollection_p2" id="44F35B21-838A-4C4E-B09B-971CEA0EB70A" /> <class name="std::vector<Trk::TrackTruthCollection_p2::Entry>" /> <class name="Trk::TrackTruthCollection_p2::Entry" /> + <!-- Track Truth p3 --> + <class name="Trk::TrackTruthCollection_p3" id="018E41F8-0857-7D8C-A062-A3947683EB99" /> + <class name="std::vector<Trk::TrackTruthCollection_p3::Entry>" /> + <class name="Trk::TrackTruthCollection_p3::Entry" /> <!-- DetailedTrackTruth stuff --> @@ -52,8 +59,16 @@ <class name="Trk::DetailedTrackTruthCollection_p3" id="F5A1DC75-C3FB-4575-8178-905223CF1277" /> <class name="Trk::DetailedTrackTruth_p3" /> + <class name="std::vector<Trk::DetailedTrackTruthCollection_p3::Entry>" /> <class name="Trk::DetailedTrackTruthCollection_p3::Entry" /> <class name="Trk::TruthTrajectory_p2" /> + <class name="Trk::DetailedTrackTruthCollection_p4" id="018E422D-E420-7894-9245-A824C0ECE535" /> + <class name="Trk::DetailedTrackTruth_p4" /> + + <class name="std::vector<Trk::DetailedTrackTruthCollection_p4::Entry>" /> + <class name="Trk::DetailedTrackTruthCollection_p4::Entry" /> + <class name="Trk::TruthTrajectory_p3" /> + </lcgdict> diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p4_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p4_test.ref new file mode 100644 index 000000000000..4a7c11977bb1 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/PRD_MultiTruthCollectionCnv_p4_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_proxy: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p3_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p3_test.ref new file mode 100644 index 000000000000..4a7c11977bb1 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TrackTruthCollectionCnv_p3_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_proxy: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p3_test.ref b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p3_test.ref new file mode 100644 index 000000000000..4a7c11977bb1 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/share/TruthTrajectoryCnv_p3_test.ref @@ -0,0 +1,8 @@ +ApplicationMgr INFO Application Manager Configured successfully +EventLoopMgr WARNING Unable to locate service "EventSelector" +EventLoopMgr WARNING No events will be processed from external input. +HistogramPersis...WARNING Histograms saving not required. +ApplicationMgr INFO Application Manager Initialized successfully +ApplicationMgr Ready +test1 +HepMcParticleLink INFO find_proxy: Using TruthEvent as McEventCollection key for this job diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p4.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p4.cxx new file mode 100644 index 000000000000..23b2567560fc --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCnv_p4.cxx @@ -0,0 +1,50 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// T/P converter for DetailedTrackTruth. +// Andrei Gaponenko <agaponenko@lbl.gov>, 2008 +// Olivier.Arnaez@cern.ch, 2015 + +#include "TrkTruthTPCnv/DetailedTrackTruthCnv_p4.h" +#include "TrkTruthTPCnv/DetailedTrackTruth_p4.h" +#include "TrkTruthData/DetailedTrackTruth.h" + +#include "TrkTruthTPCnv/SubDetHitStatisticsCnv_p0.h" +#include "TrkTruthTPCnv/TruthTrajectoryCnv_p3.h" + +#include "TrackTruthCollectionAccessor.h" + +namespace { + const SubDetHitStatisticsCnv_p0 subDetHitStatConverter; + const TruthTrajectoryCnv_p3 truthTrajConverter; +} + + +void DetailedTrackTruthCnv_p4::persToTrans( const Trk::DetailedTrackTruth_p4* pers, + DetailedTrackTruth* trans, + MsgStream& msg ) const +{ + msg<<MSG::DEBUG<<"DetailedTrackTruthCnv_p4::persToTrans()"<<endmsg; + + subDetHitStatConverter.persToTrans(&pers->m_hitsCommon, &TrackTruthCollectionAccessor::statsCommon(trans), msg); + subDetHitStatConverter.persToTrans(&pers->m_hitsTrack, &TrackTruthCollectionAccessor::statsTrack(trans), msg); + subDetHitStatConverter.persToTrans(&pers->m_hitsTruth, &TrackTruthCollectionAccessor::statsTruth(trans), msg); + truthTrajConverter.persToTrans(&pers->m_trajectory, &TrackTruthCollectionAccessor::trajectory(trans), msg); + + msg<<MSG::DEBUG<<"DetailedTrackTruthCnv_p4::persToTrans() DONE"<<endmsg; +} + +void DetailedTrackTruthCnv_p4::transToPers( const DetailedTrackTruth* trans, + Trk::DetailedTrackTruth_p4* pers, + MsgStream& msg ) const +{ + msg<<MSG::DEBUG<<"DetailedTrackTruthCnv_p4::transToPers()"<<endmsg; + + subDetHitStatConverter.transToPers(&trans->statsCommon(), &pers->m_hitsCommon, msg); + subDetHitStatConverter.transToPers(&trans->statsTrack(), &pers->m_hitsTrack, msg); + subDetHitStatConverter.transToPers(&trans->statsTruth(), &pers->m_hitsTruth, msg); + truthTrajConverter.transToPers(&trans->trajectory(), &pers->m_trajectory, msg); + + msg<<MSG::DEBUG<<"DetailedTrackTruthCnv_p4::transToPers() DONE"<<endmsg; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p4.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p4.cxx new file mode 100644 index 000000000000..94acc6968bb8 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/DetailedTrackTruthCollectionCnv_p4.cxx @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// T/P converter for DetailedTrackTruthCollection. +// +// Andrei Gaponenko <agaponenko@lbl.gov>, 2008 +// Olivier.Arnaez@cern.ch, 2015 + +#include "TrkTruthData/DetailedTrackTruthCollection.h" + +#include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p4.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h" + +#include "DataModelAthenaPool/DataLinkCnv_p1.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCnv_p4.h" + +#include "StoreGate/StoreGateSvc.h" + +#include "TrackTruthCollectionAccessor.h" + +namespace { + const DataLinkCnv_p1<DataLink<TrackCollection> > dataLinkConverter; + const DetailedTrackTruthCnv_p4 detailedTruthConverter; +} + +void DetailedTrackTruthCollectionCnv_p4::persToTrans( const Trk::DetailedTrackTruthCollection_p4* pers, + DetailedTrackTruthCollection* trans, + MsgStream& msg ) +{ + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p4::persToTrans(): PERS size = "<<pers->m_entries.size()<<endmsg; + + trans->clear(); + + dataLinkConverter.persToTrans(pers->m_trackCollectionLink, TrackTruthCollectionAccessor::trackCollectionLink(trans), msg); + + for(Trk::DetailedTrackTruthCollection_p4::CollectionType::const_iterator i=pers->m_entries.begin(); i!=pers->m_entries.end(); ++i) { + DetailedTrackTruth dt; + detailedTruthConverter.persToTrans(&i->detailedTruth, &dt, msg); + trans->insert(trans->end(), std::make_pair(i->key.m_index, dt) ); + } + + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p4::persToTrans() DONE"<<endmsg; +} + +void DetailedTrackTruthCollectionCnv_p4::transToPers( const DetailedTrackTruthCollection* trans, + Trk::DetailedTrackTruthCollection_p4* pers, + MsgStream& msg ) +{ + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p4::transToPers()"<<endmsg; + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p4::transToPers(): input size = "<<trans->size()<<endmsg; + + dataLinkConverter.transToPers(trans->trackCollectionLink(), pers->m_trackCollectionLink, msg); + + pers->m_entries.resize(trans->size()); + Trk::DetailedTrackTruthCollection_p4::CollectionType::size_type ipers(0); + + for(DetailedTrackTruthCollection::const_iterator itrans=trans->begin(); itrans!=trans->end(); ++itrans, ++ipers) { + Trk::DetailedTrackTruthCollection_p4::Entry& current = pers->m_entries[ipers]; + current.key.m_index = itrans->first.index(); // extract index from ElementLink + detailedTruthConverter.transToPers(&itrans->second, ¤t.detailedTruth, msg); + } + + msg<<MSG::DEBUG<<"DetailedTrackTruthCollectionCnv_p4::transToPers() DONE"<<endmsg; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p4.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p4.cxx new file mode 100755 index 000000000000..ac3c51ac22e2 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/PRD_MultiTruthCollectionCnv_p4.cxx @@ -0,0 +1,51 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// T/P converter for PRD_MultiTruthCollection. +// Andrei Gaponenko <agaponenko@lbl.gov>, 2007 +// Olivier Arnaez <olivier.arnaez@cern.ch>, 2015 + +#include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h" + +#include "TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h" +#include "TrkTruthData/PRD_MultiTruthCollection.h" + +#include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p3.h" + +namespace { + const HepMcParticleLinkCnv_p3 particleLinkConverter; +} + + +void PRD_MultiTruthCollectionCnv_p4::persToTrans( const Trk::PRD_MultiTruthCollection_p4* pers, + PRD_MultiTruthCollection* trans, + MsgStream& msg ) +{ + msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p4::persToTrans()"<<endmsg; + + for (const Trk::PRD_MultiTruthCollection_p4::Entry& ent : pers->m_entries) { + HepMcParticleLink link; + particleLinkConverter.persToTrans(&ent.particle, &link, msg); + trans->insert(trans->end(), std::make_pair(Identifier(ent.id), link) ); + } + + msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p4::persToTrans() DONE"<<endmsg; +} + +void PRD_MultiTruthCollectionCnv_p4::transToPers( const PRD_MultiTruthCollection* trans, + Trk::PRD_MultiTruthCollection_p4* pers, + MsgStream& msg ) +{ + msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p4::transToPers()"<<endmsg; + + pers->m_entries.reserve(trans->size()); + + for (const auto& p : *trans) { + HepMcParticleLink_p3 link; + particleLinkConverter.transToPers(&p.second, &link, msg); + pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p4::Entry(p.first.get_compact(), link)); + } + + msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p4::transToPers() DONE"<<endmsg; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p3.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p3.cxx new file mode 100755 index 000000000000..29532c102f73 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrackTruthCollectionCnv_p3.cxx @@ -0,0 +1,63 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// T/P converter for TrackTruthCollection. +// Andrei Gaponenko <agaponenko@lbl.gov>, 2007 +// Olivier Arnaez <olivier.arnaez@cern.ch>, 2015 + +#include "TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h" + +#include "TrkTruthTPCnv/TrackTruthCollection_p3.h" +#include "TrkTruthData/TrackTruthCollection.h" + +#include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p3.h" +#include "DataModelAthenaPool/DataLinkCnv_p1.h" + +#include "StoreGate/StoreGateSvc.h" + +#include "TrackTruthCollectionAccessor.h" + +namespace { + const HepMcParticleLinkCnv_p3 particleLinkConverter; + const DataLinkCnv_p1<DataLink<TrackCollection> > dataLinkConverter; +} + +void TrackTruthCollectionCnv_p3::persToTrans( const Trk::TrackTruthCollection_p3* pers, + TrackTruthCollection* trans, + MsgStream& msg ) +{ + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p3::persToTrans(): PERS size = "<<pers->m_entries.size()<<endmsg; + + dataLinkConverter.persToTrans(pers->m_trackCollectionLink, TrackTruthCollectionAccessor::trackCollectionLink(trans), msg); + + for(Trk::TrackTruthCollection_p3::CollectionType::const_iterator i=pers->m_entries.begin(); i!=pers->m_entries.end(); ++i) { + HepMcParticleLink link; + particleLinkConverter.persToTrans(&i->particle, &link, msg); + trans->insert(trans->end(), std::make_pair(i->index, TrackTruth(link, i->probability, 0)) ); + } + + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p3::persToTrans() DONE"<<endmsg; +} + +void TrackTruthCollectionCnv_p3::transToPers( const TrackTruthCollection* trans, + Trk::TrackTruthCollection_p3* pers, + MsgStream& msg ) +{ + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p3::transToPers()"<<endmsg; + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p3::transToPers(): input size = "<<trans->size()<<endmsg; + + dataLinkConverter.transToPers(trans->trackCollectionLink(), pers->m_trackCollectionLink, msg); + + pers->m_entries.resize(trans->size()); + Trk::TrackTruthCollection_p3::CollectionType::size_type ipers(0); + for(TrackTruthCollection::const_iterator itrans=trans->begin(); itrans!=trans->end(); ++itrans, ++ipers) { + Trk::TrackTruthCollection_p3::Entry& current = pers->m_entries[ipers]; + const TrackTruth& truth = itrans->second; + current.index = itrans->first.index(); // extract index from ElementLink + current.probability = truth.probability(); + particleLinkConverter.transToPers(&itrans->second.particleLink(), ¤t.particle, msg); + } + + msg<<MSG::DEBUG<<"TrackTruthCollectionCnv_p3::transToPers() DONE"<<endmsg; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnv.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnv.cxx index 89e329e9eb23..5e4c60503e1f 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnv.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnv.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // generate the T/P converter entries @@ -9,6 +9,8 @@ #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p2.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p3.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p3.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollectionCnv_p4.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h" #include "TrkTruthData/DetailedTrackTruthCollection.h" DECLARE_TPCNV_FACTORY (DetailedTrackTruthCollectionCnv_p2, @@ -20,3 +22,8 @@ DECLARE_TPCNV_FACTORY (DetailedTrackTruthCollectionCnv_p3, DetailedTrackTruthCollection, Trk::DetailedTrackTruthCollection_p3, Athena::TPCnvVers::Current) + +DECLARE_TPCNV_FACTORY (DetailedTrackTruthCollectionCnv_p4, + DetailedTrackTruthCollection, + Trk::DetailedTrackTruthCollection_p4, + Athena::TPCnvVers::Old) diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnvDict.h b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnvDict.h index 911935ded4f4..4d29e3d29ccb 100755 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnvDict.h +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TrkTruthTPCnvDict.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ -#ifndef TRKTRUTHTPCNV_H -#define TRKTRUTHTPCNV_H +#ifndef TRKTRUTHTPCNV_TRKTRUTHTPCNVDICT_H +#define TRKTRUTHTPCNV_TRKTRUTHTPCNVDICT_H //----------------------------------------------------------------------------- // MC truth @@ -11,10 +11,12 @@ #include "TrkTruthTPCnv/PRD_MultiTruthCollection_p1.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollection_p2.h" #include "TrkTruthTPCnv/PRD_MultiTruthCollection_p3.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h" #include "TrkTruthTPCnv/TrackTruthCollection_p0.h" #include "TrkTruthTPCnv/TrackTruthCollection_p1.h" #include "TrkTruthTPCnv/TrackTruthCollection_p2.h" +#include "TrkTruthTPCnv/TrackTruthCollection_p3.h" #include "TrkTruthTPCnv/DetailedTrackTruthCollection_p0.h" #include "TrkTruthTPCnv/DetailedTrackTruth_p0.h" @@ -34,6 +36,10 @@ #include "TrkTruthTPCnv/DetailedTrackTruth_p3.h" #include "TrkTruthTPCnv/TruthTrajectory_p2.h" +#include "TrkTruthTPCnv/DetailedTrackTruthCollection_p4.h" +#include "TrkTruthTPCnv/DetailedTrackTruth_p4.h" +#include "TrkTruthTPCnv/TruthTrajectory_p3.h" + namespace { // --->> genreflex: WARNING: Class std::pair<ElementLink<DataVector<Trk::Track>, DataProxyStorage<DataVector<Trk::Track> >,ForwardIndexingPolicy<DataVector<Trk::Track> > >,TrackTruth> in selection file ../i686-slc4-gcc34-opt/dict/TrkTruthTPCnv_selection.xml not generated. Fixing that: std::pair<ElementLink<TrackCollection>,TrackTruth> dummy1; @@ -42,4 +48,4 @@ namespace { std::pair<Trk::TrackTruthKey_p0, Trk::DetailedTrackTruth_p0 > dummy2; } -#endif/*TRKTRUTHTPCNV_H*/ +#endif // TRKTRUTHTPCNV_TRKTRUTHTPCNVDICT_H diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p3.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p3.cxx new file mode 100644 index 000000000000..471193fdc647 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/src/TruthTrajectoryCnv_p3.cxx @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// T/P converter for TruthTrajectory. +// Andrei Gaponenko <agaponenko@lbl.gov>, 2007 +// Olivier Arnaez <olivier.arnaez@cern.ch>, 2015 + +#include "TrkTruthTPCnv/TruthTrajectoryCnv_p3.h" +#include "TrkTruthTPCnv/TruthTrajectory_p3.h" +#include "TrkTruthData/TruthTrajectory.h" + +#include "GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p3.h" + +namespace { + const HepMcParticleLinkCnv_p3 particleLinkConverter; +} + +void TruthTrajectoryCnv_p3::persToTrans( const Trk::TruthTrajectory_p3* pers, + TruthTrajectory* trans, + MsgStream& msg ) const +{ + trans->resize(pers->size()); + for(Trk::TruthTrajectory_p3::size_type i=0; i<trans->size(); i++) { + particleLinkConverter.persToTrans( &((*pers)[i]), &((*trans)[i]), msg); + } +} + +void TruthTrajectoryCnv_p3::transToPers( const TruthTrajectory* trans, + Trk::TruthTrajectory_p3* pers, + MsgStream& msg ) const +{ + pers->resize(trans->size()); + for(TruthTrajectory::size_type i=0; i<trans->size(); i++) { + particleLinkConverter.transToPers( &((*trans)[i]), &((*pers)[i]), msg); + } +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx index 0e518832bf60..fb9f11e6dcbe 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx @@ -16,6 +16,7 @@ #include "TrkTruthData/PRD_MultiTruthCollection.h" #include "StoreGate/StoreGateSvc.h" #include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" #include "GeneratorObjectsTPCnv/initMcEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenParticle.h" @@ -28,6 +29,7 @@ void compare (const HepMcParticleLink& p1, { assert ( p1.isValid() == p2.isValid() ); assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); assert ( p1.eventIndex() == p2.eventIndex() ); assert ( p1.cptr() == p2.cptr() ); assert ( p1 == p2 ); @@ -68,7 +70,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) PRD_MultiTruthCollection trans1; for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); const Identifier chanId(i+100); trans1.insert(trans1.end(), std::make_pair(chanId, trkLink) ); } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx index ab34c06f84d1..759d94bed818 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx @@ -16,6 +16,7 @@ #include "TrkTruthData/PRD_MultiTruthCollection.h" #include "StoreGate/StoreGateSvc.h" #include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" #include "GeneratorObjectsTPCnv/initMcEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenParticle.h" @@ -28,6 +29,7 @@ void compare (const HepMcParticleLink& p1, { assert ( p1.isValid() == p2.isValid() ); assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); assert ( p1.eventIndex() == p2.eventIndex() ); assert ( p1.cptr() == p2.cptr() ); assert ( p1 == p2 ); @@ -68,7 +70,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) PRD_MultiTruthCollection trans1; for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); const Identifier chanId(i+100); trans1.insert(trans1.end(), std::make_pair(chanId, trkLink) ); } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p4_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p4_test.cxx new file mode 100644 index 000000000000..fdabcdf2b333 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p4_test.cxx @@ -0,0 +1,93 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p4_test.cxx + * @date Feb, 2018 + * @brief Tests for PRD_MultiTruthCollectionCnv_p4. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p4.h" +#include "TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h" +#include "TrkTruthData/PRD_MultiTruthCollection.h" +#include "StoreGate/StoreGateSvc.h" +#include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "AtlasHepMC/GenEvent.h" +#include "AtlasHepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const PRD_MultiTruthCollection& p1, + const PRD_MultiTruthCollection& p2) +{ + assert (p1.size() == p2.size()); + PRD_MultiTruthCollection::const_iterator i1 = p1.begin(); + PRD_MultiTruthCollection::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + assert (i1->first == i2->first); + compare (i1->second, i2->second); + assert (i1->second == i2->second); + } +} + + +void testit (const PRD_MultiTruthCollection& trans1) +{ + MsgStream log (nullptr, "test"); + PRD_MultiTruthCollectionCnv_p4 cnv; + Trk::PRD_MultiTruthCollection_p4 pers; + cnv.transToPers (&trans1, &pers, log); + PRD_MultiTruthCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticlePtr> genPartVector) +{ + std::cout << "test1\n"; + + PRD_MultiTruthCollection trans1; + for (int i=0; i<10; i++) { + auto pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); + const Identifier chanId(i+100); + trans1.insert(trans1.end(), std::make_pair(chanId, trkLink) ); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticlePtr> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx index 34bd20ecffb9..3c0dfde0fa0a 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx @@ -15,6 +15,7 @@ #include "TrkTruthTPCnv/TrackTruthCollection_p1.h" #include "TrkTruthData/TrackTruthCollection.h" #include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" #include "GeneratorObjectsTPCnv/initMcEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenParticle.h" @@ -27,6 +28,7 @@ void compare (const HepMcParticleLink& p1, { assert ( p1.isValid() == p2.isValid() ); assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); assert ( p1.eventIndex() == p2.eventIndex() ); assert ( p1.cptr() == p2.cptr() ); assert ( p1 == p2 ); @@ -69,7 +71,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) TrackTruthCollection trans1 (DataLink<TrackCollection>("tpc")); for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); Trk::TrackTruthKey key (ElementLink<TrackCollection> ("tpc", i)); TrackTruth val (trkLink, (float)i/10); trans1[key] = val; diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx index 836667cb06fc..301168c6d514 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx @@ -15,6 +15,7 @@ #include "TrkTruthTPCnv/TrackTruthCollection_p2.h" #include "TrkTruthData/TrackTruthCollection.h" #include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" #include "GeneratorObjectsTPCnv/initMcEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenParticle.h" @@ -27,6 +28,7 @@ void compare (const HepMcParticleLink& p1, { assert ( p1.isValid() == p2.isValid() ); assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); assert ( p1.eventIndex() == p2.eventIndex() ); assert ( p1.cptr() == p2.cptr() ); assert ( p1 == p2 ); @@ -69,7 +71,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) TrackTruthCollection trans1 (DataLink<TrackCollection>("tpc")); for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); Trk::TrackTruthKey key (ElementLink<TrackCollection> ("tpc", i)); TrackTruth val (trkLink, (float)i/10); trans1[key] = val; diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p3_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p3_test.cxx new file mode 100644 index 000000000000..4c16050790cb --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p3_test.cxx @@ -0,0 +1,96 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/TrackTruthCollectionCnv_p3_test.cxx + * @date Feb, 2018 + * @brief Tests for TrackTruthCollectionCnv_p3. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h" +#include "TrkTruthTPCnv/TrackTruthCollection_p3.h" +#include "TrkTruthData/TrackTruthCollection.h" +#include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "AtlasHepMC/GenEvent.h" +#include "AtlasHepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const TrackTruthCollection& p1, + const TrackTruthCollection& p2) +{ + assert (p1.trackCollectionLink() == p2.trackCollectionLink()); + assert (p1.size() == p2.size()); + TrackTruthCollection::const_iterator i1 = p1.begin(); + TrackTruthCollection::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + assert (i1->first.index() == i2->first.index()); + compare (i1->second.particleLink(), i2->second.particleLink()); + assert (i1->second.particleLink() == i2->second.particleLink()); + assert (i1->second.probability() == i2->second.probability()); + } +} + + +void testit (const TrackTruthCollection& trans1) +{ + MsgStream log (nullptr, "test"); + TrackTruthCollectionCnv_p3 cnv; + Trk::TrackTruthCollection_p3 pers; + cnv.transToPers (&trans1, &pers, log); + TrackTruthCollection trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticlePtr> genPartVector) +{ + std::cout << "test1\n"; + + TrackTruthCollection trans1 (DataLink<TrackCollection>("tpc")); + for (int i=0; i<10; i++) { + auto pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); + Trk::TrackTruthKey key (ElementLink<TrackCollection> ("tpc", i)); + TrackTruth val (trkLink, (float)i/10); + trans1[key] = val; + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticlePtr> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx index c1b516012a5a..e1b194395b75 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx @@ -15,6 +15,7 @@ #include "TrkTruthTPCnv/TruthTrajectory_p1.h" #include "TrkTruthData/TruthTrajectory.h" #include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" #include "GeneratorObjectsTPCnv/initMcEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenParticle.h" @@ -27,6 +28,7 @@ void compare (const HepMcParticleLink& p1, { assert ( p1.isValid() == p2.isValid() ); assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); assert ( p1.eventIndex() == p2.eventIndex() ); assert ( p1.cptr() == p2.cptr() ); assert ( p1 == p2 ); @@ -66,7 +68,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) TruthTrajectory trans1; for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); trans1.push_back(trkLink); } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx index 52922ef22b8e..c02df747ff62 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx @@ -15,6 +15,7 @@ #include "TrkTruthTPCnv/TruthTrajectory_p2.h" #include "TrkTruthData/TruthTrajectory.h" #include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" #include "GeneratorObjectsTPCnv/initMcEventCollection.h" #include "AtlasHepMC/GenEvent.h" #include "AtlasHepMC/GenParticle.h" @@ -27,6 +28,7 @@ void compare (const HepMcParticleLink& p1, { assert ( p1.isValid() == p2.isValid() ); assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); assert ( p1.eventIndex() == p2.eventIndex() ); assert ( p1.cptr() == p2.cptr() ); assert ( p1 == p2 ); @@ -66,7 +68,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) TruthTrajectory trans1; for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); trans1.push_back(trkLink); } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p3_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p3_test.cxx new file mode 100644 index 000000000000..6cc369861713 --- /dev/null +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p3_test.cxx @@ -0,0 +1,91 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +// $Id$ +/** + * @file TrkTruthTPCnv/test/TruthTrajectoryCnv_p3_test.cxx + * @date March, 2024 + * @brief Tests for TruthTrajectoryCnv_p3. + */ + + +#undef NDEBUG +#include "TrkTruthTPCnv/TruthTrajectoryCnv_p3.h" +#include "TrkTruthTPCnv/TruthTrajectory_p3.h" +#include "TrkTruthData/TruthTrajectory.h" +#include "SGTools/TestStore.h" +#include "TruthUtils/MagicNumbers.h" +#include "GeneratorObjectsTPCnv/initMcEventCollection.h" +#include "AtlasHepMC/GenEvent.h" +#include "AtlasHepMC/GenParticle.h" +#include <cassert> +#include <iostream> + + +void compare (const HepMcParticleLink& p1, + const HepMcParticleLink& p2) +{ + assert ( p1.isValid() == p2.isValid() ); + assert ( p1.barcode() == p2.barcode() ); + assert ( p1.id() == p2.id() ); + assert ( p1.eventIndex() == p2.eventIndex() ); + assert ( p1.cptr() == p2.cptr() ); + assert ( p1 == p2 ); +} + + +void compare (const TruthTrajectory& p1, + const TruthTrajectory& p2) +{ + assert (p1.size() == p2.size()); + TruthTrajectory::const_iterator i1 = p1.begin(); + TruthTrajectory::const_iterator i2 = p2.begin(); + for (; i1 != p1.end(); ++i1, ++i2) { + compare (*i1, *i2); + assert (*i1 == *i2); + } +} + + +void testit (const TruthTrajectory& trans1) +{ + MsgStream log (nullptr, "test"); + TruthTrajectoryCnv_p3 cnv; + Trk::TruthTrajectory_p3 pers; + cnv.transToPers (&trans1, &pers, log); + TruthTrajectory trans2; + cnv.persToTrans (&pers, &trans2, log); + + compare (trans1, trans2); +} + + +void test1(std::vector<HepMC::GenParticlePtr> genPartVector) +{ + std::cout << "test1\n"; + + TruthTrajectory trans1; + for (int i=0; i<10; i++) { + auto pGenParticle = genPartVector.at(i); + HepMcParticleLink trkLink(HepMC::uniqueID(pGenParticle), pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_ID); + trans1.push_back(trkLink); + } + + testit (trans1); +} + + +int main() +{ + ISvcLocator* pSvcLoc = nullptr; + std::vector<HepMC::GenParticlePtr> genPartVector; + if (!Athena_test::initMcEventCollection(pSvcLoc,genPartVector)) { + std::cerr << "This test can not be run" << std::endl; + return 0; + } + + //SGTest::initTestStore(); + test1(genPartVector); + return 0; +} -- GitLab