diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h index 0329f3aa51561c651664bd108ecd2b8b646b70a2..080c2156d02bdca154e0f746d2061ec8e5d5a1a9 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfigMT_Tier0.h @@ -928,20 +928,17 @@ protected: int _ip = 0; /// count of particles in this interaction - int pid = (*evitr)->signal_process_id(); + int pid = HepMC::signal_process_id((*evitr)); - 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()); + //The logic should be clarified here + if ( pid!=0 ) { /// hooray! actually found a sensible event - while ( pitr!=pend ) { + for (auto pitr: *(*evitr) ) { - selectorTruth.selectTrack( *pitr ); + selectorTruth.selectTrack( pitr ); ++_ip; - - ++pitr; + } } diff --git a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfig_Tier0.h b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfig_Tier0.h index 99c320e463a8c360d24cd021a1adf2d738468376..6de9f6db838c9b523337d617854faa4590574f6f 100644 --- a/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfig_Tier0.h +++ b/Trigger/TrigAnalysis/TrigInDetAnalysisExample/TrigInDetAnalysisExample/T_AnalysisConfig_Tier0.h @@ -1089,20 +1089,17 @@ protected: int _ip = 0; /// count of particles in this interaction - int pid = (*evitr)->signal_process_id(); + int pid = HepMC::signal_process_id((*evitr)); - 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()); + //The logic should be clarified here + if ( pid!=0 ) { /// hooray! actually found a sensible event - while ( pitr!=pend ) { + for (auto pitr: *(*evitr)) { - selectorTruth.selectTrack( *pitr ); + selectorTruth.selectTrack( pitr ); ++_ip; - ++pitr; } }