|
[Rivet] reading particles from the hepmc record with special status code '3'Frank Siegert frank.siegert at cern.chWed May 18 13:47:24 BST 2016
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: MC_STATUS3TEST.cc Type: text/x-c++src Size: 2871 bytes Desc: not available URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20160518/475b4bce/attachment.cc>
More information about the Rivet mailing list |