diff --git a/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.h b/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.h index f0fffcbc7d2e09fa8c86a69d98a2b8f7fc548dea..930cbe4bdf0919fedbe57c1cc9f48ef84b3ee89c 100644 --- a/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.h +++ b/Simulation/Barcode/BarcodeInterfaces/BarcodeInterfaces/IBarcodeSvc.h @@ -45,12 +45,6 @@ namespace Barcode { /** Generate a new unique vertex barcode below the simulation offset */ virtual int newGeneratedVertex() = 0; - /** Generate a common barcode which will be shared by all children - of the given parent barcode (used for child particles which are - not stored in the mc truth event) */ - virtual int sharedChildBarcode( int parentBC, - int process=0 ) = 0; - /** Inform the BarcodeSvc about the largest particle and vertex Barcodes in the event input */ virtual void registerLargestGeneratedParticleBC( int bc) = 0; diff --git a/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.h b/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.h index de8a828495017634a48e0c2a827ff95539e156aa..3b3d2240ce20a28b4870e16334aabab7091dd657 100644 --- a/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.h +++ b/Simulation/Barcode/BarcodeServices/BarcodeServices/LegacyBarcodeSvc.h @@ -59,12 +59,6 @@ namespace Barcode { /** Generate a new unique vertex barcode below the simulation offset */ virtual int newGeneratedVertex() override; - /** Generate a common barcode which will be shared by all children - of the given parent barcode (used for child particles which are - not stored in the mc truth event) */ - virtual int sharedChildBarcode( int parentBC, - int process=0 ) override; - /** Inform the BarcodeSvc about the largest particle and vertex Barcodes in the event input */ virtual void registerLargestGeneratedParticleBC( int bc) override; diff --git a/Simulation/Barcode/BarcodeServices/BarcodeServices/ValidationBarcodeSvc.h b/Simulation/Barcode/BarcodeServices/BarcodeServices/ValidationBarcodeSvc.h index 71dbdc605e7d32069cf75eaef1b8f71bbf99b86f..27d6e584d642cee8f4d5f29ae5a637bd4be4438e 100644 --- a/Simulation/Barcode/BarcodeServices/BarcodeServices/ValidationBarcodeSvc.h +++ b/Simulation/Barcode/BarcodeServices/BarcodeServices/ValidationBarcodeSvc.h @@ -59,12 +59,6 @@ namespace Barcode { /** Generate a new unique vertex barcode below the simulation offset */ virtual int newGeneratedVertex() override; - /** Generate a common barcode which will be shared by all children - of the given parent barcode (used for child particles which are - not stored in the mc truth event) */ - virtual int sharedChildBarcode( int parentBC, - int process=0 ) override; - /** Return the secondary particle and vertex offsets */ virtual int secondaryParticleBcOffset() const override; virtual int secondaryVertexBcOffset() const override; diff --git a/Simulation/Barcode/BarcodeServices/src/LegacyBarcodeSvc.cxx b/Simulation/Barcode/BarcodeServices/src/LegacyBarcodeSvc.cxx index 602c0dbb65d8f3d8e78cbae1d71478522c392e4b..942ea502498dd3c9f342815c0192205e384eb190 100644 --- a/Simulation/Barcode/BarcodeServices/src/LegacyBarcodeSvc.cxx +++ b/Simulation/Barcode/BarcodeServices/src/LegacyBarcodeSvc.cxx @@ -172,17 +172,6 @@ int Barcode::LegacyBarcodeSvc::newGeneratedParticle(int) } -/** Generate a common barcode which will be shared by all children - of the given parent barcode (used for child particles which are - not stored in the mc truth event) */ -int Barcode::LegacyBarcodeSvc::sharedChildBarcode( int /* parentBC */, - int /* process */) -{ - // concept of shared barcodes not present in MC12 yet - return HepMC::UNDEFINED_ID; -} - - void Barcode::LegacyBarcodeSvc::registerLargestGeneratedParticleBC( int bc ) { ATH_MSG_DEBUG( "registering largest generated particle barcode" ); BarcodeInfo& barcodeInfo = getBarcodeInfo(); diff --git a/Simulation/Barcode/BarcodeServices/src/ValidationBarcodeSvc.cxx b/Simulation/Barcode/BarcodeServices/src/ValidationBarcodeSvc.cxx index 66343156adff5a4320e3d8035f9f28004d63d537..442cf95f1466a864adb58281ff05be94043111ec 100644 --- a/Simulation/Barcode/BarcodeServices/src/ValidationBarcodeSvc.cxx +++ b/Simulation/Barcode/BarcodeServices/src/ValidationBarcodeSvc.cxx @@ -118,16 +118,6 @@ int Barcode::ValidationBarcodeSvc::newGeneratedVertex() } -/** Generate a common barcode which will be shared by all children - of the given parent barcode (used for child particles which are - not stored in the mc truth event) */ -int Barcode::ValidationBarcodeSvc::sharedChildBarcode( int parentBC, - int /* process */) -{ - return parentBC+m_barcodeGenerationOffset; -} - - /** Return the secondary particle offset */ int Barcode::ValidationBarcodeSvc::secondaryParticleBcOffset() const { diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h index 891d30f054625202af3c5546f47311c19fb9da07..b6630c29a441cde8a0dff1cf0c068259839c2197 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFParticle.h @@ -157,8 +157,6 @@ namespace ISF { int barcode() const; // FIXME barcode-based /** set a new barcode */ void setBarcode(int bc); // FIXME barcode-based - /** set a new barcode and update the HepMcParticleLink */ - void setBarcodeAndUpdateHepMcParticleLink(int bc); // FIXME barcode-based TODO Update this method to use the unique ID rather than the barcode. /** unique ID */ int id() const; diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h index ea6607dda9b59c51af7d5f3264940dda606896a9..95c9c3996fbf51c98cf3197f00bfbb6d78b1a545 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ISFTruthIncident.h @@ -96,8 +96,6 @@ namespace ISF { simulation) - TODO only a dummy implementation currently */ virtual HepMC::GenParticlePtr updateChildParticle(unsigned short index, HepMC::GenParticlePtr existingChild) const override final; - /** Set the the barcode of all child particles to the given bc */ - void setAllChildrenBarcodes(int bc) override final; private: ISFTruthIncident(); diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h index f1cba57d258f64ef23c25cf13434cca8aacdb7fd..de2b88112090799fc61b53a0837122e04411aab0 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h @@ -114,8 +114,6 @@ namespace ISF { simulation). */ virtual HepMC::GenParticlePtr updateChildParticle(unsigned short index, HepMC::GenParticlePtr existingChild) const = 0; - /** Set the the barcode of all child particles to the given bc */ - virtual void setAllChildrenBarcodes(int bc) = 0; /** Record that a particular child passed a check */ inline void setChildPassedFilters(unsigned short index); diff --git a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx index c0d619ddae1bc822a3c3bf6369d364618bdf5761..3055b76268569c5d04cb26769b2657d2c66542b2 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFParticle.cxx @@ -267,18 +267,3 @@ bool ISF::ISFParticle::isIdent(const ISF::ISFParticle& rhs) const pass &= m_partLink == rhs.getParticleLink(); return pass; } - -void ISF::ISFParticle::setBarcodeAndUpdateHepMcParticleLink( int bc) { - // set a new barcode - setBarcode(bc); - - //creating/changing the ISFParticle's HepMcParticleLink - HepMcParticleLink* newHMPL = nullptr; - if (m_partLink) { - newHMPL = new HepMcParticleLink(bc, m_partLink->eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based - delete m_partLink; - } else { - 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_Event/src/ISFTruthIncident.cxx b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx index 6e4d77c719204f85c25a330fff8f7f4459884512..b7b31cf2686c9039b58a85336c05b092971f55d1 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Event/src/ISFTruthIncident.cxx @@ -164,19 +164,6 @@ HepMC::GenParticlePtr ISF::ISFTruthIncident::updateChildParticle(unsigned short return existingChild; } -void ISF::ISFTruthIncident::setAllChildrenBarcodes(int bc) { - unsigned short numSec = numberOfChildren(); - for (unsigned short i=0; i<numSec; i++) { - // the current particle - ISF::ISFParticle *p = m_children[i]; - - // set a new barcode and update the ISFParticle's HMPL - p->setBarcodeAndUpdateHepMcParticleLink(bc); - } - - return; -} - /** return attached truth particle */ HepMC::GenParticlePtr ISF::ISFTruthIncident::getHepMCTruthParticle( ISF::ISFParticle& particle ) const { diff --git a/Simulation/ISF/ISF_Core/ISF_Event/test/ISFTruthIncident_test.cxx b/Simulation/ISF/ISF_Core/ISF_Event/test/ISFTruthIncident_test.cxx index 2c571ee230ae14a63bb4c3a79c2bc2eb236f73d4..cd4c697855de969e643541e0397e349ef2347910 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/test/ISFTruthIncident_test.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Event/test/ISFTruthIncident_test.cxx @@ -330,17 +330,6 @@ namespace MCTesting { } - TEST_F(ISFTruthIncident_test, testSetAllChildrenBarcodes) { - - int newBarcode = 42; - unsigned short numSec = m_truthIncident->numberOfChildren(); - m_truthIncident->setAllChildrenBarcodes(newBarcode); - for (unsigned short index=0; index<numSec; index++) { - ASSERT_EQ(m_truthIncident->childBarcode(index), newBarcode); - } - - } - } // <-- namespace MCTesting diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx index 1daebd9e66fceb717e707ec326d356d7a06273a4..2c63fcb7fd22737db4dfd697360d7516dd393892 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.cxx @@ -190,8 +190,6 @@ void ISF::TruthSvc::registerTruthIncident( ISF::ITruthIncident& ti, bool saveAll } - // -> assign shared barcode to all child particles (if barcode service supports it) - setSharedChildParticleBarcode( ti); } return; @@ -360,21 +358,3 @@ HepMC::GenVertexPtr ISF::TruthSvc::createGenVertexFromTruthIncident( ISF::ITrut return parent->end_vertex(); } - -/** Set shared barcode for child particles particles */ -void ISF::TruthSvc::setSharedChildParticleBarcode( ISF::ITruthIncident& ti) const { - int processCode = ti.physicsProcessCode(); - int parentBC = ti.parentBarcode(); - - ATH_MSG_VERBOSE ( "End Vertex representing process: " << processCode << ". TruthIncident failed cuts. Skipping."); - - // generate one new barcode for all child particles - int childBC = m_barcodeSvc->sharedChildBarcode( parentBC, processCode); - - // propagate this barcode into the TruthIncident only if - // it is a proper barcode, ie !=fUndefinedBarcode - if (childBC != HepMC::UNDEFINED_ID) { - ti.setAllChildrenBarcodes( childBC ); - } -} - diff --git a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h index bdaf2f267017fdce54cf87ca1805394d66c5e430..5b5ea9c0fb344a17007c6b4018c2673d8b463492 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h +++ b/Simulation/ISF/ISF_Core/ISF_Services/src/TruthSvc.h @@ -80,9 +80,6 @@ namespace ISF { /** Record and end vertex to the MC Truth for the parent particle */ HepMC::GenVertexPtr createGenVertexFromTruthIncident( ITruthIncident& truthincident) const; - /** Set shared barcode for child particles */ - void setSharedChildParticleBarcode( ITruthIncident& truthincident) const; - ServiceHandle<Barcode::IBarcodeSvc> m_barcodeSvc{this, "BarcodeSvc", "BarcodeSvc", ""}; //!< The Barcode service /** the truth strategies applied (as AthenaToolHandle Array) */ diff --git a/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx b/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx index 25bf645191be308a7e18b6af1d85dfd0ff0a282f..814b5d3c9c9781cf86a495c21798d6454e4136ee 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Services/test/TruthSvc_test.cxx @@ -127,8 +127,6 @@ namespace ISFTesting { simulation). */ virtual HepMC::GenParticlePtr updateChildParticle(unsigned short, HepMC::GenParticlePtr ) const override {return nullptr;}; - /** Set the the barcode of all child particles to the given bc */ - virtual void setAllChildrenBarcodes(int) override {}; private: const HepMC::FourVector m_myPosition{0.0, 40.0, 0.0, 40.0}; }; @@ -408,13 +406,6 @@ namespace ISFTesting { anEvent->set_beam_particles(inParticle1,inParticle2); MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); - EXPECT_CALL(ti, physicsProcessCode()) - .Times(1) - .WillOnce(::testing::Return(21)); - EXPECT_CALL(ti, parentBarcode()) - .Times(1) - .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); - registerTruthIncident(ti); HepMC::GenVertexPtr generated = HepMC::barcode_to_vertex(anEvent.get(),-200001); //Find a nicer way to get this. HepMC::GenVertexPtr expectedVtx(nullptr); @@ -456,12 +447,10 @@ namespace ISFTesting { MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); HepMC::FourVector vtxPosition(0.0, 40.0, 0.0, 40.0); EXPECT_CALL(ti, physicsProcessCode()) - .Times(2) - .WillOnce(::testing::Return(21)) + .Times(1) .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) - .Times(2) - .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .Times(1) .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); EXPECT_CALL(ti, parentParticle()) .Times(1) @@ -532,12 +521,10 @@ namespace ISFTesting { MockTruthIncident ti(AtlasDetDescr::fAtlasID, 2); HepMC::FourVector vtxPosition(0.0, 40.0, 0.0, 40.0); EXPECT_CALL(ti, physicsProcessCode()) - .Times(2) - .WillOnce(::testing::Return(21)) + .Times(1) .WillOnce(::testing::Return(21)); EXPECT_CALL(ti, parentBarcode()) - .Times(2) - .WillOnce(::testing::Return(HepMC::barcode(inParticle3))) + .Times(1) .WillOnce(::testing::Return(HepMC::barcode(inParticle3))); EXPECT_CALL(ti, parentParticle()) .Times(1) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h index 29953205b580f2242932025c1163c0524e532b32..cc3abbb47c57ae70fdd93f931278fbc0a59653fd 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/ISF_Geant4Event/Geant4TruthIncident.h @@ -86,8 +86,6 @@ namespace iGeant4 { int childPdgCode(unsigned short index) const override final; /** Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise return 0 */ int childBarcode(unsigned short index) const override final; // TODO Remove - only used in one place in TruthSvc - /** Set the the barcode of all child particles to the given bc */ - void setAllChildrenBarcodes(int bc) override final; /** The interaction classifications are described as follows: STD_VTX: interaction of a particle without a pre-defined decay; diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx index 323d0f65de0c23d757003357fd670c0067070497..58ae74a761c4346b010a9f890cf4c4b206c79885 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/Geant4TruthIncident.cxx @@ -226,12 +226,6 @@ int iGeant4::Geant4TruthIncident::childBarcode(unsigned short index) const { return 0; } -void iGeant4::Geant4TruthIncident::setAllChildrenBarcodes(int) { - G4ExceptionDescription description; - description << G4String("setAllChildrenBarcodes: ") + "Shared child particle barcodes are not implemented in ISF_Geant4 at this point."; - G4Exception("iGeant4::Geant4TruthIncident", "NotImplemented", FatalException, description); -} - HepMC::GenParticlePtr iGeant4::Geant4TruthIncident::childParticle(unsigned short i, int newBarcode) { // the G4Track instance for the current child particle