|
[Rivet-svn] r1856 - in trunk: . include/Rivet include/Rivet/Projections src/Analyses src/Projectionsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgSun Oct 4 18:34:58 BST 2009
Author: buckley Date: Sun Oct 4 18:34:58 2009 New Revision: 1856 Log: Adding CDF Run 0 & Run 1, and UA5 trigger projections Added: trunk/include/Rivet/Projections/TriggerCDFRun0Run1.hh (contents, props changed) - copied, changed from r1844, trunk/include/Rivet/Projections/Beam.hh trunk/include/Rivet/Projections/TriggerUA5.hh (contents, props changed) - copied, changed from r1844, trunk/include/Rivet/Projections/Beam.hh trunk/src/Projections/TriggerCDFRun0Run1.cc (contents, props changed) - copied, changed from r1844, trunk/src/Projections/Beam.cc trunk/src/Projections/TriggerUA5.cc (contents, props changed) - copied, changed from r1844, trunk/src/Projections/Beam.cc Modified: trunk/ChangeLog trunk/include/Rivet/Makefile.am trunk/src/Analyses/CDF_1988_S1865951.cc trunk/src/Analyses/CDF_1990_S2089246.cc trunk/src/Analyses/CDF_2001_S4751469.cc trunk/src/Analyses/CDF_2002_S4796047.cc trunk/src/Analyses/CDF_2004_S5839831.cc trunk/src/Analyses/CDF_2008_LEADINGJETS.cc trunk/src/Analyses/CDF_2009_S8233977.cc trunk/src/Analyses/OPAL_1998_S3780481.cc trunk/src/Analyses/OPAL_2004_S6132243.cc trunk/src/Analyses/UA5_1982_S875503.cc trunk/src/Analyses/UA5_1986_S1583476.cc trunk/src/Analyses/UA5_1988_S1867512.cc trunk/src/Analyses/UA5_1989_S1926373.cc trunk/src/Projections/Makefile.am Modified: trunk/ChangeLog ============================================================================== --- trunk/ChangeLog Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/ChangeLog Sun Oct 4 18:34:58 2009 (r1856) @@ -1,3 +1,11 @@ +2009-10-04 Andy Buckley <andy at insectnation.org> + + * Moving projection setup and registration into init() method for + remaining analyses. + + * Adding trigger implementations as projections for CDF Runs 0 & + 1, and for UA5. + 2009-10-01 Andy Buckley <andy.buckley at cern.ch> * Moving projection setup and registration into init() method for Modified: trunk/include/Rivet/Makefile.am ============================================================================== --- trunk/include/Rivet/Makefile.am Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/include/Rivet/Makefile.am Sun Oct 4 18:34:58 2009 (r1856) @@ -68,6 +68,8 @@ Projections/SVertex.hh \ Projections/Thrust.hh \ Projections/TotalVisibleMomentum.hh \ + Projections/TriggerCDFRun0Run1.hh \ + Projections/TriggerUA5.hh \ Projections/UnstableFinalState.hh \ Projections/VetoedFinalState.hh \ Projections/VisibleFinalState.hh \ Copied and modified: trunk/include/Rivet/Projections/TriggerCDFRun0Run1.hh (from r1844, trunk/include/Rivet/Projections/Beam.hh) ============================================================================== --- trunk/include/Rivet/Projections/Beam.hh Thu Oct 1 18:21:30 2009 (r1844, copy source) +++ trunk/include/Rivet/Projections/TriggerCDFRun0Run1.hh Sun Oct 4 18:34:58 2009 (r1856) @@ -1,51 +1,41 @@ // -*- C++ -*- -#ifndef RIVET_Beam_HH -#define RIVET_Beam_HH +#ifndef RIVET_TriggerCDFRun0Run1_HH +#define RIVET_TriggerCDFRun0Run1_HH #include "Rivet/Projection.hh" #include "Rivet/Event.hh" #include "Rivet/Particle.hh" +#include "Rivet/Projections/Beam.hh" namespace Rivet { /// Project out the incoming beams - class Beam : public Projection { - + class TriggerCDFRun0Run1 : public Projection { public: - /// The default constructor. - Beam() { - setName("Beam"); + /// Default constructor. + TriggerCDFRun0Run1() { + setName("TriggerCDFRun0Run1"); + + addProjection(ChargedFinalState(-5.9, 5.9), "CFS"); } /// Clone on the heap. virtual const Projection* clone() const { - return new Beam(*this); + return new TriggerCDFRun0Run1(*this); } public: - /// The pair of beam particles in the current collision. - const ParticlePair& beams() const { - return _theBeams; - } - - /// The pair of beam particle PDG codes in the current collision. - const BeamPair beamIDs() const { - return make_pair(beams().first.pdgId(), - beams().second.pdgId()); + /// The trigger result + const bool minBiasDecision() const { + return _decision_mb; } - /// Get centre of mass energy, \f$ \sqrt{s} \f$. - const double sqrtS() const; - - - public: - /// Project on to the Event - virtual void project(const Event& e); + void project(const Event& evt); protected: @@ -57,24 +47,12 @@ private: - /// The beam particles in the current collision in GenEvent - ParticlePair _theBeams; - - }; - - /////////////////////////////////////////////////////// + /// The min bias trigger decision + bool _decision_mb; - /// @name Stand-alone functions - //@{ - - /// Function to get beam particles from an event - ParticlePair beams(const Event& e); - - /// Function to get beam particle IDs from an event - BeamPair beamIds(const Event& e); + }; - //@} } Copied and modified: trunk/include/Rivet/Projections/TriggerUA5.hh (from r1844, trunk/include/Rivet/Projections/Beam.hh) ============================================================================== --- trunk/include/Rivet/Projections/Beam.hh Thu Oct 1 18:21:30 2009 (r1844, copy source) +++ trunk/include/Rivet/Projections/TriggerUA5.hh Sun Oct 4 18:34:58 2009 (r1856) @@ -1,51 +1,60 @@ // -*- C++ -*- -#ifndef RIVET_Beam_HH -#define RIVET_Beam_HH +#ifndef RIVET_TriggerUA5_HH +#define RIVET_TriggerUA5_HH #include "Rivet/Projection.hh" #include "Rivet/Event.hh" #include "Rivet/Particle.hh" +#include "Rivet/Projections/Beam.hh" namespace Rivet { /// Project out the incoming beams - class Beam : public Projection { - + class TriggerUA5 : public Projection { public: - /// The default constructor. - Beam() { - setName("Beam"); + /// Default constructor. + TriggerUA5() { + setName("TriggerUA5"); + + addProjection(Beam(), "Beam"); + addProjection(ChargedFinalState(-3.5, 3.5), "CFS"); + + _n_plus = 0; + _n_minus = 0; } /// Clone on the heap. virtual const Projection* clone() const { - return new Beam(*this); + return new TriggerUA5(*this); } public: - /// The pair of beam particles in the current collision. - const ParticlePair& beams() const { - return _theBeams; + /// The trigger result for non-single diffractive (2 arm) trigger + const bool sdDecision() const { + return _decision_sd; } - /// The pair of beam particle PDG codes in the current collision. - const BeamPair beamIDs() const { - return make_pair(beams().first.pdgId(), - beams().second.pdgId()); + /// The trigger result for non-single diffractive (2 arm) trigger + const bool nsdDecision() const { + return _decision_nsd; } - /// Get centre of mass energy, \f$ \sqrt{s} \f$. - const double sqrtS() const; - + /// The trigger result + const bool samebeams() const { + return _samebeams; + } - public: + /// Number of hits in <-,+> eta hodoscopes + pair<unsigned int, unsigned int> numHits() { + return make_pair(_n_plus, _n_minus); + } /// Project on to the Event - virtual void project(const Event& e); + void project(const Event& evt); protected: @@ -57,24 +66,18 @@ private: - /// The beam particles in the current collision in GenEvent - ParticlePair _theBeams; - - }; + /// The min bias trigger decisions + bool _decision_sd, _decision_nsd; - /////////////////////////////////////////////////////// + /// Is it a pp collision? + bool _samebeams; - /// @name Stand-alone functions - //@{ + /// Number of hits in hodoscopes + unsigned int _n_plus, _n_minus; - /// Function to get beam particles from an event - ParticlePair beams(const Event& e); - - /// Function to get beam particle IDs from an event - BeamPair beamIds(const Event& e); + }; - //@} } Modified: trunk/src/Analyses/CDF_1988_S1865951.cc ============================================================================== --- trunk/src/Analyses/CDF_1988_S1865951.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/CDF_1988_S1865951.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -5,6 +5,7 @@ #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/TotalVisibleMomentum.hh" #include "Rivet/Projections/Beam.hh" +#include "Rivet/Projections/TriggerCDFRun0Run1.hh" namespace Rivet { @@ -25,9 +26,9 @@ /// Book histograms void init() { - const ChargedFinalState cfs(-1.,1., 0.4*GeV); + addProjection(TriggerCDFRun0Run1(), "Trigger"); + const ChargedFinalState cfs(-1.0, 1.0, 0.4*GeV); addProjection(cfs, "CFS"); - addProjection(ChargedFinalState(-5.9, 5.9), "CFSAll"); addProjection(TotalVisibleMomentum(cfs), "Mom"); addProjection(Beam(), "Beam"); @@ -38,39 +39,15 @@ /// Do the analysis void analyze(const Event& event) { - const double sqrtS = applyProjection<Beam>(event, "Beam").sqrtS(); - const FinalState& fs = applyProjection<ChargedFinalState>(event, "CFS"); + // Trigger + const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision(); + if (!trigger) vetoEvent; const double weight = event.weight(); + + const double sqrtS = applyProjection<Beam>(event, "Beam").sqrtS(); + const FinalState& trackfs = applyProjection<ChargedFinalState>(event, "CFS"); - // Minimum Bias trigger requirements from the BBC counters - int n_trig_1 = 0; - int n_trig_2 = 0; - - // Event selection based on tracks in VTPC (time projection chambers) - // Require at least 4 tracks with at least one in each of the forward - // and backward hemispheres - int n_backward = 0; - int n_forward = 0; - - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFSAll"); - foreach (const Particle& p, cfs.particles()) { - double eta = p.momentum().pseudorapidity(); - if (inRange(eta, -5.9, -3.2)) n_trig_1 += 1; - else if (inRange(eta, 3.2, 5.9)) n_trig_2 += 1; - - if (inRange(eta, -3.0, 0.0)) n_backward += 1; - else if (inRange(eta, 0.0, 3.0)) n_forward += 1; - } - - // Require at least one coincidence hit in both BBC counters - if (n_trig_1 == 0 || n_trig_2 == 0) vetoEvent; - getLog() << Log::DEBUG << "Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2 << endl; - - // Further event selection cut - if (n_backward + n_forward < 4 || n_backward == 0 || n_forward == 0) vetoEvent; - getLog() << Log::DEBUG << " Num. forward: " << n_forward << ", Num. backward: " << n_backward << endl; - - foreach (Particle p, fs.particles()) { + foreach (Particle p, trackfs.particles()) { const double pt = p.momentum().pT(); // Effective weight for d3sig/dp3 = weight / ( Delta eta * 2pi * pt ), with Delta(eta) = 2 const double eff_weight = weight/(2*TWOPI*pt); Modified: trunk/src/Analyses/CDF_1990_S2089246.cc ============================================================================== --- trunk/src/Analyses/CDF_1990_S2089246.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/CDF_1990_S2089246.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -7,6 +7,7 @@ #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/PVertex.hh" #include "Rivet/Projections/TotalVisibleMomentum.hh" +#include "Rivet/Projections/TriggerCDFRun0Run1.hh" namespace Rivet { @@ -29,8 +30,8 @@ //@{ void init() { - addProjection(ChargedFinalState(-3.5, 3.5), "FS"); - addProjection(ChargedFinalState(-5.9, 5.9), "CFSAll"); + addProjection(TriggerCDFRun0Run1(), "Trigger"); + addProjection(ChargedFinalState(-3.5, 3.5), "CFS"); addProjection(Beam(), "Beam"); _hist_eta1800 = bookHistogram1D(3, 1, 1); @@ -40,39 +41,16 @@ /// Do the analysis void analyze(const Event& event) { - const double sqrtS = applyProjection<Beam>(event, "Beam").sqrtS(); + // Trigger + const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision(); + if (!trigger) vetoEvent; + + // Get final state and energy + const double sqrtS = applyProjection<Beam>(event, "Beam").sqrtS(); + const FinalState& fs = applyProjection<FinalState>(event, "CFS"); + + // Loop over final state charged particles to fill eta histos const double weight = event.weight(); - - // Minimum Bias trigger requirements from the BBC counters - int n_trig_1 = 0; - int n_trig_2 = 0; - - // Event selection based on tracks in VTPC (time projection chambers) - // Require at least 4 tracks with at least one in each of the forward - // and backward hemispheres - int n_backward = 0; - int n_forward = 0; - - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFSAll"); - foreach (const Particle& p, cfs.particles()) { - double eta = p.momentum().pseudorapidity(); - if (inRange(eta, -5.9, -3.2)) n_trig_1++; - else if (inRange(eta, 3.2, 5.9)) n_trig_2++; - - if (inRange(eta, -3.0, 0.0)) n_backward++; - else if (inRange(eta, 0.0, 3.0)) n_forward++; - } - - // Require at least one coincidence hit in both BBC counters - if (n_trig_1 == 0 || n_trig_2 == 0) vetoEvent; - getLog() << Log::DEBUG << "Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2 << endl; - - // Further event selection cut - if (n_backward + n_forward < 4 || n_backward == 0 || n_forward == 0) vetoEvent; - getLog() << Log::DEBUG << " Num. forward: " << n_forward << ", Num. backward: " << n_backward << endl; - - // Loop over final state charged particles - const FinalState& fs = applyProjection<FinalState>(event, "FS"); foreach (const Particle& p, fs.particles()) { const double eta = p.momentum().pseudorapidity(); if (fuzzyEquals(sqrtS/GeV, 630)) { Modified: trunk/src/Analyses/CDF_2001_S4751469.cc ============================================================================== --- trunk/src/Analyses/CDF_2001_S4751469.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/CDF_2001_S4751469.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -10,7 +10,7 @@ #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/LossyFinalState.hh" #include "Rivet/Projections/FastJets.hh" - +#include "Rivet/Projections/TriggerCDFRun0Run1.hh" #include "LWH/Profile1D.h" namespace Rivet { @@ -47,6 +47,7 @@ // Book histograms void init() { + addProjection(TriggerCDFRun0Run1(), "Trigger"); // Randomly discard 8% of charged particles as a kind of hacky detector correction. const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV); const LossyFinalState lfs(cfs, 0.08); @@ -82,6 +83,9 @@ /// Do the analysis void analyze(const Event& event) { + // Trigger + const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision(); + if (!trigger) vetoEvent; // Analyse, with pT > 0.5 GeV AND |eta| < 1 const JetAlg& tj = applyProjection<JetAlg>(event, "TrackJet"); Modified: trunk/src/Analyses/CDF_2002_S4796047.cc ============================================================================== --- trunk/src/Analyses/CDF_2002_S4796047.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/CDF_2002_S4796047.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -4,6 +4,7 @@ #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/Beam.hh" #include "Rivet/Projections/ChargedFinalState.hh" +#include "Rivet/Projections/TriggerCDFRun0Run1.hh" namespace Rivet { @@ -43,6 +44,7 @@ /// Book projections and histograms void init() { + addProjection(TriggerCDFRun0Run1(), "Trigger"); addProjection(Beam(), "Beam"); const ChargedFinalState cfs(-1.0, 1.0, 0.4*GeV); addProjection(cfs, "FS"); @@ -55,14 +57,17 @@ /// Do the analysis - void analyze(const Event& e) { - const double sqrtS = applyProjection<Beam>(e, "Beam").sqrtS(); - const ChargedFinalState& fs = applyProjection<ChargedFinalState>(e, "FS"); + void analyze(const Event& evt) { + // Trigger + const bool trigger = applyProjection<TriggerCDFRun0Run1>(evt, "Trigger").minBiasDecision(); + if (!trigger) vetoEvent; + const double weight = evt.weight(); + + // Get beam energy and tracks + const double sqrtS = applyProjection<Beam>(evt, "Beam").sqrtS(); + const ChargedFinalState& fs = applyProjection<ChargedFinalState>(evt, "FS"); const size_t numParticles = fs.particles().size(); - // Get the event weight - const double weight = e.weight(); - // Fill histos of charged multiplicity distributions if (fuzzyEquals(sqrtS, 630/GeV)) { _hist_multiplicity_630->fill(numParticles, weight); Modified: trunk/src/Analyses/CDF_2004_S5839831.cc ============================================================================== --- trunk/src/Analyses/CDF_2004_S5839831.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/CDF_2004_S5839831.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -8,6 +8,7 @@ #include "Rivet/Projections/Beam.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/FastJets.hh" +#include "Rivet/Projections/TriggerCDFRun0Run1.hh" namespace Rivet { @@ -93,6 +94,7 @@ void init() { // Set up projections + addProjection(TriggerCDFRun0Run1(), "Trigger"); addProjection(Beam(), "Beam"); const FinalState calofs(-1.2, 1.2); addProjection(calofs, "CaloFS"); @@ -138,6 +140,11 @@ /// Do the analysis void analyze(const Event& event) { + // Trigger + const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision(); + if (!trigger) vetoEvent; + + // Get sqrt(s) and event weight const double sqrtS = applyProjection<Beam>(event, "Beam").sqrtS(); const double weight = event.weight(); Modified: trunk/src/Analyses/CDF_2008_LEADINGJETS.cc ============================================================================== --- trunk/src/Analyses/CDF_2008_LEADINGJETS.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/CDF_2008_LEADINGJETS.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -74,6 +74,8 @@ // Do the analysis void analyze(const Event& e) { + /// @todo Implement Run II min bias trigger cf. CDF_2009? + const FinalState& fsj = applyProjection<FinalState>(e, "FSJ"); if (fsj.particles().size() < 1) { getLog() << Log::DEBUG << "Failed multiplicity cut" << endl; Modified: trunk/src/Analyses/CDF_2009_S8233977.cc ============================================================================== --- trunk/src/Analyses/CDF_2009_S8233977.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/CDF_2009_S8233977.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -40,34 +40,38 @@ /// Book histograms and projections void init() { - const FinalState fs(-1.0, 1.0, 0.0*GeV); - const ChargedFinalState cfs(-1.0, 1.0, 0.4*GeV); - addProjection(fs, "FS"); - addProjection(cfs, "CFS"); + addProjection(ChargedFinalState(-4.7, 4.7, 0.0*GeV), "TriggerFS"); + addProjection(FinalState(-1.0, 1.0, 0.0*GeV), "EtFS"); + addProjection(ChargedFinalState(-1.0, 1.0, 0.4*GeV), "CFS"); _hist_pt_vs_multiplicity = bookProfile1D(1, 1, 1); - _hist_pt = bookHistogram1D(2, 1, 1); - _hist_sumEt = bookHistogram1D(3, 1, 1); + _hist_pt = bookHistogram1D(2, 1, 1); + _hist_sumEt = bookHistogram1D(3, 1, 1); } /// Do the analysis - void analyze(const Event& e) { - const FinalState& fs = applyProjection<FinalState>(e, "FS"); - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS"); - const size_t numParticles = cfs.particles().size(); - - // Even if we only generate hadronic events, we still need a cut on numCharged >= 2. - if (numParticles < 1) { - getLog() << Log::DEBUG << "Failed multiplicity cut" << endl; - vetoEvent; + void analyze(const Event& evt) { + // Trigger: need at least one charged particle in both -4.7 < eta < -3.7 and 3.7 < eta < 4.7 + const FinalState& trigfs = applyProjection<FinalState>(evt, "TriggerFS"); + unsigned int n_plus(0), n_minus(0); + foreach (const Particle& p, trigfs.particles()) { + const double eta = p.momentum().eta(); + if (inRange(eta, -4.7, -3.7)) n_minus++; + else if (inRange(eta, 4.7, 3.7)) n_plus++; } + if (n_plus == 0 || n_minus == 0) vetoEvent; // Get the event weight - const double weight = e.weight(); - - foreach (const Particle& p, cfs.particles()) { + const double weight = evt.weight(); + + /// @todo The pT and sum(ET) distributions look slightly different from + /// Niccolo's Monte Carlo plots. Still waiting for his answer. + + const ChargedFinalState& trackfs = applyProjection<ChargedFinalState>(evt, "CFS"); + const size_t numParticles = trackfs.size(); + foreach (const Particle& p, trackfs.particles()) { const double pT = p.momentum().pT() / GeV; _hist_pt_vs_multiplicity->fill(numParticles, pT, weight); @@ -82,9 +86,6 @@ // // sinh(1) = 1.1752012 // m(charged pion)^2 = (139.57 MeV)^2 = 0.019479785 GeV^2 - - //// FIXME: The pT and sum(ET) distributions look slightly different from - //// Niccolo's Monte Carlo plots. Still waiting for his answer. const double sinh1 = 1.1752012; const double apT = sinh1 * pT; const double mPi = 139.57*MeV; @@ -93,8 +94,11 @@ const double dphi = 2*M_PI; _hist_pt->fill(pT, weight/(pT*dphi*dy)); } - double sumEt = 0.; - foreach (const Particle& p, fs.particles()) { + + // Calc sum(Et) from calo particles + const FinalState& etfs = applyProjection<FinalState>(evt, "EtFS"); + double sumEt = 0.0; + foreach (const Particle& p, etfs.particles()) { sumEt += p.momentum().Et(); } _hist_sumEt->fill(sumEt, weight); Modified: trunk/src/Analyses/OPAL_1998_S3780481.cc ============================================================================== --- trunk/src/Analyses/OPAL_1998_S3780481.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/OPAL_1998_S3780481.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -16,8 +16,7 @@ public: /// Constructor - OPAL_1998_S3780481() - : Analysis("OPAL_1998_S3780481") + OPAL_1998_S3780481() : Analysis("OPAL_1998_S3780481") { setBeams(ELECTRON, POSITRON); Modified: trunk/src/Analyses/OPAL_2004_S6132243.cc ============================================================================== --- trunk/src/Analyses/OPAL_2004_S6132243.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/OPAL_2004_S6132243.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -8,14 +8,26 @@ class OPAL_2004_S6132243 : public Analysis { - OPAL_2004_S6132243() : Analysis("OPAL_2004_S6132243") { } - void init() { } - void analyze(const Event & event) { } - void finalize() { } + OPAL_2004_S6132243() : Analysis("OPAL_2004_S6132243") { + + } + + void init() { + + } + + void analyze(const Event & event) { + + } + + void finalize() { + + } }; + // This global object acts as a hook for the plugin system AnalysisBuilder<OPAL_2004_S6132243> plugin_OPAL_2004_S6132243; Modified: trunk/src/Analyses/UA5_1982_S875503.cc ============================================================================== --- trunk/src/Analyses/UA5_1982_S875503.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/UA5_1982_S875503.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -4,6 +4,7 @@ #include "Rivet/Tools/ParticleIdUtils.hh" #include "Rivet/Projections/Beam.hh" #include "Rivet/Projections/ChargedFinalState.hh" +#include "Rivet/Projections/TriggerUA5.hh" namespace Rivet { @@ -20,9 +21,8 @@ //@{ void init() { - const ChargedFinalState cfs(-3.5, 3.5); - addProjection(Beam(), "Beam"); - addProjection(cfs, "CFS"); + addProjection(TriggerUA5(), "Trigger"); + addProjection(ChargedFinalState(-3.5, 3.5), "CFS"); _hist_nch_pp = bookHistogram1D(2,1,1); _hist_nch_ppbar = bookHistogram1D(2,1,2); @@ -32,32 +32,15 @@ void analyze(const Event& event) { - const Beam b = applyProjection<Beam>(event, "Beam"); - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); - const double weight = event.weight(); - - // Different trigger implementations for ppbar and pp! - int n_trig_1(0), n_trig_2(0); - foreach (const Particle& p, cfs.particles()) { - double eta = p.momentum().pseudorapidity(); - if (inRange(eta, -5.6, -2.0)) n_trig_1 += 1; - else if (inRange(eta, 2.0, 5.6)) n_trig_2 += 1; - } - - // Trigger requirements - const bool samebeam = (b.beams().first.pdgId() == b.beams().second.pdgId()); - if (samebeam) { - // PP - if (n_trig_1 == 0 || n_trig_2 == 0) vetoEvent; - } else { - // PPbar - /// @todo Is this actually the exact trigger requirement? - if (n_trig_1 * n_trig_2 < 4) vetoEvent; - } + // Trigger + const TriggerUA5& trigger = applyProjection<TriggerUA5>(event, "Trigger"); + if (!trigger.nsdDecision()) vetoEvent; + const double weight = event.weight(); - // Iterate over all FS particles and fill histograms + // Iterate over all tracks and fill histograms + const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); foreach (const Particle& p, cfs.particles()) { - if (samebeam) { + if (trigger.samebeams()) { // PP collision _hist_eta_pp->fill(fabs(p.momentum().pseudorapidity()), weight); } else { @@ -67,7 +50,7 @@ } // Fill mean charged multiplicity histos - if (samebeam) { + if (trigger.samebeams()) { // PP _hist_nch_pp->fill(_hist_nch_pp->binMean(0), cfs.particles().size()); } else { @@ -79,11 +62,12 @@ void finalize() { - scale(_hist_nch_pp, 1./sumOfWeights()); - scale(_hist_nch_ppbar, 1./sumOfWeights()); + scale(_hist_nch_pp, 1.0/sumOfWeights()); + scale(_hist_nch_ppbar, 1.0/sumOfWeights()); normalize(_hist_eta_pp, 5.28); normalize(_hist_eta_ppbar, 5.29); } + //@} Modified: trunk/src/Analyses/UA5_1986_S1583476.cc ============================================================================== --- trunk/src/Analyses/UA5_1986_S1583476.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/UA5_1986_S1583476.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -4,6 +4,7 @@ #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/Beam.hh" +#include "Rivet/Projections/TriggerUA5.hh" namespace Rivet { @@ -21,14 +22,9 @@ //@{ void init() { - addProjection(Beam(), "Beams"); - - // All charged final state particles, needed for triggers - const ChargedFinalState cfs; - addProjection(cfs, "CFSAll"); - // Charged particles in |eta| < 5.0 - const ChargedFinalState cfs50(-5.0, 5.0); - addProjection(cfs50, "CFS50"); + addProjection(TriggerUA5(), "Trigger"); + addProjection(Beam(), "Beams"); + addProjection(ChargedFinalState(-5.0, 5.0), "CFS50"); // Histograms _hist_eta_nsd_200 = bookHistogram1D(1,1,1); @@ -56,39 +52,25 @@ void analyze(const Event& event) { - const double sqrtS = applyProjection<Beam>(event, "Beams").sqrtS(); - const double weight = event.weight(); - - // Trigger requirements from the hodoscopes (1 arm (elastic) and 2 arms (NSD)) - int n_trig_1(0), n_trig_2(0); - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFSAll"); - foreach (const Particle& p, cfs.particles()) { - double eta = p.momentum().pseudorapidity(); - if (inRange(eta, -5.6, -2.0)) n_trig_1 += 1; - else if (inRange(eta, 2.0, 5.6)) n_trig_2 += 1; - } - getLog() << Log::DEBUG << "Trigger -: " << n_trig_1 << ", Trigger +: " << n_trig_2 << endl; - - // Check if we have a coincidence hit in hodoscopes == NSD - if (n_trig_1 == 0 && n_trig_2 == 0) vetoEvent - // Require at least one hit in trigger hodoscopes - bool isNSD = true; - if (n_trig_1 == 0 || n_trig_2 == 0) isNSD = false; - - // Declare final state for |eta| < 5.0 - const ChargedFinalState& cfs50 = applyProjection<ChargedFinalState>(event, "CFS50"); - int numP = cfs50.particles().size(); + // Trigger + const TriggerUA5& trigger = applyProjection<TriggerUA5>(event, "Trigger"); + if (!trigger.sdDecision()) vetoEvent; + const bool isNSD = trigger.nsdDecision(); + const double weight = event.weight(); + const double sqrtS = applyProjection<Beam>(event, "Beams").sqrtS(); // Iterate over particles in |eta| < 5.0 and fill histos with |eta| - foreach (const Particle& p, cfs.particles()) { + const ChargedFinalState& cfs50 = applyProjection<ChargedFinalState>(event, "CFS50"); + const unsigned int numP = cfs50.size(); + foreach (const Particle& p, cfs50.particles()) { double eta = fabs(p.momentum().pseudorapidity()); // Fill 200 GeV histos - if (fuzzyEquals(sqrtS, 200.0, 1E-4)) { + if (fuzzyEquals(sqrtS/GeV, 200.0, 1E-4)) { // Fill histos that don't require a certain multiplicity _hist_eta_inelastic_200->fill(eta, weight); - if ( isNSD ) { + if (isNSD) { // Fill histos that require a certain multiplicity _hist_eta_nsd_200->fill(eta, weight); if ( ( 2 <= numP ) && ( numP <= 10 ) ) _hist_eta_nsd_n_2_200->fill(eta, weight); @@ -101,7 +83,7 @@ } // Fill 900 GeV histos - else if (fuzzyEquals(sqrtS, 900.0, 1E-4)) { + else if (fuzzyEquals(sqrtS/GeV, 900.0, 1E-4)) { // Fill histos that don't require a certain multiplicity _hist_eta_inelastic_900->fill(eta, weight); if ( isNSD ) { Modified: trunk/src/Analyses/UA5_1988_S1867512.cc ============================================================================== --- trunk/src/Analyses/UA5_1988_S1867512.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/UA5_1988_S1867512.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -4,6 +4,7 @@ #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/ChargedFinalState.hh" #include "Rivet/Projections/Beam.hh" +#include "Rivet/Projections/TriggerUA5.hh" namespace Rivet { @@ -64,12 +65,9 @@ //@{ void init() { + addProjection(TriggerUA5(), "Trigger"); addProjection(Beam(), "Beams"); - // All charged final state particles, needed for trigger implementation only - const ChargedFinalState cfs; - addProjection(cfs, "CFSAll"); - // Symmetric eta interval addProjection(ChargedFinalState(-0.5, 0.5), "CFS05"); @@ -142,24 +140,13 @@ void analyze(const Event& event) { + // Trigger + const bool trigger = applyProjection<TriggerUA5>(event, "Trigger").nsdDecision(); + if (!trigger) vetoEvent; + const double sqrtS = applyProjection<Beam>(event, "Beams").sqrtS(); const double weight = event.weight(); - - // Minimum Bias trigger requirements from the hodoscopes - int n_trig_1 = 0; - int n_trig_2 = 0; - - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFSAll"); - foreach (const Particle& p, cfs.particles()) { - double eta = p.momentum().pseudorapidity(); - if (inRange(eta, -5.6, -2.0)) n_trig_1++; - else if (inRange(eta, 2.0, 5.6)) n_trig_2++; - } - - // Require at least one coincidence hit in trigger hodoscopes - if (n_trig_1 == 0 || n_trig_2 == 0) vetoEvent; - getLog() << Log::DEBUG << "Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2 << endl; - + // Count forward/backward rates n_10f += applyProjection<ChargedFinalState>(event, "CFS10F").size(); n_15f += applyProjection<ChargedFinalState>(event, "CFS15F").size(); Modified: trunk/src/Analyses/UA5_1989_S1926373.cc ============================================================================== --- trunk/src/Analyses/UA5_1989_S1926373.cc Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Analyses/UA5_1989_S1926373.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -4,6 +4,7 @@ #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/Beam.hh" #include "Rivet/Projections/ChargedFinalState.hh" +#include "Rivet/Projections/TriggerUA5.hh" namespace Rivet { @@ -23,8 +24,8 @@ /// Book histograms and projections void init() { + addProjection(TriggerUA5(), "Trigger"); addProjection(Beam(), "Beams"); - addProjection(ChargedFinalState(), "CFSAll"); addProjection(ChargedFinalState(-0.5, 0.5), "CFS05"); addProjection(ChargedFinalState(-1.5, 1.5), "CFS15"); addProjection(ChargedFinalState(-3.0, 3.0), "CFS30"); @@ -50,26 +51,13 @@ /// Do the analysis void analyze(const Event& event) { + // Trigger + const TriggerUA5& trigger = applyProjection<TriggerUA5>(event, "Trigger"); + if (!trigger.nsdDecision()) vetoEvent; + const double sqrtS = applyProjection<Beam>(event, "Beams").sqrtS(); const double weight = event.weight(); - // Minimum Bias trigger requirements from the hodoscopes - int n_trig_1(0), n_trig_2(0); - /// @todo Use CFS in +,- eta ranges as below, to cache this loop between UA5 analyses - const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFSAll"); - foreach (const Particle& p, cfs.particles()) { - const double eta = p.momentum().pseudorapidity(); - if (inRange(eta, -5.6, -2.0)) n_trig_1 += 1; - else if (inRange(eta, 2.0, 5.6)) n_trig_2 += 1; - } - - // Require at least one coincidence hit in trigger hodoscopes - getLog() << Log::DEBUG << "Trigger -: " << n_trig_1 << ", Trigger +: " << n_trig_2 << endl; - if (n_trig_1 == 0 || n_trig_2 == 0) { - _numVetoed +=1; - vetoEvent; - } - // Count final state particles in several eta regions const int numP05 = applyProjection<ChargedFinalState>(event, "CFS05").size(); const int numP15 = applyProjection<ChargedFinalState>(event, "CFS15").size(); @@ -77,7 +65,7 @@ const int numP50 = applyProjection<ChargedFinalState>(event, "CFS50").size(); // Fill histograms - if (fuzzyEquals(sqrtS, 200.0, 1E-4)) { + if (fuzzyEquals(sqrtS/GeV, 200.0, 1E-4)) { _hist_nch200->fill(numP50, weight); _hist_nch200eta05->fill(numP05, weight); _hist_nch200eta15->fill(numP15, weight); @@ -85,7 +73,7 @@ _hist_nch200eta50->fill(numP50, weight); _hist_mean_nch_200->fill(_hist_mean_nch_200->binMean(0), numP50); } - else if (fuzzyEquals(sqrtS, 900.0, 1E-4)) { + else if (fuzzyEquals(sqrtS/GeV, 900.0, 1E-4)) { _hist_nch900->fill(numP50, weight); _hist_nch900eta05->fill(numP05, weight); _hist_nch900eta15->fill(numP15, weight); Modified: trunk/src/Projections/Makefile.am ============================================================================== --- trunk/src/Projections/Makefile.am Sun Oct 4 16:50:01 2009 (r1855) +++ trunk/src/Projections/Makefile.am Sun Oct 4 18:34:58 2009 (r1856) @@ -27,6 +27,8 @@ SVertex.cc \ Thrust.cc \ TotalVisibleMomentum.cc \ + TriggerCDFRun0Run1.cc \ + TriggerUA5.cc \ UnstableFinalState.cc \ VetoedFinalState.cc \ VisibleFinalState.cc \ Copied and modified: trunk/src/Projections/TriggerCDFRun0Run1.cc (from r1844, trunk/src/Projections/Beam.cc) ============================================================================== --- trunk/src/Projections/Beam.cc Thu Oct 1 18:21:30 2009 (r1844, copy source) +++ trunk/src/Projections/TriggerCDFRun0Run1.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -2,54 +2,41 @@ #include "Rivet/Rivet.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/Beam.hh" +#include "Rivet/Projections/ChargedFinalState.hh" +#include "Rivet/Projections/TriggerCDFRun0Run1.hh" namespace Rivet { - void Beam::project(const Event& e) { - assert(e.genEvent().particles_size() >= 2); - std::pair<HepMC::GenParticle*, HepMC::GenParticle*> beams = - e.genEvent().beam_particles(); - assert(beams.first); - _theBeams.first = *(beams.first); - assert(beams.second); - _theBeams.second = *(beams.second); - - getLog() << Log::DEBUG << "Beam particle IDs = " - << _theBeams.first.pdgId() << ", " - << _theBeams.second.pdgId() << endl; - } - - - const double Beam::sqrtS() const { - const double mom1 = beams().first.momentum().pz(); - const double mom2 = beams().second.momentum().pz(); - assert(sign(mom1) != sign(mom2)); - double sqrts = 0.0; - if (fuzzyEquals(fabs(mom1), fabs(mom2))) { - sqrts = fabs(mom1) + fabs(mom2); - } else { - /// @todo Implement general sqrt(s) for asymmetric beams... requires particle masses. - throw Error("Asymmetric beams... calculation of sqrt(S) not yet implemented"); + void TriggerCDFRun0Run1::project(const Event& evt) { + // Start with the assumption that the trigger fails + _decision_mb = false; + + // Minimum Bias trigger requirements from the BBC counters + int n_trig_1 = 0; + int n_trig_2 = 0; + // Event selection based on tracks in VTPC (time projection chambers) + int n_backward = 0; + int n_forward = 0; + + const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(evt, "CFS"); + foreach (const Particle& p, cfs.particles()) { + const double eta = p.momentum().pseudorapidity(); + if (inRange(eta, -5.9, -3.2)) n_trig_1++; + else if (inRange(eta, 3.2, 5.9)) n_trig_2++; + if (inRange(eta, -3.0, 0.0)) n_backward++; + else if (inRange(eta, 0.0, 3.0)) n_forward++; } - getLog() << Log::DEBUG << "sqrt(s) = " << sqrts/GeV << " GeV" << endl; - return sqrts; - } - - - ///////////////////////////////////////////////// - - - ParticlePair beams(const Event& e) { - Beam beamproj; - beamproj.project(e); - return beamproj.beams(); - } - - BeamPair beamIds(const Event& e) { - Beam beamproj; - beamproj.project(e); - return beamproj.beamIDs(); + + // Require at least 4 tracks with at least one in each of the forward + // and backward hemispheres: + if (n_trig_1 == 0 || n_trig_2 == 0) return; + getLog() << Log::DEBUG << "Trigger 1: " << n_trig_1 << " Trigger 2: " << n_trig_2 << endl; + if (n_backward + n_forward < 4 || n_backward == 0 || n_forward == 0) return; + getLog() << Log::DEBUG << " Num. forward: " << n_forward << ", Num. backward: " << n_backward << endl; + + // Trigger success: + _decision_mb = true; } Copied and modified: trunk/src/Projections/TriggerUA5.cc (from r1844, trunk/src/Projections/Beam.cc) ============================================================================== --- trunk/src/Projections/Beam.cc Thu Oct 1 18:21:30 2009 (r1844, copy source) +++ trunk/src/Projections/TriggerUA5.cc Sun Oct 4 18:34:58 2009 (r1856) @@ -2,54 +2,44 @@ #include "Rivet/Rivet.hh" #include "Rivet/Tools/Logging.hh" #include "Rivet/Projections/Beam.hh" +#include "Rivet/Projections/ChargedFinalState.hh" +#include "Rivet/Projections/TriggerUA5.hh" namespace Rivet { - void Beam::project(const Event& e) { - assert(e.genEvent().particles_size() >= 2); - std::pair<HepMC::GenParticle*, HepMC::GenParticle*> beams = - e.genEvent().beam_particles(); - assert(beams.first); - _theBeams.first = *(beams.first); - assert(beams.second); - _theBeams.second = *(beams.second); - - getLog() << Log::DEBUG << "Beam particle IDs = " - << _theBeams.first.pdgId() << ", " - << _theBeams.second.pdgId() << endl; - } - + void TriggerUA5::project(const Event& evt) { + // Start with the assumption that the trigger fails + _decision_sd = false; + _decision_nsd = false; + + // Different trigger implementations for ppbar and pp! + const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(evt, "CFS"); + foreach (const Particle& p, cfs.particles()) { + const double eta = p.momentum().pseudorapidity(); + if (inRange(eta, -5.6, -2.0)) _n_minus++; + else if (inRange(eta, 2.0, 5.6)) _n_plus++; + } + getLog() << Log::DEBUG << "Trigger -: " << _n_minus << ", Trigger +: " << _n_plus << endl; - const double Beam::sqrtS() const { - const double mom1 = beams().first.momentum().pz(); - const double mom2 = beams().second.momentum().pz(); - assert(sign(mom1) != sign(mom2)); - double sqrts = 0.0; - if (fuzzyEquals(fabs(mom1), fabs(mom2))) { - sqrts = fabs(mom1) + fabs(mom2); + // Common SD/NSD trigger requirement: must activate at least one hodoscope + if (_n_minus == 0 && _n_plus == 0) return; + _decision_sd = true; + + // Extra NSD trigger requirements + const Beam& b = applyProjection<Beam>(evt, "Beam"); + _samebeams = (b.beams().first.pdgId() == b.beams().second.pdgId()); + if (_samebeams) { + // PP + if (_n_minus == 0 || _n_plus == 0) return; } else { - /// @todo Implement general sqrt(s) for asymmetric beams... requires particle masses. - throw Error("Asymmetric beams... calculation of sqrt(S) not yet implemented"); + // PPbar + /// @todo Is this actually the exact trigger requirement? + if (_n_minus * _n_plus < 4) return; } - getLog() << Log::DEBUG << "sqrt(s) = " << sqrts/GeV << " GeV" << endl; - return sqrts; - } - - - ///////////////////////////////////////////////// - - - ParticlePair beams(const Event& e) { - Beam beamproj; - beamproj.project(e); - return beamproj.beams(); - } - BeamPair beamIds(const Event& e) { - Beam beamproj; - beamproj.project(e); - return beamproj.beamIDs(); + // Trigger success: + _decision_nsd = true; }
More information about the Rivet-svn mailing list |