diff --git a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx index 0678534f6ba3df99d681a4d7d64808f7b31f9025..e60ec1590a2b16fde5b302e5397a7a67984b62da 100644 --- a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx +++ b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.cxx @@ -339,7 +339,8 @@ HepMC::GenEvent * LArFastShower::GetGenEvent(const G4FastTrack &fastTrack) if (pdgcode < 0) pdgcode = -pdgcode; // hack for positrons. let it be electrons. // new event. Signal processing = 0, event number "next" - HepMC::GenEvent* ge = new HepMC::GenEvent( 0, ++m_eventNum); + HepMC::GenEvent* ge = new HepMC::GenEvent(); + ge->set_event_number(++m_eventNum); // vertex. Position of the shower, time = 0 HepMC::GenVertexPtr gv = HepMC::newGenVertexPtr( HepMC::FourVector(showerPos.x(), showerPos.y(), showerPos.z(), 0) ); diff --git a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.h b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.h index f8d4a87abcd3cd5916df8a3331b2dab9cd992c65..dddb5629e259f33029ba9ec3bc626b656363a885 100644 --- a/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.h +++ b/LArCalorimeter/LArG4/LArG4FastSimulation/src/LArFastShower.h @@ -17,7 +17,7 @@ // Forward declarations #include "AtlasHepMC/GenEvent_fwd.h" -#include "AtlasHepMC/IO_GenEvent_fwd.h" +#include "AtlasHepMC/IO_GenEvent.h" class IFastSimDedicatedSD; class ILArG4ShowerLibSvc; diff --git a/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h b/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h index 83c1f4141be18cf7cf2c8c186261f6477cddd6db..88d81b5d80e2c40018578ac5426d16112857e88e 100644 --- a/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h +++ b/Simulation/BeamEffects/src/BeamSpotReweightingAlg.h @@ -24,11 +24,7 @@ // Forward declarations #include "AtlasHepMC/GenEvent_fwd.h" - -namespace HepMC -{ - class GenVertex; -} +#include "AtlasHepMC/GenVertex_fwd.h" namespace Simulation { diff --git a/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx b/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx index ba6588c726880469163682dbd3e8a5e4708d38a8..218d91e783df1a18c485d354955ba2b3f394cb51 100644 --- a/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx +++ b/Simulation/BeamEffects/src/ZeroLifetimePositioner.cxx @@ -82,35 +82,35 @@ StatusCode Simulation::ZeroLifetimePositioner::manipulate(HepMC::GenEvent& ge, b ATH_MSG_DEBUG("Found a vertex to correct with incoming PDG code = " << pdgIn); ATH_MSG_VERBOSE("Next Vertex:"); if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) { - nextVtx->print(); + HepMC::Print::line(nextVtx); } const HepMC::FourVector &nextVec = nextVtx->position(); const CLHEP::HepLorentzVector nextPos( nextVec.x(), nextVec.y(), nextVec.z(), nextVec.t() ); ATH_MSG_VERBOSE("Current Vertex:"); if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) { - curVtx->print(); + HepMC::Print::line(curVtx); } if (applyPatch) { HepMC::GenVertexPtr prevVtx = curVtx->particles_in().front()->production_vertex(); ATH_MSG_VERBOSE("Previous Vertex:"); if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) { - prevVtx->print(); + HepMC::Print::line(prevVtx); } const HepMC::FourVector &prevVec = prevVtx->position(); const CLHEP::HepLorentzVector prevPos( prevVec.x(), prevVec.y(), prevVec.z(), prevVec.t() ); CLHEP::HepLorentzVector newPos = 0.5*(prevPos+nextPos); - curVtx->set_position(newPos); + curVtx->set_position(HepMC::FourVector(newPos.x(),newPos.y(),newPos.z(),newPos.t())); ATH_MSG_DEBUG("Revised current Vertex"); if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) { - curVtx->print(); + HepMC::Print::line(curVtx); } } if (removePatch) { CLHEP::HepLorentzVector newPos = nextPos; - curVtx->set_position(newPos); + curVtx->set_position(HepMC::FourVector(newPos.x(),newPos.y(),newPos.z(),newPos.t())); ATH_MSG_DEBUG("Revised current Vertex"); if (ATH_UNLIKELY(this->msgLvl (MSG::VERBOSE))) { - curVtx->print(); + HepMC::Print::line(curVtx); } } } diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimHitTreeCreator.cxx b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimHitTreeCreator.cxx index 5ecfb37021a044d45d641e23c00dcc1e2a474c93..e8d4d417193d920bf935324c64fed6b5b5042182 100644 --- a/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimHitTreeCreator.cxx +++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/src/SimHitTreeCreator.cxx @@ -309,7 +309,8 @@ StatusCode ISF::SimHitTreeCreator::fillSimHitsTree() //** Add information from HepMcParticleLink to TTree - common for all SimHit types */ void ISF::SimHitTreeCreator::addHepMcParticleLinkInfoToTree(HepMcParticleLink &HMPL) { if (HMPL.isValid()) { - m_momentum = (HMPL.cptr())->momentum().rho(); + auto t_mom=(HMPL.cptr())->momentum(); + m_momentum = std::sqrt( t_mom.x()*t_mom.x()+t_mom.y()*t_mom.y()+t_mom.z()*t_mom.z()); m_eta= (HMPL.cptr())->momentum().eta(); m_theta= (HMPL.cptr())->momentum().theta(); m_phi = (HMPL.cptr())->momentum().phi(); diff --git a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h index 69ed5994ff622a12c444542562173c303716e3d9..903b6c6a266c95c0a02afb8f8638508fabcd0950 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/HepMCHelper.h @@ -18,6 +18,7 @@ // HepMC includes #include "AtlasHepMC/GenRanges.h" #include "AtlasHepMC/GenVertex.h" +#include "AtlasHepMC/IteratorRange.h" // forward declarations #include "AtlasHepMC/GenParticle_fwd.h" 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 843d0645c6f6b747c12d90c0551d196121b8b69a..27254707a2edffda8635034f49c8d85822551a08 100644 --- a/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h +++ b/Simulation/ISF/ISF_Core/ISF_Event/ISF_Event/ITruthIncident.h @@ -17,7 +17,7 @@ // forward declarations #include "AtlasHepMC/GenParticle_fwd.h" -#include "AtlasHepMC/SimpleVector_fwd.h" +#include "AtlasHepMC/SimpleVector.h" namespace ISF { diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/CylinderVolumeTruthStrategy.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/CylinderVolumeTruthStrategy.cxx index 846a7cd4e812c781e28f6df05d133c23b54ac53a..be3a1e46c50b2e70e86231743cdd710330079459 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/CylinderVolumeTruthStrategy.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/CylinderVolumeTruthStrategy.cxx @@ -59,7 +59,8 @@ StatusCode ISF::CylinderVolumeTruthStrategy::finalize() bool ISF::CylinderVolumeTruthStrategy::pass( ITruthIncident& ti) const { // the current truth incident radius - double r = ti.position().rho(); + auto t_pos=ti.position(); + double r = std::sqrt(t_pos.x()*t_pos.x()+t_pos.y()*t_pos.y()+t_pos.z()*t_pos.z()); // is the current radius on the surface? bool onSurf = (r>m_ri) && (r<m_ro);