|
[Rivet-svn] r2471 - in trunk: . bin doc include/Rivet include/Rivet/Projections include/Rivet/Tools pyext src/Analyses src/Core src/Projections src/Toolsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue Jun 8 16:48:29 BST 2010
Author: buckley Date: Tue Jun 8 16:48:37 2010 New Revision: 2471 Log: Major overhaul or the nominally cosmetic details of how particle code <-> name translations are done. Due to various stages of development and merging, this was a confusing mess with a duplication of types, enums being awkward, etc. Hopefully it's now both more efficient (well, as efficient as two of Frank's static maps, since that's what's now at the root of this system) and a hell of a lot clearer. There should be virtually no *real* API changes, except for clearing up of crufy functions which should only have been used internally, but there are places where either enums have been replaced with binary-compatible ints, or where typedef names to the same type have changed or been unified. Added: trunk/include/Rivet/RivetSTL.hh trunk/src/Core/ParticleName.cc Modified: trunk/ChangeLog trunk/README trunk/bin/root2flat trunk/configure.ac trunk/doc/analyses.tex trunk/include/Rivet/Analysis.hh trunk/include/Rivet/AnalysisHandler.hh trunk/include/Rivet/AnalysisInfo.hh trunk/include/Rivet/BeamConstraint.hh trunk/include/Rivet/Exceptions.hh trunk/include/Rivet/Makefile.am trunk/include/Rivet/Particle.fhh trunk/include/Rivet/Particle.hh trunk/include/Rivet/ParticleName.hh trunk/include/Rivet/Projection.hh trunk/include/Rivet/Projections/Beam.hh trunk/include/Rivet/Projections/DISKinematics.hh trunk/include/Rivet/Projections/InvMassFinalState.hh trunk/include/Rivet/Rivet.hh trunk/include/Rivet/RivetAIDA.hh trunk/include/Rivet/RivetBoost.hh trunk/include/Rivet/Tools/Utils.hh trunk/pyext/rivet.i trunk/pyext/setup.py.in trunk/src/Analyses/D0_2004_S5992206.cc trunk/src/Core/Analysis.cc trunk/src/Core/AnalysisHandler.cc trunk/src/Core/AnalysisInfo.cc trunk/src/Core/Event.cc trunk/src/Core/Makefile.am trunk/src/Core/Projection.cc trunk/src/Projections/Beam.cc trunk/src/Projections/InvMassFinalState.cc trunk/src/Projections/SVertex.cc trunk/src/Tools/RivetPaths.cc trunk/src/Tools/Utils.cc Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/ChangeLog Tue Jun 8 16:48:37 2010 (r2471) @@ -1,7 +1,24 @@ +2010-06-08 Andy Buckley <andy at insectnation.org> + + * Removing check for CEDARSTD #define guard, since we no longer + compile against AGILe and don't have to be careful about + duplication. + + * Moving crappy closest approach and decay significance functions + from Utils into SVertex, which is the only place they have ever + been used (and is itself almost entirely pointless). + + * Overhauling particle ID <-> name system to clear up ambiguities + between enums, ints, particles and beams. There are no more enums, + although the names are still available as const static ints, and + names are now obtained via a singleton class which wraps an STL + map for name/ID lookups in both directions. + 2010-05-18 Hendrik Hoeth <hendrik.hoeth at cern.ch> * Fixing factor-of-2 bug in the error calculation when scaling histograms. + * Fixing D0_2001_S4674421 analysis. 2010-05-11 Andy Buckley <andy at insectnation.org> Modified: trunk/README ============================================================================== --- trunk/README Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/README Tue Jun 8 16:48:37 2010 (r2471) @@ -95,7 +95,7 @@ We hope this was useful as a quick guide to getting started with running Rivet's built-in analyses for Monte Carlo generator validation. Be aware that we will be -overhauling Rivet's histogramming system in version 1.2.0, from which point all +overhauling Rivet's histogramming system in version 1.3.0, from which point all the conversions away from AIDA XML will no longer be necessary, and a fully programmatic interface to the Rivet data files will be possible. Please bear with us while we get this sorted out: we're as keen to have better histogramming Modified: trunk/bin/root2flat ============================================================================== --- trunk/bin/root2flat Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/bin/root2flat Tue Jun 8 16:48:37 2010 (r2471) @@ -107,7 +107,7 @@ try: binstr = "" for key in ["xlow", "xhigh", "y", "y_err_low", "y_err_high"]: - binstr += "%s: %e "%(key, bin[key]) + binstr += "%s: %e " % (key, bin[key]) logging.info(binstr) except: pass @@ -161,8 +161,8 @@ title, xlabel, ylabel, bins = convertTGraph(R_histo) else: title, xlabel, ylabel, bins = convertHisto(R_histo) - head = "# BEGIN PLOT\nTitle=%s\nLegend=1\nLogY=1\nDrawOnly=%s\n"%(title, name) - head += "XLabel=%s\nYLabel=%s\n# END PLOT\n"%(xlabel, ylabel) + head = "# BEGIN PLOT\nTitle=%s\nLegend=1\nLogY=1\nDrawOnly=%s\n" % (title, name) + head += "XLabel=%s\nYLabel=%s\n# END PLOT\n" % (xlabel, ylabel) histo = getFlatHisto(bins, name, title) Modified: trunk/configure.ac ============================================================================== --- trunk/configure.ac Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/configure.ac Tue Jun 8 16:48:37 2010 (r2471) @@ -205,14 +205,15 @@ fi fi ## SWIG version checks -AC_PROG_SWIG -if test x$SWIG == x; then - enable_pyext=no -fi -#if test x$enable_pyext == xyes; then -# SWIG_ENABLE_CXX -# SWIG_PYTHON -#fi +if test x$enable_pyext == xyes; then + AC_PROG_SWIG + if test x$SWIG == x; then + AC_MSG_WARN([Can't build Python extension since swig could not be found]) + ## TODO: Test that SWIG makes a compilable source file... + ## cf. g++ 4.x requires that string literal is "_const_ char*" + enable_pyext=no + fi +fi ## Finish if test x$enable_pyext == xyes; then AC_MSG_NOTICE([All Python build checks successful: 'rivet' Python extension will be built]) Modified: trunk/doc/analyses.tex ============================================================================== --- trunk/doc/analyses.tex Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/doc/analyses.tex Tue Jun 8 16:48:37 2010 (r2471) @@ -60,7 +60,7 @@ \item $e^+e^-\to$ jets with $\pi$ and $\eta$ decays turned off.\end{itemize} -\noindent Earlier measurements at LEP of isolated hard photons in hadronic Z decays, attributed to radiation from primary quark pairs, have been extended in the ALEPH experiment to include hard photon production inside hadron jets. Events are selected where all particles combine democratically to form hadron jets, one of which contains a photon with a fractional energy $z > 0.7$. After statistical subtraction of non-prompt photons, the quark-to-photon fragmentation function, $D(z)$, is extracted directly from the measured 2-jet rate. +\noindent Earlier measurements at LEP of isolated hard photons in hadronic Z decays, attributed to radiation from primary quark pairs, have been extended in the ALEPH experiment to include hard photon production inside hadron jets. Events are selected where all particles combine democratically to form hadron jets, one of which contains a photon with a fractional energy $z > 0.7$. After statistical subtraction of non-prompt photons, the quark-to-photon fragmentation function, $D(z)$, is extracted directly from the measured 2-jet rate. \clearpage @@ -326,7 +326,7 @@ \item Hadronic $e^+ e^-$ events at 4 representative energies (91, 133, 177, 197). Runs with \ensuremath{\sqrt{s}} above the Z mass need to have ISR suppressed, since the data has been corrected to remove radiative return to the Z.\end{itemize} -\noindent Measurement of $e^+ e^-$ event shape variable distributions and their 1st to 5th moments in LEP running from the Z pole to the highest LEP 2 energy of 209 GeV. +\noindent Measurement of $e^+ e^-$ event shape variable distributions and their 1st to 5th moments in LEP running from the Z pole to the highest LEP 2 energy of 209 GeV. \clearpage @@ -414,7 +414,7 @@ \item QCD events with W+- production and electronic decays\end{itemize} -\noindent This is a CDF analysis from run 1, where the distribution of the transverse momentum of W candidates that decay electronically, is measured. The electron is required to be within $\left|\eta\right| < 1.1$, to have a transverse energy of $E_\perp > 20~\GeV$ and a $p_\perp > 12~\GeV$. The neutrino is required to produce a missing energy of $E_{\perp, \text{ miss}}>20~\GeV$. +\noindent This is a CDF analysis from run 1, where the distribution of the transverse momentum of W candidates that decay electronically, is measured. The electron is required to be within $\left|\eta\right| < 1.1$, to have a transverse energy of $E_\perp > 20~\GeV$ and a $p_\perp > 12~\GeV$. The neutrino is required to produce a missing energy of $E_{\perp, \text{ miss}}>20~\GeV$. \clearpage @@ -535,7 +535,7 @@ \item Pure QCD events without underlying event.\end{itemize} -\noindent Multijet distributions corresponding to ($4N-4$) variables that span the $N$-body parameter space in inclusive $N = 3$-, 4-, and 5-jet events. +\noindent Multijet distributions corresponding to ($4N-4$) variables that span the $N$-body parameter space in inclusive $N = 3$-, 4-, and 5-jet events. \clearpage @@ -627,7 +627,7 @@ \item QCD events at Tevatron with $\sqrt{s}=1.8$ TeV without MPI.\end{itemize} -\noindent Measurement of the differential cross section $\mathrm{d}\sigma/\mathrm{d}E_\perp^j$ for the production of multijet events in $p\bar{p}$ collisions where the sum is over all jets with transverse energy $E_\perp^j > E_\perp^\mathrm{min}$. +\noindent Measurement of the differential cross section $\mathrm{d}\sigma/\mathrm{d}E_\perp^j$ for the production of multijet events in $p\bar{p}$ collisions where the sum is over all jets with transverse energy $E_\perp^j > E_\perp^\mathrm{min}$. \clearpage @@ -658,7 +658,7 @@ \item $p\bar{p}$ collisions at 1800 GeV. $Z/\gamma^*$ Drell-Yan events with $e^+e^-$ decay mode only.\end{itemize} -\noindent Measurement of transverse momentum and total cross section of $e^+e^-$ pairs in the Z-boson region of $66~\text{GeV}/c^2 < m_{ee} < 116~\text{GeV}/c^2$ from pbar-p collisions at \ensuremath{\sqrt{s}} = 1.8 TeV, with the Tevatron CDF detector. The Z \pT, in a fully-factorised picture, is generated by the momentum balance against initial state radiation (ISR) and the primordial/intrinsic \pT of the Z's parent partons in the incoming hadrons. The Z \pT is important in generator tuning to fix the interplay of ISR and multi-parton interactions (MPI) ingenerating `underlying event' activity. +\noindent Measurement of transverse momentum and total cross section of $e^+e^-$ pairs in the Z-boson region of $66~\text{GeV}/c^2 < m_{ee} < 116~\text{GeV}/c^2$ from pbar-p collisions at \ensuremath{\sqrt{s}} = 1.8 TeV, with the Tevatron CDF detector. The Z \pT, in a fully-factorised picture, is generated by the momentum balance against initial state radiation (ISR) and the primordial/intrinsic \pT of the Z's parent partons in the incoming hadrons. The Z \pT is important in generator tuning to fix the interplay of ISR and multi-parton interactions (MPI) ingenerating `underlying event' activity. This analysis is subject to ambiguities in the experimental Z \pT definition, since the Rivet implementation reconstructs the Z momentum from the dilepton pair with finite cones for QED bremstrahlung summation, rather than non-portable direct use of the (sometimes absent) Z in the event record. \clearpage @@ -721,7 +721,7 @@ \item Dijet events at Tevatron with $\sqrt{s}=1.8$ TeV\end{itemize} -\noindent A measurement of the two-jet differential cross section, $\mathrm{d}^3\sigma/\mathrm{d}E_T \, \mathrm{d}\eta_1 \, \mathrm{d}\eta_2$, based on an integrated luminosity of $86 \mathrm{pb}^{-1}$. The differential cross section is measured as a function of the transverse energy, $E_\perp$, of a jet in the pseudorapidity region $0.1 < |\eta_1| < 0.7$ for four different pseudorapidity bins of a second jet restricted to $0.1 < |\eta_2| < 3.0$. +\noindent A measurement of the two-jet differential cross section, $\mathrm{d}^3\sigma/\mathrm{d}E_T \, \mathrm{d}\eta_1 \, \mathrm{d}\eta_2$, based on an integrated luminosity of $86 \mathrm{pb}^{-1}$. The differential cross section is measured as a function of the transverse energy, $E_\perp$, of a jet in the pseudorapidity region $0.1 < |\eta_1| < 0.7$ for four different pseudorapidity bins of a second jet restricted to $0.1 < |\eta_2| < 3.0$. \clearpage @@ -840,7 +840,7 @@ \penalty 100 \begin{itemize} - \item QCD events at \ensuremath{\sqrt{s}} = 630 \& 1800 GeV. Several \pTmin cutoffs are probably required to fill the profile histograms, e.g. 0 (min bias), 30, 90, 150 GeV at 1800 GeV, and 0 (min bias), 20, 90, 150 GeV at 630 GeV.\end{itemize} + \item QCD events at \ensuremath{\sqrt{s}} = 630 \& 1800 GeV. Several \pTmin cutoffs are probably required to fill the profile histograms, e.g. 0 (min bias), 30, 90, 150 GeV at 1800 GeV, and 0 (min bias), 20, 90, 150 GeV at 630 GeV.\end{itemize} \noindent This analysis studies the underlying event via transverse cones of $R = 0.7$ at 90 degrees in \phi relative to the leading (highest E) jet, at \ensuremath{\sqrt{s}} = 630 and 1800 GeV. This is similar to the 2001 CDF UE analysis, except that cones, rather than the whole central \eta range are used. The transverse cones are categorised as TransMIN and TransMAX on an event-by-event basis, to give greater sensitivity to the UE component. `Swiss Cheese' distributions, where cones around the leading $n$ jets are excluded from the distributions, are also included for $n = 2, 3$. This analysis is useful for constraining the energy evolution of the underlying event, since it performs the same analyses at two distinct CoM energies. @@ -905,7 +905,7 @@ \penalty 100 \begin{itemize} - \item QCD events at \ensuremath{\sqrt{s}} = 1960 GeV. Jet \pTmin in plots is 37 GeV/c --- choose generator min \pT somewhere well below this.\end{itemize} + \item QCD events at \ensuremath{\sqrt{s}} = 1960 GeV. Jet \pTmin in plots is 37 GeV/c --- choose generator min \pT somewhere well below this.\end{itemize} \noindent Measurement of jet shapes in inclusive jet production in p pbar collisions at center-of-mass energy \ensuremath{\sqrt{s}} = 1.96 TeV. The data cover jet transverse momenta from 37--380 GeV and absolute jet rapidities in the range 0.1--0.7. @@ -1000,7 +1000,7 @@ \penalty 100 \begin{itemize} - \item p-pbar collisions at 1960~GeV. Jet \pT bins from 54~GeV to 700~GeV. Jet rapidity $< |2.1|$.\end{itemize} + \item p-pbar collisions at 1960~GeV. Jet \pT bins from 54~GeV to 700~GeV. Jet rapidity $< |2.1|$.\end{itemize} \noindent CDF Run II measurement of inclusive jet cross sections at a p-pbar collision energy of 1.96~TeV. Jets are reconstructed in the central part of the detector ($|y|<2.1$) using the kT algorithm with an $R$ parameter of 0.7. The minimum jet \pT considered is 54~GeV, with a maximum around 700~GeV. The inclusive jet \pT is plotted in bins of rapidity $|y|<0.1$, $0.1<|y|<0.7$, $0.7<|y|<1.1$, $1.1<|y|<1.6$ and $1.6<|y|<2.1$. @@ -1025,7 +1025,7 @@ \penalty 100 \begin{itemize} - \item $p\bar{p}$ QCD interactions at 1960~GeV. Particles with $c \tau > {}$10 mm should be set stable. Several $p_\perp^\text{min}$ cutoffs are probably required to fill the profile histograms. $p_\perp^\text{min} = {}$ 0 (min bias), 10, 20, 50, 100, 150 GeV. The corresponding merging points are at $p_T = $ 0, 30, 50, 80, 130, 180 GeV\end{itemize} + \item $p\bar{p}$ QCD interactions at 1960~GeV. Particles with $c \tau > {}$10 mm should be set stable. Several $p_\perp^\text{min}$ cutoffs are probably required to fill the profile histograms. $p_\perp^\text{min} = {}$ 0 (min bias), 10, 20, 50, 100, 150 GeV. The corresponding merging points are at $p_T = $ 0, 30, 50, 80, 130, 180 GeV\end{itemize} \noindent Rick Field's measurement of the underlying event in leading jet events. If the leading jet of the event is within $|\eta| < 2$, the event is accepted and ``toward'', ``away'' and ``transverse'' regions are defined in the same way as in the original (2001) CDF underlying event analysis. The leading jet defines the $\phi$ direction of the toward region. The transverse regions are most sensitive to the underlying event. @@ -1087,9 +1087,9 @@ \penalty 100 \begin{itemize} - \item $p \bar{p} \to e^+ e^-$ + jets at 1960 GeV. Needs mass cut on lepton pair to avoid photon singularity, looser than $66 < m_{ee} < 116$\end{itemize} + \item $p \bar{p} \to e^+ e^-$ + jets at 1960 GeV. Needs mass cut on lepton pair to avoid photon singularity, looser than $66 < m_{ee} < 116$\end{itemize} -\noindent Cross sections as a function of jet transverse momentum in 1 and 2 jet events, and jet multiplicity in ppbar collisions at \ensuremath{\sqrt{s}} = 1.96 TeV, based on an integrated luminosity of $1.7~\text{fb}^{-1}$. The measurements cover the rapidity region $|y_\text{jet}| < 2.1$ and the transverse momentum range $\pT^\text{jet} > 30~\text{GeV}/c$. +\noindent Cross sections as a function of jet transverse momentum in 1 and 2 jet events, and jet multiplicity in ppbar collisions at \ensuremath{\sqrt{s}} = 1.96 TeV, based on an integrated luminosity of $1.7~\text{fb}^{-1}$. The measurements cover the rapidity region $|y_\text{jet}| < 2.1$ and the transverse momentum range $\pT^\text{jet} > 30~\text{GeV}/c$. \clearpage @@ -1118,7 +1118,7 @@ \penalty 100 \begin{itemize} - \item Requires the process $p\bar{p} \rightarrow {W} \rightarrow {e}\nu$. Additional hard jets will also have to be included to get a good description. The LO process in Herwig is set with IPROC=1451.\end{itemize} + \item Requires the process $p\bar{p} \rightarrow {W} \rightarrow {e}\nu$. Additional hard jets will also have to be included to get a good description. The LO process in Herwig is set with IPROC=1451.\end{itemize} \noindent Measurement of the cross section for W boson production in association with jets in $p\bar{p}$ collisions at $\sqrt{s}=1.96$ TeV. The analysis uses 320 pb$^{-1}$ of data collected with the CDF II detector. W bosons are identified in their $e\nu$ decay channel and jets are reconstructed using an $R < 0.4$ cone algorithm. For each $W + \geq$ n-jet sample (where n = 1--4) a measurement of d$\sigma({p}\bar{p} \rightarrow W + \geq$ n jet)/d$E_T(n^{th}$-jet) $\times$ BR($W \rightarrow{e}\nu$) is made, where d$E_T(n^{th}$-jet) is the Et of the n$^{th}$-highest Et jet above 20 GeV. A measurement of the total cross section, $\sigma(p\bar{p} \rightarrow W + \geq$ n-jet) $\times$ BR($W \rightarrow{e}\nu)$ with $E_T(n^{th}-jet) > 25$ GeV is also made. Both measurements are made for jets with $|\eta| < 2$ and for a limited region of the $W \rightarrow{e}\nu$ decay phase space; $|\eta^{e}| < 1.1$, $p_{T}^{e} > 20$ GeV, $p_{T}^{\nu} > 30$ GeV and $M_{T} > 20$ GeV. The cross secti ons are corrected for all detector effects and can be directly compared to particle level $W$ + jet(s) predictions. These measurements can be used to test and tune QCD predictions for the number of jets in and kinematics of $W$ + jets events. @@ -1270,7 +1270,7 @@ \penalty 100 \begin{itemize} - \item $p\bar{p}$ QCD interactions at 1960~GeV. Particles with $c \\tau > {}$10 mm should be set stable.\end{itemize} + \item $p\bar{p}$ QCD interactions at 1960~GeV. Particles with $c \\tau > {}$10 mm should be set stable.\end{itemize} \noindent Niccolo Moggi's min bias analysis. Minimum bias events are used to measure the average track \pT vs. charged multiplicity, a track \pT distribution and an inclusive $\sum E_T$ distribution. @@ -1299,7 +1299,7 @@ \penalty 100 \begin{itemize} - \item $p \bar{p} \to e^+ e^-$ + jets at 1960 GeV. Needs mass cut on lepton pair to avoid photon singularity, looser than $66 < m_{ee} < 116$ GeV\end{itemize} + \item $p \bar{p} \to e^+ e^-$ + jets at 1960 GeV. Needs mass cut on lepton pair to avoid photon singularity, looser than $66 < m_{ee} < 116$ GeV\end{itemize} \noindent CDF measurement of the total cross section and rapidity distribution, $\mathrm{d}\sigma/\mathrm{d}y$, for $q\bar{q}\to \gamma^{*}/Z\to e^{+}e^{-}$ events in the $Z$ boson mass region ($66<M_{ee}<116$ GeV/c$^2$) produced in $p\bar{p}$ collisions at $\sqrt{s}=1.96$ TeV with 2.1 fb$^{-1}$ of integrated luminosity. @@ -1482,7 +1482,7 @@ \item QCD events in ppbar interactions at \ensuremath{\sqrt{s}} = 1960 GeV.\end{itemize} -\noindent Correlations in the azimuthal angle between the two largest \pT jets have been measured using the D0 detector in ppbar collisions at 1960~GeV. The analysis is based on an inclusive dijet event sample in the central rapidity region. The correlations are determined for four different \pT intervals. +\noindent Correlations in the azimuthal angle between the two largest \pT jets have been measured using the D0 detector in ppbar collisions at 1960~GeV. The analysis is based on an inclusive dijet event sample in the central rapidity region. The correlations are determined for four different \pT intervals. \clearpage @@ -1513,7 +1513,7 @@ \penalty 100 \begin{itemize} - \item ppbar collisions at \ensuremath{\sqrt{s}} = 1960 GeV. Requires gamma + jet (q,qbar,g) hard processes, which for Pythia 6 means MSEL=10 for with MSUB indices 14, 18, 29, 114, 115 enabled.\end{itemize} + \item ppbar collisions at \ensuremath{\sqrt{s}} = 1960 GeV. Requires gamma + jet (q,qbar,g) hard processes, which for Pythia 6 means MSEL=10 for with MSUB indices 14, 18, 29, 114, 115 enabled.\end{itemize} \noindent Measurement of differential cross section for inclusive production of isolated photons in p pbar collisions at \ensuremath{\sqrt{s}} = 1.96 TeV with the D\O detector at the Fermilab Tevatron collider. The photons span transverse momenta 23--300 GeV and have pseudorapidity $|\eta| < 0.9$. Isolated direct photons are probes of pQCD via the annihilation ($q \bar{q} \ensuremath{\to} \gamma g$) and quark-gluon Compton scattering ($q g \ensuremath{\to} \gamma q$) processes, the latter of which is also sensitive to the gluon PDF. The initial state radiation / resummation formalisms are sensitive to the resulting photon \pT spectrum @@ -1547,7 +1547,7 @@ \item Drell-Yan $p \bar{p} \to Z/\gamma^*$ + jets events at $\sqrt{s}$ = 1960 GeV. Needs mass cut on lepton pair to avoid photon singularity, looser than $71 < m_{ee} < 111$ GeV\end{itemize} -\noindent Cross sections as a function of boson rapidity in $p \bar{p}$ collisions at $\sqrt{s}$ = 1.96 TeV, based on an integrated luminosity of $0.4~\text{fb}^{-1}$. +\noindent Cross sections as a function of boson rapidity in $p \bar{p}$ collisions at $\sqrt{s}$ = 1.96 TeV, based on an integrated luminosity of $0.4~\text{fb}^{-1}$. \clearpage @@ -1638,7 +1638,7 @@ \penalty 100 \begin{itemize} - \item QCD events at \ensuremath{\sqrt{s}} = 1960 GeV. A \pTmin cut is probably necessary since the lowest jet \pT bin is at 50 GeV\end{itemize} + \item QCD events at \ensuremath{\sqrt{s}} = 1960 GeV. A \pTmin cut is probably necessary since the lowest jet \pT bin is at 50 GeV\end{itemize} \noindent Measurement of the inclusive jet cross section in $p \bar{p}$ collisions at center-of-mass energy \ensuremath{\sqrt{s}} = 1.96 TeV. The data cover jet transverse momenta from 50--600 GeV and jet rapidities in the range -2.4 to 2.4. @@ -1671,7 +1671,7 @@ \penalty 100 \begin{itemize} - \item Produce only gamma + jet ($q,\bar{q},g$) hard processes (for Pythia 6, this means MSEL=10 and MSUB indices 14, 29 \& 115 enabled). The lowest bin edge is at 30 GeV, so a kinematic \pTmin cut is probably required to fill the histograms.\end{itemize} + \item Produce only gamma + jet ($q,\bar{q},g$) hard processes (for Pythia 6, this means MSEL=10 and MSUB indices 14, 29 \& 115 enabled). The lowest bin edge is at 30 GeV, so a kinematic \pTmin cut is probably required to fill the histograms.\end{itemize} \noindent The process $p \bar{p}$ \ensuremath{\to} photon + jet + X as studied by the D0 detector at the Fermilab Tevatron collider at center-of-mass energy \ensuremath{\sqrt{s}} = 1.96 TeV. Photons are reconstructed in the central rapidity region $|y_\gamma| < 1.0$ with transverse momenta in the range 30--400 GeV, while jets are reconstructed in either the central $|y_\text{jet}| < 0.8$ or forward $1.5 < |y_\text{jet}| < 2.5$ rapidity intervals with $\pT^\text{jet} > 15~\text{GeV}$. The differential cross section $\mathrm{d}^3 \sigma / \mathrm{d}{\pT^\gamma} \mathrm{d}{y_\gamma} \mathrm{d}{y_\text{jet}}$ is measured as a function of $\pT^\gamma$ in four regions, differing by the relative orientations of the photon and the jet. MC predictions have trouble with simultaneously describing the measured normalization and $\pT^\gamma$ dependence of the cross section in any of the four measured regions. @@ -1703,7 +1703,7 @@ \penalty 100 \begin{itemize} - \item * Event type: W production with decay to $e \, \nu_e$ only + \item * Event type: W production with decay to $e \, \nu_e$ only \item for Pythia 6: MSEL = 12, MDME(206,1) = 1 \item Energy: 1.96 TeV\end{itemize} @@ -1998,7 +1998,7 @@ \item Min bias QCD events at \ensuremath{\sqrt{s}} = 53~GeV. Run with both $pp$ and $p\bar{p}$ beams.\end{itemize} -\noindent Comparisons of multiplicity and pseudorapidity distributions for $pp$ and $p\bar{p}$ collisions at 53 GeV, based on the UA5 53~GeV runs in 1982. Data confirms the lack of significant difference between the two beams. +\noindent Comparisons of multiplicity and pseudorapidity distributions for $pp$ and $p\bar{p}$ collisions at 53 GeV, based on the UA5 53~GeV runs in 1982. Data confirms the lack of significant difference between the two beams. \clearpage @@ -2029,7 +2029,7 @@ \item * Single- and double-diffractive, plus non-diffractive inelastic, events. \item $p\bar{p}$ collider, \ensuremath{\sqrt{s}} = 200 or 900 GeV. - \item The trigger implementation for NSD events is the same as in, e.g., the UA5_1989 analysis. No further cuts are needed.\end{itemize} + \item The trigger implementation for NSD events is the same as in, e.g., the UA5_1989 analysis. No further cuts are needed.\end{itemize} \noindent This study comprises measurements of pseudorapidity distributions measured with the UA5 detector at 200 and 900 GeV center of momentum energy. There are distributions for non-single diffractive (NSD) events and also for the combination of single- and double-diffractive events. The NSD distributions are further studied for certain ranges of the events charged multiplicity. @@ -2060,7 +2060,7 @@ \item ppbar events. Non-single diffractive events need to be switched on. The trigger implementation is the same as in UA5_1989_S1926373.\end{itemize} -\noindent Data on two-particle pseudorapidity and multiplicity correlations of charged particles for non single-diffractive $\bar{p}p$ collisions at c.m. energies of 200, 546 and 900 GeV. Pseudorapidity correlations interpreted in terms of a cluster model, which has been motivated by this and other experiments, require on average about two charged particles per cluster. The decay width of the clusters in pseudorapidity is approximately independent of multiplicity and of c.m. energy. The investigations of correlations in terms of pseudorapidity gaps confirm the picture of cluster production. The strength of forward-backward multiplicity correlations increases linearly with ins and depends strongly on position and size of the pseudorapidity gap separating the forward and backward interval. All our correlation studies can be understood in terms of a cluster model in which clusters contain on average about two charged particles, i.e. are of similar magnitude to earli er estimates from the ISR. +\noindent Data on two-particle pseudorapidity and multiplicity correlations of charged particles for non single-diffractive $\bar{p}p$ collisions at c.m. energies of 200, 546 and 900 GeV. Pseudorapidity correlations interpreted in terms of a cluster model, which has been motivated by this and other experiments, require on average about two charged particles per cluster. The decay width of the clusters in pseudorapidity is approximately independent of multiplicity and of c.m. energy. The investigations of correlations in terms of pseudorapidity gaps confirm the picture of cluster production. The strength of forward-backward multiplicity correlations increases linearly with ins and depends strongly on position and size of the pseudorapidity gap separating the forward and backward interval. All our correlation studies can be understood in terms of a cluster model in which clusters contain on average about two charged particles, i.e. are of similar magnitude to earlier estimates from the ISR. \clearpage @@ -2092,7 +2092,7 @@ \item Minimum bias events at \ensuremath{\sqrt{s}} = 200 and 900 GeV. Enable single and double diffractive events in addition to non-diffractive processes.\end{itemize} -\noindent Multiplicity distributions of charged particles produced in non-single-diffractive collisions between protons and antiprotons at centre-of-mass energies of 200 and 900 GeV. The data were recorded in the UA5 streamer chambers at the CERN collider, which was operated in a pulsed mode between the two energies. This analysis confirms the violation of KNO scaling in full phase space found by the UA5 group at an energy of 546 GeV, with similar measurements at 200 and 900 GeV. +\noindent Multiplicity distributions of charged particles produced in non-single-diffractive collisions between protons and antiprotons at centre-of-mass energies of 200 and 900 GeV. The data were recorded in the UA5 streamer chambers at the CERN collider, which was operated in a pulsed mode between the two energies. This analysis confirms the violation of KNO scaling in full phase space found by the UA5 group at an energy of 546 GeV, with similar measurements at 200 and 900 GeV. \clearpage @@ -2447,7 +2447,7 @@ \penalty 100 \begin{itemize} - \item LHC pp QCD interactions at 0.9, 10 or 14 TeV. Particles with $c \tau > 10$ mm should be set stable. Several $p_\perp^\text{min}$ cutoffs are probably required to fill the profile histograms.\end{itemize} + \item LHC pp QCD interactions at 0.9, 10 or 14 TeV. Particles with $c \tau > 10$ mm should be set stable. Several $p_\perp^\text{min}$ cutoffs are probably required to fill the profile histograms.\end{itemize} \noindent Rick Field's measurement of the underlying event in leading jet events, extended to the LHC. As usual, the leading jet of the defines an azimuthal toward/transverse/away decomposition, in this case the event is accepted within $|\eta| < 2$, as in the CDF 2008 version of the analysis. Since this isn't the Tevatron, I've chosen to use $k_\perp$ rather than midpoint jets. @@ -2518,7 +2518,7 @@ \item SUSY events at any energy. \pT cutoff at 10 GeV may be advised.\end{itemize} -\noindent Analysis of generic SUSY events at the LHC, based on Atlas Herwig++ validation analysis contents. Plotted are eta, phi and \pT observables for charged tracks, photons, isolated photons, electrons, muons, and jets, as well as various dilepton mass `edge' plots for different event selection criteria. +\noindent Analysis of generic SUSY events at the LHC, based on Atlas Herwig++ validation analysis contents. Plotted are eta, phi and \pT observables for charged tracks, photons, isolated photons, electrons, muons, and jets, as well as various dilepton mass `edge' plots for different event selection criteria. \clearpage @@ -2566,7 +2566,7 @@ \item $e \, \nu$ + jets analysis.\end{itemize} -\noindent Available observables are W mass, \pT of jets 1-4, jet multiplicity, $\Delta\eta(W, \text{jet1})$, $\Delta R(\text{jet2}, \text{jet3})$, differential jet rates 0\ensuremath{\to}1, 1\ensuremath{\to}2, 2\ensuremath{\to}3, 3\ensuremath{\to}4, integrated 0--4 jet rates. +\noindent Available observables are W mass, \pT of jets 1-4, jet multiplicity, $\Delta\eta(W, \text{jet1})$, $\Delta R(\text{jet2}, \text{jet3})$, differential jet rates 0\ensuremath{\to}1, 1\ensuremath{\to}2, 2\ensuremath{\to}3, 3\ensuremath{\to}4, integrated 0--4 jet rates. \clearpage @@ -2587,9 +2587,9 @@ \penalty 100 \begin{itemize} - \item $e^+ e^-$ + jets analysis. Needs mass cut on lepton pair to avoid photon singularity, e.g. a min range of $66 < m_{ee} < 116$ GeV\end{itemize} + \item $e^+ e^-$ + jets analysis. Needs mass cut on lepton pair to avoid photon singularity, e.g. a min range of $66 < m_{ee} < 116$ GeV\end{itemize} -\noindent Available observables are Z mass, \pT of jets 1-4, jet multiplicity, $\Delta\eta(Z, \text{jet1})$, $\Delta R(\text{jet2}, \text{jet3})$, differential jet rates 0\ensuremath{\to}1, 1\ensuremath{\to}2, 2\ensuremath{\to}3, 3\ensuremath{\to}4, integrated 0--4 jet rates. +\noindent Available observables are Z mass, \pT of jets 1-4, jet multiplicity, $\Delta\eta(Z, \text{jet1})$, $\Delta R(\text{jet2}, \text{jet3})$, differential jet rates 0\ensuremath{\to}1, 1\ensuremath{\to}2, 2\ensuremath{\to}3, 3\ensuremath{\to}4, integrated 0--4 jet rates. \clearpage @@ -2637,7 +2637,7 @@ \item $e^+ e^-$ analysis on the $\Upsilon(4S)$ resonance, with CoM boost -- 8.0~GeV~($e^−$) and 3.5~GeV~($e^+$)\end{itemize} -\noindent Analysis of charm quark fragmentation at 10.6 GeV, based on a data sample of 103 fb collected by the Belle detector at the KEKB accelerator. Fragmentation into charm is studied for the main charmed hadron ground states, namely $D^0$, $D^+$, $D^+_s$ and $\Lambda_c^+$, as well as the excited states $D^{*0}$ and $D^{*+}$. This analysis can be used to constrain charm fragmentation in Monte Carlo generators. Additionally, we determine the average number of these charmed hadrons produced per B decay at the $\Upsilon(4S)$ resonance and measure the distribution of their production angle in $e^+ e^-$ annihilation events and in B decays. +\noindent Analysis of charm quark fragmentation at 10.6 GeV, based on a data sample of 103 fb collected by the Belle detector at the KEKB accelerator. Fragmentation into charm is studied for the main charmed hadron ground states, namely $D^0$, $D^+$, $D^+_s$ and $\Lambda_c^+$, as well as the excited states $D^{*0}$ and $D^{*+}$. This analysis can be used to constrain charm fragmentation in Monte Carlo generators. Additionally, we determine the average number of these charmed hadrons produced per B decay at the $\Upsilon(4S)$ resonance and measure the distribution of their production angle in $e^+ e^-$ annihilation events and in B decays. \clearpage Modified: trunk/include/Rivet/Analysis.hh ============================================================================== --- trunk/include/Rivet/Analysis.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Analysis.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -148,7 +148,7 @@ virtual std::string collider() const; /// Return the pair of incoming beams required by this analysis. - virtual const std::vector<BeamPair> requiredBeams() const; + virtual const std::vector<PdgIdPair> requiredBeams() const; /// Sets of valid beam energy pairs, in GeV virtual const std::vector<std::pair<double, double> >& energies() const; @@ -183,7 +183,7 @@ const ParticlePair& beams() const; /// Incoming beam IDs for this run - const BeamPair beamIds() const; + const PdgIdPair beamIds() const; /// Centre of mass energy for this run double sqrtS() const; @@ -194,10 +194,10 @@ public: /// Is this analysis able to run on the supplied pair of beams? - virtual bool isCompatible(const ParticleName& beam1, const ParticleName& beam2) const; + virtual bool isCompatible(PdgId beam1, PdgId beam2) const; - /// Is this analysis able to run on the BeamPair @a beams ? - virtual bool isCompatible(const BeamPair& beams) const; + /// Is this analysis able to run on the PdgIdPair @a beams ? + virtual bool isCompatible(const PdgIdPair& beams) const; /// Access the controlling AnalysisHandler object. AnalysisHandler& handler() const; @@ -410,7 +410,7 @@ /// Set the colliding beam pair. /// @deprecated Use .info file and AnalysisInfo class instead - Analysis& setBeams(const ParticleName& beam1, const ParticleName& beam2); + Analysis& setBeams(PdgId beam1, PdgId beam2); /// Declare whether this analysis needs to know the process cross-section from the generator. Analysis& setNeedsCrossSection(bool needed); Modified: trunk/include/Rivet/AnalysisHandler.hh ============================================================================== --- trunk/include/Rivet/AnalysisHandler.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/AnalysisHandler.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -144,7 +144,7 @@ } /// Get beam IDs for this run, determined from first event - BeamPair beamIds() const; + PdgIdPair beamIds() const; /// Get energy for this run, determined from first event double sqrtS() const; @@ -189,7 +189,7 @@ /// Remove beam-incompatible analyses from the run list. /// @todo Do this automatically in the init phase (including energies) and deprecate explicit use - AnalysisHandler& removeIncompatibleAnalyses(const BeamPair& beams); + AnalysisHandler& removeIncompatibleAnalyses(const PdgIdPair& beams); //@} @@ -313,8 +313,6 @@ /// fact, it should not even be implemented. AnalysisHandler(const AnalysisHandler&); - static void initializeParticleNames(); - }; Modified: trunk/include/Rivet/AnalysisInfo.hh ============================================================================== --- trunk/include/Rivet/AnalysisInfo.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/AnalysisInfo.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -8,7 +8,7 @@ namespace Rivet { - class AnalysisInfo { + class AnalysisInfo { /// @todo Remove this when all metadata taken from YAML friend class Analysis; @@ -76,11 +76,11 @@ const std::string& runInfo() const { return _runInfo; } /// Beam particle types - const std::vector<std::pair<ParticleName,ParticleName> >& beams() const { return _beams; } + const std::vector<std::pair<PdgId,PdgId> >& beams() const { return _beams; } - /// Sets of valid beam energy pairs + /// Sets of valid beam energy pairs const std::vector<std::pair<double,double> >& energies() const { return _energies; } - + /// Experiment which performed and published this analysis. const std::string& experiment() const { return _experiment; } @@ -99,7 +99,7 @@ const std::string& bibKey() const { return _bibKey;} /// BibTeX citation entry for this article. - const std::string& bibTeX() const { + const std::string& bibTeX() const { //return "@Article{" + bibKey() + ",\n" + _bibTeXBody + "\n}"; return _bibTeX; } @@ -125,7 +125,7 @@ std::string _runInfo; std::string _experiment; std::string _collider; - std::vector<std::pair<ParticleName, ParticleName> > _beams; + std::vector<std::pair<PdgId, PdgId> > _beams; std::vector<std::pair<double, double> > _energies; std::string _year; std::vector<std::string> _references; Modified: trunk/include/Rivet/BeamConstraint.hh ============================================================================== --- trunk/include/Rivet/BeamConstraint.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/BeamConstraint.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -18,10 +18,10 @@ return (allowed == ANY || p == allowed); } - /// Find whether BeamPair @a pair is compatible with the template - /// BeamPair @a allowedpair. This assesses whether either of the + /// Find whether PdgIdPair @a pair is compatible with the template + /// PdgIdPair @a allowedpair. This assesses whether either of the /// two possible pairings of @a pair's constituents is compatible. - inline bool compatible(const BeamPair& pair, const BeamPair& allowedpair) { + inline bool compatible(const PdgIdPair& pair, const PdgIdPair& allowedpair) { bool oneToOne = compatible(pair.first, allowedpair.first); bool twoToTwo = compatible(pair.second, allowedpair.second); bool oneToTwo = compatible(pair.first, allowedpair.second); @@ -32,30 +32,30 @@ /// Check particle compatibility of Particle pairs inline bool compatible(const ParticlePair& ppair, - const BeamPair& allowedpair) { + const PdgIdPair& allowedpair) { return compatible(make_pdgid_pair(ppair.first.pdgId(), ppair.second.pdgId()), allowedpair); } /// Check particle compatibility of Particle pairs (for symmetric completeness) - inline bool compatible(const BeamPair& allowedpair, + inline bool compatible(const PdgIdPair& allowedpair, const ParticlePair& ppair) { return compatible(ppair, allowedpair); } - /// Find whether a BeamPair @a pair is compatible with at least one template + /// Find whether a PdgIdPair @a pair is compatible with at least one template /// beam pair in a set @a allowedpairs. - inline bool compatible(const BeamPair& pair, const set<BeamPair>& allowedpairs) { - for (set<BeamPair>::const_iterator bp = allowedpairs.begin(); bp != allowedpairs.end(); ++bp) { + inline bool compatible(const PdgIdPair& pair, const set<PdgIdPair>& allowedpairs) { + for (set<PdgIdPair>::const_iterator bp = allowedpairs.begin(); bp != allowedpairs.end(); ++bp) { if (compatible(pair, *bp)) return true; } return false; } - /// Return the intersection of two sets of {@link BeamPair}s. - inline set<BeamPair> intersection(const set<BeamPair>& a, const set<BeamPair>& b) { - set<BeamPair> ret; - for (set<BeamPair>::const_iterator bp = a.begin(); bp != a.end(); ++bp) { + /// Return the intersection of two sets of {@link PdgIdPair}s. + inline set<PdgIdPair> intersection(const set<PdgIdPair>& a, const set<PdgIdPair>& b) { + set<PdgIdPair> ret; + for (set<PdgIdPair>::const_iterator bp = a.begin(); bp != a.end(); ++bp) { if (compatible(*bp, b)) ret.insert(*bp); } return ret; Modified: trunk/include/Rivet/Exceptions.hh ============================================================================== --- trunk/include/Rivet/Exceptions.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Exceptions.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -7,6 +7,7 @@ namespace Rivet { + /// @brief Generic runtime Rivet error. class Error : public std::runtime_error { public: @@ -31,6 +32,14 @@ LogicError(const std::string& what) : Error(what) {} }; + + /// @brief Error specialisation for failures relating to particle ID codes. + class PidError : public Error { + public: + PidError(const std::string& what) : Error(what) {} + }; + + /// @brief Errors relating to event/bin weights /// Arises in computing statistical quantities because e.g. the bin /// weight is zero or negative. @@ -39,6 +48,7 @@ WeightError(const std::string& what) : Error(what) {} }; + } #endif Modified: trunk/include/Rivet/Makefile.am ============================================================================== --- trunk/include/Rivet/Makefile.am Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Makefile.am Tue Jun 8 16:48:37 2010 (r2471) @@ -8,6 +8,7 @@ nobase_pkginclude_HEADERS += \ Rivet.hh Exceptions.hh \ RivetBoost.hh RivetHepMC.hh \ + RivetSTL.hh \ Constraints.hh BeamConstraint.hh \ Event.hh Event.fhh \ ParticleBase.hh Jet.hh \ Modified: trunk/include/Rivet/Particle.fhh ============================================================================== --- trunk/include/Rivet/Particle.fhh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Particle.fhh Tue Jun 8 16:48:37 2010 (r2471) @@ -2,28 +2,39 @@ #ifndef RIVET_Particle_FHH #define RIVET_Particle_FHH -#include "Rivet/Rivet.hh" +#include "Rivet/RivetSTL.hh" namespace Rivet { + /// @name Particle declarations + //@{ + + // Forward declaration class Particle; - - /** Typedef a vector of Particle objects. */ + + /// Typedef for a vector of Particle objects. typedef std::vector<Particle> ParticleVector; - - /** Typedef a pair of Particle objects. */ + + /// Typedef for a pair of Particle objects. typedef std::pair<Particle, Particle> ParticlePair; + //@} + + + /// @name PdgId declarations + //@{ + /// Typedef for a PDG ID code. typedef int PdgId; /// Typedef for a pair of particle names. - typedef std::pair<PdgId, PdgId> PidPair; + typedef std::pair<PdgId, PdgId> PdgIdPair; + + //@} - /// Typedef for a pair of beam particle names. - typedef std::pair<PdgId, PdgId> BeamPair; } + #endif Modified: trunk/include/Rivet/Particle.hh ============================================================================== --- trunk/include/Rivet/Particle.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Particle.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -18,19 +18,22 @@ /// Default constructor. /// @deprecated A particle without info is useless. This only exists to keep STL containers happy. - Particle() : ParticleBase(), - _original(0), _id(0), _momentum() + Particle() + : ParticleBase(), + _original(0), _id(0), _momentum() { } /// Constructor without GenParticle. - Particle(PdgId pid, const FourMomentum& mom) : ParticleBase(), - _original(0), _id(pid), _momentum(mom) + Particle(PdgId pid, const FourMomentum& mom) + : ParticleBase(), + _original(0), _id(pid), _momentum(mom) { } /// Constructor from a HepMC GenParticle. - Particle(const GenParticle& gp) : ParticleBase(), - _original(&gp), _id(gp.pdg_id()), - _momentum(gp.momentum()) + Particle(const GenParticle& gp) + : ParticleBase(), + _original(&gp), _id(gp.pdg_id()), + _momentum(gp.momentum()) { } @@ -44,43 +47,43 @@ /// Check if the particle corresponds to a GenParticle. - bool hasGenParticle() const { - return bool(_original); + bool hasGenParticle() const { + return bool(_original); } /// The PDG ID code for this Particle. - long pdgId() const { - return _id; + long pdgId() const { + return _id; } /// The momentum of this Particle. - const FourMomentum& momentum() const { - return _momentum; + const FourMomentum& momentum() const { + return _momentum; } /// Set the momentum of this Particle. - Particle& setMomentum(const FourMomentum& momentum) { - _momentum = momentum; - return *this; + Particle& setMomentum(const FourMomentum& momentum) { + _momentum = momentum; + return *this; } /// The mass of this Particle. - double mass() const { - return momentum().mass(); + double mass() const { + return momentum().mass(); } // /// The charge of this Particle. - // double charge() const { - // return PID::charge(*this); + // double charge() const { + // return PID::charge(*this); // } // /// Three times the charge of this Particle (i.e. integer multiple of smallest quark charge). - // int threeCharge() const { - // return PID::threeCharge(*this); + // int threeCharge() const { + // return PID::threeCharge(*this); // } @@ -107,7 +110,7 @@ /// Print a ParticlePair as a string. inline std::string toString(const ParticlePair& pair) { stringstream out; - out << "[" + out << "[" << toParticleName(pair.first.pdgId()) << " @ " << pair.first.momentum().E()/GeV << " GeV, " << toParticleName(pair.second.pdgId()) << " @ " Modified: trunk/include/Rivet/ParticleName.hh ============================================================================== --- trunk/include/Rivet/ParticleName.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/ParticleName.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -1,180 +1,177 @@ #ifndef RIVET_PARTICLENAME_HH #define RIVET_PARTICLENAME_HH -#include "Rivet/Rivet.hh" #include "Rivet/Particle.fhh" - -namespace Rivet { +#include "Rivet/Exceptions.hh" - /// Enumeration of available beam particles (using PDG IDs where available) - enum ParticleName { - ELECTRON = 11, - POSITRON = -11, - PROTON = 2212, - ANTIPROTON = -2212, - PHOTON = 22, - NEUTRON = 2112, - ANTINEUTRON = -2112, - MUON = 13, - ANTIMUON = -13, - NU_E = 12, - NU_EBAR = -12, - NU_MU = 14, - NU_MUBAR = -14, - NU_TAU = 16, - NU_TAUBAR = -16, - PIPLUS = 211, - PIMINUS = -211, - K0L = 130, - K0S = 310, - KPLUS = 321, - KMINUS = -321, - LAMBDA = 3122, - LAMBDABAR = -3122, - XIMINUS = 3312, - XIPLUS = -3312, - OMEGAMINUS = 3334, - OMEGAPLUS = -3334, - TAU = 15, - ANTITAU = -15, - EMINUS = 11, - EPLUS = -11, - P = 2212, - PBAR = -2212, - GLUON = 21, - GAMMA = 22, - WPLUSBOSON = 24, - WMINUSBOSON = -24, - ZBOSON = 23, - HIGGS = 25, - DQUARK = 1, - UQUARK = 2, - SQUARK = 3, - CQUARK = 4, - BQUARK = 5, - TQUARK = 6, - ANY = 10000, - PHOTOELECTRON, - PHOTOPOSITRON, - PHOTOMUON, - PHOTOANTIMUON, - PHOTOTAU, - PHOTOANTITAU - }; +namespace Rivet { - /// Convenience maker of particle ID pairs. - inline std::pair<PdgId,PdgId> make_pdgid_pair(PdgId a, PdgId b) { - return make_pair<PdgId,PdgId>(a, b); - } + /// @name Static const convenience particle ID names + //@{ + static const PdgId ELECTRON = 11; + static const PdgId POSITRON = -11; + static const PdgId PROTON = 2212; + static const PdgId ANTIPROTON = -2212; + static const PdgId PHOTON = 22; + static const PdgId NEUTRON = 2112; + static const PdgId ANTINEUTRON = -2112; + static const PdgId MUON = 13; + static const PdgId ANTIMUON = -13; + static const PdgId NU_E = 12; + static const PdgId NU_EBAR = -12; + static const PdgId NU_MU = 14; + static const PdgId NU_MUBAR = -14; + static const PdgId NU_TAU = 16; + static const PdgId NU_TAUBAR = -16; + static const PdgId PIPLUS = 211; + static const PdgId PIMINUS = -211; + static const PdgId K0L = 130; + static const PdgId K0S = 310; + static const PdgId KPLUS = 321; + static const PdgId KMINUS = -321; + static const PdgId LAMBDA = 3122; + static const PdgId LAMBDABAR = -3122; + static const PdgId XIMINUS = 3312; + static const PdgId XIPLUS = -3312; + static const PdgId OMEGAMINUS = 3334; + static const PdgId OMEGAPLUS = -3334; + static const PdgId TAU = 15; + static const PdgId ANTITAU = -15; + static const PdgId EMINUS = 11; + static const PdgId EPLUS = -11; + static const PdgId P = 2212; + static const PdgId PBAR = -2212; + static const PdgId GLUON = 21; + static const PdgId GAMMA = 22; + static const PdgId WPLUSBOSON = 24; + static const PdgId WMINUSBOSON = -24; + static const PdgId ZBOSON = 23; + static const PdgId HIGGS = 25; + static const PdgId DQUARK = 1; + static const PdgId UQUARK = 2; + static const PdgId SQUARK = 3; + static const PdgId CQUARK = 4; + static const PdgId BQUARK = 5; + static const PdgId TQUARK = 6; + static const PdgId ANY = 10000; + // static const PdgId PHOTOELECTRON; + // static const PdgId PHOTOPOSITRON; + // static const PdgId PHOTOMUON; + // static const PdgId PHOTOANTIMUON; + // static const PdgId PHOTOTAU; + // static const PdgId PHOTOANTITAU; + //@} + + + class ParticleNames { + public: + + static const std::string& particleName(PdgId pid) { + if (!_instance) _instance = new ParticleNames(); + return _instance->_particleName(pid); + } - /// Convenience maker of particle ID pairs. - // inline std::pair<PdgId,PdgId> make_pdgid_pair(ParticleName aname, ParticleName bname) { - // return make_pdgid_pair(aname, bname); - // } - - /// Convenience maker of particle ID pairs. - inline std::pair<PdgId,PdgId> make_pdgid_pair(const std::pair<ParticleName,ParticleName>& pnamepair) { - return make_pdgid_pair(pnamepair.first, pnamepair.second); - } + static PdgId particleId(const std::string& pname) { + if (!_instance) _instance = new ParticleNames(); + return _instance->_particleId(pname); + } - /// Typedef for a map of beam particle name enums to strings. - typedef std::map<PdgId, std::string> ParticleNameMap; + public: - /// Typedef for a map of beam particle name strings to enums. - typedef std::map<std::string, PdgId> ParticleNameMapR; + const std::string& _particleName(PdgId pid); - static ParticleNameMap s_pnames; + PdgId _particleId(const std::string& pname); - /// Function which returns a map from beam particle name strings to the corresponding enums. - inline ParticleNameMapR getParticleNamesRMap() { - ParticleNameMapR bpmapr; - for (ParticleNameMap::const_iterator bp = s_pnames.begin(); bp != s_pnames.end(); ++bp) { - bpmapr[bp->second] = bp->first; + private: + + ParticleNames() { + _add_pid_name(ELECTRON, "ELECTRON"); + _add_pid_name(POSITRON, "POSITRON"); + _add_pid_name(PROTON, "PROTON"); + _add_pid_name(ANTIPROTON, "ANTIPROTON"); + _add_pid_name(PHOTON, "PHOTON"); + _add_pid_name(NEUTRON, "NEUTRON"); + _add_pid_name(ANTINEUTRON, "ANTINEUTRON"); + _add_pid_name(MUON, "MUON"); + _add_pid_name(ANTIMUON, "ANTIMUON"); + _add_pid_name(NU_E, "NU_E"); + _add_pid_name(NU_EBAR, "NU_EBAR"); + _add_pid_name(NU_MU, "NU_MU"); + _add_pid_name(NU_MUBAR, "NU_MUBAR"); + _add_pid_name(NU_TAU, "NU_TAU"); + _add_pid_name(NU_TAUBAR, "NU_TAUBAR"); + _add_pid_name(PIPLUS, "PIPLUS"); + _add_pid_name(PIMINUS, "PIMINUS"); + _add_pid_name(TAU, "TAU"); + _add_pid_name(WPLUSBOSON, "WPLUSBOSON"); + _add_pid_name(WMINUSBOSON, "WMINUSBOSON"); + _add_pid_name(ZBOSON, "ZBOSON"); + _add_pid_name(HIGGS, "HIGGS"); + _add_pid_name(ANTITAU, "ANTITAU"); + // _add_pid_name(PHOTOELECTRON, "PHOTOELECTRON"); + // _add_pid_name(PHOTOPOSITRON, "PHOTOPOSITRON"); + // _add_pid_name(PHOTOMUON, "PHOTOMUON"); + // _add_pid_name(PHOTOANTIMUON, "PHOTOANTIMUON"); + // _add_pid_name(PHOTOTAU, "PHOTOTAU"); + // _add_pid_name(PHOTOANTITAU, "PHOTOANTITAU"); + _add_pid_name(ANY, "*"); } - return bpmapr; - } - - - /// Typedef for a collection of beam particle name enums. - typedef std::vector<PdgId> ParticleNameList; - - /// Function which returns a vector of all the beam particle values in - /// the ParticleName enum. - inline ParticleNameList getParticleNameEnums() { - ParticleNameList names; - for (ParticleNameMap::const_iterator bp = s_pnames.begin(); bp != s_pnames.end(); ++bp) { - names.push_back(bp->first); + void _add_pid_name(PdgId pid, const std::string& pname) { + _ids_names[pid] = pname; + _names_ids[pname] = pid; } - return names; - } - /// Function which converts a particle name string to a ParticleName enum - inline ParticleName getParticleNameEnum(const std::string& pname) { - return (ParticleName) Rivet::getParticleNamesRMap()[pname]; - } + static ParticleNames* _instance; + std::map<PdgId, std::string> _ids_names; + std::map<std::string, PdgId> _names_ids; - /// Function which returns a vector of all the beam particle name strings. - inline std::vector<std::string> getParticleNames() { - vector<string> names; - for (ParticleNameMap::const_iterator bp = s_pnames.begin(); bp != s_pnames.end(); ++bp) { - names.push_back(bp->second); - } - return names; - } + }; - /// Print a ParticleName as a string. - inline std::string toString(const ParticleName& p) { - return s_pnames[p]; + /// Print a PdgId as a named string. + inline const std::string& toParticleName(PdgId p) { + return ParticleNames::particleName(p); } /// Print a PdgId as a named string. - inline std::string toParticleName(PdgId p) { - if (s_pnames.find(p) != s_pnames.end()) { - return s_pnames[p]; - } - ostringstream ss; - ss << p; - return ss.str(); + inline PdgId toParticleId(const std::string& pname) { + return ParticleNames::particleId(pname); } - /// Allow ParticleName to be passed to an iostream. - inline std::ostream& operator<<(std::ostream& os, const ParticleName& p) { - os << toString(p); - return os; + /// Convenience maker of particle ID pairs from PdgIds. + inline std::pair<PdgId,PdgId> make_pdgid_pair(PdgId a, PdgId b) { + return make_pair<PdgId,PdgId>(a, b); } - ///////////////////////////////////////////////// - // Beams + /// Convenience maker of particle ID pairs from particle names. + inline std::pair<PdgId,PdgId> make_pdgid_pair(const std::string& a, const std::string& b) { + const PdgId pa = toParticleId(a); + const PdgId pb = toParticleId(b); + return make_pair<PdgId,PdgId>(pa, pb); + } + - /// Print a BeamPair as a string. - inline std::string toString(const BeamPair& pair) { + /// Print a PdgIdPair as a string. + inline std::string toBeamsString(const PdgIdPair& pair) { string out = "[" + toParticleName(pair.first) + ", " + toParticleName(pair.second) + "]"; return out; } - /// Allow BeamPair to be passed to an ostream. - inline std::ostream& operator<<(std::ostream& os, const BeamPair& bp) { - os << toString(bp); - return os; - } - } - #endif Modified: trunk/include/Rivet/Projection.hh ============================================================================== --- trunk/include/Rivet/Projection.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Projection.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -95,7 +95,7 @@ /// recursion. Derived classes should ensure that all contained projections /// are registered in the @a _projections set for the beam constraint /// chaining to work. - virtual const std::set<BeamPair> beamPairs() const; + virtual const std::set<PdgIdPair> beamPairs() const; /// Get the name of the projection. virtual std::string name() const { @@ -104,8 +104,8 @@ /// Add a colliding beam pair. - Projection& addBeamPair(const ParticleName& beam1, const ParticleName& beam2) { - _beamPairs.insert(BeamPair(beam1, beam2)); + Projection& addPdgIdPair(PdgId beam1, PdgId beam2) { + _beamPairs.insert(PdgIdPair(beam1, beam2)); return *this; } @@ -140,7 +140,7 @@ string _name; /// Beam-type constraint. - set<BeamPair> _beamPairs; + set<PdgIdPair> _beamPairs; }; Modified: trunk/include/Rivet/Projections/Beam.hh ============================================================================== --- trunk/include/Rivet/Projections/Beam.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Projections/Beam.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -16,10 +16,10 @@ ParticlePair beams(const Event& e); /// Function to get beam particle IDs from an event - BeamPair beamIds(const Event& e); + PdgIdPair beamIds(const Event& e); /// Function to get beam particle IDs from a pair of particles - BeamPair beamIds(const ParticlePair& beams); + PdgIdPair beamIds(const ParticlePair& beams); /// Function to get beam centre of mass energy from an event double sqrtS(const Event& e); @@ -58,7 +58,7 @@ } /// The pair of beam particle PDG codes in the current collision. - const BeamPair beamIds() const { + const PdgIdPair beamIds() const { return Rivet::beamIds(beams()); } Modified: trunk/include/Rivet/Projections/DISKinematics.hh ============================================================================== --- trunk/include/Rivet/Projections/DISKinematics.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Projections/DISKinematics.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -21,7 +21,7 @@ : _theQ2(-1.0), _theW2(-1.0), _theX(-1.0), _theY(-1.0), _theS(-1.0) { setName("DISKinematics"); - //addBeamPair(ANY, hadid); + //addPdgIdPair(ANY, hadid); addProjection(Beam(), "Beam"); addProjection(DISLepton(), "Lepton"); } Modified: trunk/include/Rivet/Projections/InvMassFinalState.hh ============================================================================== --- trunk/include/Rivet/Projections/InvMassFinalState.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Projections/InvMassFinalState.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -47,11 +47,8 @@ private: - /// Handy typedef for a pair of PID codes - typedef pair<PdgId,PdgId> PidPair; - /// IDs of the decay products - std::vector<PidPair> _decayids; + std::vector<PdgIdPair> _decayids; /// Constituent pairs std::vector<std::pair<Particle, Particle> > _particlePairs; Modified: trunk/include/Rivet/Rivet.hh ============================================================================== --- trunk/include/Rivet/Rivet.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Rivet.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -4,22 +4,8 @@ #include "Rivet/Config/RivetConfig.hh" #include "Rivet/Config/BuildOptions.hh" -#include <typeinfo> -#include <set> -#include <list> -#include <map> -#include <utility> -#include <string> -#include <sstream> -#include <vector> -#include <stdexcept> -#include <iostream> -#include <iomanip> -#include <cmath> -#include <limits> -#include <cassert> -#include <fstream> - +// Bring selected STL classes into the Rivet namespace +#include "Rivet/RivetSTL.hh" // Macro to help with overzealous compiler warnings #ifdef UNUSED @@ -34,30 +20,6 @@ namespace Rivet { - // Convenient imports of common STL classes and functions. - using std::set; - using std::map; - using std::multimap; - using std::type_info; - using std::string; - using std::stringstream; - using std::less; - using std::list; - using std::vector; - using std::pair; - using std::make_pair; - using std::runtime_error; - using std::min; - using std::max; - using std::numeric_limits; - using std::ostream; - using std::istream; - using std::cout; - using std::cin; - using std::cerr; - using std::setw; - using std::endl; - /// A sensible default maximum value of rapidity for Rivet analyses to use. static const double MAXRAPIDITY = 100000.0; /// @deprecated @@ -82,8 +44,9 @@ #include "Rivet/Math/Matrices.hh" #include "Rivet/Math/Units.hh" #include "Rivet/Tools/Utils.hh" -#include "Rivet/Particle.hh" + #include "Rivet/ParticleName.hh" +#include "Rivet/Particle.hh" namespace Rivet { Modified: trunk/include/Rivet/RivetAIDA.hh ============================================================================== --- trunk/include/Rivet/RivetAIDA.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/RivetAIDA.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -19,9 +19,9 @@ #include "LWH/AITree.h" #include "LWH/AIAxis.h" - namespace Rivet { + AIDA::IAnalysisFactory* createAnalysisFactory(); /// Function to get a map of all the bin edge vectors in a paper with the @@ -36,18 +36,17 @@ /// Get the file system path to the AIDA reference file for this paper. const string getDataPath(string papername); - /// Return the integral over the histogram bins assuming it has been - // normalize()d. + /// Return the integral over the histogram bins inline double integral(AIDA::IHistogram1D* histo) { double intg = 0.; - for ( int i = 0; i < histo->axis().bins(); ++i ) + for ( int i = 0; i < histo->axis().bins(); ++i ) { // Don't multiply with binWidth -- it's already included in binHeight intg += histo->binHeight(i); // * histo->axis().binWidth(i); + } return intg; } - using AIDA::IHistogram1D; using AIDA::IDataPointSet; using AIDA::IDataPoint; @@ -56,6 +55,7 @@ using AIDA::IAxis; using AIDA::IProfile1D; + } #endif Modified: trunk/include/Rivet/RivetBoost.hh ============================================================================== --- trunk/include/Rivet/RivetBoost.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/RivetBoost.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -19,6 +19,7 @@ // Clever casts using boost::lexical_cast; + using boost::bad_lexical_cast; // Clever assignment shortcuts using namespace boost::assign; Added: trunk/include/Rivet/RivetSTL.hh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/include/Rivet/RivetSTL.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -0,0 +1,49 @@ +#ifndef RIVET_RivetSTL_HH +#define RIVET_RivetSTL_HH + +#include <typeinfo> +#include <set> +#include <list> +#include <map> +#include <utility> +#include <string> +#include <sstream> +#include <vector> +#include <stdexcept> +#include <iostream> +#include <iomanip> +#include <cmath> +#include <limits> +#include <cassert> +#include <fstream> + + +namespace Rivet { + + // Convenient imports of common STL classes and functions. + using std::set; + using std::map; + using std::multimap; + using std::type_info; + using std::string; + using std::stringstream; + using std::less; + using std::list; + using std::vector; + using std::pair; + using std::make_pair; + using std::runtime_error; + using std::min; + using std::max; + using std::numeric_limits; + using std::ostream; + using std::istream; + using std::cout; + using std::cin; + using std::cerr; + using std::setw; + using std::endl; + +} + +#endif Modified: trunk/include/Rivet/Tools/Utils.hh ============================================================================== --- trunk/include/Rivet/Tools/Utils.hh Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/include/Rivet/Tools/Utils.hh Tue Jun 8 16:48:37 2010 (r2471) @@ -2,7 +2,7 @@ #ifndef RIVET_Utils_HH #define RIVET_Utils_HH -#include <Rivet/Rivet.hh> +// #include <Rivet/Rivet.hh> #include <Rivet/Math/Math.hh> #include <cctype> #include <algorithm> @@ -83,28 +83,10 @@ /// Get Rivet data install path const string getRivetDataPath(); - /// Get RivetGun data install path - const string getRivetgunDataPath(); - - - // Return distance of closest approach from track to given (primary) vertex position. - double get2dClosestApproach(const HepMC::GenParticle& track, const Vector3& vtx3pos); - - // Return distance of closest approach from track to given (primary) vertex position. - double get3dClosestApproach(const HepMC::GenParticle& track, const Vector3& vtx3pos); - - /// Return 2-dimensional decay length between two vertices in transverse plane. - double get2dDecayLength(const Vector3& vtx1, const Vector3& vtx2, const FourMomentum& jetaxis); - - /// Return 3-dimensional decay length between vertices. - double get3dDecayLength(const Vector3& vtx1, const Vector3& vtx2, const FourMomentum& jetaxis); } -#endif -#ifndef CEDARSTD -#define CEDARSTD namespace std { template <typename T> @@ -132,4 +114,5 @@ } } + #endif Modified: trunk/pyext/rivet.i ============================================================================== --- trunk/pyext/rivet.i Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/pyext/rivet.i Tue Jun 8 16:48:37 2010 (r2471) @@ -29,8 +29,7 @@ %include "Rivet/Particle.fhh" %include "Rivet/ParticleName.hh" %template(PdgIdPair) std::pair<Rivet::PdgId,Rivet::PdgId>; -%template(PdgIdPairList) std::vector<Rivet::BeamPair>; -//%template(PdgIdPairList) std::vector< std::pair<PdgId,PdgId> >; +%template(PdgIdPairList) std::vector<Rivet::PdgIdPair>; // Logging interface %template(LogLevelMap) std::map<std::string, int>; @@ -62,7 +61,7 @@ ParticlePair beams(const Event& e); - BeamPair beamIds(const HepMC::GenEvent& e) { + PdgIdPair beamIds(const HepMC::GenEvent& e) { return beamIds(Event(e)); } @@ -80,7 +79,7 @@ virtual std::string experiment() const; virtual std::string collider() const; virtual std::string year() const; - virtual const std::vector<BeamPair>& requiredBeams() const; + virtual const std::vector<PdgIdPair>& requiredBeams() const; virtual const std::vector<std::pair<double,double> >& energies() const; virtual std::vector<std::string> authors() const; virtual std::vector<std::string> references() const; @@ -88,9 +87,8 @@ virtual std::string status() const; virtual std::string bibKey() const; virtual std::string bibTeX() const; - virtual const bool isCompatible(const ParticleName& beam1, - const ParticleName& beam2) const; - virtual const bool isCompatible(const BeamPair& beams) const; + virtual const bool isCompatible(PdgId beam1, PdgId beam2) const; + virtual const bool isCompatible(const PdgIdPair& beams) const; //AnalysisHandler& handler() const; bool needsCrossSection() const; private: @@ -109,13 +107,13 @@ double sumOfWeights() const; double sqrtS() const; const ParticlePair& beams() const; - const BeamPair& beamIds() const; + const PdgIdPair& beamIds() const; std::vector<std::string> analysisNames(); AnalysisHandler& addAnalysis(const std::string& analysisname); AnalysisHandler& addAnalyses(const std::vector<std::string>& analysisnames); AnalysisHandler& removeAnalysis(const std::string& analysisname); AnalysisHandler& removeAnalyses(const std::vector<std::string>& analysisnames); - AnalysisHandler& removeIncompatibleAnalyses(const BeamPair& beams); + AnalysisHandler& removeIncompatibleAnalyses(const PdgIdPair& beams); void init(); void init(const HepMC::GenEvent& event); void analyze(const HepMC::GenEvent& event); Modified: trunk/pyext/setup.py.in ============================================================================== --- trunk/pyext/setup.py.in Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/pyext/setup.py.in Tue Jun 8 16:48:37 2010 (r2471) @@ -2,9 +2,9 @@ from distutils.core import setup, Extension -longdesc = """This is a simple SWIG wrapper on the main steering interface of -the Rivet event simulation analysis library. It is used to create, query and -use the Rivet C++ analysis classes from a Python program, of which the prime +longdesc = """This is a simple SWIG wrapper on the main steering interface of +the Rivet event simulation analysis library. It is used to create, query and +use the Rivet C++ analysis classes from a Python program, of which the prime example is Rivet's own command line interface. """ Modified: trunk/src/Analyses/D0_2004_S5992206.cc ============================================================================== --- trunk/src/Analyses/D0_2004_S5992206.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Analyses/D0_2004_S5992206.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -49,14 +49,11 @@ // Veto neutrinos, and muons with pT above 1.0 GeV VetoedFinalState vfs(fs); vfs.vetoNeutrinos(); - //VisibleFinalState vfs(fs); vfs.addVetoPairDetail(MUON, 1.0*GeV, MAXDOUBLE); addProjection(vfs, "VFS"); addProjection(FastJets(vfs, FastJets::D0ILCONE, 0.7), "Jets"); addProjection(MissingMomentum(vfs), "CalMET"); - - // Book histograms _histJetAzimuth_pTmax75_100 = bookHistogram1D(1, 2, 1); _histJetAzimuth_pTmax100_130 = bookHistogram1D(2, 2, 1); Modified: trunk/src/Core/Analysis.cc ============================================================================== --- trunk/src/Core/Analysis.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Core/Analysis.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -80,7 +80,7 @@ return handler().beams(); } - const BeamPair Analysis::beamIds() const { + const PdgIdPair Analysis::beamIds() const { return handler().beamIds(); } @@ -202,10 +202,9 @@ return _info->todos(); } - const vector<BeamPair> Analysis::requiredBeams() const { - vector<BeamPair> reqbeams; - typedef std::pair<ParticleName,ParticleName> ParticleNamePair; - foreach (const ParticleNamePair& bp, info().beams()) { + const vector<PdgIdPair> Analysis::requiredBeams() const { + vector<PdgIdPair> reqbeams; + foreach (const PdgIdPair& bp, info().beams()) { reqbeams += bp; } return reqbeams; @@ -213,7 +212,7 @@ /// @todo Deprecate? - Analysis& Analysis::setBeams(const ParticleName& beam1, const ParticleName& beam2) { + Analysis& Analysis::setBeams(PdgId beam1, PdgId beam2) { assert(_info.get() != 0); _info->_beams.clear(); _info->_beams += make_pair(beam1, beam2); @@ -222,15 +221,15 @@ /// @todo Deprecate? - bool Analysis::isCompatible(const ParticleName& beam1, const ParticleName& beam2) const { - BeamPair beams(beam1, beam2); + bool Analysis::isCompatible(PdgId beam1, PdgId beam2) const { + PdgIdPair beams(beam1, beam2); return isCompatible(beams); } /// @todo Deprecate? - bool Analysis::isCompatible(const BeamPair& beams) const { - foreach (const BeamPair& bp, requiredBeams()) { + bool Analysis::isCompatible(const PdgIdPair& beams) const { + foreach (const PdgIdPair& bp, requiredBeams()) { if (compatible(beams, bp)) return true; } return false; @@ -559,7 +558,7 @@ // "Bin error" is a misnomer in the AIDA spec: width is neglected. // We'd like to do this: ey.push_back(histo->binError(i) * scale); - ey.push_back(histo->binError(i)*scale/(histo->axis().binWidth(i))); + ey.push_back(histo->binError(i)*scale/histo->axis().binWidth(i)); } string title = histo->title(); Modified: trunk/src/Core/AnalysisHandler.cc ============================================================================== --- trunk/src/Core/AnalysisHandler.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Core/AnalysisHandler.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -21,7 +21,6 @@ { _theAnalysisFactory = createAnalysisFactory(); _setupFactories(); - initializeParticleNames(); } @@ -35,7 +34,6 @@ << "please migrate your code to use the one-arg constructor" << endl; _theAnalysisFactory = createAnalysisFactory(); _setupFactories(basefilename, storetype); - initializeParticleNames(); } @@ -104,11 +102,11 @@ // Proceed with event analysis assert(_initialised); // Ensure that beam details match those from first event - const BeamPair beams = Rivet::beamIds(ge); + const PdgIdPair beams = Rivet::beamIds(ge); const double sqrts = Rivet::sqrtS(ge); if (!compatible(beams, _beams) || !fuzzyEquals(sqrts, sqrtS())) { getLog() << Log::ERROR << "Event beams mismatch: " - << beams << " @ " << sqrts/GeV << " GeV" << " vs. first beams " + << toBeamsString(beams) << " @ " << sqrts/GeV << " GeV" << " vs. first beams " << this->beams() << " @ " << this->sqrtS()/GeV << " GeV" << endl; exit(1); } @@ -195,7 +193,7 @@ } - AnalysisHandler& AnalysisHandler::removeIncompatibleAnalyses(const BeamPair& beams) { + AnalysisHandler& AnalysisHandler::removeIncompatibleAnalyses(const PdgIdPair& beams) { vector<Analysis*> todelete; foreach (Analysis* a, _analyses) { if (! a->isCompatible(beams)) { @@ -385,7 +383,7 @@ return *this; } - BeamPair AnalysisHandler::beamIds() const { + PdgIdPair AnalysisHandler::beamIds() const { return Rivet::beamIds(beams()); } @@ -394,39 +392,4 @@ } - void AnalysisHandler::initializeParticleNames() { - Rivet::s_pnames[ELECTRON] = "ELECTRON"; - Rivet::s_pnames[POSITRON] = "POSITRON"; - Rivet::s_pnames[PROTON] = "PROTON"; - Rivet::s_pnames[ANTIPROTON] = "ANTIPROTON"; - Rivet::s_pnames[PHOTON] = "PHOTON"; - Rivet::s_pnames[NEUTRON] = "NEUTRON"; - Rivet::s_pnames[ANTINEUTRON] = "ANTINEUTRON"; - Rivet::s_pnames[MUON] = "MUON"; - Rivet::s_pnames[ANTIMUON] = "ANTIMUON"; - Rivet::s_pnames[NU_E] = "NU_E"; - Rivet::s_pnames[NU_EBAR] = "NU_EBAR"; - Rivet::s_pnames[NU_MU] = "NU_MU"; - Rivet::s_pnames[NU_MUBAR] = "NU_MUBAR"; - Rivet::s_pnames[NU_TAU] = "NU_TAU"; - Rivet::s_pnames[NU_TAUBAR] = "NU_TAUBAR"; - Rivet::s_pnames[PIPLUS] = "PIPLUS"; - Rivet::s_pnames[PIMINUS] = "PIMINUS"; - Rivet::s_pnames[TAU] = "TAU"; - Rivet::s_pnames[WPLUSBOSON] = "WPLUSBOSON"; - Rivet::s_pnames[WMINUSBOSON] = "WMINUSBOSON"; - Rivet::s_pnames[ZBOSON] = "ZBOSON"; - Rivet::s_pnames[HIGGS] = "HIGGS"; - Rivet::s_pnames[ANTITAU] = "ANTITAU"; - Rivet::s_pnames[PHOTOELECTRON] = "PHOTOELECTRON"; - Rivet::s_pnames[PHOTOPOSITRON] = "PHOTOPOSITRON"; - Rivet::s_pnames[PHOTOMUON] = "PHOTOMUON"; - Rivet::s_pnames[PHOTOANTIMUON] = "PHOTOANTIMUON"; - Rivet::s_pnames[PHOTOTAU] = "PHOTOTAU"; - Rivet::s_pnames[PHOTOANTITAU] = "PHOTOANTITAU"; - Rivet::s_pnames[ANY] = "*"; - } - - - } Modified: trunk/src/Core/AnalysisInfo.cc ============================================================================== --- trunk/src/Core/AnalysisInfo.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Core/AnalysisInfo.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -87,35 +87,31 @@ it.second() >> ai->_experiment; } else if (key == "Beams") { const YAML::Node& beampairs = it.second(); - vector<pair<ParticleName,ParticleName> > beam_pairs; - if (beampairs.size() == 2 && - beampairs[0].GetType() == YAML::CT_SCALAR && + vector<PdgIdPair> beam_pairs; + if (beampairs.size() == 2 && + beampairs[0].GetType() == YAML::CT_SCALAR && beampairs[1].GetType() == YAML::CT_SCALAR) { string bstr0, bstr1; beampairs[0] >> bstr0; - ParticleName b0 = getParticleNameEnum(bstr0); beampairs[1] >> bstr1; - ParticleName b1 = getParticleNameEnum(bstr1); - beam_pairs += make_pair<ParticleName,ParticleName>(b0, b1); - } else { + beam_pairs += make_pdgid_pair(bstr0, bstr1); + } else { for (YAML::Iterator bpi = beampairs.begin(); bpi != beampairs.end(); ++bpi) { const YAML::Node& bp = *bpi; - if (bp.size() == 2 && - bp[0].GetType() == YAML::CT_SCALAR && + if (bp.size() == 2 && + bp[0].GetType() == YAML::CT_SCALAR && bp[1].GetType() == YAML::CT_SCALAR) { string bstr0, bstr1; bp[0] >> bstr0; - ParticleName b0 = getParticleNameEnum(bstr0); bp[1] >> bstr1; - ParticleName b1 = getParticleNameEnum(bstr1); - beam_pairs += make_pair<ParticleName,ParticleName>(b0, b1); + beam_pairs += make_pdgid_pair(bstr0, bstr1); } else { assert(0 && "Beam ID pairs have to be either a 2-tuple or a list of 2-tuples of particle names"); } } } ai->_beams = beam_pairs; - } + } else if (key == "Energies") { const YAML::Node& energies = it.second(); vector<pair<double,double> > beam_energy_pairs; Modified: trunk/src/Core/Event.cc ============================================================================== --- trunk/src/Core/Event.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Core/Event.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -27,7 +27,7 @@ if (!_genEvent.valid_beam_particles()) return; typedef pair<HepMC::GenParticle*, HepMC::GenParticle*> GPPair; GPPair bps = _genEvent.beam_particles(); - const BeamPair beamids = make_pdgid_pair(bps.first->pdg_id(), bps.second->pdg_id()); + const PdgIdPair beamids = make_pdgid_pair(bps.first->pdg_id(), bps.second->pdg_id()); //Log::getLog("Rivet.Event") << Log::TRACE << "Beam IDs: " << beamids << endl; const HepMC::GenParticle* plusgp = 0; bool rot = false; Modified: trunk/src/Core/Makefile.am ============================================================================== --- trunk/src/Core/Makefile.am Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Core/Makefile.am Tue Jun 8 16:48:37 2010 (r2471) @@ -1,7 +1,7 @@ noinst_LTLIBRARIES = libRivetCore.la libRivetCore_la_SOURCES = \ - Event.cc Jet.cc Particle.cc \ + Event.cc Jet.cc Particle.cc ParticleName.cc \ ProjectionApplier.cc Projection.cc \ Analysis.cc AnalysisLoader.cc AnalysisInfo.cc \ AnalysisHandler.cc Run.cc ProjectionHandler.cc HistoHandler.cc Added: trunk/src/Core/ParticleName.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/src/Core/ParticleName.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -0,0 +1,40 @@ +#include "Rivet/ParticleName.hh" +#include "Rivet/RivetBoost.hh" +#include "Rivet/Tools/Utils.hh" + +namespace Rivet { + + + // Initialise ParticleNames singleton pointer + ParticleNames* ParticleNames::_instance = 0; + + + + const std::string& ParticleNames::_particleName(PdgId pid) { + if (_ids_names.find(pid) == _ids_names.end()) { + throw PidError("Particle ID '" + lexical_cast<string>(pid) + "' not known."); + } + return _ids_names[pid]; + } + + + PdgId ParticleNames::_particleId(const std::string& pname) { + if (_names_ids.find(pname) == _names_ids.end()) { + if (toUpper(pname) == "P+" || toUpper(pname) == "P") return PROTON; + if (toUpper(pname) == "P-" || toUpper(pname) == "PBAR") return ANTIPROTON; + if (toUpper(pname) == "E-") return ELECTRON; + if (toUpper(pname) == "E+") return POSITRON; + if (toUpper(pname) == "GAMMA") return PHOTON; + if (toUpper(pname) == "N") return NEUTRON; + try { + PdgId rtn = lexical_cast<PdgId>(pname); + return rtn; + } catch (const bad_lexical_cast& blc) { + throw PidError("Particle name '" + pname + "' not known and could not be directly cast to a PDG ID."); + } + } + return _names_ids[pname]; + } + + +} Modified: trunk/src/Core/Projection.cc ============================================================================== --- trunk/src/Core/Projection.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Core/Projection.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -10,7 +10,7 @@ Projection::Projection() : _name("BaseProjection") { - addBeamPair(ANY, ANY); + addPdgIdPair(ANY, ANY); //getLog() << Log::TRACE << "Creating " << name() << " at " << this << endl; } @@ -36,8 +36,8 @@ } - const set<BeamPair> Projection::beamPairs() const { - set<BeamPair> ret = _beamPairs; + const set<PdgIdPair> Projection::beamPairs() const { + set<PdgIdPair> ret = _beamPairs; set<ConstProjectionPtr> projs = getProjections(); for (set<ConstProjectionPtr>::const_iterator ip = projs.begin(); ip != projs.end(); ++ip) { ConstProjectionPtr p = *ip; Modified: trunk/src/Projections/Beam.cc ============================================================================== --- trunk/src/Projections/Beam.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Projections/Beam.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -12,13 +12,13 @@ return beamproj.beams(); } - BeamPair beamIds(const Event& e) { + PdgIdPair beamIds(const Event& e) { Beam beamproj; beamproj.project(e); return beamproj.beamIds(); } - BeamPair beamIds(const ParticlePair& beams) { + PdgIdPair beamIds(const ParticlePair& beams) { return make_pair(beams.first.pdgId(), beams.second.pdgId()); } Modified: trunk/src/Projections/InvMassFinalState.cc ============================================================================== --- trunk/src/Projections/InvMassFinalState.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Projections/InvMassFinalState.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -66,7 +66,7 @@ // Get all the particles of the type specified in the pair from the particle list foreach (const Particle& ipart, fs.particles()) { // Loop around possible particle pairs (typedef needed to keep BOOST_FOREACH happy) - foreach (const PidPair& ipair, _decayids) { + foreach (const PdgIdPair& ipair, _decayids) { if (ipart.pdgId() == ipair.first) { if (accept(ipart.genParticle())) { type1 += &ipart; @@ -102,12 +102,12 @@ _theParticles += *i2; } // Store accepted particle pairs - _particlePairs += make_pair(*i1, *i2); + _particlePairs += make_pair(*i1, *i2); } } } - - getLog() << Log::DEBUG << "Selected " << _theParticles.size() << " particles " + + getLog() << Log::DEBUG << "Selected " << _theParticles.size() << " particles " << "(" << _particlePairs.size() << " pairs)" << endl; if (getLog().isActive(Log::TRACE)) { foreach (const Particle& p, _theParticles) { Modified: trunk/src/Projections/SVertex.cc ============================================================================== --- trunk/src/Projections/SVertex.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Projections/SVertex.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -10,6 +10,59 @@ namespace Rivet { + // Return distance of closest approach from track to given (primary) vertex position. + inline double get2dClosestApproach(const HepMC::GenParticle& track, const Vector3& vtx3pos) { + /// @todo Whoa! - implicit constructors from hell! + HepMC::FourVector trkvec = track; + HepMC::ThreeVector trk3vec = trkvec; + HepMC::ThreeVector trk3pos = track.production_vertex()->position(); + + Vector3 diff(vtx3pos.x()-trk3pos.x(), vtx3pos.y()-trk3pos.y(), vtx3pos.z()-trk3pos.z()); + + // Impact parameter in the transverse plane + const double d = fabs( trk3vec.x()*diff.y() - trk3vec.y()*diff.x() ) + / sqrt( sqr(trk3vec.x()) + sqr(trk3vec.y()) ); + return d; + } + + + // Return distance of closest approach from track to given (primary) vertex position. + inline double get3dClosestApproach(const HepMC::GenParticle& track, const Vector3& vtx3pos) { + HepMC::FourVector trkvec = track; + HepMC::ThreeVector trk3vec = trkvec; + HepMC::FourVector trkpos = track.production_vertex()->position(); + HepMC::ThreeVector trk3pos = trkpos; + Vector3 diff(vtx3pos.x()-trk3pos.x(), vtx3pos.y()-trk3pos.y(), vtx3pos.z()-trk3pos.z()); + + // Impact parameter in 3 dimensions + const double mag = sqrt( sqr(trk3vec.x()) + sqr(trk3vec.y()) + sqr(trk3vec.z()) ); + const double d = sqrt( sqr(trk3vec.y()*diff.z()-trk3vec.z()*diff.y()) - + sqr(trk3vec.x()*diff.z()-trk3vec.z()*diff.x()) + + sqr(trk3vec.x()*diff.y()-trk3vec.y()*diff.x()) ) / mag; + return d; + } + + + /// Return Decay Length Significance between two vertices in transverse plane + inline double get2dDecayLength(const Vector3& vtx1, const Vector3& vtx2, const FourMomentum& jetaxis) { + Vector3 diff = vtx1 - vtx2; + const double l = (jetaxis.px()*diff.x() + jetaxis.py()*diff.y() ) + / sqrt(sqr(jetaxis.px())+sqr(jetaxis.py())); + return l; + } + + + + /// Return 3 dimensional Decay Length Significance between vertices + inline double get3dDecayLength(const Vector3& vtx1, const Vector3& vtx2, const FourMomentum& jetaxis) { + Vector3 diff = vtx1 - vtx2; + const double l = (jetaxis.px()*diff.x() +jetaxis.py()*diff.y() +jetaxis.pz()*diff.z()) + / sqrt(sqr(jetaxis.px())+sqr(jetaxis.py())+sqr(jetaxis.pz())); + return l; + } + + + int SVertex::compare(const Projection& p) const { const PCmp fscmp = mkNamedPCmp(p, "PV"); if (fscmp != EQUIVALENT) return fscmp; @@ -27,7 +80,7 @@ const PVertex& pvtx = applyProjection<PVertex>(e, "PV"); const Vector3 pvpos = pvtx.position(); const ChargedFinalState& chfs = applyProjection<ChargedFinalState>(e, "FS"); - + // Produce vector of vertices, each containing a vector of all charged // final state particles belonging to this vertex typedef map<GenVertex*,ParticleVector> VtxPartsMap; @@ -53,7 +106,7 @@ } } } - + } @@ -74,10 +127,10 @@ // Check vertex final state charged particles, if fulfilling track criteria size_t pass1trk1pTdcaSig25(0), pass1trk05pTdcaSig25(0), pass2trk15pTdcaSig3(0), pass2trk1pTdcaSig3(0); - + foreach (const Particle& vp, vtxparts) { const double IPsig = get2dClosestApproach(vp.genParticle(), pvtxpos) / _IPres; - + // Update "visible momentum" vector (returned by reference). if (vp.momentum().pT() > 0.5) { vtxVisMom += vp.momentum(); Modified: trunk/src/Tools/RivetPaths.cc ============================================================================== --- trunk/src/Tools/RivetPaths.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Tools/RivetPaths.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -22,9 +22,5 @@ return getDataPath() + "/Rivet"; } - const string getRivetgunDataPath() { - return getDataPath() + "/AGILe"; - } - } Modified: trunk/src/Tools/Utils.cc ============================================================================== --- trunk/src/Tools/Utils.cc Wed Jun 2 11:38:49 2010 (r2470) +++ trunk/src/Tools/Utils.cc Tue Jun 8 16:48:37 2010 (r2471) @@ -11,58 +11,4 @@ } - //////////////////////////////////////////////////////////////// - - - // Return distance of closest approach from track to given (primary) vertex position. - double get2dClosestApproach(const HepMC::GenParticle& track, const Vector3& vtx3pos) { - /// @todo Whoa! - implicit constructors from hell! - HepMC::FourVector trkvec = track; - HepMC::ThreeVector trk3vec = trkvec; - HepMC::ThreeVector trk3pos = track.production_vertex()->position(); - - Vector3 diff(vtx3pos.x()-trk3pos.x(), vtx3pos.y()-trk3pos.y(), vtx3pos.z()-trk3pos.z()); - - // Impact parameter in the transverse plane - const double d = fabs( trk3vec.x()*diff.y() - trk3vec.y()*diff.x() ) - / sqrt( sqr(trk3vec.x()) + sqr(trk3vec.y()) ); - return d; - } - - - // Return distance of closest approach from track to given (primary) vertex position. - double get3dClosestApproach(const HepMC::GenParticle& track, const Vector3& vtx3pos) { - HepMC::FourVector trkvec = track; - HepMC::ThreeVector trk3vec = trkvec; - HepMC::FourVector trkpos = track.production_vertex()->position(); - HepMC::ThreeVector trk3pos = trkpos; - Vector3 diff(vtx3pos.x()-trk3pos.x(), vtx3pos.y()-trk3pos.y(), vtx3pos.z()-trk3pos.z()); - - // Impact parameter in 3 dimensions - const double mag = sqrt( sqr(trk3vec.x()) + sqr(trk3vec.y()) + sqr(trk3vec.z()) ); - const double d = sqrt( sqr(trk3vec.y()*diff.z()-trk3vec.z()*diff.y()) - - sqr(trk3vec.x()*diff.z()-trk3vec.z()*diff.x()) + - sqr(trk3vec.x()*diff.y()-trk3vec.y()*diff.x()) ) / mag; - return d; - } - - - /// Return Decay Length Significance between two vertices in transverse plane - double get2dDecayLength(const Vector3& vtx1, const Vector3& vtx2, const FourMomentum& jetaxis) { - Vector3 diff = vtx1 - vtx2; - const double l = (jetaxis.px()*diff.x() + jetaxis.py()*diff.y() ) - / sqrt(sqr(jetaxis.px())+sqr(jetaxis.py())); - return l; - } - - - - /// Return 3 dimensional Decay Length Significance between vertices - double get3dDecayLength(const Vector3& vtx1, const Vector3& vtx2, const FourMomentum& jetaxis) { - Vector3 diff = vtx1 - vtx2; - const double l = (jetaxis.px()*diff.x() +jetaxis.py()*diff.y() +jetaxis.pz()*diff.z()) - / sqrt(sqr(jetaxis.px())+sqr(jetaxis.py())+sqr(jetaxis.pz())); - return l; - } - }
More information about the Rivet-svn mailing list |