|
[Rivet-svn] r1791 - in trunk: . include/Rivet include/Rivet/Analyses src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Aug 31 12:51:00 BST 2009
Author: buckley Date: Mon Aug 31 12:51:00 2009 New Revision: 1791 Log: Removing headers for most MC_ analysis class (MC_JetAnalysis remains) Deleted: trunk/include/Rivet/Analyses/MC_LHC_DIJET.hh trunk/include/Rivet/Analyses/MC_LHC_LEADINGJETS.hh trunk/include/Rivet/Analyses/MC_LHC_ZANALYSIS.hh trunk/include/Rivet/Analyses/MC_TVT1960_PHOTONJETS.hh trunk/include/Rivet/Analyses/MC_TVT1960_ZJETS.hh Modified: trunk/ChangeLog trunk/include/Rivet/Makefile.am trunk/src/Analyses/MC_LHC_DIJET.cc trunk/src/Analyses/MC_LHC_LEADINGJETS.cc trunk/src/Analyses/MC_LHC_ZANALYSIS.cc trunk/src/Analyses/MC_TVT1960_PHOTONJETS.cc trunk/src/Analyses/MC_TVT1960_ZJETS.cc Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Mon Aug 31 11:52:47 2009 (r1790) +++ trunk/ChangeLog Mon Aug 31 12:51:00 2009 (r1791) @@ -1,6 +1,6 @@ 2009-08-31 Andy Buckley <andy at insectnation.org> - * Removing headers for PDG analyses. + * Removing headers for PDG analyses and MC analyses. * Removing headers for STAR analyses. Modified: trunk/include/Rivet/Makefile.am ============================================================================== --- trunk/include/Rivet/Makefile.am Mon Aug 31 11:52:47 2009 (r1790) +++ trunk/include/Rivet/Makefile.am Mon Aug 31 12:51:00 2009 (r1791) @@ -40,12 +40,7 @@ Analyses/OPAL_1998_S3780481.hh \ Analyses/OPAL_2004_S6132243.hh \ Analyses/ZEUS_2001_S4815815.hh \ - Analyses/MC_TVT1960_PHOTONJETS.hh \ - Analyses/MC_TVT1960_ZJETS.hh \ - Analyses/MC_JetAnalysis.hh \ - Analyses/MC_LHC_LEADINGJETS.hh \ - Analyses/MC_LHC_ZANALYSIS.hh \ - Analyses/MC_LHC_DIJET.hh + Analyses/MC_JetAnalysis.hh ## Projections Modified: trunk/src/Analyses/MC_LHC_DIJET.cc ============================================================================== --- trunk/src/Analyses/MC_LHC_DIJET.cc Mon Aug 31 11:52:47 2009 (r1790) +++ trunk/src/Analyses/MC_LHC_DIJET.cc Mon Aug 31 12:51:00 2009 (r1791) @@ -1,98 +1,119 @@ +// -*- C++ -*- #include "Rivet/Analysis.hh" +#include "Rivet/RivetAIDA.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/ChargedFinalState.hh" -#include "Rivet/AnalysisLoader.hh" -#include "Rivet/RivetAIDA.hh" -#include "Rivet/Rivet.hh" #include "Rivet/Projections/FastJets.hh" -#include "Rivet/Analyses/MC_LHC_DIJET.hh" namespace Rivet { - /// Default constructor - MC_LHC_DIJET::MC_LHC_DIJET() - : Analysis("MC_LHC_DIJET") { - FinalState fs; - ChargedFinalState cfs; - addProjection(fs, "FS"); - addProjection(cfs, "CFS"); - addProjection(FastJets(fs, FastJets::KT, 0.7), "Jets"); - addProjection(FastJets(cfs, FastJets::KT, 0.7), "ChargedJets"); - } - - - /// @name Analysis methods - //@{ - void MC_LHC_DIJET::init() { - _hist_jetcount = bookHistogram1D("d01-x01-y01", 5, 0., 10.); - _hist_jetpt = bookHistogram1D("d02-x01-y01", 30, 30.,100.); - _hist_jetptlog = bookHistogram1D("d03-x01-y01", 20, 0.,8.); - _hist_leadingjetpt = bookHistogram1D("d04-x01-y01", 25, 30.,100.); - _hist_secondleadingjetpt = bookHistogram1D("d05-x01-y01", 25, 30.,100.); - _hist_jetphi = bookHistogram1D("d06-x01-y01",24, 0., 6.4); - _hist_jeteta = bookHistogram1D("d07-x01-y01", 30, -6., 6.); - _hist_jetdphi = bookHistogram1D("d08-x01-y01", 24, 0., 6.4); - _hist_jetdeta = bookHistogram1D("d09-x01-y01", 24, 0., 6.); - _hist_chargemultiplicity = bookHistogram1D("d10-x01-y01",30, 0.5, 250.5); - _hist_chargemeanpt = bookHistogram1D("d11-x01-y01", 25, 0., 10.); - _hist_chargept = bookHistogram1D("d12-x01-y01", 32, 0., 25.); - _hist_chargelogpt = bookHistogram1D("d13-x01-y01", 32, 0., 6.); - _hist_chargermspt = bookHistogram1D("d14-x01-y01", 32, 0., 10.); - } + class MC_LHC_DIJET : public Analysis { + public: + /// Default constructor + MC_LHC_DIJET() + : Analysis("MC_LHC_DIJET") { + FinalState fs; + ChargedFinalState cfs; + addProjection(fs, "FS"); + addProjection(cfs, "CFS"); + addProjection(FastJets(fs, FastJets::KT, 0.7), "Jets"); + addProjection(FastJets(cfs, FastJets::KT, 0.7), "ChargedJets"); + } + + + /// @name Analysis methods + //@{ - void MC_LHC_DIJET::analyze(const Event& event) { - const FastJets& fastjets = applyProjection<FastJets>(event, "Jets"); - const Jets jets = fastjets.jetsByPt(20.); - const double weight = event.weight(); - - if (jets.size() < 2 || jets.size() >= 3) vetoEvent; - const double angle = fabs(jets[1].momentum().azimuthalAngle() - jets[0].momentum().azimuthalAngle()); - const double prapidity = fabs(jets[1].momentum().pseudorapidity() - jets[0].momentum().pseudorapidity()); - _hist_jetcount->fill(jets.size(), weight); - _hist_leadingjetpt->fill(jets[0].momentum().pT(), weight); - _hist_secondleadingjetpt->fill(jets[1].momentum().pT(), weight); - _hist_jetdphi->fill(angle , weight); - _hist_jetdeta->fill(prapidity, weight); - - foreach(Jet j, fastjets.jetsByPt(20*GeV)) { - _hist_jetpt->fill(j.momentum().pT(), weight); - _hist_jetptlog->fill(log(j.momentum().pT()), weight); - _hist_jetphi->fill(j.momentum().azimuthalAngle(), weight); - _hist_jeteta->fill(j.momentum().pseudorapidity(), weight); + void init() { + _hist_jetcount = bookHistogram1D("d01-x01-y01", 5, 0., 10.); + _hist_jetpt = bookHistogram1D("d02-x01-y01", 30, 30.,100.); + _hist_jetptlog = bookHistogram1D("d03-x01-y01", 20, 0.,8.); + _hist_leadingjetpt = bookHistogram1D("d04-x01-y01", 25, 30.,100.); + _hist_secondleadingjetpt = bookHistogram1D("d05-x01-y01", 25, 30.,100.); + _hist_jetphi = bookHistogram1D("d06-x01-y01",24, 0., 6.4); + _hist_jeteta = bookHistogram1D("d07-x01-y01", 30, -6., 6.); + _hist_jetdphi = bookHistogram1D("d08-x01-y01", 24, 0., 6.4); + _hist_jetdeta = bookHistogram1D("d09-x01-y01", 24, 0., 6.); + _hist_chargemultiplicity = bookHistogram1D("d10-x01-y01",30, 0.5, 250.5); + _hist_chargemeanpt = bookHistogram1D("d11-x01-y01", 25, 0., 10.); + _hist_chargept = bookHistogram1D("d12-x01-y01", 32, 0., 25.); + _hist_chargelogpt = bookHistogram1D("d13-x01-y01", 32, 0., 6.); + _hist_chargermspt = bookHistogram1D("d14-x01-y01", 32, 0., 10.); } - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); - // const FastJets& cfastjets = applyProjection<FastJets>(event, "ChargedJets"); - // const Jets cjets = cfastjets.jetsByPt(20.); - double meanpt = 0.; - double rmspt = 0.; - // foreach(Jet cj, cfastjets.jetsByPt(20.)){ - _hist_chargemultiplicity->fill(cfs.particles().size(), weight); - foreach(Particle cp, cfs.particles()) { - meanpt= meanpt + cp.momentum().pT(); - rmspt = rmspt + (cp.momentum().pT()*cp.momentum().pT()); - _hist_chargept->fill(cp.momentum().pT(), weight); - _hist_chargelogpt->fill(log(cp.momentum().pT()), weight); + + void analyze(const Event& event) { + const FastJets& fastjets = applyProjection<FastJets>(event, "Jets"); + const Jets jets = fastjets.jetsByPt(20.); + const double weight = event.weight(); + + if (jets.size() < 2 || jets.size() >= 3) vetoEvent; + const double angle = fabs(jets[1].momentum().azimuthalAngle() - jets[0].momentum().azimuthalAngle()); + const double prapidity = fabs(jets[1].momentum().pseudorapidity() - jets[0].momentum().pseudorapidity()); + _hist_jetcount->fill(jets.size(), weight); + _hist_leadingjetpt->fill(jets[0].momentum().pT(), weight); + _hist_secondleadingjetpt->fill(jets[1].momentum().pT(), weight); + _hist_jetdphi->fill(angle , weight); + _hist_jetdeta->fill(prapidity, weight); + + foreach(Jet j, fastjets.jetsByPt(20*GeV)) { + _hist_jetpt->fill(j.momentum().pT(), weight); + _hist_jetptlog->fill(log(j.momentum().pT()), weight); + _hist_jetphi->fill(j.momentum().azimuthalAngle(), weight); + _hist_jeteta->fill(j.momentum().pseudorapidity(), weight); + } + + const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); + // const FastJets& cfastjets = applyProjection<FastJets>(event, "ChargedJets"); + double meanpt(0), rmspt(0); + /// @todo Add jets + // foreach(Jet cj, cfastjets.jetsByPt(20.)){ + _hist_chargemultiplicity->fill(cfs.particles().size(), weight); + foreach(Particle cp, cfs.particles()) { + meanpt= meanpt + cp.momentum().pT(); + rmspt = rmspt + (cp.momentum().pT()*cp.momentum().pT()); + _hist_chargept->fill(cp.momentum().pT(), weight); + _hist_chargelogpt->fill(log(cp.momentum().pT()), weight); + } + meanpt = meanpt / cfs.particles().size(); + _hist_chargemeanpt->fill(meanpt, weight); + rmspt = sqrt(rmspt / cfs.particles().size()); + _hist_chargermspt->fill(rmspt, weight); + // } } - meanpt = meanpt / cfs.particles().size(); - _hist_chargemeanpt->fill(meanpt, weight); - rmspt = sqrt(rmspt / cfs.particles().size()); - _hist_chargermspt->fill(rmspt, weight); - // } - } - - - void MC_LHC_DIJET::finalize() { - /// @todo Normalise! - } - - //@} + + + void finalize() { + /// @todo Normalise! + } + + //@} + private: + + AIDA::IHistogram1D* _hist_jetcount; + AIDA::IHistogram1D* _hist_jetpt; + AIDA::IHistogram1D* _hist_jetptlog; + AIDA::IHistogram1D* _hist_leadingjetpt; + AIDA::IHistogram1D* _hist_secondleadingjetpt; + AIDA::IHistogram1D* _hist_jetphi; + AIDA::IHistogram1D* _hist_jetdphi; + AIDA::IHistogram1D* _hist_jeteta; + AIDA::IHistogram1D* _hist_jetdeta; + AIDA::IHistogram1D* _hist_chargemultiplicity; + AIDA::IHistogram1D* _hist_chargemeanpt; + AIDA::IHistogram1D* _hist_chargept; + AIDA::IHistogram1D* _hist_chargelogpt; + AIDA::IHistogram1D* _hist_chargermspt; + + }; + + // This global object acts as a hook for the plugin system AnalysisBuilder<MC_LHC_DIJET> plugin_MC_LHC_DIJET; - + } Modified: trunk/src/Analyses/MC_LHC_LEADINGJETS.cc ============================================================================== --- trunk/src/Analyses/MC_LHC_LEADINGJETS.cc Mon Aug 31 11:52:47 2009 (r1790) +++ trunk/src/Analyses/MC_LHC_LEADINGJETS.cc Mon Aug 31 12:51:00 2009 (r1791) @@ -1,5 +1,4 @@ // -*- C++ -*- - #include "Rivet/Analysis.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/RivetAIDA.hh" @@ -10,16 +9,12 @@ namespace Rivet { - /* Underlying event in leading jet, extended to the LHC * @author Andy Buckley */ class MC_LHC_LEADINGJETS : public Analysis { public: - /// @name Constructors etc. - //@{ - /// Constructor MC_LHC_LEADINGJETS() : Analysis("MC_LHC_LEADINGJETS") @@ -35,7 +30,6 @@ const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV); addProjection(cfs, "CFS"); } - //@} /// @name Analysis methods @@ -124,8 +118,8 @@ if (pT > ptMaxAway) ptMaxAway = pT; } } - - + + // Fill the histograms //_hist_tnchg->fill(jetpT, numToward/(4*PI/3), weight); _hist_pnchg->fill(jetpT, (numTrans1+numTrans2)/(4*PI/3), weight); @@ -133,14 +127,14 @@ _hist_pminnchg->fill(jetpT, (numTrans1<numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight); //_hist_pdifnchg->fill(jetpT, abs(numTrans1-numTrans2)/(2*PI/3), weight); //_hist_anchg->fill(jetpT, numAway/(4*PI/3), weight); - + //_hist_tcptsum->fill(jetpT, ptSumToward/(4*PI/3), weight); _hist_pcptsum->fill(jetpT, (ptSumTrans1+ptSumTrans2)/(4*PI/3), weight); _hist_pmaxcptsum->fill(jetpT, (ptSumTrans1>ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/(2*PI/3), weight); _hist_pmincptsum->fill(jetpT, (ptSumTrans1<ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/(2*PI/3), weight); //_hist_pdifcptsum->fill(jetpT, fabs(ptSumTrans1-ptSumTrans2)/(2*PI/3), weight); //_hist_acptsum->fill(jetpT, ptSumAway/(4*PI/3), weight); - + //if (numToward > 0) { // _hist_tcptave->fill(jetpT, ptSumToward/numToward, weight); // _hist_tcptmax->fill(jetpT, ptMaxToward, weight); @@ -154,13 +148,13 @@ // _hist_acptmax->fill(jetpT, ptMaxAway, weight); //} } - - + + void finalize() { // } - - + + private: AIDA::IProfile1D *_hist_pnchg; @@ -172,10 +166,10 @@ AIDA::IProfile1D *_hist_pcptave; }; - - + + // This global object acts as a hook for the plugin system AnalysisBuilder<MC_LHC_LEADINGJETS> plugin_MC_LHC_LEADINGJETS; - + } Modified: trunk/src/Analyses/MC_LHC_ZANALYSIS.cc ============================================================================== --- trunk/src/Analyses/MC_LHC_ZANALYSIS.cc Mon Aug 31 11:52:47 2009 (r1790) +++ trunk/src/Analyses/MC_LHC_ZANALYSIS.cc Mon Aug 31 12:51:00 2009 (r1791) @@ -1,94 +1,122 @@ +// -*- C++ -*- #include "Rivet/Analysis.hh" -#include "Rivet/Projections/ChargedFinalState.hh" -#include "Rivet/AnalysisLoader.hh" #include "Rivet/RivetAIDA.hh" +#include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/TotalVisibleMomentum.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Projections/FastJets.hh" -#include "Rivet/Analyses/MC_LHC_ZANALYSIS.hh" namespace Rivet { + + class MC_LHC_ZANALYSIS : public Analysis { + public: /// Default constructor - MC_LHC_ZANALYSIS::MC_LHC_ZANALYSIS() - : Analysis("MC_LHC_ZANALYSIS") { - const ChargedFinalState cfs; - addProjection(cfs, "CFS"); - const ZFinder zf(-MaxRapidity, MaxRapidity, 0.0*GeV, ELECTRON, 30.0*GeV, 115.0*GeV, 0.2); - addProjection(zf, "ZF"); - FastJets fastjets(zf.remainingFinalState(), FastJets::KT, 0.7); - addProjection(fastjets, "Jets"); - } - - /// @name Analysis methods - ///@todo change "Weights" to differential cross sections once histos normalised to cross-section. - //@{ - void MC_LHC_ZANALYSIS::init() { - _hist_chargemulti = bookHistogram1D("d01-x01-y01", 30, 0.5, 250.5); - _hist_chargept = bookHistogram1D("d02-x01-y01", 32, 0., 25.); - _hist_chargemeanpt = bookHistogram1D("d03-x01-y01", 25, 0., 10.); - _hist_chargermspt = bookHistogram1D("d04-x01-y01", 32, 0., 10.); - _hist_zcount = bookHistogram1D("d05-x01-y01", 30, 0., 15.); - _hist_zpt = bookHistogram1D("d06-x01-y01", 32, 0., 25.); - _hist_zlogpt = bookHistogram1D("d07-x01-y01", 32, 0., 6.); - _hist_zeta = bookHistogram1D("d08-x01-y01", 32, -6., 6.); - _hist_zphi = bookHistogram1D("d09-x01-y01", 32, 0., 6.4); - _hist_zmass = bookHistogram1D("d10-x01-y01", 40, 60., 100.); - _hist_zlogmass = bookHistogram1D("d11-x01-y01",32, 0., 10.); - _hist_jetcount = bookHistogram1D("d12-x01-y01", 32, 0, 100); - _hist_jetpt = bookHistogram1D("d13-x01-y01",32, 20., 100.); - _hist_jetlogpt = bookHistogram1D("d14-x01-y01", 32, 0., 20.); - } - + MC_LHC_ZANALYSIS() + : Analysis("MC_LHC_ZANALYSIS") { + const ChargedFinalState cfs; + addProjection(cfs, "CFS"); + const ZFinder zf(-MaxRapidity, MaxRapidity, 0.0*GeV, ELECTRON, 30.0*GeV, 115.0*GeV, 0.2); + addProjection(zf, "ZF"); + FastJets fastjets(zf.remainingFinalState(), FastJets::KT, 0.7); + addProjection(fastjets, "Jets"); + } + - void MC_LHC_ZANALYSIS::analyze(const Event& event) { - const FinalState& cfs = applyProjection<FinalState>(event, "CFS"); - const ZFinder zf = applyProjection<ZFinder>(event, "ZF"); - const FastJets fastjets = applyProjection<FastJets>(event, "Jets"); - const Jets jets = fastjets.jetsByPt(); - const double weight = event.weight(); - double meanpt = 0.; - double rmspt = 0.; - - // Charged particles part - _hist_chargemulti->fill(cfs.particles().size(), weight); - foreach(Particle p, cfs.particles()) { - _hist_chargept->fill(p.momentum().pT(), weight); - meanpt = meanpt + p.momentum().pT(); - rmspt = rmspt + p.momentum().pT()*p.momentum().pT(); + /// @name Analysis methods + /// @todo change "Weights" to differential cross sections once histos normalised to cross-section. + //@{ + + void init() { + _hist_chargemulti = bookHistogram1D("d01-x01-y01", 30, 0.5, 250.5); + _hist_chargept = bookHistogram1D("d02-x01-y01", 32, 0., 25.); + _hist_chargemeanpt = bookHistogram1D("d03-x01-y01", 25, 0., 10.); + _hist_chargermspt = bookHistogram1D("d04-x01-y01", 32, 0., 10.); + _hist_zcount = bookHistogram1D("d05-x01-y01", 30, 0., 15.); + _hist_zpt = bookHistogram1D("d06-x01-y01", 32, 0., 25.); + _hist_zlogpt = bookHistogram1D("d07-x01-y01", 32, 0., 6.); + _hist_zeta = bookHistogram1D("d08-x01-y01", 32, -6., 6.); + _hist_zphi = bookHistogram1D("d09-x01-y01", 32, 0., 6.4); + _hist_zmass = bookHistogram1D("d10-x01-y01", 40, 60., 100.); + _hist_zlogmass = bookHistogram1D("d11-x01-y01",32, 0., 10.); + _hist_jetcount = bookHistogram1D("d12-x01-y01", 32, 0, 100); + _hist_jetpt = bookHistogram1D("d13-x01-y01",32, 20., 100.); + _hist_jetlogpt = bookHistogram1D("d14-x01-y01", 32, 0., 20.); } - meanpt = meanpt/ cfs.particles().size(); - _hist_chargemeanpt->fill(meanpt, weight); - rmspt = sqrt(rmspt / cfs.particles().size()); - _hist_chargermspt->fill(rmspt, weight); - - // Z part - _hist_zcount->fill(zf.particles().size(), weight); - foreach (Particle zp, zf.particles()) { - _hist_zpt->fill(zp.momentum().pT(), weight); - _hist_zlogpt->fill(log(zp.momentum().pT()), weight); - _hist_zeta->fill(zp.momentum().pseudorapidity(), weight); - _hist_zphi->fill(zp.momentum().azimuthalAngle(), weight); - _hist_zmass->fill(zp.momentum().mass(), weight); - _hist_zlogmass->fill(log(zp.momentum().mass()), weight); + + void analyze(const Event& event) { + const FinalState& cfs = applyProjection<FinalState>(event, "CFS"); + const ZFinder zf = applyProjection<ZFinder>(event, "ZF"); + const FastJets fastjets = applyProjection<FastJets>(event, "Jets"); + const Jets jets = fastjets.jetsByPt(); + const double weight = event.weight(); + double meanpt(0), rmspt(0); + + // Charged particles part + _hist_chargemulti->fill(cfs.particles().size(), weight); + foreach(Particle p, cfs.particles()) { + _hist_chargept->fill(p.momentum().pT(), weight); + meanpt = meanpt + p.momentum().pT(); + rmspt = rmspt + p.momentum().pT()*p.momentum().pT(); + } + + meanpt = meanpt/ cfs.particles().size(); + _hist_chargemeanpt->fill(meanpt, weight); + rmspt = sqrt(rmspt / cfs.particles().size()); + _hist_chargermspt->fill(rmspt, weight); + + // Z part + _hist_zcount->fill(zf.particles().size(), weight); + foreach (Particle zp, zf.particles()) { + _hist_zpt->fill(zp.momentum().pT(), weight); + _hist_zlogpt->fill(log(zp.momentum().pT()), weight); + _hist_zeta->fill(zp.momentum().pseudorapidity(), weight); + _hist_zphi->fill(zp.momentum().azimuthalAngle(), weight); + _hist_zmass->fill(zp.momentum().mass(), weight); + _hist_zlogmass->fill(log(zp.momentum().mass()), weight); + } + + // Jet part + _hist_jetcount->fill(fastjets.size(), weight); + foreach(Jet j, fastjets.jetsByPt()) { + _hist_jetpt->fill(j.momentum().pT(), weight); + _hist_jetlogpt->fill(log(j.momentum().pT()), weight); + } } - - // Jet part - _hist_jetcount->fill(fastjets.size(), weight); - foreach(Jet j, fastjets.jetsByPt()) { - _hist_jetpt->fill(j.momentum().pT(), weight); - _hist_jetlogpt->fill(log(j.momentum().pT()), weight); + + + void finalize() { + ///@todo Obtain cross-sections from generator and normalise histos to them. } - } + + //@} + + private: + /// @name Histograms + //@{ + AIDA::IHistogram1D* _hist_chargemulti; + AIDA::IHistogram1D* _hist_chargept; + AIDA::IHistogram1D* _hist_chargemeanpt; + AIDA::IHistogram1D* _hist_chargermspt; + AIDA::IHistogram1D* _hist_zcount; + AIDA::IHistogram1D* _hist_zpt; + AIDA::IHistogram1D* _hist_zlogpt; + //AIDA::IHistogram1D* _hist_zpthigh; + //AIDA::IHistogram1D* _hist_zlogpthigh; + AIDA::IHistogram1D* _hist_zeta; + AIDA::IHistogram1D* _hist_zphi; + AIDA::IHistogram1D* _hist_zmass; + AIDA::IHistogram1D* _hist_zlogmass; + AIDA::IHistogram1D* _hist_jetcount; + AIDA::IHistogram1D* _hist_jetpt; + AIDA::IHistogram1D* _hist_jetlogpt; + //@} - void MC_LHC_ZANALYSIS::finalize() { - ///@todo Obtain cross-sections from generator and normalise histos to them. - } + }; - //@} // This global object acts as a hook for the plugin system Modified: trunk/src/Analyses/MC_TVT1960_PHOTONJETS.cc ============================================================================== --- trunk/src/Analyses/MC_TVT1960_PHOTONJETS.cc Mon Aug 31 11:52:47 2009 (r1790) +++ trunk/src/Analyses/MC_TVT1960_PHOTONJETS.cc Mon Aug 31 12:51:00 2009 (r1791) @@ -1,5 +1,5 @@ // -*- C++ -*- -#include "Rivet/Analyses/MC_TVT1960_PHOTONJETS.hh" +#include "Rivet/Analyses/MC_JetAnalysis.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/LeadingParticlesFinalState.hh" #include "Rivet/Projections/FastJets.hh" @@ -7,103 +7,122 @@ namespace Rivet { - - MC_TVT1960_PHOTONJETS::MC_TVT1960_PHOTONJETS() - : MC_JetAnalysis("MC_TVT1960_PHOTONJETS", 1960.0, 4, "Jets") - { - setBeams(PROTON, ANTIPROTON); - setNeedsCrossSection(true); - - // General FS - FinalState fs(-5.0, 5.0); - addProjection(fs, "FS"); - - // Get leading photon - LeadingParticlesFinalState photonfs(fs, -1.0, 1.0); - photonfs.addParticleId(PHOTON); - addProjection(photonfs, "LeadingPhoton"); - - // FS for jets excludes the leading photon - VetoedFinalState vfs(fs); - vfs.addVetoOnThisFinalState(photonfs); - addProjection(vfs, "JetFS"); - FastJets jetpro(vfs, FastJets::KT, 0.7, 20.0*GeV); - addProjection(jetpro, "Jets"); - } - - - - // Book histograms - void MC_TVT1960_PHOTONJETS::init() { - _h_photon_pT = bookHistogram1D("photon_pT", 100, 0.0, 500.0); - _h_photon_y = bookHistogram1D("photon_y", 40, -4.0, 4.0); - _h_photon_jet1_deta = bookHistogram1D("photon_jet1_deta", 50, -5.0, 5.0); - _h_photon_jet1_dR = bookHistogram1D("photon_jet1_dR", 25, 0.5, 7.0); - - MC_JetAnalysis::init(); - } - - - - // Do the analysis - void MC_TVT1960_PHOTONJETS::analyze(const Event & e) { - double weight = e.weight(); - - // Get the photon - const ParticleVector photons = applyProjection<FinalState>(e, "LeadingPhoton").particles(); - if (photons.size() != 1) { - vetoEvent; - } - const FourMomentum photon = photons.front().momentum(); - if (photon.pT()/GeV < 30) { - getLog() << Log::DEBUG << "Leading photon has pT < 30 GeV: " << photon.pT()/GeV << endl; - vetoEvent; + class MC_TVT1960_PHOTONJETS : public MC_JetAnalysis { + public: + + /// Default constructor + MC_TVT1960_PHOTONJETS() + : MC_JetAnalysis("MC_TVT1960_PHOTONJETS", 1960.0, 4, "Jets") + { + setBeams(PROTON, ANTIPROTON); + setNeedsCrossSection(true); + + // General FS + FinalState fs(-5.0, 5.0); + addProjection(fs, "FS"); + + // Get leading photon + LeadingParticlesFinalState photonfs(fs, -1.0, 1.0); + photonfs.addParticleId(PHOTON); + addProjection(photonfs, "LeadingPhoton"); + + // FS for jets excludes the leading photon + VetoedFinalState vfs(fs); + vfs.addVetoOnThisFinalState(photonfs); + addProjection(vfs, "JetFS"); + FastJets jetpro(vfs, FastJets::KT, 0.7, 20.0*GeV); + addProjection(jetpro, "Jets"); } + + + /// @name Analysis methods + //@{ + + /// Book histograms + void init() { + _h_photon_pT = bookHistogram1D("photon_pT", 100, 0.0, 500.0); + _h_photon_y = bookHistogram1D("photon_y", 40, -4.0, 4.0); + _h_photon_jet1_deta = bookHistogram1D("photon_jet1_deta", 50, -5.0, 5.0); + _h_photon_jet1_dR = bookHistogram1D("photon_jet1_dR", 25, 0.5, 7.0); - // Get all charged particles - const FinalState& fs = applyProjection<FinalState>(e, "JetFS"); - if (fs.isEmpty()) { - vetoEvent; + MC_JetAnalysis::init(); } + + + /// Do the analysis + void analyze(const Event& e) { + const double weight = e.weight(); + + // Get the photon + const ParticleVector photons = applyProjection<FinalState>(e, "LeadingPhoton").particles(); + if (photons.size() != 1) { + vetoEvent; + } + const FourMomentum photon = photons.front().momentum(); + if (photon.pT()/GeV < 30) { + getLog() << Log::DEBUG << "Leading photon has pT < 30 GeV: " << photon.pT()/GeV << endl; + vetoEvent; + } - // Isolate photon by ensuring that a 0.4 cone around it contains less than 7% of the photon's energy - const double egamma = photon.E(); - double econe = 0.0; - foreach (const Particle& p, fs.particles()) { - if (deltaR(photon, p.momentum()) < 0.4) { - econe += p.momentum().E(); - // Veto as soon as E_cone gets larger - if (econe/egamma > 0.07) { - vetoEvent; + // Get all charged particles + const FinalState& fs = applyProjection<FinalState>(e, "JetFS"); + if (fs.isEmpty()) { + vetoEvent; + } + + // Isolate photon by ensuring that a 0.4 cone around it contains less than 7% of the photon's energy + const double egamma = photon.E(); + double econe = 0.0; + foreach (const Particle& p, fs.particles()) { + if (deltaR(photon, p.momentum()) < 0.4) { + econe += p.momentum().E(); + // Veto as soon as E_cone gets larger + if (econe/egamma > 0.07) { + vetoEvent; + } } } + + _h_photon_pT->fill(photon.pT(),weight); + _h_photon_y->fill(photon.rapidity(),weight); + + const FastJets& jetpro = applyProjection<FastJets>(e, "Jets"); + const Jets& jets = jetpro.jetsByPt(20.0*GeV); + if (jets.size()>0) { + _h_photon_jet1_deta->fill(photon.eta()-jets[0].momentum().eta(), weight); + _h_photon_jet1_dR->fill(deltaR(photon, jets[0].momentum()), weight); + } + + MC_JetAnalysis::analyze(e); } - _h_photon_pT->fill(photon.pT(),weight); - _h_photon_y->fill(photon.rapidity(),weight); - const FastJets& jetpro = applyProjection<FastJets>(e, "Jets"); - const Jets& jets = jetpro.jetsByPt(20.0*GeV); - if (jets.size()>0) { - _h_photon_jet1_deta->fill(photon.eta()-jets[0].momentum().eta(), weight); - _h_photon_jet1_dR->fill(deltaR(photon, jets[0].momentum()), weight); + // Finalize + void finalize() { + scale(_h_photon_pT, crossSection()/sumOfWeights()); + scale(_h_photon_y, crossSection()/sumOfWeights()); + scale(_h_photon_jet1_deta, crossSection()/sumOfWeights()); + scale(_h_photon_jet1_dR, crossSection()/sumOfWeights()); + + MC_JetAnalysis::finalize(); } - MC_JetAnalysis::analyze(e); - } + //@} - // Finalize - void MC_TVT1960_PHOTONJETS::finalize() { - scale(_h_photon_pT, crossSection()/sumOfWeights()); - scale(_h_photon_y, crossSection()/sumOfWeights()); - scale(_h_photon_jet1_deta, crossSection()/sumOfWeights()); - scale(_h_photon_jet1_dR, crossSection()/sumOfWeights()); - - MC_JetAnalysis::finalize(); - } + private: + /// @name Histograms + //@{ + AIDA::IHistogram1D * _h_photon_pT; + AIDA::IHistogram1D * _h_photon_y; + AIDA::IHistogram1D * _h_photon_jet1_deta; + AIDA::IHistogram1D * _h_photon_jet1_dR; + //@} + }; + + // This global object acts as a hook for the plugin system AnalysisBuilder<MC_TVT1960_PHOTONJETS> plugin_MC_TVT1960_PHOTONJETS; Modified: trunk/src/Analyses/MC_TVT1960_ZJETS.cc ============================================================================== --- trunk/src/Analyses/MC_TVT1960_ZJETS.cc Mon Aug 31 11:52:47 2009 (r1790) +++ trunk/src/Analyses/MC_TVT1960_ZJETS.cc Mon Aug 31 12:51:00 2009 (r1791) @@ -1,5 +1,5 @@ // -*- C++ -*- -#include "Rivet/Analyses/MC_TVT1960_ZJETS.hh" +#include "Rivet/Analyses/MC_JetAnalysis.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/ZFinder.hh" #include "Rivet/Projections/FastJets.hh" @@ -7,81 +7,107 @@ namespace Rivet { - - MC_TVT1960_ZJETS::MC_TVT1960_ZJETS() - : MC_JetAnalysis("MC_TVT1960_ZJETS", 1960.0, 4, "Jets") - { - setBeams(PROTON, ANTIPROTON); - setNeedsCrossSection(true); - - ZFinder zfinder(-3.5, 3.5, 25.0*GeV, ELECTRON, 65.0*GeV, 115.0*GeV, 0.2); - addProjection(zfinder, "ZFinder"); - FastJets jetpro(zfinder.remainingFinalState(), FastJets::KT, 0.7, 20.0*GeV); - addProjection(jetpro, "Jets"); - } - - - - // Book histograms - void MC_TVT1960_ZJETS::init() { - _h_Z_mass = bookHistogram1D("Z_mass", 50, 66.0, 116.0); - _h_Z_pT = bookHistogram1D("Z_pT", 100, 0.0, 500.0); - _h_Z_y = bookHistogram1D("Z_y", 40, -4.0, 4.0); - _h_Z_jet1_deta = bookHistogram1D("Z_jet1_deta", 50, -5.0, 5.0); - _h_Z_jet1_dR = bookHistogram1D("Z_jet1_dR", 25, 0.5, 7.0); - _h_lepton_pT = bookHistogram1D("lepton_pT", 100, 0.0, 500.0); - _h_lepton_eta = bookHistogram1D("lepton_eta", 40, -4.0, 4.0); - - MC_JetAnalysis::init(); - } - - - - // Do the analysis - void MC_TVT1960_ZJETS::analyze(const Event & e) { - double weight = e.weight(); - - const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder"); - if (zfinder.particles().size()!=1) { - vetoEvent; + /// @brief Monte Carlo validation observables for Z[e+ e-] + jets production at Tevatron Run II + /// @author Frank Siegert + class MC_TVT1960_ZJETS : public MC_JetAnalysis { + + public: + + /// Default constructor + MC_TVT1960_ZJETS() + : MC_JetAnalysis("MC_TVT1960_ZJETS", 1960.0, 4, "Jets") + { + setBeams(PROTON, ANTIPROTON); + setNeedsCrossSection(true); + + ZFinder zfinder(-3.5, 3.5, 25.0*GeV, ELECTRON, 65.0*GeV, 115.0*GeV, 0.2); + addProjection(zfinder, "ZFinder"); + FastJets jetpro(zfinder.remainingFinalState(), FastJets::KT, 0.7, 20.0*GeV); + addProjection(jetpro, "Jets"); } + + + /// @name Analysis methods + //@{ - FourMomentum zmom(zfinder.particles()[0].momentum()); - _h_Z_mass->fill(zmom.mass(),weight); - _h_Z_pT->fill(zmom.pT(),weight); - _h_Z_y->fill(zmom.rapidity(),weight); - foreach (const Particle& l, zfinder.constituentsFinalState().particles()) { - _h_lepton_pT->fill(l.momentum().pT(), weight); - _h_lepton_eta->fill(l.momentum().eta(), weight); + /// Book histograms + void init() { + _h_Z_mass = bookHistogram1D("Z_mass", 50, 66.0, 116.0); + _h_Z_pT = bookHistogram1D("Z_pT", 100, 0.0, 500.0); + _h_Z_y = bookHistogram1D("Z_y", 40, -4.0, 4.0); + _h_Z_jet1_deta = bookHistogram1D("Z_jet1_deta", 50, -5.0, 5.0); + _h_Z_jet1_dR = bookHistogram1D("Z_jet1_dR", 25, 0.5, 7.0); + _h_lepton_pT = bookHistogram1D("lepton_pT", 100, 0.0, 500.0); + _h_lepton_eta = bookHistogram1D("lepton_eta", 40, -4.0, 4.0); + + MC_JetAnalysis::init(); } - const FastJets& jetpro = applyProjection<FastJets>(e, "Jets"); - const Jets& jets = jetpro.jetsByPt(20.0*GeV); - if (jets.size()>0) { - _h_Z_jet1_deta->fill(zmom.eta()-jets[0].momentum().eta(), weight); - _h_Z_jet1_dR->fill(deltaR(zmom, jets[0].momentum()), weight); + + + /// Do the analysis + void analyze(const Event & e) { + const double weight = e.weight(); + + const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder"); + if (zfinder.particles().size()!=1) { + vetoEvent; + } + + FourMomentum zmom(zfinder.particles()[0].momentum()); + _h_Z_mass->fill(zmom.mass(),weight); + _h_Z_pT->fill(zmom.pT(),weight); + _h_Z_y->fill(zmom.rapidity(),weight); + foreach (const Particle& l, zfinder.constituentsFinalState().particles()) { + _h_lepton_pT->fill(l.momentum().pT(), weight); + _h_lepton_eta->fill(l.momentum().eta(), weight); + } + + const FastJets& jetpro = applyProjection<FastJets>(e, "Jets"); + const Jets& jets = jetpro.jetsByPt(20.0*GeV); + if (jets.size() > 0) { + _h_Z_jet1_deta->fill(zmom.eta()-jets[0].momentum().eta(), weight); + _h_Z_jet1_dR->fill(deltaR(zmom, jets[0].momentum()), weight); + } + + MC_JetAnalysis::analyze(e); } + - MC_JetAnalysis::analyze(e); - } + /// Finalize + void finalize() { + scale(_h_Z_mass, crossSection()/sumOfWeights()); + scale(_h_Z_pT, crossSection()/sumOfWeights()); + scale(_h_Z_y, crossSection()/sumOfWeights()); + scale(_h_Z_jet1_deta, crossSection()/sumOfWeights()); + scale(_h_Z_jet1_dR, crossSection()/sumOfWeights()); + scale(_h_lepton_pT, crossSection()/sumOfWeights()); + scale(_h_lepton_eta, crossSection()/sumOfWeights()); + + MC_JetAnalysis::finalize(); + } + + //@} - // Finalize - void MC_TVT1960_ZJETS::finalize() { - scale(_h_Z_mass, crossSection()/sumOfWeights()); - scale(_h_Z_pT, crossSection()/sumOfWeights()); - scale(_h_Z_y, crossSection()/sumOfWeights()); - scale(_h_Z_jet1_deta, crossSection()/sumOfWeights()); - scale(_h_Z_jet1_dR, crossSection()/sumOfWeights()); - scale(_h_lepton_pT, crossSection()/sumOfWeights()); - scale(_h_lepton_eta, crossSection()/sumOfWeights()); - - MC_JetAnalysis::finalize(); - } + private: + /// @name Histograms + //@{ + AIDA::IHistogram1D * _h_Z_mass; + AIDA::IHistogram1D * _h_Z_pT; + AIDA::IHistogram1D * _h_Z_y; + AIDA::IHistogram1D * _h_Z_jet1_deta; + AIDA::IHistogram1D * _h_Z_jet1_dR; + AIDA::IHistogram1D * _h_lepton_pT; + AIDA::IHistogram1D * _h_lepton_eta; + //@} + }; + + // This global object acts as a hook for the plugin system AnalysisBuilder<MC_TVT1960_ZJETS> plugin_MC_TVT1960_ZJETS; - + }
More information about the Rivet-svn mailing list |