|
[Rivet] reading particles from the hepmc record with special status code '3'Raghav Kunnawalkam Elayavalli raghav.k.e at cern.chWed May 18 12:48:05 BST 2016
Hey, Sorry for the multiple emails, I think i finally figured out how to properly type cast the GenParticle object /// get the scattered particles from the gen event: vector <HepMC::GenParticle*> pscat; foreach (const HepMC::GenParticle* p, particles(event.genEvent())) { if(p->status() == 3) pscat.push_back((HepMC::GenParticle*)p); } std::cout<<"There are a total of "<<pscat.size()<<" scattered particles"<<std::endl; /// print scattered particle information for(unsigned ip = 0; ip<pscat.size(); ++ip){ std::cout<<"Start of particle **************"<<std::endl; pscat[ip]->print(); } this works! This way we can also include the any additional particles in our modded hepMC file to work out. Again, i apologize for the many emails. Cheers Raghav > On May 18, 2016, at 11:59 AM, Raghav Kunnawalkam Elayavalli <raghav.k.e at cern.ch> wrote: > > Dear Rivet experts, > > Now this is a bit of a follow up from my previous questions about reading from the hepMC record. Instead of the individual partons, we are adding an additional set of particles with the status code '3' to our hepMC file. These particles are essentially those from our medium that interacted with the final state objects from the hard scatter. > > Im messing it up in my c++ implementation since this should be doable in the latest rivet setup yes? to have something like this in my analyze method: > > /// get the scattered particles from the gen event: > vector <HepMC::GenParticle> pscat; > foreach (const HepMC::GenParticle* p, particles(event.genEvent())) { > // if(p.status() == 3) > pscat.push_back(p); > } > > std::cout<<"There are a total of "<<pscat.size()<<" scattered particles"<<std::endl; > /// print scattered particle information > for(unsigned ip = 0; ip<pscat.size(); ++ip){ > std::cout<<"Start of particle **************"<<std::endl; > pscat[ip].print(); > } > pscat.clear(); > > > Thanks a lot for your help! > > Cheers > Raghav
More information about the Rivet mailing list |