[Rivet-svn] r2176 - in trunk: bin include/Rivet/Projections src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Dec 11 12:49:05 GMT 2009


Author: buckley
Date: Fri Dec 11 12:49:04 2009
New Revision: 2176

Log:
Cross-sec normalisation updates and comments

Modified:
   trunk/bin/aida2flat
   trunk/bin/chisquared
   trunk/bin/chop_bins
   trunk/bin/compare-histos
   trunk/bin/rivet
   trunk/include/Rivet/Projections/PVertex.hh
   trunk/src/Analyses/CDF_2002_S4796047.cc
   trunk/src/Analyses/CDF_2004_S5839831.cc
   trunk/src/Analyses/D0_1996_S3324664.cc
   trunk/src/Analyses/D0_2008_S6879055.cc
   trunk/src/Analyses/DELPHI_2003_WUD_03_11.cc

Modified: trunk/bin/aida2flat
==============================================================================
--- trunk/bin/aida2flat	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/bin/aida2flat	Fri Dec 11 12:49:04 2009	(r2176)
@@ -6,14 +6,14 @@
 
 
 ## Make "sorted" a builtin function on Python < 2.4
-if not 'sorted' in dir(__builtins__):
+if 'sorted' not in dir(__builtins__):
     def sorted(iterable, cmp=None, key=None, reverse=None):
         rtn = iterable
         rtn.sort(cmp)
         return rtn
 
 ## Add logging.log if needed
-if not 'log' in dir(logging):
+if 'log' not in dir(logging):
     def _logit(level, msg):
         l = logging.getLogger()
         l.log(level, msg)

Modified: trunk/bin/chisquared
==============================================================================
--- trunk/bin/chisquared	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/bin/chisquared	Fri Dec 11 12:49:04 2009	(r2176)
@@ -4,14 +4,14 @@
 
 
 ## Make "sorted" a builtin function on Python < 2.4
-if not 'sorted' in dir(__builtins__):
+if 'sorted' not in dir(__builtins__):
     def sorted(iterable, cmp=None, key=None, reverse=None):
         rtn = iterable
         rtn.sort(cmp)
         return rtn
 
 ## Add logging.log if needed
-if not 'log' in dir(logging):
+if 'log' not in dir(logging):
     def _logit(level, msg):
         l = logging.getLogger()
         l.log(level, msg)

Modified: trunk/bin/chop_bins
==============================================================================
--- trunk/bin/chop_bins	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/bin/chop_bins	Fri Dec 11 12:49:04 2009	(r2176)
@@ -27,14 +27,14 @@
 
 import lighthisto
 ## Make "sorted" a builtin function on Python < 2.4
-if not 'sorted' in dir(__builtins__):
+if 'sorted' not in dir(__builtins__):
     def sorted(iterable, cmp=None, key=None, reverse=None):
         rtn = iterable
         rtn.sort(cmp)
         return rtn
 
 ## Add logging.log if needed
-if not 'log' in dir(logging):
+if 'log' not in dir(logging):
     def _logit(level, msg):
         l = logging.getLogger()
         l.log(level, msg)

Modified: trunk/bin/compare-histos
==============================================================================
--- trunk/bin/compare-histos	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/bin/compare-histos	Fri Dec 11 12:49:04 2009	(r2176)
@@ -2,11 +2,11 @@
 
 
 ## Make "set" a builtin type on Python < 2.4
-if not 'set' in dir(__builtins__):
+if 'set' not in dir(__builtins__):
     from sets import Set as set
 
 ## Make "sorted" a builtin function on Python < 2.4
-if not 'sorted' in dir(__builtins__):
+if 'sorted' not in dir(__builtins__):
     def sorted(iterable, cmp=None, key=None, reverse=None):
         rtn = iterable
         rtn.sort(cmp)#, key, reverse)

Modified: trunk/bin/rivet
==============================================================================
--- trunk/bin/rivet	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/bin/rivet	Fri Dec 11 12:49:04 2009	(r2176)
@@ -6,14 +6,14 @@
 
 
 ## Make "sorted" a builtin function on Python < 2.4
