HepMC, HepMC::GenVertex::particle_iterator !=

Hello,

I am trying to loop over a particles mothers using the HepMC::GenVertex::particle_iterator class using ROOT 5.12/00. I get the following error,

root [0] .x /data/work/NewData/xQCDx8.C
100000
Error: operator!= not defined for HepMC::GenVertex::particle_iterator /data/work/NewData/xQCDx8.C:86:
*** Interpreter error recovered ***
root [1]

I do not have this problem with the HepMC::GenParticle::particle_iterator class. Does any one have any suggestions? Thank you for your time.

Mike

The code I am using is given below,

#include

void xQCDx8() {

gSystem->Load(“libFWCoreFWLite.so”);
AutoLibraryLoader::enable();

TChain chain(“Events”);
chain.Add("/data/work/NewData/bb_*");

int nevt = chain.GetEntries();

edm::HepMCProduct prod;

chain.GetEvent(0);
chain.SetBranchAddress(“edmHepMCProduct_source__PROD.obj”,&prod);

HepMC::GenParticle* Part = 0;
HepMC::GenParticle* Mom = 0;

HepMC::GenEvent::particle_iterator pit;

int treenumber = 0;

cout<<nevt<<endl;

for(int iev=0;ievpdg_id()) == 5 ) return 1;
return 0;
}
};

int N=0;
Isb isb;

for (pit=Evt->particles_begin(); pit!=Evt->particles_end(); pit++)
if ( isb(*pit) )
{

Part = (*pit);
//Part->print();
p_id = Part->ParticleID();
p_mom = Part->momentum().perp();
p_eta = Part->momentum().eta();
MotherPosition = Part->Mother();
MotherPosition2 = Part->SecondMother();
MotherTemp = 0;

N++;

//cout<<iev<<"\t"<<N<<"\t"<<p_id<<"\t"<<MotherPosition<<"\t"<< <production_vertex() )
{
HepMC::GenVertex::particle_iterator vit;
for ( vit = Part->production_vertex()->particles_begin(HepMC::parents) ;
vit != Part->production_vertex()->particles_end(HepMC::parents) ; vit++)
{Mom = (*vit)}
}
}
}
}

Most likely you do not have the dictionary for operator!= for HepMC::GenVertex::particle_iterator.
The easiest is problably to compile your script using ACliC (add include statement and do .x /data/work/NewData/xQCDx8.C+)

Cheers,
Philippe.