|
[Rivet] reading particles from the hepmc record with special status code '3'David Grellscheid david.grellscheid at durham.ac.ukThu May 19 08:33:48 BST 2016
Hi Raghav, can I suggest one more thing? Unless you need it for some other reason, please use a high status code (meaning "generator-specific") rather than "3" which is a generic comment. Tools are in principle permitted to skip processing the comments completely. Thanks, David On 18/05/2016 14:47, Frank Siegert wrote: > Dear Raghav, > > you could also (and more elegantly) use a modified FinalState > projection which selects status==3 particles instead of status==1. You > can embed such a projection also in a custom analysis module, I am > attaching an example to give you an idea. > > Cheers, > Frank > > > On 18 May 2016 at 13:48, Raghav Kunnawalkam Elayavalli > <raghav.k.e at cern.ch> wrote: >> 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 >> >> _______________________________________________ >> Rivet mailing list >> Rivet at projects.hepforge.org >> https://www.hepforge.org/lists/listinfo/rivet >> >> >> _______________________________________________ >> Rivet mailing list >> Rivet at projects.hepforge.org >> https://www.hepforge.org/lists/listinfo/rivet
More information about the Rivet mailing list |