diff --git a/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx b/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx index 95567cc477bbcd64566a328b7ea81d0dc2293286..b587830d15400badcde8c79e8bba6e3b0e5dffc5 100644 --- a/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx +++ b/Event/xAOD/xAODTruthCnv/src/RedoTruthLinksAlg.cxx @@ -63,7 +63,7 @@ namespace xAODMaker { } // Create link between HepMC and xAOD truth /// @todo AB: Truth particle links should only be made to the signal event... hence the 0. Right? - truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), 0, HepMcParticleLink::IS_POSITION), par)); + truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE), par)); // FIXME is barcode-based } } diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx index 8aad52fc25ca7de153c3faa17f34a861e88c5fee..e03a40fe151b89ffd865090c1dff0a62d2ac22c4 100644 --- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx +++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "xAODTruthCnvAlg.h" @@ -405,8 +405,8 @@ namespace xAODMaker { if (!isSignalProcess) xTruthPileupEvent->addTruthParticleLink(eltp); // Create link between HepMC and xAOD truth - if (isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink(k,0,HepMcParticleLink::IS_POSITION), eltp)); - if (!isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink(k,genEvt->event_number()), eltp)); + if (isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink(k,0,HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE), eltp)); // FIXME barcode-based + if (!isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink(k,genEvt->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE), eltp)); // FIXME barcode-based // Is this one of the beam particles? if (genEvt_valid_beam_particles) { diff --git a/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx b/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx index 97b12452b21c1afece909345888f13e98b24c22d..3f87db196d45e059c26e5f14186345797001d2c7 100644 --- a/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx +++ b/ForwardDetectors/ForwardTransport/src/ForwardTransportModel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "ForwardTransportModel.h" @@ -189,7 +189,7 @@ void ForwardTransportModel::DoIt(const G4FastTrack& fastTrack, G4FastStep& fastS // Create postTransportISP if required. const auto pBarcode = HepMC::barcode(gParticle); auto tBinding = std::make_unique<ISF::TruthBinding>(gParticle); - auto hmpl = std::make_unique<HepMcParticleLink>(pBarcode, gEvent->event_number()); + auto hmpl = std::make_unique<HepMcParticleLink>(pBarcode, gEvent->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based const Amg::Vector3D pos(postTransportPosition.x(), postTransportPosition.y(), postTransportPosition.z()); const Amg::Vector3D mom(postTransportMomentum.x(), postTransportMomentum.y(), postTransportMomentum.z()); postTransportISP = std::make_unique<ISF::ISFParticle>(pos, diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx index f365e44fa2893193280be059fee5121d1c4dc1b6..ac98f8076c90d391043bdf806adaee9984607d9c 100644 --- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.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 */ /** * @file LUCID_EventTPCnv/test/LUCID_SimHitCnv_p1_test.cxx @@ -73,12 +73,12 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; auto pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); LUCID_SimHit trans1 (1, pGenParticle->pdg_id(), trkLink, 4, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, diff --git a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx index a1d41d67b6fcb3ee75c6e189d3fa2113a6adf972..975d9d2f289f94de4c6991c7d78ecf324536d1ee 100644 --- a/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx +++ b/ForwardDetectors/LUCID/LUCID_Cnv/LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.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 */ /** * @file LUCID_EventTPCnv/test/LUCID_SimHitCnv_p2_test.cxx @@ -72,11 +72,13 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; - HepMcParticleLink trkLink(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); LUCID_SimHit trans1 (1, genPartVector.at(0)->pdg_id(), trkLink, 4, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, diff --git a/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx b/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx index 973802b611c9963de57f318ed526d3aca4c480e8..0ce40ab8f998451fab009d9b99b64dd196e6d2b3 100644 --- a/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx +++ b/ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent/src/LUCID_SimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "LUCID_SimEvent/LUCID_SimHit.h" @@ -44,7 +44,7 @@ LUCID_SimHit::LUCID_SimHit(short tubeID, m_tubeID (tubeID), m_pdgCode (pdgCode), m_track (track), // Susumu Oda 2011.04.03 - m_partLink (track), + m_partLink (track, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE), // FIXME barcode-based m_genVolume (genVolume), m_stepStartPosX(stepStartPosX), m_stepStartPosY(stepStartPosY), diff --git a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h index b59378651a99664189e37a53956d0bdef49a5d0e..66752817233ab53ff9e5a96e3adee493d4e61092 100644 --- a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h +++ b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.h @@ -59,8 +59,8 @@ class McEventCollection; * As a special case, a GenEvent number of 0 is interpreted as the first * GenEvent in the collection. * - * The particle within the GenEvent is represented by a barcode. - * A barcode of 0 implies a null link. + * The particle within the GenEvent is represented by a unique ID. + * A unique ID of 0 implies a null link. * * In order to dereference a link, we need to reference a particular * event store. By default, the current store (as defined by @@ -79,6 +79,11 @@ public: IS_POSITION = 1, }; + enum UniqueIDFlag { + IS_ID = 0, + IS_BARCODE = 1, + }; + /** * @brief Persistent representation of a link. @@ -87,18 +92,19 @@ public: class ExtendedBarCode { public: /// All 1's. Used to represent an undefined index/position. - constexpr static index_type UNDEFINED = ~static_cast<index_type>(0); + constexpr static index_type UNDEFINED = ~static_cast<index_type>(0); // TODO Move to MagicNumbers.h? + constexpr static barcode_type UNDEFINEDBC = ~static_cast<barcode_type>(0); // TODO Move to MagicNumbers.h? /** - * @brief Default constructor. Makes a null link (barcode 0). + * @brief Default constructor. Makes a null link (unique ID 0). */ ExtendedBarCode(); /** * @brief Constructor. - * @param barcode Barcode of target particle. + * @param uid Unique ID of target particle. * @param eventIndex Identifies the target GenEvent in a McEventCollection, * as either the event number if @c isIndexEventPosition is IS_EVENTNUM, * or the position in the container @@ -106,9 +112,10 @@ public: * 0 always means the first event in the collection. * @param isIndexEventPosition: See @c eventIndex. */ - ExtendedBarCode (barcode_type barcode, + ExtendedBarCode (barcode_type uid, index_type eventIndex, - PositionFlag isIndexEventPosition = IS_EVENTNUM); + PositionFlag isIndexEventPosition /*= IS_EVENTNUM*/, + UniqueIDFlag isUniqueIDBarcode /*= IS_ID*/); /** * @brief Copy constructor. (Can't be defaulted due to the atomic member.) @@ -230,6 +237,8 @@ public: /// Flag marking that an index refers to an event position. constexpr static index_type POSITION_MASK = UNDEFINED ^ (UNDEFINED>>1); + /// Flag marking that an unique ID refers to a barcode. + constexpr static barcode_type BARCODE_MASK = UNDEFINEDBC ^ (UNDEFINEDBC>>1); /** * @brief Initialize the event index part of the link. @@ -268,7 +277,7 @@ public: /** * @brief Constructor. - * @param barCode Barcode of the target particle. 0 means a null link. + * @param uid Unique ID of the target particle. 0 means a null link. * @param eventIndex Identifies the target GenEvent in a McEventCollection, * as either the event number if @c isIndexEventPosition is IS_EVENTNUM, * or the position in the container @@ -277,15 +286,16 @@ public: * @param positionFlag: See @c eventIndex. * @param sg Optional specification of a specific store to reference. */ - HepMcParticleLink (barcode_type barCode, - uint32_t eventIndex = 0, - PositionFlag positionFlag = IS_EVENTNUM, + HepMcParticleLink (barcode_type uid, + uint32_t eventIndex /*= 0*/, + PositionFlag positionFlag /*= IS_EVENTNUM*/, + UniqueIDFlag uniqueIDFlag /*= IS_ID*/, IProxyDict* sg = SG::CurrentEventStore::store()); /** * @brief Constructor. - * @param barCode Barcode of the target particle. 0 means a null link. + * @param uid Unique ID of the target particle. 0 means a null link. * @param eventIndex Identifies the target GenEvent in a McEventCollection, * as either the event number if @c isIndexEventPosition is IS_EVENTNUM, * or the position in the container @@ -294,9 +304,10 @@ public: * @param positionFlag: See @c eventIndex. * @param ctx Context of the store to reference. */ - HepMcParticleLink (barcode_type barCode, + HepMcParticleLink (barcode_type uid, uint32_t eventIndex, PositionFlag positionFlag, + UniqueIDFlag uniqueIDFlag, const EventContext& ctx); diff --git a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc index f99f6b861114c6e459ede628e7da2d3d2419c756..614e976d49569f79c97c31ef67bbd68d2e61a85a 100644 --- a/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc +++ b/Generators/GeneratorObjects/GeneratorObjects/HepMcParticleLink.icc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration. + * Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration. */ /** * @file GeneratorObjects/HepMcParticleLink.icc @@ -21,7 +21,7 @@ HepMcParticleLink::ExtendedBarCode::ExtendedBarCode() /** * @brief Constructor. - * @param barcode Barcode of target particle. + * @param uid Unique ID of target particle. * @param eventIndex Identifies the target GenEvent in a McEventCollection, * as either the event number if @c isIndexEventPosition is IS_EVENTNUM, * or the position in the container @@ -31,10 +31,11 @@ HepMcParticleLink::ExtendedBarCode::ExtendedBarCode() */ inline HepMcParticleLink::ExtendedBarCode::ExtendedBarCode - (barcode_type barcode, + (barcode_type uid, index_type eventIndex, - PositionFlag isIndexEventPosition /*=IS_EVENTNUM*/) - : m_BC(barcode) + PositionFlag isIndexEventPosition /*=IS_EVENTNUM*/, + UniqueIDFlag /*isUniqueIDBarcode = IS_ID*/) + : m_BC(uid) { setIndex (eventIndex, isIndexEventPosition); } @@ -292,7 +293,7 @@ HepMcParticleLink::HepMcParticleLink (const EventContext& ctx) /** * @brief Constructor. - * @param barCode Barcode of the target particle. 0 means a null link. + * @param uid Unique ID of the target particle. 0 means a null link. * @param eventIndex Identifies the target GenEvent in a McEventCollection, * as either the event number if @c isIndexEventPosition is IS_EVENTNUM, * or the position in the container @@ -302,19 +303,20 @@ HepMcParticleLink::HepMcParticleLink (const EventContext& ctx) * @param sg Optional specification of a specific store to reference. */ inline -HepMcParticleLink::HepMcParticleLink (barcode_type barCode, +HepMcParticleLink::HepMcParticleLink (barcode_type uid, uint32_t eventIndex /*= 0*/, PositionFlag positionFlag /*= IS_EVENTNUM*/, + UniqueIDFlag uniqueIDFlag /*= IS_ID*/, IProxyDict* sg /*= SG::CurrentEventStore::store()*/) : m_store (sg), - m_extBarcode (barCode, eventIndex, positionFlag) + m_extBarcode (uid, eventIndex, positionFlag, uniqueIDFlag) { } /** * @brief Constructor. - * @param barCode Barcode of the target particle. 0 means a null link. + * @param uid Unique ID of the target particle. 0 means a null link. * @param eventIndex Identifies the target GenEvent in a McEventCollection, * as either the event number if @c isIndexEventPosition is IS_EVENTNUM, * or the position in the container @@ -324,11 +326,12 @@ HepMcParticleLink::HepMcParticleLink (barcode_type barCode, * @param ctx Context of the store to reference. */ inline -HepMcParticleLink::HepMcParticleLink (barcode_type barCode, +HepMcParticleLink::HepMcParticleLink (barcode_type uid, uint32_t eventIndex, PositionFlag positionFlag, + UniqueIDFlag uniqueIDFlag, const EventContext& ctx) - : HepMcParticleLink (barCode, eventIndex, positionFlag, + : HepMcParticleLink (uid, eventIndex, positionFlag, uniqueIDFlag, Atlas::getExtendedEventContext(ctx).proxy()) { } diff --git a/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref index 53cf1c466b0c51da608040fa73cf0f6c853e286c..24a005c550ff2521bbfedecf997a9faf67100721 100644 --- a/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref +++ b/Generators/GeneratorObjects/share/HepMcParticleLink_test.ref @@ -14,6 +14,10 @@ HepMcParticleLink INFO find_proxy: Using TruthEvent as McEventCollection key *** HepMcParticleLink_test OK *** [ OK ] HepMcParticleLink_test.old_test ((xx ms)) [ RUN ] HepMcParticleLink_test.broken_event_link +HepMcParticleLink WARNING find_proxy: No Valid MC event Collection found +HepMcParticleLink WARNING cptr: McEventCollection not found +HepMcParticleLink WARNING find_proxy: No Valid MC event Collection found +HepMcParticleLink WARNING cptr: McEventCollection not found [ OK ] HepMcParticleLink_test.broken_event_link ((xx ms)) [ RUN ] HepMcParticleLink_test.truth_event_link_first_event [ OK ] HepMcParticleLink_test.truth_event_link_first_event ((xx ms)) diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx index 84a4e997adc0aa16989eb6998eb42d5754a3fba5..9217a6a73f01c0ab1c5937821aeddcd2b774b4c8 100644 --- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx +++ b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx @@ -104,7 +104,7 @@ HepMcParticleLink::HepMcParticleLink (const HepMC::ConstGenParticlePtr& part, IProxyDict* sg /*= SG::CurrentEventStore::store()*/) : m_store (sg), m_ptr (part), - m_extBarcode((nullptr != part) ? HepMC::barcode(part) : 0, eventIndex, positionFlag) + m_extBarcode((nullptr != part) ? HepMC::barcode(part) : 0, eventIndex, positionFlag, HepMcParticleLink::IS_BARCODE) { assert(part); diff --git a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx index a8d149bbb9a254d426da46bccbf37e857666187b..b5467ed398ad0ddb7a255295c30deba2c20b1e87 100644 --- a/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx +++ b/Generators/GeneratorObjects/test/HepMcParticleLink_test.cxx @@ -137,7 +137,7 @@ namespace MCTesting { HepMC::set_signal_process_vertex(evt, v3 ); // the event is complete, we now print it out to the screen #ifdef GENP_DEBUG - evt->print(); + std::cout << evt << std::endl; #endif // delete all particle data objects in the particle data table pdt @@ -275,23 +275,27 @@ namespace MCTesting { std::copy_if( pEvent->particles().begin(), pEvent->particles().end(), std::back_inserter(theGammas), is_photon() ); #else std::copy_if( pEvent->particles_begin(), pEvent->particles_end(), - back_inserter(theGammas), is_photon() ); + back_inserter(theGammas), is_photon() ); #endif ASSERT_EQ(1u, theGammas.size()); HepMC::ConstGenParticlePtr pGamma(theGammas.front()); #ifdef GENP_DEBUG - pGamma->print(); - std::cout << "gamma barcode " << hex << HepMC::barcode(pGamma) << std::endl; + std::cout << pGamma << std::endl; + std::cout << "gamma barcode " << HepMC::barcode(pGamma) << std::endl; #endif - HepMcParticleLink gammaLink1(pGamma); - HepMcParticleLink gammaLink2(HepMC::barcode(pGamma)); - HepMcParticleLink gammaLink11(pGamma, 1); - HepMcParticleLink gammaLink12(HepMC::barcode(pGamma), 1); + HepMcParticleLink gammaLink1(pGamma, 0, + HepMcParticleLink::IS_EVENTNUM); + HepMcParticleLink gammaLink3(HepMC::barcode(pGamma), 0, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + HepMcParticleLink gammaLink11(pGamma, 1, + HepMcParticleLink::IS_EVENTNUM); + HepMcParticleLink gammaLink13(HepMC::barcode(pGamma), 1, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); std::stringstream out; out << "Testing HepMcParticleLink streamer " - << gammaLink1 << " --- " << gammaLink11 <<std::endl; + << gammaLink1 << " --- " << gammaLink11 <<std::endl; #ifdef HEPMC3 ASSERT_EQ(out.str(),"Testing HepMcParticleLink streamer Event index 0, Barcode 10005, McEventCollection CollectionNotSet --- Event index 1, Barcode 10005, McEventCollection CollectionNotSet\n"); #else @@ -299,17 +303,19 @@ namespace MCTesting { #endif #ifdef GENP_DEBUG - std::cout << "link barcode " << hex << gammaLink1.barcode() << std::endl; - std::cout << "link index " << hex << gammaLink1.eventIndex() << std::endl; - std::cout << "link1 barcode " << hex << gammaLink11.barcode() << std::endl; - std::cout << "link1 index " << hex << gammaLink11.eventIndex() << std::endl; + std::cout << "link barcode " << gammaLink1.barcode() << std::endl; + std::cout << "link index " << gammaLink1.eventIndex() << std::endl; + std::cout << "link id " << gammaLink1.id() << std::endl; + std::cout << "link1 barcode " << gammaLink11.barcode() << std::endl; + std::cout << "link1 index " << gammaLink11.eventIndex() << std::endl; + std::cout << "link1 id " << gammaLink1.id() << std::endl; #endif - ASSERT_EQ(*gammaLink1, *gammaLink2); - ASSERT_EQ(gammaLink1, gammaLink2); + ASSERT_EQ(*gammaLink1, *gammaLink3); + ASSERT_EQ(gammaLink1, gammaLink3); ASSERT_EQ(gammaLink1.barcode(), HepMC::barcode(pGamma)); - ASSERT_EQ(*gammaLink11, *gammaLink12); - ASSERT_EQ(gammaLink11, gammaLink12); + ASSERT_EQ(gammaLink1, gammaLink3); + ASSERT_EQ(gammaLink11, gammaLink13); ASSERT_EQ(*gammaLink1, *gammaLink11); ASSERT_NE( gammaLink1, gammaLink11 ); //FIXME weird! Can't check ptr... @@ -320,7 +326,7 @@ namespace MCTesting { TEST_F(HepMcParticleLink_test, broken_event_link) { // create dummy input McEventCollection with a name that // HepMcParticleLink does not know about - SG::WriteHandle<McEventCollection> inputTestDataHandle{"GEN_EVENT"}; + SG::WriteHandle<McEventCollection> inputTestDataHandle{"MISNAMED_EVENT"}; inputTestDataHandle = std::make_unique<McEventCollection>(); // Fill it with a dummy GenEvent inputTestDataHandle->push_back(HepMC::newGenEvent(20,1)); @@ -328,12 +334,18 @@ namespace MCTesting { HepMC::ConstGenParticlePtr particle1 = populateGenEvent(ge1); // A HepMcParticleLink built using a GenParticle pointer should // still work. - HepMcParticleLink testLink1a(particle1,0); + HepMcParticleLink testLink1a(particle1,0, + HepMcParticleLink::IS_EVENTNUM); ASSERT_TRUE( testLink1a.isValid() ); // A HepMcParticleLink built using the barcode and the position of + // the GenEvent in the McEventCollection will not work. + HepMcParticleLink testLink1b(HepMC::barcode(particle1),0, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_FALSE( testLink1b.isValid() ); + // A HepMcParticleLink built using a GenParticle pointer and the position of // the GenEvent in the McEventCollection should still work. - HepMcParticleLink testLink1b(HepMC::barcode(particle1),0); - ASSERT_TRUE( testLink1b.isValid() ); + HepMcParticleLink testLink1c(particle1,0,HepMcParticleLink::IS_POSITION); + ASSERT_TRUE( testLink1c.isValid() ); } TEST_F(HepMcParticleLink_test, truth_event_link_first_event) { @@ -385,7 +397,7 @@ namespace MCTesting { // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink1b(HepMC::barcode(particle1),dummyIndex1, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink1b.isValid() ); ASSERT_EQ( HepMC::barcode(particle1), testLink1b.barcode()); ASSERT_EQ( refEvtNum1, testLink1b.eventIndex()); @@ -393,22 +405,23 @@ namespace MCTesting { ASSERT_EQ(*(testLink1a.cptr()),*(testLink1b.cptr())); // HepMcParticleLink built using a GenParticle pointer and the // event_number of the GenEvent. - HepMcParticleLink testLink1c(particle1,event_number1); - ASSERT_TRUE( testLink1c.isValid() ); - ASSERT_EQ( HepMC::barcode(particle1), testLink1c.barcode()); - ASSERT_NE( dummyIndex1, testLink1c.eventIndex()); - ASSERT_EQ( refEvtNum1, testLink1c.eventIndex()); - ASSERT_EQ( dummyIndex1, testLink1c.getEventPositionInCollection(sg)); - ASSERT_EQ(particle1,testLink1c.cptr()); - // A HepMcParticleLink built using the barcode and the event_number of - // the GenEvent. - HepMcParticleLink testLink1d(HepMC::barcode(particle1),event_number1); + HepMcParticleLink testLink1d(particle1,event_number1); ASSERT_TRUE( testLink1d.isValid() ); ASSERT_EQ( HepMC::barcode(particle1), testLink1d.barcode()); ASSERT_NE( dummyIndex1, testLink1d.eventIndex()); ASSERT_EQ( refEvtNum1, testLink1d.eventIndex()); ASSERT_EQ( dummyIndex1, testLink1d.getEventPositionInCollection(sg)); ASSERT_EQ(particle1,testLink1d.cptr()); + // A HepMcParticleLink built using the barcode and the event_number of + // the GenEvent. + HepMcParticleLink testLink1e(HepMC::barcode(particle1),event_number1, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_TRUE( testLink1e.isValid() ); + ASSERT_EQ( HepMC::barcode(particle1), testLink1e.barcode()); + ASSERT_NE( dummyIndex1, testLink1e.eventIndex()); + ASSERT_EQ( refEvtNum1, testLink1e.eventIndex()); + ASSERT_EQ( dummyIndex1, testLink1e.getEventPositionInCollection(sg)); + ASSERT_EQ(particle1,testLink1e.cptr()); } TEST_F(HepMcParticleLink_test, truth_event_link_second_event) { @@ -460,7 +473,7 @@ namespace MCTesting { // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink2b(HepMC::barcode(particle2), dummyIndex2, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink2b.isValid() ); ASSERT_EQ( HepMC::barcode(particle2), testLink2b.barcode()); ASSERT_EQ( refEvtNum2, testLink2b.eventIndex()); @@ -468,22 +481,23 @@ namespace MCTesting { ASSERT_EQ(particle2,testLink2b.cptr()); // HepMcParticleLink built using a GenParticle pointer and the // event_number of the GenEvent. - HepMcParticleLink testLink2c(particle2,event_number2); - ASSERT_TRUE( testLink2c.isValid() ); - ASSERT_EQ( HepMC::barcode(particle2), testLink2c.barcode()); - ASSERT_NE( dummyIndex2, testLink2c.eventIndex()); - ASSERT_EQ( refEvtNum2, testLink2c.eventIndex()); - ASSERT_EQ( dummyIndex2, testLink2c.getEventPositionInCollection(sg)); - ASSERT_EQ(particle2,testLink2c.cptr()); - // A HepMcParticleLink built using the barcode and the event_number of - // the GenEvent. - HepMcParticleLink testLink2d(HepMC::barcode(particle2),event_number2); + HepMcParticleLink testLink2d(particle2,event_number2); ASSERT_TRUE( testLink2d.isValid() ); ASSERT_EQ( HepMC::barcode(particle2), testLink2d.barcode()); ASSERT_NE( dummyIndex2, testLink2d.eventIndex()); ASSERT_EQ( refEvtNum2, testLink2d.eventIndex()); ASSERT_EQ( dummyIndex2, testLink2d.getEventPositionInCollection(sg)); ASSERT_EQ(particle2,testLink2d.cptr()); + // A HepMcParticleLink built using the barcode and the event_number of + // the GenEvent. + HepMcParticleLink testLink2e(HepMC::barcode(particle2),event_number2, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_TRUE( testLink2e.isValid() ); + ASSERT_EQ( HepMC::barcode(particle2), testLink2e.barcode()); + ASSERT_NE( dummyIndex2, testLink2e.eventIndex()); + ASSERT_EQ( refEvtNum2, testLink2e.eventIndex()); + ASSERT_EQ( dummyIndex2, testLink2e.getEventPositionInCollection(sg)); + ASSERT_EQ(particle2,testLink2e.cptr()); } TEST_F(HepMcParticleLink_test, truth_event_link_third_event) { @@ -496,6 +510,7 @@ namespace MCTesting { const int process_id1(20); const int event_number1(17); inputTestDataHandle->push_back(HepMC::newGenEvent(process_id1, event_number1)); + const HepMcParticleLink::index_type dummyIndex1(0); HepMC::GenEvent& ge1 = *(inputTestDataHandle->at(0)); HepMC::ConstGenParticlePtr particle1 = populateGenEvent(ge1); // Add a second dummy GenEvent @@ -519,6 +534,7 @@ namespace MCTesting { ge4.set_event_number(event_number4); (void)populateFilteredGenEvent(ge4); + const IProxyDict* sg = SG::CurrentEventStore::store(); //Testing links to the third dummy GenEvent @@ -529,32 +545,41 @@ namespace MCTesting { ASSERT_TRUE( testLink3a.isValid() ); ASSERT_EQ( HepMC::barcode(particle3), testLink3a.barcode()); ASSERT_EQ( refEvtNum3, testLink3a.eventIndex()); + ASSERT_NE( dummyIndex3, testLink3a.getEventPositionInCollection(sg)); // Returns the position of the first event with a given event number + ASSERT_EQ( dummyIndex1, testLink3a.getEventPositionInCollection(sg)); ASSERT_EQ(particle3,testLink3a.cptr()); // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink3b(HepMC::barcode(particle3), dummyIndex3, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink3b.isValid() ); ASSERT_EQ( HepMC::barcode(particle3), testLink3b.barcode()); ASSERT_EQ( refEvtNum3, testLink3b.eventIndex()); + ASSERT_NE( dummyIndex3, testLink3b.getEventPositionInCollection(sg)); // Returns the position of the first event with a given event number + ASSERT_EQ( dummyIndex1, testLink3a.getEventPositionInCollection(sg)); ASSERT_EQ(particle3,testLink3b.cptr()); // HepMcParticleLink built using a GenParticle pointer and the // event_number of the GenEvent. - HepMcParticleLink testLink3c(particle3,event_number3); - ASSERT_TRUE( testLink3c.isValid() ); - ASSERT_EQ( HepMC::barcode(particle3), testLink3c.barcode()); - ASSERT_NE( dummyIndex3, testLink3c.eventIndex()); - ASSERT_EQ( refEvtNum3, testLink3c.eventIndex()); - ASSERT_EQ(particle3,testLink3c.cptr()); - // A HepMcParticleLink built using the barcode and the event_number of - // the GenEvent. BROKEN - HepMcParticleLink testLink3d(HepMC::barcode(particle3),event_number3); + HepMcParticleLink testLink3d(particle3,event_number3); ASSERT_TRUE( testLink3d.isValid() ); ASSERT_EQ( HepMC::barcode(particle3), testLink3d.barcode()); ASSERT_NE( dummyIndex3, testLink3d.eventIndex()); ASSERT_EQ( refEvtNum3, testLink3d.eventIndex()); - ASSERT_NE(particle3,testLink3d.cptr()); - ASSERT_EQ(particle1,testLink3d.cptr()); //POINTS AT THE IDENTICAL PARTICLE IN FIRST GenEvent!! + ASSERT_NE( dummyIndex3, testLink3d.getEventPositionInCollection(sg)); // Returns the position of the first event with a given event number + ASSERT_EQ( dummyIndex1, testLink3a.getEventPositionInCollection(sg)); + ASSERT_EQ(particle3,testLink3d.cptr()); + // A HepMcParticleLink built using the barcode and the event_number of + // the GenEvent. BROKEN + HepMcParticleLink testLink3e(HepMC::barcode(particle3),event_number3, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_TRUE( testLink3e.isValid() ); + ASSERT_EQ( HepMC::barcode(particle3), testLink3e.barcode()); + ASSERT_NE( dummyIndex3, testLink3e.eventIndex()); + ASSERT_EQ( refEvtNum3, testLink3e.eventIndex()); + ASSERT_NE( dummyIndex3, testLink3e.getEventPositionInCollection(sg)); // Returns the position of the first event with a given event number + ASSERT_EQ( dummyIndex1, testLink3a.getEventPositionInCollection(sg)); + ASSERT_NE(particle3,testLink3e.cptr()); + ASSERT_EQ(particle1,testLink3e.cptr()); //POINTS AT THE IDENTICAL PARTICLE IN FIRST GenEvent!! } TEST_F(HepMcParticleLink_test, truth_event_link_fourth_event) { @@ -602,33 +627,33 @@ namespace MCTesting { ASSERT_EQ( refEvtNum4, testLink4a.eventIndex()); ASSERT_EQ( dummyIndex4, testLink4a.getEventPositionInCollection(sg)); ASSERT_EQ( particle4, testLink4a.cptr()); - // A HepMcParticleLink built using the barcode and the event_number of + // A HepMcParticleLink built using the barcode and the position of // the GenEvent. - HepMcParticleLink testLink4b(HepMC::barcode(particle4),event_number4); - ASSERT_TRUE( testLink4b.isValid() ); - ASSERT_EQ( HepMC::barcode(particle4), testLink4b.barcode()); - ASSERT_EQ( refEvtNum4, testLink4b.eventIndex()); - ASSERT_EQ( dummyIndex4, testLink4a.getEventPositionInCollection(sg)); - ASSERT_EQ( particle4, testLink4b.cptr()); - // HepMcParticleLink built using a GenParticle pointer and the - // position of the GenEvent. - HepMcParticleLink testLink4c(particle4, dummyIndex4, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink testLink4c(HepMC::barcode(particle4),event_number4, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink4c.isValid() ); ASSERT_EQ( HepMC::barcode(particle4), testLink4c.barcode()); ASSERT_EQ( refEvtNum4, testLink4c.eventIndex()); ASSERT_EQ( dummyIndex4, testLink4c.getEventPositionInCollection(sg)); ASSERT_EQ( particle4, testLink4c.cptr()); - - // A HepMcParticleLink built using the barcode and the position of - // the GenEvent. - HepMcParticleLink testLink4d(HepMC::barcode(particle4), dummyIndex4, + // HepMcParticleLink built using a GenParticle pointer and the + // position of the GenEvent. + HepMcParticleLink testLink4d(particle4, dummyIndex4, HepMcParticleLink::IS_POSITION); ASSERT_TRUE( testLink4d.isValid() ); ASSERT_EQ( HepMC::barcode(particle4), testLink4d.barcode()); ASSERT_EQ( refEvtNum4, testLink4d.eventIndex()); ASSERT_EQ( dummyIndex4, testLink4d.getEventPositionInCollection(sg)); ASSERT_EQ( particle4, testLink4d.cptr()); + // A HepMcParticleLink built using the barcode and the position of + // the GenEvent. + HepMcParticleLink testLink4f(HepMC::barcode(particle4), dummyIndex4, + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); + ASSERT_TRUE( testLink4f.isValid() ); + ASSERT_EQ( HepMC::barcode(particle4), testLink4f.barcode()); + ASSERT_EQ( refEvtNum4, testLink4f.eventIndex()); + ASSERT_EQ( dummyIndex4, testLink4f.getEventPositionInCollection(sg)); + ASSERT_EQ( particle4, testLink4f.cptr()); } TEST_F(HepMcParticleLink_test, truth_event_link_delta_rays) { @@ -674,44 +699,46 @@ namespace MCTesting { // HepMcParticleLink built using a delta-ray barcode and the event_number of // the GenEvent. - HepMcParticleLink testLink5a(deltaRayBarcode, refEvtNum1); + HepMcParticleLink testLink5a(deltaRayBarcode, refEvtNum1, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); ASSERT_EQ( refEvtNum1, testLink5a.eventIndex()); ASSERT_FALSE( testLink5a.isValid() ); ASSERT_EQ( deltaRayBarcode, testLink5a.barcode()); ASSERT_EQ( dummyIndex1, testLink5a.getEventPositionInCollection(sg)); ASSERT_EQ( deltaRayPtr, testLink5a.cptr()); - - // HepMcParticleLink built using a delta-ray barcode and the event_number of - // the GenEvent. GenEvent not recorded - const int event_number5(460); - const HepMcParticleLink::index_type refEvtNum5 = static_cast<HepMcParticleLink::index_type>(event_number5); - HepMcParticleLink testLink5b(deltaRayBarcode, refEvtNum5); + // HepMcParticleLink built using a delta-ray barcode and the + // position of the GenEvent. + HepMcParticleLink testLink5b(deltaRayBarcode, dummyIndex1, + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_FALSE( testLink5b.isValid() ); ASSERT_EQ( deltaRayBarcode, testLink5b.barcode()); - ASSERT_EQ( refEvtNum5, testLink5b.eventIndex()); - ASSERT_EQ( HepMcParticleLink:: ExtendedBarCode::UNDEFINED, testLink5b.getEventPositionInCollection(sg)); + ASSERT_EQ( refEvtNum1, testLink5b.eventIndex()); + ASSERT_EQ( dummyIndex1, testLink5b.getEventPositionInCollection(sg)); ASSERT_EQ( deltaRayPtr, testLink5b.cptr()); // HepMcParticleLink built using a delta-ray barcode and the - // position of the GenEvent. - HepMcParticleLink testLink5c(deltaRayBarcode, dummyIndex1, - HepMcParticleLink::IS_POSITION); - ASSERT_FALSE( testLink5c.isValid() ); - ASSERT_EQ( deltaRayBarcode, testLink5c.barcode()); - ASSERT_EQ( refEvtNum1, testLink5c.eventIndex()); - ASSERT_EQ( dummyIndex1, testLink5c.getEventPositionInCollection(sg)); - ASSERT_EQ( deltaRayPtr, testLink5c.cptr()); + // position of the GenEvent (2nd event). + HepMcParticleLink testLink5e(deltaRayBarcode, dummyIndex2, + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); + ASSERT_FALSE( testLink5e.isValid() ); + ASSERT_EQ( deltaRayBarcode, testLink5e.barcode()); + ASSERT_EQ( refEvtNum2, testLink5e.eventIndex()); + ASSERT_EQ( dummyIndex2, testLink5e.getEventPositionInCollection(sg)); + ASSERT_EQ( deltaRayPtr, testLink5e.cptr()); - // HepMcParticleLink built using a delta-ray barcode and the - // position of the GenEvent. - HepMcParticleLink testLink5d(deltaRayBarcode, dummyIndex2, - HepMcParticleLink::IS_POSITION); - ASSERT_FALSE( testLink5d.isValid() ); - ASSERT_EQ( deltaRayBarcode, testLink5d.barcode()); - ASSERT_EQ( refEvtNum2, testLink5d.eventIndex()); - ASSERT_EQ( dummyIndex2, testLink5d.getEventPositionInCollection(sg)); - ASSERT_EQ( deltaRayPtr, testLink5d.cptr()); - } + // HepMcParticleLink built using a delta-ray barcode and the event_number of + // the GenEvent. GenEvent not recorded + const int event_number5(460); + const HepMcParticleLink::index_type refEvtNum5 = static_cast<HepMcParticleLink::index_type>(event_number5); + HepMcParticleLink testLink5f(deltaRayBarcode, refEvtNum5, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_FALSE( testLink5f.isValid() ); + ASSERT_EQ( deltaRayBarcode, testLink5f.barcode()); + ASSERT_EQ( refEvtNum5, testLink5f.eventIndex()); + ASSERT_EQ( HepMcParticleLink:: ExtendedBarCode::UNDEFINED, testLink5f.getEventPositionInCollection(sg)); + ASSERT_EQ( deltaRayPtr, testLink5f.cptr()); + + } TEST_F(HepMcParticleLink_test, truth_event_link_cut_events) { // create dummy input McEventCollection with a name that @@ -762,7 +789,7 @@ namespace MCTesting { // Link to a GenParticle which was not recorded to the // McEventCollection, even though other parts of the same GenEvent // were recorded. - HepMcParticleLink testLink6a(cutBarcode, refEvtNum1); + HepMcParticleLink testLink6a(cutBarcode, refEvtNum1, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); ASSERT_FALSE( testLink6a.isValid() ); ASSERT_EQ( cutBarcode, testLink6a.barcode()); ASSERT_EQ( refEvtNum1, testLink6a.eventIndex()); @@ -770,7 +797,7 @@ namespace MCTesting { ASSERT_EQ( cutParticlePtr, testLink6a.cptr()); // Link to a GenEvent which was not recorded to the McEventCollection - HepMcParticleLink testLink6b(cutBarcode, refEvtNum5); + HepMcParticleLink testLink6b(cutBarcode, refEvtNum5, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); ASSERT_FALSE( testLink6b.isValid() ); ASSERT_EQ( cutBarcode, testLink6b.barcode()); ASSERT_EQ( refEvtNum5, testLink6b.eventIndex()); @@ -821,29 +848,30 @@ namespace MCTesting { // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink1b(HepMC::barcode(particle1),dummyIndex1, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink1b.isValid() ); // HepMcParticleLink built using a GenParticle pointer and the // event_number of the GenEvent. - HepMcParticleLink testLink1c(particle1,event_number1); - ASSERT_TRUE( testLink1c.isValid() ); + HepMcParticleLink testLink1d(particle1,event_number1); + ASSERT_TRUE( testLink1d.isValid() ); // A HepMcParticleLink built using the barcode and the event_number of // the GenEvent. - HepMcParticleLink testLink1d(HepMC::barcode(particle1),event_number1); - ASSERT_TRUE( testLink1d.isValid() ); + HepMcParticleLink testLink1e(HepMC::barcode(particle1),event_number1, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_TRUE( testLink1e.isValid() ); // Comparing links to the same particle in the first event ASSERT_FALSE( testLink1a < testLink1b ); - ASSERT_FALSE( testLink1a < testLink1c ); ASSERT_FALSE( testLink1a < testLink1d ); + ASSERT_FALSE( testLink1a < testLink1e ); ASSERT_FALSE( testLink1b < testLink1a ); - ASSERT_FALSE( testLink1b < testLink1c ); ASSERT_FALSE( testLink1b < testLink1d ); - ASSERT_FALSE( testLink1c < testLink1a ); - ASSERT_FALSE( testLink1c < testLink1b ); - ASSERT_FALSE( testLink1c < testLink1d ); + ASSERT_FALSE( testLink1b < testLink1e ); ASSERT_FALSE( testLink1d < testLink1a ); ASSERT_FALSE( testLink1d < testLink1b ); - ASSERT_FALSE( testLink1d < testLink1c ); + ASSERT_FALSE( testLink1d < testLink1e ); + ASSERT_FALSE( testLink1e < testLink1a ); + ASSERT_FALSE( testLink1e < testLink1b ); + ASSERT_FALSE( testLink1e < testLink1d ); // HepMcParticleLink built using a GenParticle pointer and the // position of the GenEvent. HepMcParticleLink testLink2a(particle2, dummyIndex2, @@ -852,46 +880,47 @@ namespace MCTesting { // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink2b(HepMC::barcode(particle2), dummyIndex2, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink2b.isValid() ); // HepMcParticleLink built using a GenParticle pointer and the // event_number of the GenEvent. - HepMcParticleLink testLink2c(particle2,event_number2); - ASSERT_TRUE( testLink2c.isValid() ); + HepMcParticleLink testLink2d(particle2,event_number2); + ASSERT_TRUE( testLink2d.isValid() ); // A HepMcParticleLink built using the barcode and the event_number of // the GenEvent. - HepMcParticleLink testLink2d(HepMC::barcode(particle2),event_number2); - ASSERT_TRUE( testLink2d.isValid() ); + HepMcParticleLink testLink2e(HepMC::barcode(particle2),event_number2, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_TRUE( testLink2e.isValid() ); // Comparing links to the same particle in the second event ASSERT_FALSE( testLink2a < testLink2b ); - ASSERT_FALSE( testLink2a < testLink2c ); ASSERT_FALSE( testLink2a < testLink2d ); + ASSERT_FALSE( testLink2a < testLink2e ); ASSERT_FALSE( testLink2b < testLink2a ); - ASSERT_FALSE( testLink2b < testLink2c ); ASSERT_FALSE( testLink2b < testLink2d ); - ASSERT_FALSE( testLink2c < testLink2a ); - ASSERT_FALSE( testLink2c < testLink2b ); - ASSERT_FALSE( testLink2c < testLink2d ); + ASSERT_FALSE( testLink2b < testLink2e ); ASSERT_FALSE( testLink2d < testLink2a ); ASSERT_FALSE( testLink2d < testLink2b ); - ASSERT_FALSE( testLink2d < testLink2c ); + ASSERT_FALSE( testLink2d < testLink2e ); + ASSERT_FALSE( testLink2e < testLink2a ); + ASSERT_FALSE( testLink2e < testLink2b ); + ASSERT_FALSE( testLink2e < testLink2d ); // Comparing links in two different events ASSERT_TRUE( testLink1a < testLink2a ); ASSERT_TRUE( testLink1a < testLink2b ); - ASSERT_TRUE( testLink1a < testLink2c ); ASSERT_TRUE( testLink1a < testLink2d ); + ASSERT_TRUE( testLink1a < testLink2e ); ASSERT_TRUE( testLink1b < testLink2a ); ASSERT_TRUE( testLink1b < testLink2b ); - ASSERT_TRUE( testLink1b < testLink2c ); ASSERT_TRUE( testLink1b < testLink2d ); - ASSERT_TRUE( testLink1c < testLink2a ); - ASSERT_TRUE( testLink1c < testLink2b ); - ASSERT_TRUE( testLink1c < testLink2c ); - ASSERT_TRUE( testLink1c < testLink2d ); + ASSERT_TRUE( testLink1b < testLink2e ); ASSERT_TRUE( testLink1d < testLink2a ); ASSERT_TRUE( testLink1d < testLink2b ); - ASSERT_TRUE( testLink1d < testLink2c ); ASSERT_TRUE( testLink1d < testLink2d ); + ASSERT_TRUE( testLink1d < testLink2e ); + ASSERT_TRUE( testLink1e < testLink2a ); + ASSERT_TRUE( testLink1e < testLink2b ); + ASSERT_TRUE( testLink1e < testLink2d ); + ASSERT_TRUE( testLink1e < testLink2e ); // Make links to another GenParticle from the first GenEvent #ifdef HEPMC3 @@ -907,33 +936,34 @@ namespace MCTesting { // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink3b(HepMC::barcode(particle3),dummyIndex1, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink3b.isValid() ); // HepMcParticleLink built using a GenParticle pointer and the // event_number of the GenEvent. - HepMcParticleLink testLink3c(particle3,event_number1); - ASSERT_TRUE( testLink3c.isValid() ); + HepMcParticleLink testLink3d(particle3,event_number1); + ASSERT_TRUE( testLink3d.isValid() ); // A HepMcParticleLink built using the barcode and the event_number of // the GenEvent. - HepMcParticleLink testLink3d(HepMC::barcode(particle3),event_number1); - ASSERT_TRUE( testLink3d.isValid() ); + HepMcParticleLink testLink3e(HepMC::barcode(particle3),event_number1, + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); + ASSERT_TRUE( testLink3e.isValid() ); // Comparing links to two different particles in the same GenEvent ASSERT_TRUE( testLink1a < testLink3a ); ASSERT_TRUE( testLink1a < testLink3b ); - ASSERT_TRUE( testLink1a < testLink3c ); ASSERT_TRUE( testLink1a < testLink3d ); + ASSERT_TRUE( testLink1a < testLink3e ); ASSERT_TRUE( testLink1b < testLink3a ); ASSERT_TRUE( testLink1b < testLink3b ); - ASSERT_TRUE( testLink1b < testLink3c ); ASSERT_TRUE( testLink1b < testLink3d ); - ASSERT_TRUE( testLink1c < testLink3a ); - ASSERT_TRUE( testLink1c < testLink3b ); - ASSERT_TRUE( testLink1c < testLink3c ); - ASSERT_TRUE( testLink1c < testLink3d ); + ASSERT_TRUE( testLink1b < testLink3e ); ASSERT_TRUE( testLink1d < testLink3a ); ASSERT_TRUE( testLink1d < testLink3b ); - ASSERT_TRUE( testLink1d < testLink3c ); ASSERT_TRUE( testLink1d < testLink3d ); + ASSERT_TRUE( testLink1d < testLink3e ); + ASSERT_TRUE( testLink1e < testLink3a ); + ASSERT_TRUE( testLink1e < testLink3b ); + ASSERT_TRUE( testLink1e < testLink3d ); + ASSERT_TRUE( testLink1e < testLink3e ); } TEST_F(HepMcParticleLink_test, max_event_number) { @@ -983,7 +1013,7 @@ namespace MCTesting { // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink1b(HepMC::barcode(particle1), dummyIndex1, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink1b.isValid() ); ASSERT_EQ( HepMC::barcode(particle1), testLink1b.barcode()); ASSERT_EQ( refEvtNum1, testLink1b.eventIndex()); @@ -998,15 +1028,6 @@ namespace MCTesting { ASSERT_EQ( refEvtNum1, testLink1c.eventIndex()); ASSERT_EQ( dummyIndex1, testLink1c.getEventPositionInCollection(sg)); ASSERT_EQ(particle1,testLink1c.cptr()); - // A HepMcParticleLink built using the barcode and the event_number of - // the GenEvent. - HepMcParticleLink testLink1d(HepMC::barcode(particle1),event_number1); - ASSERT_TRUE( testLink1d.isValid() ); - ASSERT_EQ( HepMC::barcode(particle1), testLink1d.barcode()); - ASSERT_NE( dummyIndex1, testLink1d.eventIndex()); - ASSERT_EQ( refEvtNum1, testLink1d.eventIndex()); - ASSERT_EQ( dummyIndex1, testLink1d.getEventPositionInCollection(sg)); - ASSERT_EQ(particle1,testLink1d.cptr()); //Testing links to the second dummy GenEvent @@ -1022,7 +1043,7 @@ namespace MCTesting { // A HepMcParticleLink built using the barcode and the position of // the GenEvent. HepMcParticleLink testLink2b(HepMC::barcode(particle2), dummyIndex2, - HepMcParticleLink::IS_POSITION); + HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); ASSERT_TRUE( testLink2b.isValid() ); ASSERT_EQ( HepMC::barcode(particle2), testLink2b.barcode()); ASSERT_EQ( refEvtNum2, testLink2b.eventIndex()); @@ -1037,15 +1058,6 @@ namespace MCTesting { ASSERT_EQ( refEvtNum2, testLink2c.eventIndex()); ASSERT_EQ( dummyIndex2, testLink2c.getEventPositionInCollection(sg)); ASSERT_EQ(particle2,testLink2c.cptr()); - // A HepMcParticleLink built using the barcode and the event_number of - // the GenEvent. - HepMcParticleLink testLink2d(HepMC::barcode(particle2),event_number2); - ASSERT_TRUE( testLink2d.isValid() ); - ASSERT_EQ( HepMC::barcode(particle2), testLink2d.barcode()); - ASSERT_NE( dummyIndex2, testLink2d.eventIndex()); - ASSERT_EQ( refEvtNum2, testLink2d.eventIndex()); - ASSERT_EQ( dummyIndex2, testLink2d.getEventPositionInCollection(sg)); - ASSERT_EQ(particle2,testLink2d.cptr()); } TEST_F(HepMcParticleLink_test, size) { diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx index 9873d92b0f17a5099d01a4f03f2da3367ae710a3..f422fb8e21243b4bdfb6e982d4331aabb4c65dec 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx @@ -40,7 +40,7 @@ void HepMcParticleLinkCnv_p1::persToTrans( const HepMcParticleLink_p1* persObj, transObj->setExtendedBarCode ( HepMcParticleLink::ExtendedBarCode( persObj->m_barcode, persObj->m_mcEvtIndex, - flag) ); + flag, HepMcParticleLink::IS_BARCODE) ); // FIXME barcode-based } void HepMcParticleLinkCnv_p1::transToPers( const HepMcParticleLink* transObj, diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx index 1d34baf98ecce1f82edf2d56ae1069e7f8917c3c..0e2315288c533c06c044ba67683c5c8715d13c83 100755 --- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx +++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p2.cxx @@ -25,7 +25,7 @@ void HepMcParticleLinkCnv_p2::persToTrans( const HepMcParticleLink_p2* persObj, transObj->setExtendedBarCode ( HepMcParticleLink::ExtendedBarCode( persObj->m_barcode, persObj->m_mcEvtIndex, - flag) ); + flag, HepMcParticleLink::IS_BARCODE) ); // FIXME barcode-based } void HepMcParticleLinkCnv_p2::transToPers( const HepMcParticleLink* transObj, diff --git a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx index 810d42f205ee5940ba9d97afa4e2bfb05a69b2d5..719271f2361bc423aca02f8b230976ce0f5e6cf1 100644 --- a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx +++ b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p1_test.cxx @@ -215,13 +215,13 @@ void test1() HepMcParticleLink trans1a(particle1,particle1->parent_event()->event_number()); testit (trans1a); // By barcode + event_number - HepMcParticleLink trans1b(HepMC::barcode(particle1),particle1->parent_event()->event_number()); + HepMcParticleLink trans1b(HepMC::barcode(particle1),particle1->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans1b); // By ConstGenParticlePtr + position HepMcParticleLink trans1d(particle1,0,HepMcParticleLink::IS_POSITION); testit (trans1d); // By barcode + position - HepMcParticleLink trans1e(HepMC::barcode(particle1),0,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans1e(HepMC::barcode(particle1),0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans1e); // HepMcParticleLinks pointing at GenParticles in other GenEvents in the McEventCollection @@ -230,13 +230,13 @@ void test1() HepMcParticleLink trans2a(particle2,particle2->parent_event()->event_number()); testit (trans2a); // By barcode + event_number - HepMcParticleLink trans2b(HepMC::barcode(particle2),particle2->parent_event()->event_number()); + HepMcParticleLink trans2b(HepMC::barcode(particle2),particle2->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans2b); // By ConstGenParticlePtr + position HepMcParticleLink trans2d(particle2,1,HepMcParticleLink::IS_POSITION); testit (trans2d); // By barcode + position - HepMcParticleLink trans2e(HepMC::barcode(particle2),1,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans2e(HepMC::barcode(particle2),1,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans2e); //--------------------------------------------- HepMC::ConstGenParticlePtr particle3 = genPartList.at(8); @@ -244,13 +244,13 @@ void test1() HepMcParticleLink trans3a(particle3,particle3->parent_event()->event_number()); testit (trans3a); // By barcode + event_number - HepMcParticleLink trans3b(HepMC::barcode(particle3),particle3->parent_event()->event_number()); + HepMcParticleLink trans3b(HepMC::barcode(particle3),particle3->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans3b); // By ConstGenParticlePtr + position HepMcParticleLink trans3d(particle3,2,HepMcParticleLink::IS_POSITION); testit (trans3d); // By barcode + position - HepMcParticleLink trans3e(HepMC::barcode(particle3),2,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans3e(HepMC::barcode(particle3),2,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans3e); // HepMcParticleLinks pointing at filtered pileup truth @@ -259,23 +259,23 @@ void test1() HepMcParticleLink trans4a(particle4,particle4->parent_event()->event_number()); testit (trans4a); // By barcode + event_number - HepMcParticleLink trans4b(HepMC::barcode(particle4),particle4->parent_event()->event_number()); + HepMcParticleLink trans4b(HepMC::barcode(particle4),particle4->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans4b); // By ConstGenParticlePtr + position HepMcParticleLink trans4d(particle4,3,HepMcParticleLink::IS_POSITION); testit (trans4d); // By barcode + position - HepMcParticleLink trans4e(HepMC::barcode(particle4),3,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans4e(HepMC::barcode(particle4),3,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans4e); // HepMcParticleLinks pointing at delta-ray (barcode/id=0 - not recorded in McEventCollection) using event number const int deltaRayBarcode(0); const HepMcParticleLink::index_type deltaRayEventNumber = static_cast<HepMcParticleLink::index_type>(particle1->parent_event()->event_number()); // By barcode + event_number - HepMcParticleLink trans5a(deltaRayBarcode,deltaRayEventNumber); + HepMcParticleLink trans5a(deltaRayBarcode,deltaRayEventNumber,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans5a); // By barcode + position - HepMcParticleLink trans5c(deltaRayBarcode,0,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans5c(deltaRayBarcode,0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans5c); // Link to a GenParticle which was not recorded to the @@ -284,16 +284,16 @@ void test1() const int cutParticleBarcode(210001); const HepMcParticleLink::index_type refEventNumber = static_cast<HepMcParticleLink::index_type>(particle1->parent_event()->event_number()); // By barcode + event_number - HepMcParticleLink trans6a(cutParticleBarcode,refEventNumber); + HepMcParticleLink trans6a(cutParticleBarcode,refEventNumber,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans6a); // By barcode + position - HepMcParticleLink trans6c(cutParticleBarcode,0,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans6c(cutParticleBarcode,0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans6c); // Link to a GenEvent which was not recorded to the McEventCollection const HepMcParticleLink::index_type missingEvtNum = static_cast<HepMcParticleLink::index_type>(460); // By barcode + event_number - HepMcParticleLink trans7a(cutParticleBarcode, missingEvtNum); + HepMcParticleLink trans7a(cutParticleBarcode, missingEvtNum,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans7a); // By barcode + position - NOT SUPPORTED // Position is meaningless if the GenEvent is not in the McEventCollection diff --git a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx index 3ea3dd858fe05bb4089606f204cfee3e8f195e8c..8f9cf2243398d87484d40dd9c202618d99978e37 100644 --- a/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx +++ b/Generators/GeneratorObjectsTPCnv/test/HepMcParticleLinkCnv_p2_test.cxx @@ -215,13 +215,13 @@ void test1() HepMcParticleLink trans1a(particle1,particle1->parent_event()->event_number()); testit (trans1a); // By barcode + event_number - HepMcParticleLink trans1b(HepMC::barcode(particle1),particle1->parent_event()->event_number()); + HepMcParticleLink trans1b(HepMC::barcode(particle1),particle1->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans1b); // By ConstGenParticlePtr + position HepMcParticleLink trans1d(particle1,0,HepMcParticleLink::IS_POSITION); testit (trans1d); // By barcode + position - HepMcParticleLink trans1e(HepMC::barcode(particle1),0,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans1e(HepMC::barcode(particle1),0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans1e); // HepMcParticleLinks pointing at GenParticles in other GenEvents in the McEventCollection @@ -230,13 +230,13 @@ void test1() HepMcParticleLink trans2a(particle2,particle2->parent_event()->event_number()); testit (trans2a); // By barcode + event_number - HepMcParticleLink trans2b(HepMC::barcode(particle2),particle2->parent_event()->event_number()); + HepMcParticleLink trans2b(HepMC::barcode(particle2),particle2->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans2b); // By ConstGenParticlePtr + position HepMcParticleLink trans2d(particle2,1,HepMcParticleLink::IS_POSITION); testit (trans2d); // By barcode + position - HepMcParticleLink trans2e(HepMC::barcode(particle2),1,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans2e(HepMC::barcode(particle2),1,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans2e); //--------------------------------------------- HepMC::ConstGenParticlePtr particle3 = genPartList.at(8); @@ -244,13 +244,13 @@ void test1() HepMcParticleLink trans3a(particle3,particle3->parent_event()->event_number()); testit (trans3a); // By barcode + event_number - HepMcParticleLink trans3b(HepMC::barcode(particle3),particle3->parent_event()->event_number()); + HepMcParticleLink trans3b(HepMC::barcode(particle3),particle3->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans3b); // By ConstGenParticlePtr + position HepMcParticleLink trans3d(particle3,2,HepMcParticleLink::IS_POSITION); testit (trans3d); // By barcode + position - HepMcParticleLink trans3e(HepMC::barcode(particle3),2,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans3e(HepMC::barcode(particle3),2,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans3e); // HepMcParticleLinks pointing at filtered pileup truth @@ -259,23 +259,23 @@ void test1() HepMcParticleLink trans4a(particle4,particle4->parent_event()->event_number()); testit (trans4a); // By barcode + event_number - HepMcParticleLink trans4b(HepMC::barcode(particle4),particle4->parent_event()->event_number()); + HepMcParticleLink trans4b(HepMC::barcode(particle4),particle4->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans4b); // By ConstGenParticlePtr + position HepMcParticleLink trans4d(particle4,3,HepMcParticleLink::IS_POSITION); testit (trans4d); // By barcode + position - HepMcParticleLink trans4e(HepMC::barcode(particle4),3,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans4e(HepMC::barcode(particle4),3,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans4e); // HepMcParticleLinks pointing at delta-ray (barcode/id=0 - not recorded in McEventCollection) using event number const int deltaRayBarcode(0); const HepMcParticleLink::index_type deltaRayEventNumber = static_cast<HepMcParticleLink::index_type>(particle1->parent_event()->event_number()); // By barcode + event_number - HepMcParticleLink trans5a(deltaRayBarcode,deltaRayEventNumber); + HepMcParticleLink trans5a(deltaRayBarcode,deltaRayEventNumber,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans5a); // By barcode + position - HepMcParticleLink trans5c(deltaRayBarcode,0,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans5c(deltaRayBarcode,0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans5c); // Link to a GenParticle which was not recorded to the @@ -284,16 +284,16 @@ void test1() const int cutParticleBarcode(210001); const HepMcParticleLink::index_type refEventNumber = static_cast<HepMcParticleLink::index_type>(particle1->parent_event()->event_number()); // By barcode + event_number - HepMcParticleLink trans6a(cutParticleBarcode,refEventNumber); + HepMcParticleLink trans6a(cutParticleBarcode,refEventNumber,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans6a); // By barcode + position - HepMcParticleLink trans6c(cutParticleBarcode,0,HepMcParticleLink::IS_POSITION); + HepMcParticleLink trans6c(cutParticleBarcode,0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE); testit (trans6c); // Link to a GenEvent which was not recorded to the McEventCollection const HepMcParticleLink::index_type missingEvtNum = static_cast<HepMcParticleLink::index_type>(460); // By barcode + event_number - HepMcParticleLink trans7a(cutParticleBarcode, missingEvtNum); + HepMcParticleLink trans7a(cutParticleBarcode, missingEvtNum,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); testit (trans7a); // By barcode + position - NOT SUPPORTED // Position is meaningless if the GenEvent is not in the McEventCollection diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.cxx index 1ed9e987295e5dd5578d7fe44e8387428303161a..853166e30b9e4639cafe3592fb02f8823cee4dea 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_Digitization/src/HGTD_SurfaceChargesGenerator.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. * * @file HGTD_SurfaceChargesGenerator.h * @@ -68,7 +68,7 @@ void HGTD_SurfaceChargesGenerator::createSurfaceChargesFromHit( // some Truth information is cut for pile up events unsigned short eventId = timed_hit_ptr.eventId(); const HepMcParticleLink::PositionFlag idxFlag = (eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink trklink{HepMcParticleLink(hit.trackNumber(), eventId, idxFlag, ctx)}; + const HepMcParticleLink trklink{HepMcParticleLink(hit.trackNumber(), eventId, idxFlag, HepMcParticleLink::IS_BARCODE, ctx)}; // FIXME barcode-based SiCharge::Process hitproc{SiCharge::track}; if (hit.trackNumber() != 0) { if (not trklink.isValid()) { diff --git a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx index ae57ebed5d504b64a6b464d7a74cb648c269512f..d7638ee52d966ee119e7266f12f77c3a8ae955c6 100644 --- a/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx +++ b/HighGranularityTimingDetector/HGTD_Digitization/HGTD_FastDigitization/src/HGTD_SmearedDigitizationTool.cxx @@ -360,7 +360,7 @@ StatusCode HGTD_SmearedDigitizationTool::fillMultiTruthCollection(PRD_MultiTruth HepMcParticleLink::PositionFlag is_event_index_is_position = (hit.eventId() == 0)? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; HepMcParticleLink trk_link(hit->trackNumber(), hit.eventId(), - is_event_index_is_position, ctx); + is_event_index_is_position, HepMcParticleLink::IS_BARCODE, ctx); // FIXME ATH_MSG_DEBUG("Truth map filling with cluster " << *cluster << " and link = " << trk_link); diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx b/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx index fcb7cd10a52e8bdb41413bc7fbf795823fc69850..a0e9e061d0116d1df42b41cf69ee3d37916c66bb 100644 --- a/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/BCM_Digitization/src/BCM_DigitizationTool.cxx @@ -116,7 +116,7 @@ void BCM_DigitizationTool::processSiHit(const SiHit ¤tHit, double eventTim m_timeVect[moduleNo].push_back(hitTime); // Create new deposit and add to vector const HepMcParticleLink::PositionFlag idxFlag = (evtIndex==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink particleLink{HepMcParticleLink(currentHit.trackNumber(), evtIndex, idxFlag, ctx)}; + const HepMcParticleLink particleLink{HepMcParticleLink(currentHit.trackNumber(), evtIndex, idxFlag, HepMcParticleLink::IS_BARCODE, ctx)}; // FIXME const int barcode = particleLink.barcode(); if (barcode == 0 || barcode == HepMC::SINGLE_PARTICLE){ return; diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx index 2e677fd07679578023e97b14237db4e6d0718721..d76548067e8470b7bf37718df2ad6eda42802ece 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/EnergyDepositionTool.cxx @@ -143,7 +143,7 @@ StatusCode EnergyDepositionTool::depositEnergy(const TimedHitPtr<SiHit>& phit, c const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId() == 0) ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; const HepMcParticleLink McLink { - HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, ctx) + HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE, ctx) // FIXME }; HepMC::ConstGenParticlePtr genPart = McLink.cptr(); bool delta_hit = true; diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx index 6e5ba23184430444ed137c588609c866895a22d4..c34740f1915b1ede6714eb4867599308a17384e3 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSim3DTool.cxx @@ -119,7 +119,7 @@ StatusCode SensorSim3DTool::induceCharge(const TimedHitPtr<SiHit>& phit, (phit.eventId() == 0) ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; // pre-make HepMcParticleLink - auto particleLink = HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, ctx); + auto particleLink = HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE, ctx); // FIXME const double pHitTime = hitTime(phit); if (m_radiationDamageSimulationType != RadiationDamageSimulationType::NO_RADIATION_DAMAGE) { @@ -264,7 +264,7 @@ StatusCode SensorSim3DTool::induceCharge(const TimedHitPtr<SiHit>& phit, float ramoInit_mizj = ramoPotentialMap.getContent(ramo_init_bin_x_zj, ramo_init_bin_y_mi); float ramoInit_mimj = ramoPotentialMap.getContent(ramo_init_bin_x_mj, ramo_init_bin_y_mi); - auto mc_particle_link = HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, ctx); + auto mc_particle_link = HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE, ctx); // FIXME const auto hit_time = hitTime(phit); //Loop over charge-carrier pairs, we're looping over electrons and holes at the same time diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx index c5fe0070c3c1f20ebb96d0a4b97f1bc166518765..4d0cc04dd9bc4ed1310f267d31ac7e2cf8cc1af4 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/SensorSimPlanarTool.cxx @@ -332,7 +332,7 @@ StatusCode SensorSimPlanarTool::induceCharge(const TimedHitPtr<SiHit>& phit, //*** Now diffuse charges to surface *** // //**************************************// // pre-make HepMcParticleLink - const auto particleLink = HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, ctx); + const auto particleLink = HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE, ctx); // FIXME barcode-based syntax const double pHitTime = hitTime(phit); const double halfEtaPitch = 0.5*Module.etaPitch(); diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx index 2abb8419bd79087d382a4d6e5ff66fe1b98d4f84..a088b5db8f1b9b26eb1a63079c2d3174a44d4ce4 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_DetailedSurfaceChargesGenerator.cxx @@ -311,7 +311,7 @@ void SCT_DetailedSurfaceChargesGenerator::processSiHit(const SiDetectorElement* //check the status of truth information for this SiHit //some Truth information is cut for pile up events const HepMcParticleLink::PositionFlag idxFlag = (p_eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, idxFlag, ctx)}; + const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, idxFlag, HepMcParticleLink::IS_BARCODE, ctx)}; // FIXME SiCharge::Process hitproc{SiCharge::track}; if (phit.trackNumber()!=0) { if (not trklink.isValid()) { diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx index c861d19d8d37ac2494b992bf9de5bf5e7a4cd810..3314a7ef9c221ed4014451dcbb7a4dbc3264b521 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx +++ b/InnerDetector/InDetDigitization/SCT_Digitization/src/SCT_SurfaceChargesGenerator.cxx @@ -386,7 +386,7 @@ void SCT_SurfaceChargesGenerator::processSiHit(const SiDetectorElement* element, // check the status of truth information for this SiHit // some Truth information is cut for pile up events const HepMcParticleLink::PositionFlag idxFlag = (p_eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, idxFlag, ctx)}; + const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, idxFlag, HepMcParticleLink::IS_BARCODE, ctx)}; // FIXME SiCharge::Process hitproc{SiCharge::track}; if (phit.trackNumber() != 0) { if (not trklink.isValid()) { diff --git a/InnerDetector/InDetDigitization/StripDigitization/src/StripSurfaceChargesGenerator.cxx b/InnerDetector/InDetDigitization/StripDigitization/src/StripSurfaceChargesGenerator.cxx index dcda0be7339504c1bdd4b28e82e544b4dc7aed35..81754c13940683a4381de97fe5a9a535ac9f130c 100644 --- a/InnerDetector/InDetDigitization/StripDigitization/src/StripSurfaceChargesGenerator.cxx +++ b/InnerDetector/InDetDigitization/StripDigitization/src/StripSurfaceChargesGenerator.cxx @@ -431,7 +431,7 @@ void StripSurfaceChargesGenerator::processSiHit(const SiDetectorElement* element // check the status of truth information for this SiHit // some Truth information is cut for pile up events const HepMcParticleLink::PositionFlag idxFlag = (p_eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, idxFlag, ctx)}; + const HepMcParticleLink trklink{HepMcParticleLink(phit.trackNumber(), p_eventId, idxFlag, HepMcParticleLink::IS_BARCODE, ctx)}; // FIXME SiCharge::Process hitproc{SiCharge::track}; if (phit.trackNumber() != 0) { if (not trklink.isValid()) { diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx index 164ac2d9bddfc8d3d1fe99a5e1fe755fdb4af56e..0f4352c049fec2da2a8517e6e46984f3ccbd3fba 100644 --- a/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/TRT_Digitization/src/TRTDigitizationTool.cxx @@ -427,7 +427,7 @@ StatusCode TRTDigitizationTool::processStraws(const EventContext& ctx, for (TimedHitCollection<TRTUncompressedHit>::const_iterator hit_iter(i); hit_iter != e; ++hit_iter ) { const HepMcParticleLink::PositionFlag idxFlag = (hit_iter->eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; // suspect that we could use evtIndex here rather than hit_iter->eventId() // create a new deposit - InDetSimData::Deposit deposit( HepMcParticleLink((*hit_iter)->GetTrackID(), hit_iter->eventId(), idxFlag, ctx), (*hit_iter)->GetEnergyDeposit() ); + InDetSimData::Deposit deposit( HepMcParticleLink((*hit_iter)->GetTrackID(), hit_iter->eventId(), idxFlag, HepMcParticleLink::IS_BARCODE, ctx), (*hit_iter)->GetEnergyDeposit() ); // FIXME if (HepMC::ignoreTruthLink(deposit.first, m_vetoPileUpTruthLinks)) { continue; } diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/InDetSimDataCollectionCnv_common_test.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/InDetSimDataCollectionCnv_common_test.h index 5d8b5047469996f58d71ce58e43f5e5a05c7c164..62c7fb148b7e4839ba742c635ef90efe4c01232b 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/InDetSimDataCollectionCnv_common_test.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/test/InDetSimDataCollectionCnv_common_test.h @@ -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 */ /** @@ -95,7 +95,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle), particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle), particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; @@ -103,11 +103,11 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec // Assumme genPartVector is filled by Athena_test::initMcEventCollection. Do not check the vector size. for (int i=0; i<3; i++) { std::vector<InDetSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))), genPartVector.at(0+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))), genPartVector.at(0+(3*i))->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); deps.emplace_back(trkLink1, 2.5+i); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))), genPartVector.at(1+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))), genPartVector.at(1+(3*i))->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); deps.emplace_back(trkLink2, 13.5+i); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))), genPartVector.at(2+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))), genPartVector.at(2+(3*i))->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); deps.emplace_back(trkLink3, 23.5+i); trans1[Identifier(1234+i)] = InDetSimData(deps, 4321+i); diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx index 61d1cd831c2ee4aa14a26912781ee503f921d27d..e537552ccc405e203d1c950ec9d3f8c445dd4b05 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p2.cxx @@ -333,7 +333,7 @@ void SiHitCollectionCnv_p2::persToTrans(const SiHitCollection_p2* persCont, SiHi HepGeom::Point3D<double> endThis( endLast + r ); - HepMcParticleLink partLink( persCont->m_barcode[idxBC], event_number, HepMcParticleLink::IS_EVENTNUM, sg); + HepMcParticleLink partLink( persCont->m_barcode[idxBC], event_number, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, sg); transCont->Emplace( endLast, endThis, eneLoss, meanTime, partLink, persCont->m_id[idxId]); endLast = endThis; diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx index 451975f8acb8c427676f581fa3fd5815f8a6c400..e4c1396c750b88f27f1cf7f0aa832c2f0fdc953a 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/SiHitCollectionCnv_p3.cxx @@ -352,7 +352,7 @@ void SiHitCollectionCnv_p3::persToTrans(const SiHitCollection_p3* persCont, SiHi if (persCont->m_mcEvtIndex[idxBC] == 0) { flag = HepMcParticleLink::IS_POSITION; } - HepMcParticleLink partLink( persCont->m_barcode[idxBC], persCont->m_mcEvtIndex[idxBC], flag, ctx ); + HepMcParticleLink partLink( persCont->m_barcode[idxBC], persCont->m_mcEvtIndex[idxBC], flag, HepMcParticleLink::IS_BARCODE, ctx ); transCont->Emplace( endLast, endThis, eneLoss, meanTime, partLink, persCont->m_id[idxId]); endLast = endThis; diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.cxx index 48ef54e8f1eb45d6e2aeeb7268b5c0f6fdd4f0a4..e22e5fa75243e48fcab48aea2a4c6edf90f53d8d 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p2.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 */ #include "InDetSimEvent/TRTUncompressedHit.h" @@ -158,8 +158,8 @@ void TRT_HitCollectionCnv_p2::persToTrans(const TRT_HitCollection_p2* persCont, HepGeom::Point3D<double> endThis(persCont->m_endX[j], persCont->m_endY[j], persCont->m_endZ[j]); - HepMcParticleLink partLink(persCont->m_barcode[idxBC]); - partLink.setExtendedBarCode(HepMcParticleLink::ExtendedBarCode(persCont->m_barcode[idxBC], 0, HepMcParticleLink::IS_POSITION));; + HepMcParticleLink partLink(persCont->m_barcode[idxBC], 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + partLink.setExtendedBarCode(HepMcParticleLink::ExtendedBarCode(persCont->m_barcode[idxBC], 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE)); // FIXME barcode-based transCont->Emplace( persCont->m_hitId[hitCount], partLink, persCont->m_id[idxId], persCont->m_kinEne[hitCount], eneLoss, endLast.x(), endLast.y(), endLast.z(), endThis.x(), endThis.y(), endThis.z(), persCont->m_meanTime[hitCount] ); diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx index 3a5029202015cb512652bbf25b5b8991b6c23865..a47376d3ab401926f631c8c6e4ba3779c533344e 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p3.cxx @@ -482,7 +482,7 @@ void TRT_HitCollectionCnv_p3::persToTrans(const TRT_HitCollection_p3* persCont, // - For charged particles kinEne is *zero*! // - HepMcParticleLink partLink(persCont->m_barcode[idxBC], event_number, HepMcParticleLink::IS_EVENTNUM, sg); + HepMcParticleLink partLink(persCont->m_barcode[idxBC], event_number, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, sg); transCont->Emplace( strawId, partLink, persCont->m_id[idxId], kinEne, hitEne, startX, startY, startZ, endX, endY, endZ, meanTime ); diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx index 7ad9a9a2407f24e578cde0b3cba2aaf03a648ae5..8cbdf692ba78b75273ca2c8c73f265a0df9a6652 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/src/InDetHits/TRT_HitCollectionCnv_p4.cxx @@ -500,7 +500,7 @@ void TRT_HitCollectionCnv_p4::persToTrans(const TRT_HitCollection_p4* persCont, if (persCont->m_mcEvtIndex[idxBC] == 0) { flag = HepMcParticleLink::IS_POSITION; } - HepMcParticleLink partLink( persCont->m_barcode[idxBC], persCont->m_mcEvtIndex[idxBC], flag, ctx ); + HepMcParticleLink partLink( persCont->m_barcode[idxBC], persCont->m_mcEvtIndex[idxBC], flag, HepMcParticleLink::IS_BARCODE, ctx ); transCont->Emplace( strawId, partLink, persCont->m_id[idxId], kinEne, hitEne, startX, startY, startZ, endX, endY, endZ, meanTime ); diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx index 44c74c49a515d71ede8a83a558b52cba5256635f..447149aa3dc90e0fd140547aae96dd22245cbef5 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCnv_p1_test.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 */ /** * @file InDetSimEventTPCnv/test/SiHitCnv_p1_test.cxx @@ -63,12 +63,12 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; auto pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHit trans1 (HepGeom::Point3D<double> (10.5, 11.5, 12.5), HepGeom::Point3D<double> (13.5, 14.5, 15.5), 16.5, diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx index 3786f5c16bd26073cf4e3833ff50612f2d5e53d3..a6396cf26bb0a9f1b507f175f23a6f0dabb12684 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.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 */ /** * @file InDetSimEventTPCnv/test/SiHitCollectionCnv_p2_test.cxx @@ -73,7 +73,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. SiHitCollection dum ("coll"); @@ -82,7 +82,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec SiHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based const double angle = i*0.2*M_PI; std::vector< HepGeom::Point3D<double> > stepPoints(11); for (int j=0; j<11; ++j) { diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx index 70214fa77c81bad7d464d5f59775a60f70323e40..b32fb10dad29dca18358814407eede6113e10d33 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.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 */ /** * @file InDetSimEventTPCnv/test/SiHitCollectionCnv_p3_test.cxx @@ -72,7 +72,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. SiHitCollection dum ("coll"); @@ -81,7 +81,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec SiHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based const double angle = i*0.2*M_PI; std::vector< HepGeom::Point3D<double> > stepPoints(11); for (int j=0; j<11; ++j) { diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx index d4cb3390d6858118bc5525136b81192ec9ea2f04..74cbddf8e878878b549776dca87629d5ec112800 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.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 */ /** * @file InDetSimEventTPCnv/test/TRT_HitCnv_p1_test.cxx @@ -68,12 +68,12 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; auto pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based TRTUncompressedHit trans1 (101, trkLink, pGenParticle->pdg_id(), 104.5, 105.5, 106.5, 107.5, 108.5, diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx index 7befa561f1fe1c77087aa5ec7b6d3ccf4f9fc0d5..08f618edb0a78a93704c14a279fc6aa116f76613 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.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 */ /** * @file InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p2_test.cxx @@ -78,7 +78,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TRTUncompressedHitCollection dum ("coll"); @@ -88,7 +88,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec for (int i=0; i < 10; i++) { int o = i*100; auto pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (101+o, trkLink, pGenParticle->pdg_id(), 104.5+o, 105.5+o, (106.5+o)/1000, (107.5+o)/1000, 108.5+o, @@ -97,7 +97,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec } // Special case for photons auto pGenParticle = genPartVector.at(10); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (131, trkLink, 22, 134.5, 135.5, 10, 3, 138.5, diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx index ae2574335e26dd7be05d0bd266ec3c1a69fc4f3d..92bc9586bb055538a43675e04d7e45e3015de766 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.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 */ /** * @file InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p3_test.cxx @@ -98,7 +98,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TRTUncompressedHitCollection dum ("coll"); @@ -108,7 +108,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec for (int i=0; i < 10; i++) { int o = i*100; auto pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (101+o, trkLink, 20+o, 104.5+o, 105.5+o, (106.5+o)/1000, (107.5+o)/1000, 108.5+o, @@ -117,7 +117,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec } // Special case for photons auto pGenParticle = genPartVector.at(10); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (131, trkLink, 22, 134.5, 135.5, 10, 3, 138.5, diff --git a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx index 7d4a079ea9477310f1d824cd095f83a831055e8a..288c094f0a3f21076aca8cb9849d4ac665cec2c3 100644 --- a/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx +++ b/InnerDetector/InDetEventCnv/InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.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 */ /** * @file InDetSimEventTPCnv/test/TRT_HitCollectionCnv_p4_test.cxx @@ -98,7 +98,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TRTUncompressedHitCollection dum ("coll"); @@ -108,7 +108,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec for (int i=0; i < 10; i++) { int o = i*100; auto pGenParticle = genPartVector.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (101+o, trkLink, 20+o, 104.5+o, 105.5+o, (106.5+o)/1000, (107.5+o)/1000, 108.5+o, @@ -117,7 +117,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec } // Special case for photons auto pGenParticle = genPartVector.at(10); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (131, trkLink, 22, 134.5, 135.5, 10, 3, 138.5, diff --git a/InnerDetector/InDetG4/BCM_G4_SD/test/BCMSensorSD_gtest.cxx b/InnerDetector/InDetG4/BCM_G4_SD/test/BCMSensorSD_gtest.cxx index 3e00b26f47a6e55de003ba37e99b51d8d212640e..dde9707ded36171d08e18aa9930e34b4e4963927 100644 --- a/InnerDetector/InDetG4/BCM_G4_SD/test/BCMSensorSD_gtest.cxx +++ b/InnerDetector/InDetG4/BCM_G4_SD/test/BCMSensorSD_gtest.cxx @@ -100,7 +100,7 @@ TEST_F( BCMSensorSDtest, ProcessHits ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd2.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit just generated by the member function ProcessHits, and it should be P1 based on my setting. The same below @@ -150,7 +150,7 @@ TEST_F( BCMSensorSDtest, AddHit ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd3.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit added by the member function AddHit, and it should be 1 because of my setting. the same below diff --git a/InnerDetector/InDetG4/BLM_G4_SD/test/BLMSensorSD_gtest.cxx b/InnerDetector/InDetG4/BLM_G4_SD/test/BLMSensorSD_gtest.cxx index 790106c4b4a543deab785719b04fe6c492bf56c4..b8725e9dc216bffcdfb1827c7bfb2f0743a0f7c1 100644 --- a/InnerDetector/InDetG4/BLM_G4_SD/test/BLMSensorSD_gtest.cxx +++ b/InnerDetector/InDetG4/BLM_G4_SD/test/BLMSensorSD_gtest.cxx @@ -105,7 +105,7 @@ TEST_F( BLMSensorSDtest, ProcessHits ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd2.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit generated by the member function ProcessHits and stored in the smart pointer m_HitColl, and it should be P1 based on the setting. The same below @@ -154,7 +154,7 @@ TEST_F( BLMSensorSDtest, AddHit ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd3.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit added by the member function AddHit, and it should be P1 based on the setting. The same below diff --git a/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorGmxSD_gtest.cxx b/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorGmxSD_gtest.cxx index 4a0d45b9ca22f6a10abc64642d7cf383849427b2..3c1fb5edc32982dbaa60818692a13d6438c590eb 100644 --- a/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorGmxSD_gtest.cxx +++ b/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorGmxSD_gtest.cxx @@ -100,7 +100,7 @@ TEST_F( PixelSensorGmxSDtest, ProcessHits ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd2.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit generated by the member function and stored in the smart pointer, and it should be P1 based on the setting. The same below @@ -149,7 +149,7 @@ TEST_F( PixelSensorGmxSDtest, AddHit ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd3.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit added by the member function AddHit and also stored in the smart pointer m_HitColl, and it should be 1 based the setting. The same below diff --git a/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorSD_gtest.cxx b/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorSD_gtest.cxx index 2d971bbf815102a51b4bb825069a4c747c4f709d..c06a5ce23e642c1607bd5860e3b8bdd287eb2d10 100644 --- a/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorSD_gtest.cxx +++ b/InnerDetector/InDetG4/PixelG4_SD/test/PixelSensorSD_gtest.cxx @@ -100,7 +100,7 @@ TEST_F( PixelSensorSDtest, ProcessHits ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd2.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit generated by the member function and stored in the smart pointer, and it should be P1 based on the setting. The same below @@ -149,7 +149,7 @@ TEST_F( PixelSensorSDtest, AddHit ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd3.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit added by the member function AddHit and also stored in the smart pointer m_HitColl, and it should be 1 based the setting. The same below diff --git a/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensorSD_gtest.cxx b/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensorSD_gtest.cxx index f05eafe7719fb7c053ba7e31bfcdc66f83f792ca..11b8a254b8a3f2eae6e449a90aa5125182a1de18 100644 --- a/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensorSD_gtest.cxx +++ b/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensorSD_gtest.cxx @@ -99,7 +99,7 @@ TEST_F( SctSensorSDtest, ProcessHits ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd2.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test if the localStartPosition value of the Hit generated by this member function is right, the same below @@ -192,7 +192,7 @@ TEST_F( SctSensorSDtest, AddHit ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd4.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit generated by the member function AddHit, the same below diff --git a/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensor_CTB_gtest.cxx b/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensor_CTB_gtest.cxx index fa8defef2917fd04985aefa8cdb2b9430c82e64a..ae671f3c02950bb17c1513b0b9a5974cf14f770c 100644 --- a/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensor_CTB_gtest.cxx +++ b/InnerDetector/InDetG4/SCT_G4_SD/test/SctSensor_CTB_gtest.cxx @@ -100,7 +100,7 @@ TEST_F( SctSensor_CTBtest, ProcessHits ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd2.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit generated by the member function ProcessHits, and it should be P1 according to my setting, the same below @@ -148,7 +148,7 @@ TEST_F( SctSensor_CTBtest, AddHit ) P2[SiHit::xDep] = 0; int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based SiHitCollection* a = sd4.m_HitColl.ptr(); ASSERT_EQ(a->begin()->localStartPosition(), P1); //test the localStartPosition value of the Hit added by the member function AddHit, and it should be P1 based on the setting, the same below diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx index 7aed2c7eb25b81574dee42cd7284ed7ef14d08ca..9dd27252382aa4809007599decd1809baf353442 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/test/TRTOverlay_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /** @@ -623,7 +623,7 @@ namespace OverlayTesting { SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"}; inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>(); auto pGenParticle = genPartList.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based InDetSimData::Deposit deposit( trkLink, 0.0 ); std::vector<InDetSimData::Deposit> depositVector(1); depositVector.push_back(deposit); @@ -707,7 +707,7 @@ namespace OverlayTesting { SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"}; inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>(); auto pGenParticle = genPartList.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based InDetSimData::Deposit deposit( trkLink, 0.0 ); std::vector<InDetSimData::Deposit> depositVector(1); depositVector.push_back(deposit); @@ -799,7 +799,7 @@ namespace OverlayTesting { SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"}; inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>(); auto pGenParticle = genPartList.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based ASSERT_EQ(trkLink.cptr()->pdg_id(), -11); // Sanity check to confirm that we are linking to a positron as expected InDetSimData::Deposit deposit( trkLink, 0.0 ); std::vector<InDetSimData::Deposit> depositVector(1); @@ -883,7 +883,7 @@ namespace OverlayTesting { SG::WriteHandle<InDetSimDataCollection> inputSigSDODataHandle{"StoreGateSvc+TRT_SDO_Map_SIG"}; inputSigSDODataHandle = std::make_unique<InDetSimDataCollection>(); auto pGenParticle = genPartList.at(0); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based ASSERT_EQ(trkLink.cptr()->pdg_id(), -11); // Sanity check to confirm that we are linking to a positron as expected InDetSimData::Deposit deposit( trkLink, 0.0 ); std::vector<InDetSimData::Deposit> depositVector(1); diff --git a/InnerDetector/InDetSimEvent/src/SiHit.cxx b/InnerDetector/InDetSimEvent/src/SiHit.cxx index 46ee10c097ee7cf8c9fa46b8c2dd4e8bef8db638..7e91e9d84ee90ba93c8efe646313d5c2a678b815 100755 --- a/InnerDetector/InDetSimEvent/src/SiHit.cxx +++ b/InnerDetector/InDetSimEvent/src/SiHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "InDetSimEvent/SiHit.h" @@ -39,7 +39,7 @@ SiHit::SiHit(const HepGeom::Point3D<double> &localStartPosition, m_enZ( (float) localEndPosition.z() ), m_energyLoss(energyLoss), m_meanTime(meanTime), - m_partLink(trackNumber), + m_partLink(trackNumber,0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE), //FIXME barcode-based m_ID(id) { } @@ -62,7 +62,7 @@ SiHit::SiHit(const HepGeom::Point3D<double> &localStartPosition, m_enZ( (float) localEndPosition.z() ), m_energyLoss(energyLoss), m_meanTime(meanTime), - m_partLink(trackNumber), + m_partLink(trackNumber,0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE), //FIXME barcode-based m_ID(0) { // Compress the location info into the integer: diff --git a/InnerDetector/InDetSimEvent/src/TRTUncompressedHit.cxx b/InnerDetector/InDetSimEvent/src/TRTUncompressedHit.cxx index c5086572b9f7ad2185fea13258dc8e91950b485b..3236f30f2227e199cf86fa19be88a704a7d9d9fe 100755 --- a/InnerDetector/InDetSimEvent/src/TRTUncompressedHit.cxx +++ b/InnerDetector/InDetSimEvent/src/TRTUncompressedHit.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 */ #include "InDetSimEvent/TRTUncompressedHit.h" @@ -16,7 +16,7 @@ TRTUncompressedHit::TRTUncompressedHit(int hit, float postX, float postY, float postZ, float time): m_hitID(hit), - m_partLink(track), + m_partLink(track,0,HepMcParticleLink::IS_POSITION,HepMcParticleLink::IS_BARCODE), // FIXME barcode-based m_particleEncoding(particle), m_kineticEnergy(kinEnergy), m_energyDeposit(eneDeposit), diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx index bd53aec64540a42553abd1cfe766158464510d5f..02096ca2d21dc09b8f4145dc400fbaa0b1174340 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p1_test.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 */ /** * @file MuonEventTPCnv/test/CscSimDataCnv_p1_test.cxx @@ -76,16 +76,20 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; std::vector<CscSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); deps[0].second.setCharge ( 5.5); deps[1].second.setCharge (15.5); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx index 7b0b633934a6d4589f0087318787967710465564..e66ec491f5a75d2518045ed640c273a0ebb311c9 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCnv_p2_test.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 */ /** * @file MuonEventTPCnv/test/CscSimDataCnv_p2_test.cxx @@ -77,16 +77,20 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; std::vector<CscSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); deps[0].second.setCharge ( 5.5); deps[1].second.setCharge (15.5); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx index 59ebea9a5a66e8b34d30c1a97e59da46642cfe9d..a736fa36dac80f0d55a56c6af1dca405aec8507a 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.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 */ /** * @file MuonEventTPCnv/test/CscSimDataCollectionCnv_p1_test.cxx @@ -90,18 +90,22 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; CscSimDataCollection trans1; for (int i=0; i < 3; i++) { std::vector<CscSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); deps[0].second.setCharge ( 5.5+i); deps[1].second.setCharge (15.5+i); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx index 1f4a75eefc74db51f084374038d1dc68e5a1f6df..a3f2e23903382b05e298e52061143e0afbc4b37d 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.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 */ /** * @file MuonEventTPCnv/test/CscSimDataCollectionCnv_p2_test.cxx @@ -90,18 +90,22 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; CscSimDataCollection trans1; for (int i=0; i < 3; i++) { std::vector<CscSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, CscMcData ( 2.5, 3.5, 4.5)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, CscMcData (12.5, 13.5, 14.5)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, CscMcData (22.5, 23.5, 24.5)); deps[0].second.setCharge ( 5.5+i); deps[1].second.setCharge (15.5+i); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx index 1aac43156d38838d8189daf4a3ba80b357a29f19..676a151dd8aced17fb72f65b8a5fccc9bd33ad23 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p1_test.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 */ /** * @file MuonEventTPCnv/test/MuonSimDataCnv_p1_test.cxx @@ -76,16 +76,20 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; std::vector<MuonSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, MuonMCData ( 2.5, 3.5)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, MuonMCData (12.5, 13.5)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, MuonMCData (22.5, 23.5)); MuonSimData trans1 (deps, 4321); trans1.setPosition (Amg::Vector3D ( 4.5, 5.5, 6.5)); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx index 18817e38a2b4e8b66c8cf320ad56185437e23c17..b3eb7495a143082e83cbddd3027afe2e960bddda 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCnv_p2_test.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 */ /** * @file MuonEventTPCnv/test/MuonSimDataCnv_p2_test.cxx @@ -76,16 +76,20 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; std::vector<MuonSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0)),genPartVector.at(0)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, MuonMCData ( 2.5, 3.5)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1)),genPartVector.at(1)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, MuonMCData (12.5, 13.5)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2)),genPartVector.at(2)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, MuonMCData (22.5, 23.5)); MuonSimData trans1 (deps, 4321); trans1.setPosition (Amg::Vector3D ( 4.5, 5.5, 6.5)); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx index bebcd5ba3817da1362c8a18fd3f10e9ce12bdac1..9ae43a49c2587323d3c340730146dec78913bee6 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.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 */ /** * @file MuonEventTPCnv/test/MuonSimDataCollectionCnv_p1_test.cxx @@ -89,18 +89,22 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; MuonSimDataCollection trans1; for (int i=0; i < 3; i++) { std::vector<MuonSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, MuonMCData ( 2.5+i, 3.5+i)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, MuonMCData (12.5+i, 13.5+i)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, MuonMCData (22.5+i, 23.5+i)); trans1[Identifier(1234+i)] = MuonSimData (deps, 4321+i); trans1[Identifier(1234+i)].setPosition (Amg::Vector3D(4.5+i, 5.5+i, 6.5+i)); diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx index 9154c697038e63d3d4052cebebd8e22028de6122..78d5edddde81c9b33038fa2e7c0ec967e40e554e 100644 --- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.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 */ /** * @file MuonEventTPCnv/test/MuonSimDataCollectionCnv_p2_test.cxx @@ -88,18 +88,22 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); Athena_test::Leakcheck check; MuonSimDataCollection trans1; for (int i=0; i < 3; i++) { std::vector<MuonSimData::Deposit> deps; - HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink1(HepMC::barcode(genPartVector.at(0+(3*i))),genPartVector.at(0+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink1, MuonMCData ( 2.5+i, 3.5+i)); - HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink2(HepMC::barcode(genPartVector.at(1+(3*i))),genPartVector.at(1+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink2, MuonMCData (12.5+i, 13.5+i)); - HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number()); + HepMcParticleLink trkLink3(HepMC::barcode(genPartVector.at(2+(3*i))),genPartVector.at(2+(3*i))->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); deps.emplace_back (trkLink3, MuonMCData (22.5+i, 23.5+i)); trans1[Identifier(1234+i)] = MuonSimData (deps, 4321+i); trans1[Identifier(1234+i)].setPosition (Amg::Vector3D(4.5+i, 5.5+i, 6.5+i)); diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx index a62edc439c484e624df257cdcdaa03499aa69ec9..d574cafd6310af7249387e63c29de19c9447a3b7 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p1_test.cxx @@ -83,7 +83,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. CSCSimHitCollection dum ("coll"); @@ -92,7 +92,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec CSCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx index 60e28a81ead257e2bd1ecd978c7f292eb5e8cf6f..0e198a1fcd05a08c581d7e23bc467a4bcb853827 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p2_test.cxx @@ -83,7 +83,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. CSCSimHitCollection dum ("coll"); @@ -92,7 +92,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec CSCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx index 3abe19ead6dc7c46316ba3aa82de1a338ebe6938..231c40072ddbe22a5773ee374ab4ae162033c690 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/CSCSimHitCollectionCnv_p3_test.cxx @@ -83,7 +83,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. CSCSimHitCollection dum ("coll"); @@ -92,7 +92,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec CSCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx index f7e87ab5585ac68690ef4d96c02d62b758d3f499..7583f85426cef4f81dd1c5c118e04dbfe3e9ad3a 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p1_test.cxx @@ -80,7 +80,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. GenericMuonSimHitCollection dum ("coll"); @@ -89,7 +89,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect GenericMuonSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx index ab711bbc6510f20abbfdaadce26053ee4b1444da..5ba0255785b76b47ee496cb34c494e8f95854ce0 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/GenericMuonSimHitCollectionCnv_p2_test.cxx @@ -80,7 +80,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. GenericMuonSimHitCollection dum ("coll"); @@ -88,7 +88,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) GenericMuonSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (15.5, 16.5, 17.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx index 9ab26dfddde8b6d66f36cd9fc4fdc8da1388e3d1..5577ac6809c7bbda4ecddaad4abf26f2d3468b64 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p1_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. MDTSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect MDTSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), trkLink, 19.5, 20.5, pGenParticle->pdg_id(), 22.5 diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx index 65206908d8112e672c0ff9ce46675e0dbc5fe40e..4a893ef4acebbfca8e9901a12ec6b2a02066b5c7 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p2_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. MDTSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect MDTSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), trkLink, 19.5, 20.5, pGenParticle->pdg_id(), 22.5 diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx index 6b226879cfbd12f89969a370963cbb3775831415..e4a1507e9e86751c325ce0b89bbc1a1b3c96bfc9 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MDTSimHitCollectionCnv_p3_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. MDTSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect MDTSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, 11.5, Amg::Vector3D (12.5, 13.5, 14.5), trkLink, 19.5, 20.5, pGenParticle->pdg_id(), 22.5 diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p1_test.cxx index 01840cfea3e0c03f19581c4ffa51777c3066302a..a211a3e66192eacb44a0cb9e7ac2546ad0824f72 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p1_test.cxx @@ -67,7 +67,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. MMSimHitCollection dum ("coll"); @@ -75,7 +75,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) MMSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), pGenParticle->pdg_id(), 25.5, diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p2_test.cxx index cff76820fffdf3a412c0cf00a467c8fd004ef9ae..2c82d44aed7c51cd02741bc4597dd0a053f72c61 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/MMSimHitCollectionCnv_p2_test.cxx @@ -66,7 +66,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. MMSimHitCollection dum ("coll"); @@ -74,7 +74,7 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) MMSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), pGenParticle->pdg_id(), 25.5, diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx index 3c033143291a6fc09d09ef8f2f4fda9cabb7a5a6..49008b85746bb8bc39f7b7240536a8b741cd67b4 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p1_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. RPCSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect RPCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), trkLink, diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx index 71714b7bbefc68773abb6f682ed4adf1852831dc..66ad4c9f12a758a14806e902f24673abdacde3e4 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p2_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. RPCSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect RPCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), trkLink, diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx index 358012415e39da95f8f5cde78f114f729fa3b517..42bb37a6f676034897fb454b15e019b0d5fc26fb 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/RPCSimHitCollectionCnv_p3_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. RPCSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect RPCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), trkLink, diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx index 522091157705de07d329709a31ae25aa6ddcd24e..d95b544bc7aa9a079763724474694a14cd081016 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p1_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TGCSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect TGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (16.5, 17.5, 18.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx index e65bca3be3e2da7f730fbf5ac29bdc61a80ab480..12fc7ccb2ec36b198b7b12cfa266c391e4d700b1 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p2_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TGCSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect TGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (16.5, 17.5, 18.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx index 18dea8e498c2023d5c06cf0ba376213f090d0268..2334259115af3533f666d7f7780660413ed37122 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p3_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TGCSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec TGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (16.5, 17.5, 18.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx index 0e8d8f57728bef850d9bc7ed334c2e402b5cb75c..efe6fd290476eef638a75e15e2d47ad9f1fc9103 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/TGCSimHitCollectionCnv_p4_test.cxx @@ -76,7 +76,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. TGCSimHitCollection dum ("coll"); @@ -85,7 +85,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect TGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), Amg::Vector3D (16.5, 17.5, 18.5), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx index c1fc58bdc9af148181265db092a8114f108d1b4a..ce78468b97db3b7542803e28f305c2b62b0d6226 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p1_test.cxx @@ -73,7 +73,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. sTGCSimHitCollection dum ("coll"); @@ -82,7 +82,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect sTGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), pGenParticle->pdg_id(), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx index 33400a8a93271de63bfb7d18aa214495b0087e5a..0eb3eec6aae8c9933a6c0a3c65f7c84b0632b990 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p2_test.cxx @@ -82,7 +82,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. sTGCSimHitCollection dum ("coll"); @@ -91,7 +91,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect sTGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 14.5), pGenParticle->pdg_id(), diff --git a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p3_test.cxx b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p3_test.cxx index c2a838535998ce82e809870a8ccd76a854194aac..4c664ecef99f15f0c181cd9494cbe7c02419be7f 100644 --- a/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p3_test.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSimEventTPCnv/test/sTGCSimHitCollectionCnv_p3_test.cxx @@ -71,7 +71,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based assert(dummyHMPL.cptr()==particle); // Create DVL info outside of leak check. sTGCSimHitCollection dum ("coll"); @@ -80,7 +80,7 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr> genPartVect sTGCSimHitCollection trans1 ("coll"); for (int i=0; i < 10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(),HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.Emplace (123, 10.5, Amg::Vector3D (12.5, 13.5, 15.5), pGenParticle->pdg_id(), diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.cxx index 424987c2d0f24329eaf292806d3ecdf6f1084164..3a9c2ca7a5d8a058057c55950c9524eecf91ed62 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.cxx +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CSC_Digitizer.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 */ // Author: Ketevi A. Assamagan @@ -14,7 +14,6 @@ #include "CLHEP/Random/RandomEngine.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/MsgStream.h" -#include "GeneratorObjects/HepMcParticleLink.h" #include "MuonReadoutGeometry/CscReadoutElement.h" #include "StoreGate/StoreGateSvc.h" diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx index fa8209b8e1e63caab5136a056ae57e14c544536e..4d728552bea70475fc4437c278569e0535fb7c15 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/src/CscDigitizationTool.cxx @@ -209,7 +209,7 @@ StatusCode CscDigitizationTool::CoreDigitization(Collections_t& collections,CscS continue; } const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId()==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink trackLink(phit->trackNumber(), phit.eventId(), idxFlag); + const HepMcParticleLink trackLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE); // FIXME const auto cscd = CscMcData(energy, ypos, zpos); for (; vecBeg != vecEnd; ++vecBeg) { myDeposits[(*vecBeg)].emplace_back(trackLink,cscd); diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h index af4591d3c1cbde03fe8d52aad92095f78100e365..a57f3872307ae0cb3d78d369c65a1f04218a6e18 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/chargeCalculator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef MDT_DIGITIZATION_CHARGECALCULATOR_H @@ -38,7 +38,7 @@ to the third digit of decimal number of the pdgid. // double chargeCalculator(const MDTSimHit& hit, unsigned short eventId = 0) { const HepMcParticleLink::PositionFlag idxFlag = (eventId == 0) ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink trkParticle(hit.trackNumber(), eventId, idxFlag); + const HepMcParticleLink trkParticle(hit.trackNumber(), eventId, idxFlag, HepMcParticleLink::IS_BARCODE); // FIXME HepMC::ConstGenParticlePtr genParticle = trkParticle.cptr(); double qcharge = 1.; if (genParticle) { diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h index 86dc70fa6e145f999aec31455a0b1aa7cbef8b45..fddf96376da124407058328890daf2595f3f6151 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/MDT_Digitization/particleGamma.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef MDT_DIGITIZATION_PARTICLEGAMMA_H @@ -36,7 +36,7 @@ Function particleGamma returns the value of gamma factor for Qball particle. double particleGamma(const MDTSimHit& hit, unsigned short eventId = 0) { double QGamma = -9999.; const HepMcParticleLink::PositionFlag idxFlag = (eventId == 0) ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink trkParticle(hit.trackNumber(), eventId, idxFlag); + const HepMcParticleLink trkParticle(hit.trackNumber(), eventId, idxFlag, HepMcParticleLink::IS_BARCODE); // FIXME HepMC::ConstGenParticlePtr genParticle = trkParticle.cptr(); if (genParticle) { int particleEncoding = genParticle->pdg_id(); diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx index 815f4a020f7bd04fb17bf585786e852dcf82ee21..2ebd6d33c017c59d4d5f6d8fc074b98bca1b8f51 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx @@ -767,7 +767,7 @@ bool MdtDigitizationTool::createDigits(const EventContext& ctx, Collections_t& c // Create the Deposit for MuonSimData const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId() == 0) ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; - MuonSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag), + MuonSimData::Deposit deposit(HepMcParticleLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE), // FIXME MuonMCData(driftRadius, hit.localPosition().z())); // Record the SDO collection in StoreGate diff --git a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx index 109cac0c9f9e189a86f09424fbe8a20941bc1623..35b26c2f7167a3020a223a15d7e8b5d771cd74c4 100644 --- a/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/MM_Digitization/src/MM_DigitizationTool.cxx @@ -507,7 +507,7 @@ StatusCode MM_DigitizationTool::doDigitization(const EventContext& ctx) { } const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId() == 0) ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink particleLink(phit->trackNumber(), phit.eventId(), idxFlag); + const HepMcParticleLink particleLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE); // FIXME // Read the information about the Micro Megas hit ATH_MSG_DEBUG("> hitID " << hitID << " Hit bunch time " << bunchTime << " tot " << globalHitTime << " tof/G4 time " << hit.globalTime() << " globalHitPosition " << globalHitPosition << "hit: r " diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx index 992376cb99de07130ba96dda8bdb4433b18152e1..5260dd9b43f3f57bc4495f6cc3d92e9937058056 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx @@ -609,7 +609,7 @@ StatusCode RpcDigitizationTool::doDigitization(const EventContext& ctx, const RpcReadoutElement* ele = detMgr->getRpcReadoutElement(atlasRpcIdeta); // first add time jitter to the time: const HepMcParticleLink::PositionFlag idxFlag = (phit.eventId() == 0) ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM; - const HepMcParticleLink particleLink(phit->trackNumber(), phit.eventId(), idxFlag); + const HepMcParticleLink particleLink(phit->trackNumber(), phit.eventId(), idxFlag, HepMcParticleLink::IS_BARCODE); // FIXME ATH_CHECK(DetectionEfficiency(ctx, atlasRpcIdeta, atlasRpcIdphi, undefPhiStripStat, rndmEngine, particleLink)); diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx index 53f16a343ebfcfed9a669e28f1153b5feb7c7420..ca9bf1f94aa44149c35f1099cae9009b241f02de 100644 --- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx @@ -458,7 +458,7 @@ StatusCode TgcDigitizationTool::digitizeCore(const EventContext& ctx) { std::vector<MuonSimData::Deposit> deposits; deposits.emplace_back( HepMcParticleLink(phit->trackNumber(), phit.eventId(), - idxFlag), + idxFlag, HepMcParticleLink::IS_BARCODE), // FIXME MuonMCData(tof, 0)); MuonSimData simData(deposits, 0); simData.setPosition(gpos); diff --git a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx index d7151ba3927c301ee0d7968c1bc172971282742b..a9b777a65594c244c457524bad666d832b4ba75f 100644 --- a/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx @@ -415,7 +415,7 @@ StatusCode sTgcDigitizationTool::doDigitization(const EventContext& ctx) { const HepMcParticleLink::PositionFlag idxFlag = (eventId==0) ? HepMcParticleLink::IS_POSITION: HepMcParticleLink::IS_EVENTNUM; const int barcode = hit.particleLink().barcode(); - const HepMcParticleLink particleLink(barcode, eventId, idxFlag); + const HepMcParticleLink particleLink(barcode, eventId, idxFlag, HepMcParticleLink::IS_BARCODE); // FIXME const sTGCSimHit temp_hit(hit.sTGCId(), hit.globalTime(), HPOS, hit.particleEncoding(), diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetectorCosmics_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetectorCosmics_gtest.cxx index 29b436675202dabc3f739a9b5eeb9a8951f09dc1..a500c2bb0128c8b01770dc0d2fc866e313a32cd0 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetectorCosmics_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetectorCosmics_gtest.cxx @@ -82,7 +82,7 @@ TEST_F ( CSCSensitiveDetectorCosmicstest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based CSCSimHitCollection* a = sd2.m_myCSCHitColl.ptr(); ASSERT_EQ(a->begin()->CSCid(), 234691);//test if the CSCid value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetector_gtest.cxx index a6fe459fa29e0069725699f1d2ea4131b2d05748..4491331cc97abf2ec4d3cad47fa970c3a0a60390 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/CSCSensitiveDetector_gtest.cxx @@ -91,7 +91,7 @@ TEST_F ( CSCSensitiveDetectortest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based CSCSimHitCollection* a = sd2.m_myCSCHitColl.ptr(); ASSERT_EQ(a->begin()->globalTime(), 0.5); //test if the globalTime value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/GenericMuonSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/GenericMuonSensitiveDetector_gtest.cxx index 6e5f6f250eee5c4636c58fac18f9625cc67119c2..1932898db9f45599fa845e9b52d274c14c1055ab 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/GenericMuonSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/GenericMuonSensitiveDetector_gtest.cxx @@ -82,7 +82,7 @@ TEST_F ( GenericMuonSensitiveDetectortest, ProcessHits ) sd2.ProcessHits(&sp, &th ); int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based GenericMuonSimHitCollection* a = sd2.m_GenericMuonHitCollection.ptr(); ASSERT_EQ(a->begin()->GenericId(),0);//test if the HitID value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx index 56f78de0c4990311b2d6365ae50395a1346041dd..eb0f58d7d9181dedb721a52e9e4c84265d0f2f33 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetectorCosmics_gtest.cxx @@ -246,7 +246,7 @@ TEST_F ( MDTSensitiveDetectorCosmicstest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the memberfunction that is being tested int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based MDTSimHitCollection* a = sd2.m_MDTHitColl.ptr(); ASSERT_EQ(a->begin()->MDTid(), 6395024); //test if the MDTid value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx index 7fbca1e4d93a60f975d2b6692b1070c02e964cc8..2133cb36a01fcdb384ca57ff9321ccd3687168ec 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/MDTSensitiveDetector_gtest.cxx @@ -247,7 +247,7 @@ TEST_F ( MDTSensitiveDetectortest, ProcessHits ) sd2.ProcessHits(&sp, &th ); int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based MDTSimHitCollection* a = sd2.m_MDTHitColl.ptr(); ASSERT_EQ(a->begin()->MDTid(), 35753088); //test if the MDTid value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/MicromegasSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/MicromegasSensitiveDetector_gtest.cxx index ce0a601de31e0cc877cf6bb1f8aaa8d049015a1e..a8626ff06c4e874afa937942f50f2211b3bbf206 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/MicromegasSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/MicromegasSensitiveDetector_gtest.cxx @@ -171,7 +171,7 @@ TEST_F( MicromegasSensitiveDetectortest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based MMSimHitCollection* a = sd2.m_MMSimHitCollection.ptr(); ASSERT_EQ(a->begin()->MMId(), 528404);//test if the MMId alue of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx index e829936bbce70f10ab2a05d41e43b10739096b79..68bcd381599240be61799ae98200110d2860003d 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetectorCosmics_gtest.cxx @@ -82,7 +82,7 @@ TEST_F ( RPCSensitiveDetectorCosmicstest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based RPCSimHitCollection* a = sd2.m_myRPCHitColl.ptr(); diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx index 362406fc718c510f490b4d92784886895cac2f72..01084b54e8727526865f58e451f95563c198b532 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/RPCSensitiveDetector_gtest.cxx @@ -83,7 +83,7 @@ TEST_F ( RPCSensitiveDetectortest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based RPCSimHitCollection* a = sd2.m_myRPCHitColl.ptr(); diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetectorCosmics_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetectorCosmics_gtest.cxx index 77e7fb05da216737c37629cbd080ba2561d84cad..b12e359f0f8c6d2dac7bc36d475743279c3b3f6b 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetectorCosmics_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetectorCosmics_gtest.cxx @@ -82,7 +82,7 @@ TEST_F( TGCSensitiveDetectorCosmicstest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based TGCSimHitCollection* a = sd2.m_myTGCHitColl.ptr(); ASSERT_EQ(a->begin()->TGCid(), 1456690); //test if the TGCid value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetector_gtest.cxx index 2427ed740fe20ec5fe610c63a504ddd9be85bef0..5a6c8e81e7ba2c20468866a8b9efa0d662812929 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/TGCSensitiveDetector_gtest.cxx @@ -82,7 +82,7 @@ TEST_F ( TGCSensitiveDetectortest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based TGCSimHitCollection* a = sd2.m_myTGCHitColl.ptr(); ASSERT_EQ(a->begin()->TGCid(), 1456690); //test if the TGCid value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/test/sTGCSensitiveDetector_gtest.cxx b/MuonSpectrometer/MuonG4/MuonG4SD/test/sTGCSensitiveDetector_gtest.cxx index fc63dac0481965ee37a3912fa833bc5b3f9e7443..a9aa46a057e3827825816f778df56de51b9a1ed6 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/test/sTGCSensitiveDetector_gtest.cxx +++ b/MuonSpectrometer/MuonG4/MuonG4SD/test/sTGCSensitiveDetector_gtest.cxx @@ -177,7 +177,7 @@ TEST_F ( sTGCSensitiveDetectortest, ProcessHits ) sd2.ProcessHits(&sp, &th );//invoke the tested member function int barcode = 0; - HepMcParticleLink plink(barcode); + HepMcParticleLink plink(barcode,0,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // FIXME barcode-based sTGCSimHitCollection* a = sd2.m_sTGCSimHitCollection.ptr(); ASSERT_EQ(a->begin()->sTGCId(), 528402); //test if the sTGCId value of the Hit generated by this member function is right, the same below diff --git a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonSimHit/Root/xAODMuonSimHit_V1.cxx b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonSimHit/Root/xAODMuonSimHit_V1.cxx index d317a4dc120a1ea50e30047ed8c01218e0a92e48..8b351571f3f3d2df70804ee397a4ff73edf99e65 100644 --- a/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonSimHit/Root/xAODMuonSimHit_V1.cxx +++ b/MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonSimHit/Root/xAODMuonSimHit_V1.cxx @@ -69,7 +69,7 @@ const HepMcParticleLink& MuonSimHit_v1::genParticleLink() const { HepMcParticleLink::ExtendedBarCode barcode {acc_mcBarcode(*this), eventIndex, - flag}; + flag, HepMcParticleLink::IS_BARCODE}; // FIXME barcode-based link->setExtendedBarCode(std::move(barcode)); return *m_hepMCLink.set(std::move(link)); } diff --git a/MuonSpectrometer/MuonSimEvent/src/CSCSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/CSCSimHit.cxx index 4021be5f71c0e4e8f244c094e574f29bbba89972..6101bc4344e1a46588f3c9b9f3fa03282152b956 100644 --- a/MuonSpectrometer/MuonSimEvent/src/CSCSimHit.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/CSCSimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MuonSimEvent/CSCSimHit.h" @@ -51,7 +51,7 @@ CSCSimHit::CSCSimHit(int id, , m_hitStart(HitStart) , m_hitEnd(HitEnd) , m_particleID(particleID) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based , m_kineticEnergy(-1.) { @@ -70,7 +70,7 @@ CSCSimHit::CSCSimHit(int id, , m_hitStart(HitStart) , m_hitEnd(HitEnd) , m_particleID(particleID) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based , m_kineticEnergy(static_cast<float>(kineticEnergy)) { diff --git a/MuonSpectrometer/MuonSimEvent/src/GenericMuonSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/GenericMuonSimHit.cxx index db4601abf74d7b7fb4481ae95fa22f0a755533a4..439f23d1c19a4c4574b37194fb9950dcfbe4dc4c 100644 --- a/MuonSpectrometer/MuonSimEvent/src/GenericMuonSimHit.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/GenericMuonSimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MuonSimEvent/GenericMuonSimHit.h" @@ -41,7 +41,7 @@ GenericMuonSimHit::GenericMuonSimHit(HitID id, double time, double pretime, , m_globalDirection(direction) , m_depositEnergy(depositEnergy) , m_StepLength(StepLength) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based { } diff --git a/MuonSpectrometer/MuonSimEvent/src/MDTSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/MDTSimHit.cxx index 5a8aa773e134fee0bd080767a961ced478ddbf6d..dfcb93f306536962bec1c137db212b1a26d4a7df 100644 --- a/MuonSpectrometer/MuonSimEvent/src/MDTSimHit.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/MDTSimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MuonSimEvent/MDTSimHit.h" @@ -47,7 +47,7 @@ MDTSimHit::MDTSimHit(HitID id, : m_MDTid(id), m_globalTime(time) , m_driftRadius(radius) , m_localPosition(position) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based { m_stepLength = -9999999.; //total lenght of particle m_energyDeposit = -1.; //Geant4 deposited energy @@ -67,7 +67,7 @@ MDTSimHit::MDTSimHit(HitID id, : m_MDTid(id), m_globalTime(time) , m_driftRadius(radius) , m_localPosition(position) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based , m_stepLength(static_cast<float>(stepLength)) , m_energyDeposit(static_cast<float>(energyDeposit)) , m_particleEncoding(particleEncoding) diff --git a/MuonSpectrometer/MuonSimEvent/src/MMSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/MMSimHit.cxx index 33050cff198b004fecedc76a189cdaba9ccc1fd9..31d21f501ab2a650cfa097b407567b035efcd396 100644 --- a/MuonSpectrometer/MuonSimEvent/src/MMSimHit.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/MMSimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MuonSimEvent/MMSimHit.h" @@ -28,7 +28,7 @@ MMSimHit::MMSimHit(HitID id, double time, , m_kineticEnergy(kineticEnergy) , m_globalDirection(direction) , m_depositEnergy(depositEnergy) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based { } diff --git a/MuonSpectrometer/MuonSimEvent/src/RPCSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/RPCSimHit.cxx index f25919c450f667e48c79c41d5aee85de8065c485..92be51c773c8dc6d2d8ccb3b2d7bc5bce976a8d9 100644 --- a/MuonSpectrometer/MuonSimEvent/src/RPCSimHit.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/RPCSimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ @@ -47,7 +47,7 @@ RPCSimHit::RPCSimHit(int id, : m_RPCid(id), m_globalTime(time), m_localPosition(position), - m_partLink(trackNumber), + m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE), // FIXME barcode-based m_localPostStepPosition(0.,0.,0.), // post-step position m_energyDeposit(-1.), //Geant4 de/dx m_stepLength(-1.), //Geant4 step Length @@ -65,7 +65,7 @@ RPCSimHit::RPCSimHit(int id, const int particleEncoding, const double kineticEnergy) : m_RPCid(id), m_globalTime(time) , m_localPosition(prePosition) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based , m_localPostStepPosition(postPosition) , m_energyDeposit(static_cast<float>(energyDeposit)) , m_stepLength(static_cast<float>(stepLength)) diff --git a/MuonSpectrometer/MuonSimEvent/src/TGCSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/TGCSimHit.cxx index 348d943cd8ba3ece9c1e83c2f6fe68ba774269ba..9d953f84841f0720937229bab19230185f454ccf 100644 --- a/MuonSpectrometer/MuonSimEvent/src/TGCSimHit.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/TGCSimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MuonSimEvent/TGCSimHit.h" @@ -51,7 +51,7 @@ TGCSimHit::TGCSimHit(const int id, , m_globalTime(static_cast<float>(time)) , m_localPosition(position) , m_localDireCos(direcos) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based , m_energyDeposit(static_cast<float>(energyDeposit)) , m_stepLength(static_cast<float>(stepLength)) , m_particleEncoding(particleEncoding) diff --git a/MuonSpectrometer/MuonSimEvent/src/sTGCSimHit.cxx b/MuonSpectrometer/MuonSimEvent/src/sTGCSimHit.cxx index 91b59a15fa108a0a329102245d0948df086fc768..187d5c630de837b8eb174684b8c526ae121da986 100644 --- a/MuonSpectrometer/MuonSimEvent/src/sTGCSimHit.cxx +++ b/MuonSpectrometer/MuonSimEvent/src/sTGCSimHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "MuonSimEvent/sTGCSimHit.h" @@ -29,7 +29,7 @@ sTGCSimHit::sTGCSimHit(HitID id, double time, , m_particleEncoding(particleEncoding) , m_globalDirection(direction) , m_depositEnergy(depositEnergy) - , m_partLink(trackNumber) + , m_partLink(trackNumber, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based , m_kineticEnergy(-1.0) { } diff --git a/MuonSpectrometer/MuonTruthAlgs/src/DetailedMuonPatternTruthBuilder.cxx b/MuonSpectrometer/MuonTruthAlgs/src/DetailedMuonPatternTruthBuilder.cxx index 47069761cdcb6062378a7cf86c6010ac85a8a02f..c23959361eea9830208ae470233f790ad5c53bdc 100755 --- a/MuonSpectrometer/MuonTruthAlgs/src/DetailedMuonPatternTruthBuilder.cxx +++ b/MuonSpectrometer/MuonTruthAlgs/src/DetailedMuonPatternTruthBuilder.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 "DetailedMuonPatternTruthBuilder.h" @@ -313,7 +313,7 @@ namespace Trk { ATH_MSG_VERBOSE("--> no link, noise ? PRD-ID:" << id << " subdet:" << subdet); // add barcode 0 to pairs, we like to keep track of fake fakes unsigned int BC(0), EV(0); - pairStat[HepMcParticleLink(BC, EV)].subDetHits[subdet].insert(id); + pairStat[HepMcParticleLink(BC, EV, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE)].subDetHits[subdet].insert(id); // FIXME barcode-based } } // orderedPRD_Truth[] available } // subdet type check, warning in findSubDetType() @@ -369,7 +369,7 @@ namespace Trk { #endif do { - HepMcParticleLink curlink(HepMC::barcode(current), eventIndex); + HepMcParticleLink curlink(HepMC::barcode(current), eventIndex, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based // remove the current particle from the list of particles to consider (if it is still there) seeds.erase(curlink); @@ -424,7 +424,7 @@ namespace Trk { TruthTrajectory traj; traj.reserve(2); // The average size is about 1.05. Hardcode that instead of using slow list::size(). for (Sprout::const_iterator ppart = s->second.begin(); ppart != s->second.end(); ++ppart) { - traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex())); + traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE)); // FIXME barcode-based } // Count PRDs on the TruthTrajectory @@ -772,7 +772,7 @@ namespace Trk { ATH_MSG_VERBOSE("--> no link, noise ? PRD-ID:" << id << " subdet:" << subdet); // add barcode 0 to pairs, we like to keep track of fake fakes unsigned int BC(0), EV(0); - pairStat[HepMcParticleLink(BC, EV)].subDetHits[subdet].insert(id); + pairStat[HepMcParticleLink(BC, EV, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE)].subDetHits[subdet].insert(id); // FIXME barcode-based } } // orderedPRD_Truth[] available } // subdet type check, warning in findSubDetType() @@ -829,7 +829,7 @@ namespace Trk { #endif do { - HepMcParticleLink curlink(HepMC::barcode(current), eventIndex); + HepMcParticleLink curlink(HepMC::barcode(current), eventIndex, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based // remove the current particle from the list of particles to consider (if it is still there) seeds.erase(curlink); @@ -883,7 +883,7 @@ namespace Trk { TruthTrajectory traj; traj.reserve(2); // The average size is about 1.05. Hardcode that instead of using slow list::size(). for (Sprout::const_iterator ppart = s->second.begin(); ppart != s->second.end(); ++ppart) { - traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex())); + traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE)); // FIXME barcode-based } // Count PRDs on the TruthTrajectory @@ -983,7 +983,7 @@ namespace Trk { ATH_MSG_VERBOSE("--> no link, noise ? PRD-ID:" << id << " subdet:" << subdet); // add barcode 0 to pairs, we like to keep track of fake fakes unsigned int BC(0), EV(0); - pairStat[HepMcParticleLink(BC, EV)].subDetHits[subdet].insert(id); + pairStat[HepMcParticleLink(BC, EV, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE)].subDetHits[subdet].insert(id); // FIXME barcode-based } } // orderedPRD_Truth[] available } // subdet type check, warning in findSubDetType() @@ -1040,7 +1040,7 @@ namespace Trk { #endif do { - HepMcParticleLink curlink(HepMC::barcode(current), eventIndex); + HepMcParticleLink curlink(HepMC::barcode(current), eventIndex, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based // remove the current particle from the list of particles to consider (if it is still there) seeds.erase(curlink); @@ -1094,7 +1094,7 @@ namespace Trk { TruthTrajectory traj; traj.reserve(2); // The average size is about 1.05. Hardcode that instead of using slow list::size(). for (Sprout::const_iterator ppart = s->second.begin(); ppart != s->second.end(); ++ppart) { - traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex())); + traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE)); // FIXME barcode-based } // Count PRDs on the TruthTrajectory diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEvent/src/TruthParticleContainer.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEvent/src/TruthParticleContainer.cxx index 01abb84ee40965b69e436deff56414de0fb49289..dc532b913ddf62abcac07c62ea0db93b916fd583 100644 --- a/PhysicsAnalysis/TruthParticleID/McParticleEvent/src/TruthParticleContainer.cxx +++ b/PhysicsAnalysis/TruthParticleID/McParticleEvent/src/TruthParticleContainer.cxx @@ -63,7 +63,7 @@ TruthParticleContainer::TruthParticleContainer( const SG::OwnershipPolicy own ) const TruthParticle* TruthParticleContainer::truthParticle( const int barcode,std::size_t genEventIdx ) const { - HepMcParticleLink mcLink(barcode, genEventIdx, HepMcParticleLink::IS_POSITION); + HepMcParticleLink mcLink(barcode, genEventIdx, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based Map_t::const_iterator itr = m_particles.find(mcLink.compress()); if ( itr != m_particles.end() ) { return itr->second; @@ -74,7 +74,7 @@ TruthParticleContainer::truthParticle( const int barcode,std::size_t genEventIdx std::size_t TruthParticleContainer::truthParticleIdx( const int barcode, std::size_t genEventIdx ) const { - HepMcParticleLink mcLink(barcode, genEventIdx, HepMcParticleLink::IS_POSITION); + HepMcParticleLink mcLink(barcode, genEventIdx, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based Map_t::const_iterator itr = m_particles.find(mcLink.compress()); if ( itr != m_particles.end() ) { for ( std::size_t idx = 0; idx != this->size(); ++idx ) { diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEvent/test/TruthParticle_test.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEvent/test/TruthParticle_test.cxx index 1dcad59d4d8871bf394a814fb088175151d1a3b3..9acd6efe44ab7a548dc12cb421cbe32c9a3e9ff6 100644 --- a/PhysicsAnalysis/TruthParticleID/McParticleEvent/test/TruthParticle_test.cxx +++ b/PhysicsAnalysis/TruthParticleID/McParticleEvent/test/TruthParticle_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @purpose: test the TruthParticle class @@ -89,7 +89,7 @@ make_map_t_pair(const HepMC::GenParticlePtr &p, const TruthParticle &tp) { const std::size_t genEventIdx = 0; - HepMcParticleLink link(HepMC::barcode(p), genEventIdx, HepMcParticleLink::IS_POSITION); + HepMcParticleLink link(HepMC::barcode(p), genEventIdx, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based return Map_t::value_type(link.compress(), &tp); } bool operator==(TruthParticle a, HepMC::GenParticlePtr b) @@ -105,7 +105,7 @@ make_map_t_pair(const HepMC::GenParticle &p, const TruthParticle &tp) { const std::size_t genEventIdx = 0; - HepMcParticleLink link(p.barcode(), genEventIdx, HepMcParticleLink::IS_POSITION); + HepMcParticleLink link(p.barcode(), genEventIdx, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based return Map_t::value_type(link.compress(), &tp); } #endif diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.cxx index c10f6feb2c020b5408c0fff27b33b8b55bea6aa2..f3880a1753f2cd7b02a19e3a33aeb6903f5c3005 100644 --- a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.cxx +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "RootTruthParticleCnvTool.h" @@ -74,7 +74,7 @@ RootTruthParticleCnvTool::convert(const McEventCollection *mcCollection, "TruthParticle is not wrapping the GenParticle : %d !!", HepMC::barcode(hepMcPart)); } - HepMcParticleLink mcLink( HepMC::barcode(hepMcPart), genEventIndex, HepMcParticleLink::IS_POSITION ); + HepMcParticleLink mcLink( HepMC::barcode(hepMcPart), genEventIndex, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE ); // FIXME barcode-based bcToMcPart[ mcLink.compress() ] = mcPart; }//> end loop over particles diff --git a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.cxx b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.cxx index 429bbd138525cd5d09099d154cbaa2dcc52cb766..82e283afb218d8bff9a5f254e79947a0242a5d5e 100755 --- a/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.cxx +++ b/PhysicsAnalysis/TruthParticleID/McParticleTools/src/TruthParticleCnvTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -286,7 +286,7 @@ TruthParticleCnvTool::convert( const McEventCollection * mcCollection, ATH_MSG_ERROR("TruthParticle is not wrapping the GenParticle : " << hepMcPart << " !!"); } - HepMcParticleLink mcLink( bc, genEventIndex, HepMcParticleLink::IS_POSITION, sg ); // FIXME assuming that we are using the hard-scatter McEventCollection - would need to pass this info as an argument to the convert function. + HepMcParticleLink mcLink( bc, genEventIndex, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE, sg ); // FIXME barcode-based bcToMcPart[ mcLink.compress() ] = mcPart; }//> end loop over particles diff --git a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx index 30969345ba65f582683d4c52d37f4cc0938b92ae..ddf9b1c05a4bef620c0e025261a9dedbbf958ff4 100644 --- a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx +++ b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.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 */ /** * @file InDetSimEventTPCnv/test/TrackParticleTruthCollectionCnv_p1_test.cxx @@ -68,7 +68,8 @@ void test1 ATLAS_NOT_THREAD_SAFE (const std::vector<HepMC::GenParticlePtr>& genP std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle)); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),0, + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); // Get proxy created outside of leak checking. DataLink<Rec::TrackParticleContainer> dldum ("tpc"); @@ -77,7 +78,8 @@ void test1 ATLAS_NOT_THREAD_SAFE (const std::vector<HepMC::GenParticlePtr>& genP TrackParticleTruthCollection trans1 (DataLink<Rec::TrackParticleContainer>("tpc")); for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); Rec::TrackParticleTruthKey key (ElementLink<Rec::TrackParticleContainer> ("tpc", i)); TrackParticleTruth val (trkLink, (float)i/10); trans1[key] = val; diff --git a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx index 89492c0696f6d60d32a011905a75034a571df7ba..c0b3e9fad02688e37010391d29375f22521a16b7 100644 --- a/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx +++ b/Reconstruction/TrackParticleTruthTPCnv/test/TrackParticleTruthCollectionCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -70,7 +70,8 @@ void test1(std::vector<HepMC::GenParticlePtr> genPartVector) TrackParticleTruthCollection trans1 (DataLink<Rec::TrackParticleContainer>("tpc")); for (int i=0; i<10; i++) { auto pGenParticle = genPartVector.at(i); - HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number()); + HepMcParticleLink trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); Rec::TrackParticleTruthKey key (ElementLink<Rec::TrackParticleContainer> ("tpc", i)); TrackParticleTruth val (trkLink, (float)i/10); trans1[key] = val; diff --git a/Simulation/G4Sim/MCTruth/src/TrackHelper.cxx b/Simulation/G4Sim/MCTruth/src/TrackHelper.cxx index dc3bdfa8fb4727a1268954bbb9fe9f9f49bd7d7a..6dbddd60eae8759b9b4fee682fb20005d61ad4fa 100644 --- a/Simulation/G4Sim/MCTruth/src/TrackHelper.cxx +++ b/Simulation/G4Sim/MCTruth/src/TrackHelper.cxx @@ -48,5 +48,5 @@ int TrackHelper::GetStatus() const HepMcParticleLink TrackHelper::GetParticleLink() { int barcode = this->GetBarcode(); - return HepMcParticleLink(barcode); + return HepMcParticleLink(barcode, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based syntax } diff --git a/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/ScintillatorHit.cxx b/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/ScintillatorHit.cxx index e5fd42c9a8e6d29c16b6491675be8094613a8602..e21d1c3a940a45d4936e7ca49819ed68fd389151 100755 --- a/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/ScintillatorHit.cxx +++ b/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/ScintillatorHit.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 */ /////////////////////////////////////////////////////////////////// @@ -69,7 +69,8 @@ ScintillatorHit::ScintillatorHit( const int volNumber, m_globalPostStepY(globalPostStepY), m_globalPostStepZ(globalPostStepZ), m_globalTime(globalTime), - m_partLink(track) {} + m_partLink(track, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based syntax +{} int ScintillatorHit::GetTrackID() const { return m_partLink.barcode(); diff --git a/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/SimpleScintillatorHit.cxx b/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/SimpleScintillatorHit.cxx index 051ff31a50e0762ae110927af13843edc7a2ef8f..388ce71170273b32840be6c4835819f2fdbae15b 100644 --- a/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/SimpleScintillatorHit.cxx +++ b/Simulation/G4Utilities/G4Ancillary/G4AncillarySimEvent/src/SimpleScintillatorHit.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 */ /////////////////////////////////////////////////////////////////// @@ -36,7 +36,8 @@ SimpleScintillatorHit::SimpleScintillatorHit(const int particleEncoding, m_position(position), m_globalTime(globalTime), m_copyNo(copyNo), - m_partLink(track) {} + m_partLink(track, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE) // FIXME barcode-based syntax +{} int SimpleScintillatorHit::GetTrackID() const { return m_partLink.barcode(); diff --git a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx index a1b58bb6eca5034ce45f2fdb4211f97928e9b8f9..b4cef7db99f61296098729e6632a540819c2d5bf 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx @@ -278,10 +278,10 @@ void ISF::ISFParticle::setBarcodeAndUpdateHepMcParticleLink( Barcode::ParticleBa //creating/changing the ISFParticle's HepMcParticleLink HepMcParticleLink* newHMPL = nullptr; if (m_partLink) { - newHMPL = new HepMcParticleLink(bc, m_partLink->eventIndex()); + newHMPL = new HepMcParticleLink(bc, m_partLink->eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based delete m_partLink; } else { - newHMPL = new HepMcParticleLink(bc); + newHMPL = new HepMcParticleLink(bc, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based } m_partLink = newHMPL; } diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx index 521d222dfeb094465c1cd96759293bf0320ce44c..ab14d0187edd2ac7e8280b21d79fb8dcd0c55797 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/src/InputConverter.cxx @@ -341,7 +341,7 @@ ISF::InputConverter::convertParticle(const HepMC::GenParticlePtr& genPartPtr) co const auto pBarcode = HepMC::barcode(genPartPtr); auto tBinding = std::make_unique<ISF::TruthBinding>(genPartPtr); - auto hmpl = std::make_unique<HepMcParticleLink>(pBarcode, parentEvent->event_number()); + auto hmpl = std::make_unique<HepMcParticleLink>(pBarcode, parentEvent->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); auto sParticle = std::make_unique<ISF::ISFParticle>( std::move(pos), std::move(mom), diff --git a/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx b/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx index cb7e4e2d1ca3185136dac27a9cd52cbc09e4acfa..48a6e6446dc6b7afa6edaa40028b6d42d02b27c1 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/test/InputConverter_test.cxx @@ -210,7 +210,7 @@ TEST_F(InputConverter_test, convertParticle_using_generated_mass) { //AV: we set barcode here because only here the particle in HepMC3 enters event and can have a meaningful barcode. HepMC::suggest_barcode(genPart,particleBarcode); HepMC::fillBarcodesAttribute(&ge); - HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode, 0); + HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based syntax Amg::Vector3D expectedPos(9.8, 7.65, 4.3); Amg::Vector3D expectedMom(12.3, 45.6, 78.9); @@ -267,7 +267,7 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_photon) { //AV: we set barcode here because only here the particle in HepMC3 enters event and can have a meaningful barcode. HepMC::suggest_barcode(genPart,particleBarcode); HepMC::fillBarcodesAttribute(&ge); - HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode); + HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); Amg::Vector3D expectedPos(9.8, 7.65, 4.3); Amg::Vector3D expectedMom(12.3, 45.6, 78.9); @@ -322,7 +322,7 @@ TEST_F(InputConverter_test, convertParticle_using_particleDataTable_electron) { HepMC::GenEvent& ge = *(inputTestDataHandle->at(0)); ge.add_vertex( prodVtx ); HepMC::suggest_barcode(genPart,particleBarcode); - HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode, 0); + HepMcParticleLink* trackLink = new HepMcParticleLink(particleBarcode, 0, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); Amg::Vector3D expectedPos(9.8, 7.65, 4.3); Amg::Vector3D expectedMom(12.3, 45.6, 78.9); diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx index 58dae1de7cb332f2dc69a15994754e9bbfe0151e..75e1cdf66a5d05ad8e9005ec56224f2822387bd6 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/src/SimHitCreatorMS.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "SimHitCreatorMS.h" @@ -267,15 +267,19 @@ void iFatras::SimHitCreatorMS::createHits(const ISF::ISFParticle& isp, const Amg::Vector3D& entryPos(pos - 0.5*segLengthSTGC*unitMom); const Amg::Vector3D& exitPos(pos + 0.5*segLengthSTGC*unitMom); - MMSimHit nswMMHit = MMSimHit(simID,timeInfo, pos, - isp.pdgCode(),eKin,unitMom, - energyDeposit, isp.barcode()) ; - sTGCSimHit nswsTGCHit = sTGCSimHit(simID,timeInfo, exitPos, - isp.pdgCode(), unitMom, - energyDeposit, isp.barcode(), eKin, entryPos) ; - - if ( m_idHelperSvc->isMM(id) ) m_mmSimHitCollection->Insert(nswMMHit); - else m_stgcSimHitCollection->Insert(nswsTGCHit); + if ( m_idHelperSvc->isMM(id) ) { + m_mmSimHitCollection->Emplace(simID, timeInfo, pos, + isp.pdgCode(), eKin, unitMom, + energyDeposit, isp.barcode()) ; + } + else { + HepMcParticleLink partLink(isp.barcode(), 0, + HepMcParticleLink::IS_EVENTNUM, + HepMcParticleLink::IS_BARCODE); // FIXME barcode-based + m_stgcSimHitCollection->Emplace(simID, timeInfo, exitPos, + isp.pdgCode(), unitMom, energyDeposit, + partLink, eKin, entryPos); + } ATH_MSG_VERBOSE("[ muhit ] NSW hit created."); diff --git a/Simulation/Tools/McEventCollectionFilter/src/CSC_HitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/CSC_HitsTruthRelink.cxx index b05eb8b038e89af56e6f735ee98ac997f8e27eae..5368f310d4c20537d9245e6e4b7c92e73ee7a926 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/CSC_HitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/CSC_HitsTruthRelink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "CSC_HitsTruthRelink.h" @@ -45,7 +45,7 @@ StatusCode CSC_HitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const CSCSimHit &hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -55,7 +55,7 @@ StatusCode CSC_HitsTruthRelink::execute(const EventContext &ctx) const currentBarcode = referenceBarcode; } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME int id = hit.CSCid(); double time = hit.globalTime(); double energyDeposit = hit.energyDeposit(); diff --git a/Simulation/Tools/McEventCollectionFilter/src/MDT_HitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/MDT_HitsTruthRelink.cxx index 5f91c786ec2c8b646a9ea9a8e6d18a0268d0e56c..a0d28016511832382587d716040c026889a46669 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/MDT_HitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/MDT_HitsTruthRelink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "MDT_HitsTruthRelink.h" @@ -45,7 +45,7 @@ StatusCode MDT_HitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const MDTSimHit &hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -55,7 +55,7 @@ StatusCode MDT_HitsTruthRelink::execute(const EventContext &ctx) const currentBarcode = referenceBarcode; } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME int id = hit.MDTid(); double time = hit.globalTime(); double radius = hit.driftRadius(); diff --git a/Simulation/Tools/McEventCollectionFilter/src/MM_HitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/MM_HitsTruthRelink.cxx index 40178fa201a946e46f105fcd0bb3a979be40d104..8761a7e01c9c5dd12f3f891ee52adb8d2cc7de7f 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/MM_HitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/MM_HitsTruthRelink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "MM_HitsTruthRelink.h" @@ -45,7 +45,7 @@ StatusCode MM_HitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const MMSimHit &hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -55,7 +55,7 @@ StatusCode MM_HitsTruthRelink::execute(const EventContext &ctx) const currentBarcode = referenceBarcode; } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME int id = hit.MMId(); double time = hit.globalTime(); diff --git a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx index 808f7ad06e023f5cfb223d12858bdc4b6231a011..afa27a8006cca906681477be195df60e7144cb8d 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/McEventCollectionFilter.cxx @@ -140,19 +140,19 @@ StatusCode McEventCollectionFilter::execute(const EventContext &ctx) const for (const TRTUncompressedHit &hit : *inputCollectionH) { const HepMcParticleLink& link = hit.particleLink(); int pdgID = hit.GetParticleEncoding(); - if (std::abs(pdgID) != 11 || link.barcode() == 0) continue; + if (std::abs(pdgID) != 11 || link.barcode() == 0) continue; // FIXME HepMC::ConstGenParticlePtr particle = link.cptr(); HepMC::ConstGenVertexPtr vx = particle->production_vertex(); HepMC::GenParticlePtr newParticle = HepMC::newGenParticlePtr(particle->momentum(), particle->pdg_id(), particle->status()); #ifndef HEPMC3 - HepMC::suggest_barcode(newParticle, link.barcode()); + HepMC::suggest_barcode(newParticle, link.barcode()); // HepMC2 still barcode-based #endif const HepMC::FourVector &position = vx->position(); HepMC::GenVertexPtr newVertex = HepMC::newGenVertexPtr(position); newVertex->add_particle_out(newParticle); evt->add_vertex(newVertex); #ifdef HEPMC3 - HepMC::suggest_barcode(newParticle, link.barcode()); + HepMC::suggest_barcode(newParticle, link.barcode()); // FIXME #endif } } @@ -160,7 +160,7 @@ StatusCode McEventCollectionFilter::execute(const EventContext &ctx) const //.....add new vertex with geantino evt->add_vertex(genVertex); #ifdef HEPMC3 - HepMC::suggest_barcode(genPart, HepMC::SUPPRESSED_PILEUP_BARCODE ); + HepMC::suggest_barcode(genPart, HepMC::SUPPRESSED_PILEUP_BARCODE ); // FIXME #endif int referenceBarcode = HepMC::barcode(genPart); ATH_MSG_DEBUG("Reference barcode: " << referenceBarcode); diff --git a/Simulation/Tools/McEventCollectionFilter/src/RPC_HitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/RPC_HitsTruthRelink.cxx index faafb19927ba7ea1bb6fd7435697f302c78f08da..6c3e090e396701ab6f20c24adf69e7bc1706d0ef 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/RPC_HitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/RPC_HitsTruthRelink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "RPC_HitsTruthRelink.h" @@ -45,7 +45,7 @@ StatusCode RPC_HitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const RPCSimHit & hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -55,7 +55,7 @@ StatusCode RPC_HitsTruthRelink::execute(const EventContext &ctx) const currentBarcode = referenceBarcode; } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME int id = hit.RPCid(); double time = hit.globalTime(); Amg::Vector3D prePos = hit.preLocalPosition(); diff --git a/Simulation/Tools/McEventCollectionFilter/src/SiliconHitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/SiliconHitsTruthRelink.cxx index f71778ffc3bf16e01845ba415d56fc1c72943ac6..b96fb71189e5f48688d7c25951ecf586c3293aad 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/SiliconHitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/SiliconHitsTruthRelink.cxx @@ -45,7 +45,7 @@ StatusCode SiliconHitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const SiHit &hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -60,7 +60,7 @@ StatusCode SiliconHitsTruthRelink::execute(const EventContext &ctx) const if (oldLink.barcode() != 0) { currentBarcode = referenceBarcode; } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME outputCollection->Emplace(lP1, lP2, energyLoss, meanTime, particleLink, id); } diff --git a/Simulation/Tools/McEventCollectionFilter/src/TGC_HitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/TGC_HitsTruthRelink.cxx index 3d6e5d1aab1a02f58134dbfeff86e47c6c642a6b..028dd71a289ed57c8a12ec1ea6426d1e360eb72c 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/TGC_HitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/TGC_HitsTruthRelink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "TGC_HitsTruthRelink.h" @@ -45,7 +45,7 @@ StatusCode TGC_HitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const TGCSimHit &hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -55,7 +55,7 @@ StatusCode TGC_HitsTruthRelink::execute(const EventContext &ctx) const currentBarcode = referenceBarcode; } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME int id = hit.TGCid(); double time = hit.globalTime(); diff --git a/Simulation/Tools/McEventCollectionFilter/src/TRT_HitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/TRT_HitsTruthRelink.cxx index 7572bdc0f15b38302e14f3dada35c4e31bf02b16..fe9b082144cb20b2c58c1467d7f41bb595b25643 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/TRT_HitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/TRT_HitsTruthRelink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "TRT_HitsTruthRelink.h" @@ -45,7 +45,7 @@ StatusCode TRT_HitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const TRTUncompressedHit &hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -58,7 +58,7 @@ StatusCode TRT_HitsTruthRelink::execute(const EventContext &ctx) const } } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME int id = hit.GetHitID(); float kineticEnergy = hit.GetKineticEnergy(); float energyDeposit = hit.GetEnergyDeposit(); diff --git a/Simulation/Tools/McEventCollectionFilter/src/sTGC_HitsTruthRelink.cxx b/Simulation/Tools/McEventCollectionFilter/src/sTGC_HitsTruthRelink.cxx index 2ba59040d2168736b44cc26db1039bc3793f6531..93d14a9c3ac9b80c42acde5e085fb85f86019290 100644 --- a/Simulation/Tools/McEventCollectionFilter/src/sTGC_HitsTruthRelink.cxx +++ b/Simulation/Tools/McEventCollectionFilter/src/sTGC_HitsTruthRelink.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include "sTGC_HitsTruthRelink.h" @@ -45,7 +45,7 @@ StatusCode sTGC_HitsTruthRelink::execute(const EventContext &ctx) const // Do relinking int referenceBarcode{}; - ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); + ATH_CHECK(getReferenceBarcode(ctx, &referenceBarcode)); // FIXME for (const sTGCSimHit &hit : *inputCollection) { const HepMcParticleLink& oldLink = hit.particleLink(); @@ -55,7 +55,7 @@ StatusCode sTGC_HitsTruthRelink::execute(const EventContext &ctx) const currentBarcode = referenceBarcode; } - HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, ctx); + HepMcParticleLink particleLink(currentBarcode, oldLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE, ctx); // FIXME int id = hit.sTGCId(); double time = hit.globalTime(); diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx index 19eaceb328161e207022199ba2e14d5bc0b3b60c..0e518832bf60ce5eb3159ab346cdcc0c5d974f5e 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -68,7 +68,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 trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based 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 5e6ea106f1507d7f173a17b5cc9462c293c04d36..ab34c06f84d198ff845187ad8c8618f55a99a522 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/PRD_MultiTruthCollectionCnv_p3_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -68,7 +68,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 trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based const Identifier chanId(i+100); trans1.insert(trans1.end(), std::make_pair(chanId, trkLink) ); } diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx index 55ce9ae4b3d4fa9a1b5b9ece88af5b9003807436..34bd20ecffb9362f28386c266f7f7997cc0adc0e 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p1_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -69,7 +69,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 trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based 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 ffa4e2bbeb0a7497cbbda4f82371a2e45bed4a40..836667cb06fcf45a63cc9d1ae2ffe7d5ad0efdf9 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TrackTruthCollectionCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -69,7 +69,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 trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based Trk::TrackTruthKey key (ElementLink<TrackCollection> ("tpc", i)); TrackTruth val (trkLink, (float)i/10); trans1[key] = val; diff --git a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx index 03c9dc13e00b52a0235a0cd5a0df8fd6ccc83fc0..c1b516012a5a4f33821843fb7832887949e4e3bf 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p1_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -66,7 +66,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 trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based 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 47a60f25505e8aa04c040a312edb400ae36b57c1..52922ef22b8eab0e3e0962fe2e5b5d9a67fbad77 100644 --- a/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx +++ b/Tracking/TrkEventCnv/TrkTruthTPCnv/test/TruthTrajectoryCnv_p2_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -66,7 +66,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 trkLink(HepMC::barcode(pGenParticle),pGenParticle->parent_event()->event_number(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based trans1.push_back(trkLink); } diff --git a/Tracking/TrkTools/TrkTruthCreatorTools/src/DetailedTrackTruthBuilder.cxx b/Tracking/TrkTools/TrkTruthCreatorTools/src/DetailedTrackTruthBuilder.cxx index 933e4f414ba3325b35f9d5aa94c654c117440ed3..58b42d68c9a7cc7d3afbc37f51dd923f5eaf4e06 100755 --- a/Tracking/TrkTools/TrkTruthCreatorTools/src/DetailedTrackTruthBuilder.cxx +++ b/Tracking/TrkTools/TrkTruthCreatorTools/src/DetailedTrackTruthBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "TrkTruthCreatorTools/DetailedTrackTruthBuilder.h" @@ -206,27 +206,27 @@ DetailedTrackTruthBuilder::findSubDetType(const Identifier& id) const { return SubDetHitStatistics::NUM_SUBDETECTORS; } -namespace { -class ExtendedEventIndex { -public: - ExtendedEventIndex(const HepMcParticleLink &source, IProxyDict *proxy) - : m_eventIndex(source.eventIndex()), - m_isPosition(m_eventIndex == HepMcParticleLink::ExtendedBarCode::UNDEFINED) - { - if (m_isPosition) { - m_eventIndex = source.getEventPositionInCollection(proxy); + namespace { + class ExtendedEventIndex { + public: + ExtendedEventIndex(const HepMcParticleLink &source, IProxyDict *proxy) + : m_eventIndex(source.eventIndex()), + m_isPosition(m_eventIndex == HepMcParticleLink::ExtendedBarCode::UNDEFINED) + { + if (m_isPosition) { + m_eventIndex = source.getEventPositionInCollection(proxy); + } } - } - HepMcParticleLink makeLink(HepMcParticleLink::barcode_type other_particle_barcode, IProxyDict *proxy) { - return {other_particle_barcode, m_eventIndex, (m_isPosition ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM ), proxy}; - } + HepMcParticleLink makeLink(HepMcParticleLink::barcode_type other_particle_barcode, IProxyDict *proxy) { + return {other_particle_barcode, m_eventIndex, (m_isPosition ? HepMcParticleLink::IS_POSITION : HepMcParticleLink::IS_EVENTNUM ), HepMcParticleLink::IS_BARCODE, proxy}; // FIXME barcode-based + } -private: - HepMcParticleLink::index_type m_eventIndex; - bool m_isPosition; -}; -} + private: + HepMcParticleLink::index_type m_eventIndex; + bool m_isPosition; + }; + } //================================================================ void DetailedTrackTruthBuilder::addTrack(DetailedTrackTruthCollection *output, @@ -293,7 +293,7 @@ void DetailedTrackTruthBuilder::addTrack(DetailedTrackTruthCollection *output, // add barcode 0 to pairs, we like to keep track of fake fakes unsigned int BC(0); unsigned int EV(0); - pairStat[HepMcParticleLink(BC,EV)].subDetHits[subdet].insert(id); + pairStat[HepMcParticleLink(BC,EV,HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE)].subDetHits[subdet].insert(id); // FIXME barcode-based } } // orderedPRD_Truth[] available } // subdet type check, warning in findSubDetType() @@ -353,7 +353,7 @@ void DetailedTrackTruthBuilder::addTrack(DetailedTrackTruthCollection *output, HepMC::ConstGenParticlePtr current = link.cptr(); do { - HepMcParticleLink curlink( eventIndex.makeLink(HepMC::barcode(current), proxy)); + HepMcParticleLink curlink( eventIndex.makeLink(HepMC::barcode(current), proxy)); // FIXME barcode-based // remove the current particle from the list of particles to consider (if it is still there) seeds.erase(curlink); @@ -415,7 +415,7 @@ void DetailedTrackTruthBuilder::addTrack(DetailedTrackTruthCollection *output, TruthTrajectory traj; traj.reserve(2); // The average size is about 1.05. Hardcode that instead of using slow list::size(). for(Sprout::const_iterator ppart=s->second.begin(); ppart!=s->second.end(); ++ppart) { - traj.push_back(HepMcParticleLink(ExtendedEventIndex(s->first, proxy).makeLink(HepMC::barcode(*ppart), proxy))); + traj.push_back(HepMcParticleLink(ExtendedEventIndex(s->first, proxy).makeLink(HepMC::barcode(*ppart), proxy))); // FIXME barcode-based } // Count PRDs on the TruthTrajectory diff --git a/Trigger/EFTracking/FPGATrackSim/FPGATrackSimSGInput/src/FPGATrackSimSGToRawHitsTool.cxx b/Trigger/EFTracking/FPGATrackSim/FPGATrackSimSGInput/src/FPGATrackSimSGToRawHitsTool.cxx index b5c3e64c6ce56b8487e17d5220667ea3bc71817c..e2e9c0a3f052a2aa6f36dfb0d78ab003521cd68c 100644 --- a/Trigger/EFTracking/FPGATrackSim/FPGATrackSimSGInput/src/FPGATrackSimSGToRawHitsTool.cxx +++ b/Trigger/EFTracking/FPGATrackSim/FPGATrackSimSGInput/src/FPGATrackSimSGToRawHitsTool.cxx @@ -292,7 +292,7 @@ FPGATrackSimSGToRawHitsTool::readPixelSimulation(HitIndexMap& hitIndexMap, unsig tmpSGhit.setEventIndex(index); else tmpSGhit.setEventIndex(std::numeric_limits<long>::max()); - tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); + tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); // FIXME tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.))); tmpSGhit.setParentageMask(parentMask.to_ulong()); @@ -366,7 +366,7 @@ FPGATrackSimSGToRawHitsTool::readStripSimulation(HitIndexMap& hitIndexMap, unsig else tmpSGhit.setEventIndex(std::numeric_limits<long>::max()); - tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); + tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); // FIXME tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.))); tmpSGhit.setParentageMask(parentMask.to_ulong()); tmpSGhit.setX(0.5 * (endsOfStrip.first.x() + endsOfStrip.second.x())); @@ -514,7 +514,7 @@ FPGATrackSimSGToRawHitsTool::readOfflineClusters(std::vector <FPGATrackSimCluste clusterEquiv.setEventIndex(index); else clusterEquiv.setEventIndex(std::numeric_limits<long>::max()); - clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); + clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); // FIXME clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.))); clusterEquiv.setParentageMask(parentMask.to_ulong()); clusterOut.setClusterEquiv(clusterEquiv); @@ -584,7 +584,7 @@ FPGATrackSimSGToRawHitsTool::readOfflineClusters(std::vector <FPGATrackSimCluste clusterEquiv.setEventIndex(std::numeric_limits<long>::max()); - clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); + clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max())); // FIXME clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.))); clusterEquiv.setParentageMask(parentMask.to_ulong()); clusterOut.setClusterEquiv(clusterEquiv); @@ -668,8 +668,8 @@ FPGATrackSimSGToRawHitsTool::readTruthTracks(std::vector <FPGATrackSimTruthTrack // categorize particle (prompt, secondary, etc.) based on InDetPerformanceRTT/detector paper criteria. bool isPrimary = true; if (std::abs(truth_d0corr) > 2.) { isPrimary = false; } - const int bc = HepMC::barcode(particle); - if (HepMC::is_simulation_particle(particle) || bc == 0) { isPrimary = false; } + const int bc = HepMC::barcode(particle); // FIXME update barcode-based syntax + if (HepMC::is_simulation_particle(particle) || bc == 0) { isPrimary = false; } // FIXME update barcode-based syntax if (isPrimary && particle->production_vertex()) { const HepGeom::Point3D<double> startVertex(particle->production_vertex()->position().x(), particle->production_vertex()->position().y(), particle->production_vertex()->position().z()); if (std::abs(startVertex.z() - truth_zvertex) > 100.) { isPrimary = false; } @@ -682,7 +682,9 @@ FPGATrackSimSGToRawHitsTool::readTruthTracks(std::vector <FPGATrackSimTruthTrack isPrimary = false; } - HepMcParticleLink::ExtendedBarCode extBarcode2(bc, ievt); + HepMcParticleLink::ExtendedBarCode extBarcode2(bc, ievt, + HepMcParticleLink::IS_EVENTNUM, + HepMcParticleLink::IS_BARCODE); // FIXME update barcode-based syntax FPGATrackSimTruthTrack tmpSGTrack; tmpSGTrack.setVtxX(track_truth_x0); @@ -697,7 +699,7 @@ FPGATrackSimSGToRawHitsTool::readTruthTracks(std::vector <FPGATrackSimTruthTrack tmpSGTrack.setPZ(track_truth_p * track_truth_costheta); tmpSGTrack.setPDGCode(pdgcode); tmpSGTrack.setStatus(particle->status()); - tmpSGTrack.setBarcode(extBarcode2.barcode()); + tmpSGTrack.setBarcode(extBarcode2.barcode()); // FIXME index_type index2, position2; extBarcode2.eventIndex(index2, position2); tmpSGTrack.setEventIndex(index2); @@ -727,13 +729,13 @@ void FPGATrackSimSGToRawHitsTool::getTruthInformation(InDetSimDataCollection::co // reject unstable particles if (!MC::isStable(particleLink)) { continue; } // reject secondaries and low pT (<400 MeV) pileup - if (HepMC::is_simulation_particle(particleLink.cptr()) ||particleLink.barcode() == 0) { continue; } + if (HepMC::is_simulation_particle(particleLink.cptr()) ||particleLink.barcode() == 0) { continue; } // FIXME // reject far forward particles if (std::fabs(genEta) > m_maxEta) { continue; } // "bestParent" is the highest pt particle if (bestParent == nullptr || bestParent->momentum().perp() < genPt) { bestParent = particleLink.cptr(); - bestExtcode = HepMcParticleLink::ExtendedBarCode(particleLink.barcode(), particleLink.eventIndex()); + bestExtcode = HepMcParticleLink::ExtendedBarCode(particleLink.barcode(), particleLink.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based-syntax } #ifdef HEPMC3 parentMask |= FPGATrackSimInputUtils::construct_truth_bitmap(std::shared_ptr<const HepMC3::GenParticle>(particleLink.cptr())); diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx index c1435010e25380f45628ce1370d993013a46ea4b..38de7ac6ccfb93c84f523297651c502e5c4046c2 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx +++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.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 */ /** * @file TrigTruthEventTPCnv/test/TrigInDetTrackTruthCnv_p1_test.cxx @@ -55,7 +55,8 @@ public: int nstat = 4; p.m_nr_common_hits.resize (nstat); for (int i=0; i < nstat; i++) { - HepMcParticleLink particleLink(HepMC::barcode(genPartVector.at(i)),genPartVector.at(i)->parent_event()->event_number()); + HepMcParticleLink particleLink(HepMC::barcode(genPartVector.at(i)),genPartVector.at(i)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); TrigIDHitStats tihs; tihs[TrigIDHitStats::PIX] = 12 + i*10; tihs[TrigIDHitStats::SCT] = 13 + i*10; @@ -94,7 +95,8 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); // Make sure HepMcParticleLink::getLastEventCollectionName is called. std::ostringstream ss; ss << dummyHMPL; diff --git a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx index 84b9992d4299c360d0a8b5eb6b134e3fbb4c56a5..50cf8fd377e1c50156b2f42658ac8d36baa3eb93 100644 --- a/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx +++ b/Trigger/TrigTruthEvent/TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.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 */ /** * @file TrigTruthEventTPCnv/test/TrigInDetTrackTruthMapCnv_p1_test.cxx @@ -56,7 +56,8 @@ public: int nstat = 1; p.m_nr_common_hits.resize (nstat); for (int i=ndx; i < nstat; i++) { - HepMcParticleLink particleLink(HepMC::barcode(genPartVector.at(i)),genPartVector.at(i)->parent_event()->event_number()); + HepMcParticleLink particleLink(HepMC::barcode(genPartVector.at(i)),genPartVector.at(i)->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); TrigIDHitStats tihs; tihs[TrigIDHitStats::PIX] = 12 + i*10 + ndx*100; tihs[TrigIDHitStats::SCT] = 13 + i*10 + ndx*100; @@ -106,7 +107,8 @@ void test1 ATLAS_NOT_THREAD_SAFE (std::vector<HepMC::GenParticlePtr>& genPartVec std::cout << "test1\n"; auto particle = genPartVector.at(0); // Create HepMcParticleLink outside of leak check. - HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number()); + HepMcParticleLink dummyHMPL(HepMC::barcode(particle),particle->parent_event()->event_number(), + HepMcParticleLink::IS_EVENTNUM,HepMcParticleLink::IS_BARCODE); assert(dummyHMPL.cptr()==particle); diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_ForwardHit.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_ForwardHit.cxx index 00095c607a66af250389aabb1f6a7363bb55ed35..bccfc9fc811c0d4c499ad0cc976435ee6ddecb0f 100644 --- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_ForwardHit.cxx +++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_ForwardHit.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 */ @@ -45,7 +45,7 @@ SimHitHandle_ForwardHit::SimHitHandle_ForwardHit(const SimulationHit * h) if (!h) VP1Msg::message("SimHitHandle_ForwardHit constructor ERROR: Received null hit pointer"); - m_link = HepMcParticleLink(m_d->thehit->trackID()); + m_link = HepMcParticleLink(m_d->thehit->trackID(), 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based } //____________________________________________________________________ diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_TrackRecord.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_TrackRecord.cxx index 9378a8959c7a142a17a7117b459797abc2739d16..1bf3a1d14caa6351b668f7bba2921c3e004c189c 100644 --- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_TrackRecord.cxx +++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/SimHitHandle_TrackRecord.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 */ @@ -27,7 +27,7 @@ SimHitHandle_TrackRecord::SimHitHandle_TrackRecord(const TrackRecord* tr) m_trkrecord(const_cast<TrackRecord*>(tr)), m_mom(m_trkrecord->GetMomentum().mag()), m_momdir( Amg::Hep3VectorToEigen( m_trkrecord->GetMomentum().unit() ) ), - m_link( new HepMcParticleLink(m_trkrecord->GetBarCode()))//NB: We assume an event index of 0 here!!! + m_link( new HepMcParticleLink(m_trkrecord->GetBarCode(), 0, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE))// FIXME barcode-based { }