diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/CompactHardTruth.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/CompactHardTruth.cxx
index 32d008c5c725f9c9f9d5663b86fd68886f468b74..ab1a3c583e6529ff6c5677bf0955a21b1741f6fd 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/CompactHardTruth.cxx
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkMCTruth/src/CompactHardTruth.cxx
@@ -458,9 +458,11 @@ StatusCode CompactHardTruth::execute() {
 
   if( doDebug ) ATH_MSG_DEBUG("Start parton thinning");
   while( moreP ){
-    if( doDebug ) ATH_MSG_DEBUG("New parton pass " <<inEvent <<" "
-                                <<thinEvt->particles_size() <<" " 
-                                <<thinEvt->vertices_size());
+#ifdef HEPMC3 
+    if( doDebug ) ATH_MSG_DEBUG("New parton pass " <<inEvent <<" "<<thinEvt->particles().size() <<" " <<thinEvt->vertices().size());
+#else
+    if( doDebug ) ATH_MSG_DEBUG("New parton pass " <<inEvent <<" "<<thinEvt->particles_size() <<" " <<thinEvt->vertices_size());
+#endif
 
     moreP = false;
     removePV.clear();
diff --git a/Simulation/FastSimulation/FastChainPileup/src/MultiParticleGunPileup.cxx b/Simulation/FastSimulation/FastChainPileup/src/MultiParticleGunPileup.cxx
index 833e49bb3281a51541fc4a261ad664b92d367d33..09bcbe38e5bb615c1f6d813adaad973a74061327 100644
--- a/Simulation/FastSimulation/FastChainPileup/src/MultiParticleGunPileup.cxx
+++ b/Simulation/FastSimulation/FastChainPileup/src/MultiParticleGunPileup.cxx
@@ -137,10 +137,10 @@ StatusCode MultiParticleGunPileup::callGenerator() {
 //-----------------------------------------
 
       // change the process ID to incorporate the BCID * 10000
-      int pid=evt->signal_process_id();
+      int pid=HepMC::signal_process_id(evt);
       evt->set_signal_process_id(pid+10000*bcid);
       ATH_MSG_DEBUG("Signal process ID " << pid << " set to " <<
-		    evt->signal_process_id() << " for BCID " << bcid);
+		    HepMC::signal_process_id(evt) << " for BCID " << bcid);
       m_evts.push_back(evt);
       ++m_ngen;
     }
diff --git a/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx b/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx
index 35cfe3374d8101628cf7ccb381911da18eb33c84..6e00ebcf27b49f63d14250a6d89206ede3d4d96e 100644
--- a/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx
+++ b/Simulation/FastSimulation/FastChainPileup/src/MultiPy8Pileup.cxx
@@ -106,10 +106,10 @@ StatusCode MultiPy8Pileup::callGenerator() {
 	HepMC::GenEvent* evt=new HepMC::GenEvent();
 	if (Pythia8_i::fillEvt(evt)==StatusCode::SUCCESS) {
 	  // change the process ID to incorporate the BCID * 10000
-	  int pid=evt->signal_process_id();
+	  int pid=HepMC::signal_process_id(evt);
 	  evt->set_signal_process_id(pid+10000*bcid);
 	  ATH_MSG_DEBUG("Signal process ID " << pid << " set to " <<
-			evt->signal_process_id() << " for BCID " << bcid);
+			HepMC::signal_process_id(evt) << " for BCID " << bcid);
 	  m_evts.push_back(evt);
 	  ++m_ngen;
 	} else {
diff --git a/Simulation/Overlay/OverlayCopyAlgs/src/CopyMcEventCollection.cxx b/Simulation/Overlay/OverlayCopyAlgs/src/CopyMcEventCollection.cxx
index 050abc34819d4ce3fae627d2f70129cd7cdcbc84..d504eb4d828663d48be236579f0b93158a148ec2 100644
--- a/Simulation/Overlay/OverlayCopyAlgs/src/CopyMcEventCollection.cxx
+++ b/Simulation/Overlay/OverlayCopyAlgs/src/CopyMcEventCollection.cxx
@@ -81,7 +81,7 @@ StatusCode CopyMcEventCollection::execute(const EventContext& ctx) const
     if (!outputContainer->empty()) {
       ATH_MSG_DEBUG("McEventCollection contents:");
       for (const HepMC::GenEvent *event : *outputContainer) {
-        ATH_MSG_DEBUG("  GenEvent #" << event->event_number() << ", signal_process_id=" << event->signal_process_id());
+        ATH_MSG_DEBUG("  GenEvent #" << event->event_number() << ", signal_process_id=" << HepMC::signal_process_id(event));
       }
     }
   }
diff --git a/Tracking/TrkValidation/TrkVertexFitterValidationUtils/src/TrkPriVxPurityTool.cxx b/Tracking/TrkValidation/TrkVertexFitterValidationUtils/src/TrkPriVxPurityTool.cxx
index 11f434ebc3e123ef710ac0f34bf4229e3809c2f7..b0effec98c423cf4b5e65be44ff9108ef912bbe8 100755
--- a/Tracking/TrkValidation/TrkVertexFitterValidationUtils/src/TrkPriVxPurityTool.cxx
+++ b/Tracking/TrkValidation/TrkVertexFitterValidationUtils/src/TrkPriVxPurityTool.cxx
@@ -60,7 +60,6 @@ namespace Trk {
 
 //analysis method
     const TrkPriVxPurity * TrkPriVxPurityTool::purity ( const Trk::VxCandidate * vertex ) const {
-//    std::cout<<" The purity method called"<<std::endl;
 //protection and related
         if ( vertex != 0 ) {
             const std::vector<Trk::VxTrackAtVertex *> * tracks = vertex->vxTrackAtVertex();
@@ -97,7 +96,6 @@ namespace Trk {
                                           ( *pv )->position().t() );
                 double pv_r = pv_pos.perp();
                 double pv_z = pv_pos.z();
-//    std::cout<<"Purity: Primary vertex position: "<<pv_pos<<std::endl;
 
 // storing all the ids of vertices reasonably close to the primary one.
 // here the region of interest is selected.
@@ -114,17 +112,6 @@ namespace Trk {
                     }//end of accepted vertices check
                 }//end  of loop over all the vertices
 
-//    std::cout<<"Actual number of merged vertices "<<vertex_ids.size()<<std::endl;
-                /*-------------------Some debug output-------------------------------------------------
-                  std::cout<<"Actual number of merged vertices "<<vertex_ids.size()<<std::endl;
-                  for( std::map<int,HepMC::GenVertex *>::const_iterator i = vertex_ids.begin();
-                  i != vertex_ids.end(); ++i)
-                  {
-                  HepMC::GenVertex * cev =(*i).second;
-                  std::cout<<"Selected GenVertex has event index: "<<cev->parent_event()->event_number() <<std::endl;
-                  }//end of debug loop over all the vertices
-                  //------------------ End of debug output ------------------------------------------------
-                  */
 
 //getting the track truth collection
                 const TrackParticleTruthCollection * trackParticleTruthCollection ( 0 );
@@ -147,8 +134,7 @@ namespace Trk {
                 std::vector<double> out_weights ( 0 );
                 std::vector<double> pu_weights ( 0 );
                 std::vector<double> no_correspondance ( 0 );
-	
-//        std::cout<< "Getting to the main loop"<<std::endl;
+
 
                 for ( ;vt!=ve;++vt ) {
 //original element link
@@ -163,7 +149,6 @@ namespace Trk {
                             if ( tr_part !=0  && tr_part->isValid()) {
 //                 ++total_size;
                 
-//		std::cout<< "Link non zero"<<std::endl;
 
                                 std::map< Rec::TrackParticleTruthKey, TrackParticleTruth>::const_iterator ttItr = trackParticleTruthCollection->end();
                   
@@ -178,29 +163,21 @@ namespace Trk {
                                     }
                                 }
                 
-//		std::cout<< "Find done"<<std::endl;
-			
+
                                 if (ttItr != trackParticleTruthCollection->end() ) {
-//		std::cout<< "Found correspondance"<<std::endl;
                                     const HepMcParticleLink& particleLink = ttItr->second.particleLink();
                                     const HepMC::GenParticle* genParticle = particleLink.cptr();
-//		 std::cout<<"GenParticle pointer: "<<  genParticle<<std::endl;
-		 
+
                                     if(genParticle !=0) {
                                         HepMC::GenEvent * tpEvent = genParticle->parent_event();
-		 
-//		  std::cout<<"Parent event "<<  tpEvent<<std::endl;
-		 
                                         if(tpEvent==genEvent) { 
                                             const HepMC::GenVertex * pVertex(0);
                                             if (genParticle!=0) pVertex = genParticle->production_vertex();
-		
                                             if ( pVertex != 0 ) {
                                                 int link_pid = genParticle->pdg_id();
                                                 bool primary_track = false;
                                                 bool secondary_track = false;
                   
-//		    std::cout<< "Decision loop starts"<<std::endl;
 //loop over the particles until decision is really taken
                                                 do {
                                                     int tvrt_code = pVertex->barcode();
diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/VertexSeedFinderTestAlg.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/VertexSeedFinderTestAlg.cxx
index 9c1ca66ebe0e9ec149c7731f3357635263b13dab..d931afeb637975742df6ad0e9b286b4ee8bb8a01 100644
--- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/VertexSeedFinderTestAlg.cxx
+++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/VertexSeedFinderTestAlg.cxx
@@ -287,13 +287,13 @@ StatusCode VertexSeedFinderTestAlg::execute()
 StatusCode
 VertexSeedFinderTestAlg::makeMcEventCollection (const EventContext& ctx) const
 {
-  auto evt1 = std::make_unique<HepMC::GenEvent>();
-  auto evt2 = std::make_unique<HepMC::GenEvent>();
-  auto evt3 = std::make_unique<HepMC::GenEvent>();
+  auto evt1 = new HepMC::GenEvent();
+  auto evt2 = new  HepMC::GenEvent();
+  auto evt3 = new HepMC::GenEvent();
 
-  evt1->set_signal_process_vertex (new HepMC::GenVertex({1*mm,   2*mm,  12*mm}));
-  evt2->set_signal_process_vertex (new HepMC::GenVertex({0.3*mm,-0.7*mm,-3*mm}));
-  evt3->set_signal_process_vertex (new HepMC::GenVertex({0.6*mm, 0.2*mm, 7*mm}));
+  HepMC::set_signal_process_vertex (evt1,HepMC::newGenVertexPtr(HepMC::FourVector{1*mm,   2*mm,  12*mm,0.0}));
+  HepMC::set_signal_process_vertex (evt2,HepMC::newGenVertexPtr(HepMC::FourVector{0.3*mm,-0.7*mm,-3*mm,0.0}));
+  HepMC::set_signal_process_vertex (evt3,HepMC::newGenVertexPtr(HepMC::FourVector{0.6*mm, 0.2*mm, 7*mm,0.0}));
  
   Athena_test::uniform_real_distribution<double> ptdist (0.1*GeV, 100*GeV);
   Athena_test::uniform_real_distribution<double> phidist (-M_PI, M_PI);
@@ -306,17 +306,17 @@ VertexSeedFinderTestAlg::makeMcEventCollection (const EventContext& ctx) const
     double e = pt*sinh(eta);
     double charge = etadist(rng) > 0 ? 1 : -1;
     HepMC::FourVector mom {pt*cos(phi), pt*sin(phi), e, e };
-    auto p = std::make_unique<HepMC::GenParticle> ( mom, charge * 11, 1 );
+    auto p = HepMC::newGenParticlePtr ( mom, charge * 11, 1 );
 
     double vrand = etadist(rng);
     if (vrand < 0) {
-      evt1->signal_process_vertex()->add_particle_out (p.release());
+      HepMC::signal_process_vertex(evt1)->add_particle_out (p);
     }
     else if (vrand < 3) {
-      evt2->signal_process_vertex()->add_particle_out (p.release());
+      HepMC::signal_process_vertex(evt2)->add_particle_out (p);
     }
     else {
-      evt3->signal_process_vertex()->add_particle_out (p.release());
+      HepMC::signal_process_vertex(evt3)->add_particle_out (p);
     }
   }