// -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/RivetYODA.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/FastJets.hh" namespace Rivet { class JETVTXTEST : public Analysis { public: /// Constructor JETVTXTEST() : Analysis("JETVTXTEST") { } public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { addProjection(FinalState(), "FS"); addProjection(FastJets(FinalState(), FastJets::ANTIKT, 0.6), "Jets"); } /// Perform the per-event analysis void analyze(const Event& event) { ParticleVector ps = applyProjection(event, "FS").particles(); Jets jets = applyProjection(event, "Jets").jetsByPt(); MSG_INFO("FS particles"); foreach (const Particle& p, ps) { // if (p.genParticle().production_vertex() != 0) // MSG_INFO("FS particle has production vertex: " << p.genParticle().production_vertex()); if (p.genParticle().production_vertex() == 0) MSG_INFO("FS particle has no production vertex"); } if (jets.empty()) return; MSG_INFO("Jet particles"); foreach (const Particle& p, jets[0].particles()) { p.genParticle().print(); // if (p.genParticle().production_vertex() != 0) { // p.genParticle().production_vertex()->print(); // MSG_INFO("Jet particle has production vertex: " << p.genParticle().production_vertex()); // } if (p.genParticle().production_vertex() == 0) MSG_INFO("Jet particle has no production vertex"); } } //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(JETVTXTEST); }