-if not 'sorted' in dir(__builtins__):
+if 'sorted' not in dir(__builtins__):
     def sorted(iterable, cmp=None, key=None, reverse=None):
         rtn = iterable
         rtn.sort(cmp)
         return rtn
 
 ## Add logging.log if needed
-if not 'log' in dir(logging):
+if 'log' not in dir(logging):
     def _logit(level, msg):
         l = logging.getLogger()
         l.log(level, msg)

Modified: trunk/include/Rivet/Projections/PVertex.hh
==============================================================================
--- trunk/include/Rivet/Projections/PVertex.hh	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/include/Rivet/Projections/PVertex.hh	Fri Dec 11 12:49:04 2009	(r2176)
@@ -18,6 +18,8 @@
   /// Hence, we don't expose the HepMC GenVertex directly - if it were
   /// available, people might try to e.g. look at the \f$ p_T \f$
   /// of the vertex children, which would be extremely unreliable.
+  ///
+  /// @deprecated This should hardly ever be required for MC studies, and is not necessarily reliable!
   class PVertex : public Projection {
   public:
 

Modified: trunk/src/Analyses/CDF_2002_S4796047.cc
==============================================================================
--- trunk/src/Analyses/CDF_2002_S4796047.cc	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/src/Analyses/CDF_2002_S4796047.cc	Fri Dec 11 12:49:04 2009	(r2176)
@@ -36,6 +36,7 @@
       : Analysis("CDF_2002_S4796047")
     {
       setBeams(PROTON, ANTIPROTON);
+      _sumWTrig = 0;
     }
 
 
@@ -45,14 +46,17 @@
     /// 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");
 
-      _hist_multiplicity_630  = bookHistogram1D(1, 1, 1);
-      _hist_multiplicity_1800 = bookHistogram1D(2, 1, 1);
-      _hist_pt_vs_multiplicity_630  = bookProfile1D(3, 1, 1);
-      _hist_pt_vs_multiplicity_1800 = bookProfile1D(4, 1, 1);
+      // Histos
+      if (fuzzyEquals(sqrtS()/GeV, 630)) {
+        _hist_multiplicity  = bookHistogram1D(1, 1, 1);
+        _hist_pt_vs_multiplicity  = bookProfile1D(3, 1, 1);
+      } else if (fuzzyEquals(sqrtS()/GeV, 1800)) {
+        _hist_multiplicity = bookHistogram1D(2, 1, 1);
+        _hist_pt_vs_multiplicity = bookProfile1D(4, 1, 1);
+      }
     }
  
  
@@ -62,29 +66,19 @@
       const bool trigger = applyProjection<TriggerCDFRun0Run1>(evt, "Trigger").minBiasDecision();
       if (!trigger) vetoEvent;
       const double weight = evt.weight();
+      _sumWTrig += 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();
 
       // Fill histos of charged multiplicity distributions
-      if (fuzzyEquals(sqrtS, 630/GeV)) {
-        _hist_multiplicity_630->fill(numParticles, weight);
-      }
-      else if (fuzzyEquals(sqrtS, 1800/GeV)) {
-        _hist_multiplicity_1800->fill(numParticles, weight);
-      }
+      _hist_multiplicity->fill(numParticles, weight);
 
       // Fill histos for <pT> vs. charged multiplicity
       foreach (const Particle& p, fs.particles()) {
         const double pT = p.momentum().pT();
-        if (fuzzyEquals(sqrtS, 630/GeV)) {
-          _hist_pt_vs_multiplicity_630->fill(numParticles, pT/GeV, weight);
-        }
-        else if (fuzzyEquals(sqrtS, 1800/GeV)) {
-          _hist_pt_vs_multiplicity_1800->fill(numParticles, pT/GeV, weight);
-        }
+        _hist_pt_vs_multiplicity->fill(numParticles, pT/GeV, weight);
       }
    
     }
