diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/MCTrueSeedFinder.h b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/MCTrueSeedFinder.h index c657e49cb65b7033102f5cca4ce490bedc440666..1b04c08ff3b29140d76de67afa9c53b195a54b38 100755 --- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/MCTrueSeedFinder.h +++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/TrkVertexSeedFinderTools/MCTrueSeedFinder.h @@ -105,7 +105,7 @@ namespace Trk bool pass( const HepMC::GenEvent* evt, const McEventCollection* coll = 0 ) const; /// Function selecting GenParticle objects - bool pass( const HepMC::GenParticle* part, + bool pass( HepMC::ConstGenParticlePtr part, const McEventCollection* coll = 0 ) const; StatusCode retrieveInteractionsInfo (std::vector<Amg::Vector3D>& interactions) const; diff --git a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/MCTrueSeedFinder.cxx b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/MCTrueSeedFinder.cxx index 55d7697af59ff8fa164f13a180f8eaf8d24932c6..77b1176e8b8ac0394d66b30540dbb06442b8176c 100755 --- a/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/MCTrueSeedFinder.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexSeedFinderTools/src/MCTrueSeedFinder.cxx @@ -223,7 +223,7 @@ namespace Trk return true; } - bool MCTrueSeedFinder::pass( const HepMC::GenParticle* part, + bool MCTrueSeedFinder::pass( HepMC::ConstGenParticlePtr part, const McEventCollection* coll ) const { // Check if the particle is coming from a "good" GenEvent: diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx index 5f93f5604a9111eb1d4fa14903ac16a3be29ca08..01f4bf4d7d72a30a56977dbf4a507a2fb426d0db 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/src/AnalysisConfigMT_Ntuple.cxx @@ -436,34 +436,14 @@ void AnalysisConfigMT_Ntuple::loop() { int pid = HepMC::signal_process_id((*evitr)); - // if ( (*evitr)->particles_size()>0 ) std::cout << "process " << "\tpid " << pid << std::endl; - - if ( pid!=0 && (*evitr)->particles_size()>0 ) { /// hooray! actually found a sensible event - - /// go through the particles - HepMC::GenEvent::particle_const_iterator pitr((*evitr)->particles_begin()); - HepMC::GenEvent::particle_const_iterator pend((*evitr)->particles_end()); - - while ( pitr!=pend ) { - - // int pdg_id = (*pitr)->pdg_id(); - // std::cout << ip++ << "\tparticle " << pdg_id << "\t" << "(*pitr)->pT()" << std::endl; - - //if tau job, only select if have a tau somewhere along chain, otherwise just add - if ( (m_TruthPdgId==15 && fromParent(m_TruthPdgId, *pitr)!=0) || m_TruthPdgId!=15 ) { - + if ( pid!=0 ) { /// hooray! actually found a sensible event + for(auto pitr: **evitr) { + if ( (m_TruthPdgId==15 && fromParent(m_TruthPdgId, pitr)!=0) || m_TruthPdgId!=15 ) { /// select the ones of interest - selectorTruth.selectTrack( *pitr ); + selectorTruth.selectTrack( pitr ); } - - ++_ip; - - ++pitr; - } - - } ++ie; diff --git a/graphics/VP1/VP1Systems/VP1VertexSystems/src/VP1TruthVertexCollection.cxx b/graphics/VP1/VP1Systems/VP1VertexSystems/src/VP1TruthVertexCollection.cxx index d091a94b7dc3b395cb37adcffef34c256f2e75cb..a37163a8a9ea680cbef85596b20619d176a52460 100644 --- a/graphics/VP1/VP1Systems/VP1VertexSystems/src/VP1TruthVertexCollection.cxx +++ b/graphics/VP1/VP1Systems/VP1VertexSystems/src/VP1TruthVertexCollection.cxx @@ -61,12 +61,12 @@ public: QString key; VP1TruthVertexCollection * theclass; VertexSysController*controller; - std::map <SoNode *, const HepMC::GenVertex *> nodeToVertexMap; + std::map <SoNode *, HepMC::ConstGenVertexPtr> nodeToVertexMap; SoLineSet * createCross(const double& x, const double& y, const double& z, const double& extent = 10*Gaudi::Units::mm ); // 10*CLHEP::mm ); class VertexHandle { public: - VertexHandle(const HepMC::GenVertex* v,VP1TruthVertexCollection::Imp * dd) : m_attached(false), m_vertex(v), m_line(0),m_d(dd) {} + VertexHandle(HepMC::ConstGenVertexPtr v,VP1TruthVertexCollection::Imp * dd) : m_attached(false), m_vertex(v), m_line(0),m_d(dd) {} ~VertexHandle() { if (m_line) m_line->unref(); } void recheckCutStatus() {