[Rivet-svn] r3365 - in trunk: . data/anainfo include/Rivet pyext/rivet src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Sat Sep 17 18:43:35 BST 2011


Author: buckley
Date: Sat Sep 17 18:43:34 2011
New Revision: 3365

Log:
Adding support for Inspire to the AnalysisInfo and Analysis interfaces. Maybe we can find a way to combine the two, e.g. only use the 'Inspire' name in the API, and return the SPIRES code prefixed with an 'S' if no Inspire ID is available. I still need to update the mkanalysis script and the BibTeX downloader to support Inspire

Modified:
   trunk/ChangeLog
   trunk/data/anainfo/ATLAS_2011_I919017.info
   trunk/include/Rivet/Analysis.hh
   trunk/include/Rivet/AnalysisInfo.hh
   trunk/pyext/rivet/rivetwrap.i
   trunk/src/Analyses/ATLAS_2011_I919017.cc

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Sat Sep 17 18:20:20 2011	(r3364)
+++ trunk/ChangeLog	Sat Sep 17 18:43:34 2011	(r3365)
@@ -1,3 +1,10 @@
+2011-09-17  Andy Buckley  <andy at insectnation.org>
+
+	* Adding Inspire support to the AnalysisInfo and Analysis
+	interfaces. Maybe we can find a way to combine the two,
+	e.g. return the SPIRES code prefixed with an "S" if no Inspire ID
+	is available...
+
 2011-09-18  Hendrik Hoeth <hendrik.hoeth at cern.ch>
 
 	* Added ALICE_2011_S8909580 (strange particle production at 900 GeV)

Modified: trunk/data/anainfo/ATLAS_2011_I919017.info
==============================================================================
--- trunk/data/anainfo/ATLAS_2011_I919017.info	Sat Sep 17 18:20:20 2011	(r3364)
+++ trunk/data/anainfo/ATLAS_2011_I919017.info	Sat Sep 17 18:43:34 2011	(r3365)
@@ -3,7 +3,7 @@
 Summary: Measurement of ATLAS track jet properties at 7 TeV
 Experiment: ATLAS
 Collider: LHC
-#InspireID: 919017
+InspireID: 919017
 Status: UNVALIDATED
 Authors:
  - Seth Zenz <seth.zenz at cern.ch>

Modified: trunk/include/Rivet/Analysis.hh
==============================================================================
--- trunk/include/Rivet/Analysis.hh	Sat Sep 17 18:20:20 2011	(r3364)
+++ trunk/include/Rivet/Analysis.hh	Sat Sep 17 18:43:34 2011	(r3365)
@@ -59,8 +59,8 @@
     /// @name Standard constructors and destructors.
     //@{
 
-    /// The default constructor.
-    //Analysis();
+    // /// The default constructor.
+    // Analysis();
 
     /// Constructor
     Analysis(const std::string& name);
@@ -119,7 +119,12 @@
       return (info().name().empty()) ? _defaultname : info().name();
     }
 
-    /// Get a the SPIRES/Inspire ID code for this analysis.
+    /// Get the Inspire ID code for this analysis.
+    virtual std::string inspireId() const {
+      return info().inspireId();
+    }
+
+    /// Get the SPIRES ID code for this analysis (~deprecated).
     virtual std::string spiresId() const {
       return info().spiresId();
     }

Modified: trunk/include/Rivet/AnalysisInfo.hh
==============================================================================
--- trunk/include/Rivet/AnalysisInfo.hh	Sat Sep 17 18:20:20 2011	(r3364)
+++ trunk/include/Rivet/AnalysisInfo.hh	Sat Sep 17 18:43:34 2011	(r3365)
@@ -9,10 +9,6 @@
 
 
   class AnalysisInfo {
-    /// @todo Remove this when all metadata taken from YAML
-    friend class Analysis;
-
-
   public:
 
     /// Static factory method: returns null pointer if no metadata found
@@ -37,14 +33,16 @@
     /// building web pages and the analysis pages in the Rivet manual.
     //@{
 
-    /// Get the name of the analysis. By default this is computed by
-    /// combining the results of the experiment, year and Spires ID
-    /// metadata methods and you should only override it if there's a
-    /// good reason why those won't work.
+    /// Get the name of the analysis. By default this is computed using the
+    /// experiment, year and Inspire/Spires ID metadata methods.
     std::string name() const {
       if (!_name.empty()) return _name;
-      if (!experiment().empty() && !year().empty() && !spiresId().empty()) {
-        return experiment() + "_" + year() + "_S" + spiresId();
+      if (!experiment().empty() && !year().empty()) {
+        if (!inspireId().empty()) {
+          return experiment() + "_" + year() + "_I" + inspireId();
+        } else if (!spiresId().empty()) {
+          return experiment() + "_" + year() + "_S" + spiresId();
+        }
       }
       return "";
     }
@@ -53,6 +51,13 @@
     void setName(const std::string& name) { _name = name; }
 
 
+    /// Get the Inspire (SPIRES replacement) ID code for this analysis.
+    const std::string& inspireId() const { return _inspireId; }
+
+    /// Set the Inspire (SPIRES replacement) ID code for this analysis.
+    void setInspireId(const std::string& inspireId) { _inspireId = inspireId; }
+
+
     /// Get the SPIRES ID code for this analysis.
     const std::string& spiresId() const { return _spiresId; }
 
@@ -184,7 +189,7 @@
   private:
 
     std::string _name;
-    std::string _spiresId;
+    std::string _spiresId, _inspireId;
     std::vector<std::string> _authors;
     std::string _summary;
     std::string _description;
@@ -205,6 +210,7 @@
     void clear() {
       _name = "";
       _spiresId = "";
+      _inspireId = "";
       _authors.clear();
       _summary = "";
       _description = "";

Modified: trunk/pyext/rivet/rivetwrap.i
==============================================================================
--- trunk/pyext/rivet/rivetwrap.i	Sat Sep 17 18:20:20 2011	(r3364)
+++ trunk/pyext/rivet/rivetwrap.i	Sat Sep 17 18:43:34 2011	(r3365)
@@ -59,7 +59,6 @@
 
   std::string version();
 
-
   class Event {
     Event();
     Event(const HepMC::GenEvent&);
@@ -84,7 +83,6 @@
 
   double sqrtS(const Event& e);
 
-  // std::string toBeamsString(const PdgIdPair& pair);
   const std::string& toParticleName(PdgId p);
   PdgId toParticleId(const std::string& pname);
 
@@ -93,6 +91,7 @@
   class Analysis {
   public:
     virtual std::string name() const;
+    virtual std::string inspireId() const;
     virtual std::string spiresId() const;
     virtual std::string summary() const;
     virtual std::string description() const;

Modified: trunk/src/Analyses/ATLAS_2011_I919017.cc
==============================================================================
--- trunk/src/Analyses/ATLAS_2011_I919017.cc	Sat Sep 17 18:20:20 2011	(r3364)
+++ trunk/src/Analyses/ATLAS_2011_I919017.cc	Sat Sep 17 18:43:34 2011	(r3365)
@@ -28,7 +28,8 @@
     }
 
     // For annulus area kludge
-    inline double calcrweight(const Jet&j, const Particle& p) {
+    /// @todo Improve somehow... need normalisation *without* bin width factors!
+    inline double calcrweight(const Jet& j, const Particle& p) {
       size_t nBins_r = 26;
       double bins_r[] = { 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10,
                           0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30,


More information about the Rivet-svn mailing list