@@ -93,8 +87,12 @@
     void finalize() {
       // This normalisation is NOT a cross-section.
       // DON'T TRY TO REPAIR THIS, YOU WILL BREAK IT.
-      normalize(_hist_multiplicity_630, 3.21167);
-      normalize(_hist_multiplicity_1800, 4.19121);
+      /// @todo What is it, then?
+      if (fuzzyEquals(sqrtS()/GeV, 630)) {
+        normalize(_hist_multiplicity, 3.21167); // fixed norm OK
+      } else if (fuzzyEquals(sqrtS()/GeV, 1800)) {
+        normalize(_hist_multiplicity, 4.19121); // fixed norm OK
+      }
     }
 
     //@}
@@ -102,10 +100,16 @@
 
   private:
 
-    AIDA::IHistogram1D *_hist_multiplicity_630;
-    AIDA::IHistogram1D *_hist_multiplicity_1800;
-    AIDA::IProfile1D   *_hist_pt_vs_multiplicity_630 ;
-    AIDA::IProfile1D   *_hist_pt_vs_multiplicity_1800;
+    /// @name Counter
+    //@{
+    double _sumWTrig;
+    //@}
+
+    /// @name Histos
+    //@{
+    AIDA::IHistogram1D* _hist_multiplicity;
+    AIDA::IProfile1D* _hist_pt_vs_multiplicity;
+    //@}
 
   };
 

Modified: trunk/src/Analyses/CDF_2004_S5839831.cc
==============================================================================
--- trunk/src/Analyses/CDF_2004_S5839831.cc	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/src/Analyses/CDF_2004_S5839831.cc	Fri Dec 11 12:49:04 2009	(r2176)
@@ -297,17 +297,17 @@
       /// @todo Take these normalisations from the data histo (it can't come from just the MC)
 
       // Normalize to actual number of entries in pT dbn histos...
-      normalize(_pt90Dbn1800Et40,  1656.75);
-      normalize(_pt90Dbn1800Et80,  4657.5);
-      normalize(_pt90Dbn1800Et120, 5395.5);
-      normalize(_pt90Dbn1800Et160, 7248.75);
-      normalize(_pt90Dbn1800Et200, 2442.0);
+      normalize(_pt90Dbn1800Et40,  1656.75); // norm OK
+      normalize(_pt90Dbn1800Et80,  4657.5); // norm OK
+      normalize(_pt90Dbn1800Et120, 5395.5); // norm OK
+      normalize(_pt90Dbn1800Et160, 7248.75); // norm OK
+      normalize(_pt90Dbn1800Et200, 2442.0); // norm OK
    
       // ...and for min bias distributions:
-      normalize(_numTracksDbn1800MB, 309718.25);
-      normalize(_numTracksDbn630MB, 1101024.0);
-      normalize(_ptDbn1800MB, 33600.0);
-      normalize(_ptDbn630MB, 105088.0);
+      normalize(_numTracksDbn1800MB, 309718.25); // norm OK
+      normalize(_numTracksDbn630MB, 1101024.0); // norm OK
+      normalize(_ptDbn1800MB, 33600.0); // norm OK
+      normalize(_ptDbn630MB, 105088.0); // norm OK
     }
 
     //@}

