#include "Rivet/Analysis.hh" #include "Rivet/Projections/WFinder.hh" namespace Rivet { class MinimalAnalysis : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor MinimalAnalysis() : Analysis("MinimalAnalysis"){} //@} public: /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { addProjection(WFinder(FinalState(), (Cuts::abseta < 6) & (Cuts::pT > 20*GeV), PID::MUON, 0*GeV, 1000*GeV, 20*GeV), "W1"); addProjection(WFinder(FinalState(), (Cuts::abseta < 6) & (Cuts::pT > 20*GeV), PID::MUON, 0*GeV, 1000*GeV, 200*GeV), "W2"); } /// Perform the per-event analysis void analyze(const Event& event) { const WFinder& w1 = applyProjection(event, "W1"); if (w1.bosons().size() == 1) MSG_INFO("pT_nu1 = " << w1.constituentNeutrinos()[0].pT()/GeV << " GeV"); else MSG_INFO("No W1 found"); const WFinder& w2 = applyProjection(event, "W2"); if (w2.bosons().size() == 1) MSG_INFO("pT_nu2 = " << w2.constituentNeutrinos()[0].pT()/GeV << " GeV"); else MSG_INFO("No W2 found"); } //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(MinimalAnalysis); }