Vector in loop

Hi dear
I have int vector and loop over the size of this vector, and each elements at the vector has many elements. I need to delete element if one of the numbers has a certain value could you please help me with that.part of my code is below

vector particles = slowJet.constituents(ijet);// jet’s particles
int iSize = particles.size();

for( int injets=0; injets< iSize; ++injets){// loop over the particles inside the jets
if (abs(pythia.event[particles[injets]].id())!=13 ) njets.push_back(ijet);
if (abs(pythia.event[particles[injets]].id())==13 ) nmujets.push_back(ijet);
}

I do not know exactly what you are trying to do, but certainly is a general programming question and not specific to ROOT. Perhaps something like this would help you.

vector<int> particles = slowJet.constituents(ijet);// jet's particles
int iSize = particles.size();

bool hasmuon = false;
for( int p = 0; p < iSize; ++p) {  // loop over the particles inside the jets
  if (abs(pythia.event[particles[p]].id())==13 ) {
     hasmuon = true;
     break;
  }
}

if( hasmuon ) nmujets.push_back(ijet);
else          njets.push_back(ijet);