|
[Rivet-svn] r2663 - in trunk: . data/anainfo data/plotinfo src/Analysesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Aug 18 16:03:59 BST 2010
Author: buckley Date: Wed Aug 18 16:03:59 2010 New Revision: 2663 Log: Adding MC_GENERIC analysis: basic E, pT, y, eta, phi, eta+/eta-, y+/y-, etc. plots of final state particles Added: trunk/data/anainfo/MC_GENERIC.info trunk/data/plotinfo/MC_GENERIC.plot trunk/src/Analyses/MC_GENERIC.cc Modified: trunk/ChangeLog trunk/data/anainfo/Makefile.am trunk/data/plotinfo/Makefile.am trunk/src/Analyses/Makefile.am Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Wed Aug 18 14:38:58 2010 (r2662) +++ trunk/ChangeLog Wed Aug 18 16:03:59 2010 (r2663) @@ -1,3 +1,7 @@ +2010-08-18 Andy Buckley <andy at insectnation.org> + + * Adding MC_GENERIC analysis. NB. Frank Siegert also added MC_HJETS. + 2010-08-03 Andy Buckley <andy at insectnation.org> * Fixing compare-histos treatment of what is now a ref file, and Added: trunk/data/anainfo/MC_GENERIC.info ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/data/anainfo/MC_GENERIC.info Wed Aug 18 16:03:59 2010 (r2663) @@ -0,0 +1,10 @@ +Name: MC_GENERIC +Summary: Generic MC testing analysis +Status: UNVALIDATED +Authors: + - Ian Bruce <ibruce at cern.ch> + - Andy Buckley <andy.buckley at cern.ch> +NumEvents: 50000 +# Beams: [*, *] +Description: + Generic analysis of typical event distributions such as $\eta$, $y$, $pT$, $\phi$... Modified: trunk/data/anainfo/Makefile.am ============================================================================== --- trunk/data/anainfo/Makefile.am Wed Aug 18 14:38:58 2010 (r2662) +++ trunk/data/anainfo/Makefile.am Wed Aug 18 16:03:59 2010 (r2663) @@ -70,6 +70,7 @@ H1_1995_S3167097.info \ H1_2000_S4129130.info \ JADE_OPAL_2000_S4300807.info \ + MC_GENERIC.info \ MC_LEADINGJETS.info \ MC_DIJET.info \ MC_DIPHOTON.info \ Added: trunk/data/plotinfo/MC_GENERIC.plot ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/data/plotinfo/MC_GENERIC.plot Wed Aug 18 16:03:59 2010 (r2663) @@ -0,0 +1,119 @@ +# BEGIN PLOT /MC_GENERIC/ECh +Title=Energy of charged particles +XLabel=$E$ [GeV] +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}E$ [GeV$^{-1}$] +# END PLOT + +# BEGIN PLOT /MC_GENERIC/E +Title=Energy of all particles +XLabel=$E$ [GeV] +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}E$ [GeV$^{-1}$] +# END PLOT + +# BEGIN PLOT /MC_GENERIC/EtaCh +Title=Pseudorapidity of charged particles +XLabel=$\eta$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}\eta$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/EtaChPMRatio +Title=Pseudorapidity $+/-$ ratio of charged particles +XLabel=$|\eta|$ +YLabel=$\mathrm{d}\sigma/\mathrm{d}\eta_+ \; / \; \mathrm{d}\sigma/\mathrm{d}\eta_-$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/Eta +Title=Pseudorapidity of all particles +XLabel=$\eta$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}\eta$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/EtaPMRatio +Title=Pseudorapidity $+/-$ ratio of all particles +XLabel=$|\eta|$ +YLabel=$\mathrm{d}\sigma/\mathrm{d}\eta_+ \; / \; \mathrm{d}\sigma/\mathrm{d}\eta_-$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/MultCh +Title=Charged multiplicity of events +XLabel=$N_text{ch}$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}N_\text{ch}$ +LogY=0 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/Mult +Title=Total multiplicity of events +XLabel=$N$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}N$ +LogY=0 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/PhiCh +Title=Azimuthal distribution of charged particles +XLabel=$\phi$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}\phi$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/Phi +Title=Azimuthal distribution of all particles +XLabel=$\phi$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}\phi$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/PtCh +Title=Transverse momentum of charged particles +XLabel=$p_\perp$ [GeV] +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}p_\perp$ [GeV$^{-1}$] +FullRange=1 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/Pt +Title=Transverse momentum of all particles +XLabel=$p_\perp$ [GeV] +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}p_\perp$ [GeV$^{-1}$] +FullRange=1 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/RapidityCh +Title=Rapidity of charged particles +XLabel=$y$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}y$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/RapidityChPMRatio +Title=Rapidity $+/-$ ratio of charged particles +XLabel=$|y|$ +YLabel=$\mathrm{d}\sigma/\mathrm{d}y_+ \; / \; \mathrm{d}\sigma/\mathrm{d}y_-$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/Rapidity +Title=Rapidity of all particles +XLabel=$y$ +YLabel=$1/\sigma \; \mathrm{d}\sigma/\mathrm{d}y$ +LogY=0 +LegendYPos=0.5 +# END PLOT + +# BEGIN PLOT /MC_GENERIC/RapidityPMRatio +Title=Rapidity $+/-$ ratio of all particles +XLabel=$|y|$ +YLabel=$\mathrm{d}\sigma/\mathrm{d}y_+ \; / \; \mathrm{d}\sigma/\mathrm{d}y_-$ +LogY=0 +LegendYPos=0.5 +# END PLOT Modified: trunk/data/plotinfo/Makefile.am ============================================================================== --- trunk/data/plotinfo/Makefile.am Wed Aug 18 14:38:58 2010 (r2662) +++ trunk/data/plotinfo/Makefile.am Wed Aug 18 16:03:59 2010 (r2663) @@ -68,6 +68,7 @@ H1_1995_S3167097.plot \ H1_2000_S4129130.plot \ JADE_OPAL_2000_S4300807.plot \ + MC_GENERIC.plot \ MC_LEADINGJETS.plot \ MC_DIJET.plot \ MC_DIPHOTON.plot \ Added: trunk/src/Analyses/MC_GENERIC.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/src/Analyses/MC_GENERIC.cc Wed Aug 18 16:03:59 2010 (r2663) @@ -0,0 +1,170 @@ +// -*- C++ -*- +#include "Rivet/Analysis.hh" +#include "Rivet/RivetAIDA.hh" +#include "Rivet/Tools/Logging.hh" +#include "Rivet/Projections/FinalState.hh" +#include "Rivet/Projections/ChargedFinalState.hh" +#include "LWH/Histogram1D.h" + +namespace Rivet { + + + /// Generic analysis looking at various distributions of final state particles + class MC_GENERIC : public Analysis { + public: + + /// Constructor + MC_GENERIC() + : Analysis("MC_GENERIC") + { } + + + public: + + /// @name Analysis methods + //@{ + + /// Book histograms and initialise projections before the run + void init() { + + // Projections + const FinalState cnfs(-5.0, 5.0, 500*MeV); + const ChargedFinalState cfs(-5.0, 5.0, 500*MeV); + addProjection(cfs, "CFS"); + addProjection(cnfs, "FS"); + + // Histograms + // @todo Choose E/pT ranged based on input energies... can't do anything about kin. cuts, though + _histMult = bookHistogram1D("Mult", 100, -0.5, 199.5); + _histMultCh = bookHistogram1D("MultCh", 100, -0.5, 199.5); + + _histPt = bookHistogram1D("Pt", 300, 0, 30); + _histPtCh = bookHistogram1D("PtCh", 300, 0, 30); + + _histE = bookHistogram1D("E", 100, 0, 200); + _histECh = bookHistogram1D("ECh", 100, 0, 200); + + _histEta = bookHistogram1D("Eta", 50, -5, 5); + _histEtaCh = bookHistogram1D("EtaCh", 50, -5, 5); + _tmphistEtaPlus.reset(new LWH::Histogram1D(25, 0, 5)); + _tmphistEtaMinus.reset(new LWH::Histogram1D(25, 0, 5)); + _tmphistEtaChPlus.reset(new LWH::Histogram1D(25, 0, 5)); + _tmphistEtaChMinus.reset(new LWH::Histogram1D(25, 0, 5)); + + _histRapidity = bookHistogram1D("Rapidity", 50, -5, 5); + _histRapidityCh = bookHistogram1D("RapidityCh", 50, -5, 5); + _tmphistRapPlus.reset(new LWH::Histogram1D(25, 0, 5)); + _tmphistRapMinus.reset(new LWH::Histogram1D(25, 0, 5)); + _tmphistRapChPlus.reset(new LWH::Histogram1D(25, 0, 5)); + _tmphistRapChMinus.reset(new LWH::Histogram1D(25, 0, 5)); + + _histPhi = bookHistogram1D("Phi", 50, 0, TWOPI); + _histPhiCh = bookHistogram1D("PhiCh", 50, 0, TWOPI); + } + + + + /// Perform the per-event analysis + void analyze(const Event& event) { + const double weight = event.weight(); + + // Analyse and print some info + const FinalState& cnfs = applyProjection<FinalState>(event, "FS"); + getLog() << Log::DEBUG << "Total multiplicity = " << cnfs.size() << endl; + _histMult->fill(cnfs.size(), weight); + foreach (const Particle& p, cnfs.particles()) { + const double eta = p.momentum().eta(); + _histEta->fill(eta, weight); + if (eta > 0) { + _tmphistEtaPlus->fill(fabs(eta), weight); + } else { + _tmphistEtaMinus->fill(fabs(eta), weight); + } + const double rapidity = p.momentum().rapidity(); + _histRapidity->fill(rapidity, weight); + if (rapidity > 0) { + _tmphistRapPlus->fill(fabs(rapidity), weight); + } else { + _tmphistRapMinus->fill(fabs(rapidity), weight); + } + _histPt->fill(p.momentum().pT()/GeV, weight); + _histE->fill(p.momentum().E()/GeV, weight); + _histPhi->fill(p.momentum().phi(), weight); + } + + const FinalState& cfs = applyProjection<FinalState>(event, "CFS"); + getLog() << Log::DEBUG << "Total charged multiplicity = " << cfs.size() << endl; + _histMultCh->fill(cfs.size(), weight); + foreach (const Particle& p, cfs.particles()) { + const double eta = p.momentum().eta(); + _histEtaCh->fill(eta, weight); + if (eta > 0) { + _tmphistEtaChPlus->fill(fabs(eta), weight); + } else { + _tmphistEtaChMinus->fill(fabs(eta), weight); + } + const double rapidity = p.momentum().rapidity(); + _histRapidityCh->fill(rapidity, weight); + if (rapidity > 0) { + _tmphistRapChPlus->fill(fabs(rapidity), weight); + } else { + _tmphistRapChMinus->fill(fabs(rapidity), weight); + } + _histPtCh->fill(p.momentum().pT()/GeV, weight); + _histECh->fill(p.momentum().E()/GeV, weight); + _histPhiCh->fill(p.momentum().phi(), weight); + } + + } + + + /// Finalize + void finalize() { + scale(_histMult, 1/sumOfWeights()); + scale(_histMultCh, 1/sumOfWeights()); + scale(_histEta, 1/sumOfWeights()); + scale(_histEtaCh, 1/sumOfWeights()); + scale(_histRapidity, 1/sumOfWeights()); + scale(_histRapidityCh, 1/sumOfWeights()); + scale(_histPt, 1/sumOfWeights()); + scale(_histPtCh, 1/sumOfWeights()); + scale(_histE, 1/sumOfWeights()); + scale(_histECh, 1/sumOfWeights()); + scale(_histPhi, 1/sumOfWeights()); + scale(_histPhiCh, 1/sumOfWeights()); + + histogramFactory().divide("/MC_GENERIC/EtaPMRatio", *_tmphistEtaPlus, *_tmphistEtaMinus); + histogramFactory().divide("/MC_GENERIC/EtaChPMRatio", *_tmphistEtaChPlus, *_tmphistEtaChMinus); + histogramFactory().divide("/MC_GENERIC/RapidityPMRatio", *_tmphistRapPlus, *_tmphistRapMinus); + histogramFactory().divide("/MC_GENERIC/RapidityChPMRatio", *_tmphistRapChPlus, *_tmphistRapChMinus); + } + + //@} + + + private: + + /// Temporary histos used to calculate eta+/eta- ratio plot + shared_ptr<LWH::Histogram1D> _tmphistEtaPlus, _tmphistEtaMinus; + shared_ptr<LWH::Histogram1D> _tmphistEtaChPlus, _tmphistEtaChMinus; + shared_ptr<LWH::Histogram1D> _tmphistRapPlus, _tmphistRapMinus; + shared_ptr<LWH::Histogram1D> _tmphistRapChPlus, _tmphistRapChMinus; + + //@{ + /// Histograms + AIDA::IHistogram1D *_histMult, *_histMultCh; + AIDA::IHistogram1D *_histEta, *_histEtaCh; + AIDA::IHistogram1D *_histRapidity, *_histRapidityCh; + AIDA::IHistogram1D *_histPt, *_histPtCh; + AIDA::IHistogram1D *_histE, *_histECh; + AIDA::IHistogram1D *_histPhi, *_histPhiCh; + //@} + + }; + + + + // This global object acts as a hook for the plugin system + AnalysisBuilder<MC_GENERIC> plugin_MC_GENERIC; + +} Modified: trunk/src/Analyses/Makefile.am ============================================================================== --- trunk/src/Analyses/Makefile.am Wed Aug 18 14:38:58 2010 (r2662) +++ trunk/src/Analyses/Makefile.am Wed Aug 18 16:03:59 2010 (r2663) @@ -145,6 +145,7 @@ lib_LTLIBRARIES += RivetMCAnalyses.la RivetMCAnalyses_la_SOURCES = \ ExampleAnalysis.cc \ + MC_GENERIC.cc \ MC_JETS.cc \ MC_PHOTONJETS.cc \ MC_HJETS.cc \
More information about the Rivet-svn mailing list |