]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/HepMC/SearchVector.cc
Adding include path to allow compilation of CleanGeom task
[u/mrichter/AliRoot.git] / TEvtGen / HepMC / SearchVector.cc
CommitLineData
0ca57c2f 1//////////////////////////////////////////////////////////////////////////
2// Author: Lynn Garren
3// search vectors for a GenParicle* instance
4//////////////////////////////////////////////////////////////////////////
5
6#include "HepMC/SearchVector.h"
7
8namespace HepMC {
9
10
11bool not_in_vector( std::vector<GenParticle*>* v, GenParticle* p )
12{
13 if( already_in_vector(v,p) == v->end() ) return true;
14 return false;
15}
16
17/// returns true if GenParticle is in the vector
18std::vector<HepMC::GenParticle*>::iterator already_in_vector( std::vector<GenParticle*>* v, GenParticle* p )
19{
20 // if the vectors are mostly large, the search should be coded differently
21 std::vector<GenParticle*>::iterator it;
22 for( it = v->begin(); it != v->end(); ++it ) {
23 // bail as soon as we find a match
24 if( (*it) == p ) return it;
25 }
26 return v->end();
27}
28
29} // HepMC