Modified: trunk/src/Analyses/D0_1996_S3324664.cc
==============================================================================
--- trunk/src/Analyses/D0_1996_S3324664.cc	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/src/Analyses/D0_1996_S3324664.cc	Fri Dec 11 12:49:04 2009	(r2176)
@@ -86,11 +86,12 @@
  
     void finalize() {
       // Normalised to #events
-      normalize(_h_deta, 8830.0);
+      normalize(_h_deta, 8830.0); // fixed norm OK
    
       // I have no idea what this is normalised to... in the paper it says unity!
       /// @todo Understand this!
       foreach (IHistogram1D* histo, _h_dphi.getHistograms()) {
+        /// @todo Prefer to scale rather than normalize, if possible
         normalize(histo, 0.0798);
       }
    

Modified: trunk/src/Analyses/D0_2008_S6879055.cc
==============================================================================
--- trunk/src/Analyses/D0_2008_S6879055.cc	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/src/Analyses/D0_2008_S6879055.cc	Fri Dec 11 12:49:04 2009	(r2176)
@@ -97,8 +97,8 @@
       const Jets jets = jetpro.jetsByPt(20.0*GeV);
       vector<FourMomentum> finaljet_list;
       foreach (const Jet& j, jets) {
-        const double jeta = j.momentum().pseudorapidity();
-        const double jphi = j.momentum().azimuthalAngle();
+        const double jeta = j.momentum().eta();
+        const double jphi = j.momentum().phi();
         if (fabs(jeta) > 2.5) continue;
      
         FourMomentum e0 = invmassfs.particles()[0].momentum();
@@ -145,8 +145,8 @@
       _crossSectionRatio->scale(1.0/_crossSectionRatio->binHeight(0));
    
       // Normalise jet pT's to integral of data
-      // there is no other way to do this, because these quantities are not
-      // detector corrected
+      // NB. There is no other way to do this, because these quantities are not
+      // detector-corrected
       normalize(_pTjet1, 10439.0);
       normalize(_pTjet2, 1461.5);
       normalize(_pTjet3, 217.0);

Modified: trunk/src/Analyses/DELPHI_2003_WUD_03_11.cc
==============================================================================
--- trunk/src/Analyses/DELPHI_2003_WUD_03_11.cc	Fri Dec 11 12:48:43 2009	(r2175)
+++ trunk/src/Analyses/DELPHI_2003_WUD_03_11.cc	Fri Dec 11 12:49:04 2009	(r2176)
@@ -9,36 +9,11 @@
 namespace Rivet {
 
 
-  /**
-   * @brief DELPHI 4-jet angular distributions
-   * @author Hendrik Hoeth
-   *
-   * This is Hendrik Hoeth's Diploma thesis, measuring the 4-jet angular
-   * distributions at LEP-1.
-   *
-   *
-   * @par Run conditions
-   *
-   * @arg LEP1 beam energy: \f$ \sqrt{s} = \$f 91.2 GeV
-   * @arg Run with generic QCD events.
-   * @arg No \f$ p_\perp^\text{min} \f$ cutoff is required
-   */
-  class DELPHI_2003_WUD_03_11 : public Analysis {
-  public:
-
-    /// Constructor
-    DELPHI_2003_WUD_03_11()
-      : Analysis("DELPHI_2003_WUD_03_11")
-    {
-      _numdurjets = 0;
-      _numjadejets = 0;
-    }
- 
-
+  namespace {
 
     /// @name Jet angle calculator functions
-    /// @todo These shouldn't be object methods, as they have no state!
     //@{
+    /// @todo Move to utils?
  
     /// @todo Use Jet or FourMomentum interface rather than PseudoJet
     /// @todo Move to utils?
@@ -83,6 +58,33 @@
 
     //@}
 
+  }
+
+
+  /**
+   * @brief DELPHI 4-jet angular distributions
+   * @author Hendrik Hoeth
+   *
+   * This is Hendrik Hoeth's Diploma thesis, measuring the 4-jet angular
+   * distributions at LEP-1.
+   *
+   *
+   * @par Run conditions
+   *
+   * @arg LEP1 beam energy: \f$ \sqrt{s} = \$f 91.2 GeV
+   * @arg Run with generic QCD events.
+   * @arg No \f$ p_\perp^\text{min} \f$ cutoff is required
+   */
+  class DELPHI_2003_WUD_03_11 : public Analysis {
+  public:
+
+    /// Constructor
+    DELPHI_2003_WUD_03_11()
+      : Analysis("DELPHI_2003_WUD_03_11")
+    {
+      _numdurjets = 0;
+      _numjadejets = 0;
+    }
 
 
     /// @name Analysis methods
@@ -163,6 +165,8 @@
    
       getLog() << Log::INFO << "Number of Durham jets = " << _numdurjets << endl;
       getLog() << Log::INFO << "Number of Jade jets   = " << _numjadejets << endl;
+
+      /// @todo Scale rather than normalize?
       normalize(_histDurhamBZ      , 0.0785);
       normalize(_histDurhamKSW     , 0.0785);
       normalize(_histDurhamNR      , 0.0785);


More information about the Rivet-svn mailing list