[Rivet-svn] r1852 - trunk/src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Sun Oct 4 16:49:15 BST 2009


Author: buckley
Date: Sun Oct  4 16:49:15 2009
New Revision: 1852

Log:
Moving projection registration into init for HERA analyses

Modified:
   trunk/src/Analyses/H1_1994_S2919893.cc
   trunk/src/Analyses/H1_1995_S3167097.cc
   trunk/src/Analyses/H1_2000_S4129130.cc
   trunk/src/Analyses/ZEUS_2001_S4815815.cc

Modified: trunk/src/Analyses/H1_1994_S2919893.cc
==============================================================================
--- trunk/src/Analyses/H1_1994_S2919893.cc	Sun Oct  4 16:49:01 2009	(r1851)
+++ trunk/src/Analyses/H1_1994_S2919893.cc	Sun Oct  4 16:49:15 2009	(r1852)
@@ -19,9 +19,13 @@
       : Analysis("H1_1994_S2919893")
     {
       setBeams(ELECTRON, PROTON);
-      addProjection(DISLepton(), "Lepton");
-      addProjection(DISKinematics(), "Kinematics");
-      addProjection(FinalState(), "FS");
+
+      // Initialise member variables
+      _w77  = make_pair(0.0, 0.0);
+      _w122 = make_pair(0.0, 0.0);
+      _w169 = make_pair(0.0, 0.0);
+      _w117 = make_pair(0.0, 0.0);
+      _wEnergy = make_pair(0.0, 0.0);
     }
     
 
@@ -169,20 +173,18 @@
 
 
     void init() {
-      _w77  = make_pair(0.0, 0.0);
-      _w122 = make_pair(0.0, 0.0);
-      _w169 = make_pair(0.0, 0.0);
-      _w117 = make_pair(0.0, 0.0);
-      _wEnergy = make_pair(0.0, 0.0);
+      // Projections
+      addProjection(DISLepton(), "Lepton");
+      addProjection(DISKinematics(), "Kinematics");
+      addProjection(FinalState(), "FS");
 
-      /// @todo What is "N"?
+      // Histos
       _histEnergyFlowLowX =  bookHistogram1D(1, 1, 1);
       _histEnergyFlowHighX = bookHistogram1D(1, 1, 2);
 
       _histEECLowX = bookHistogram1D(2, 1, 1);
       _histEECHighX = bookHistogram1D(2, 1, 2);
 
-      /// @todo Add cross-section units to label
       _histSpectraW77 = bookHistogram1D(3, 1, 1);
       _histSpectraW122 = bookHistogram1D(3, 1, 2);
       _histSpectraW169 = bookHistogram1D(3, 1, 3);

Modified: trunk/src/Analyses/H1_1995_S3167097.cc
==============================================================================
--- trunk/src/Analyses/H1_1995_S3167097.cc	Sun Oct  4 16:49:01 2009	(r1851)
+++ trunk/src/Analyses/H1_1995_S3167097.cc	Sun Oct  4 16:49:15 2009	(r1852)
@@ -14,15 +14,9 @@
   public:
 
     /// Constructor
-    H1_1995_S3167097() 
-      : Analysis("H1_1995_S3167097")
+    H1_1995_S3167097() : Analysis("H1_1995_S3167097")
     { 
       setBeams(ELECTRON, PROTON);
-      const DISKinematics& diskin = addProjection(DISKinematics(), "Kinematics");
-      const FinalStateHCM& fshcm = addProjection(FinalStateHCM(diskin), "FS");
-      addProjection(CentralEtHCM(fshcm), "Y1HCM");
-      //addCut("x", MORE_EQ, _xmin);
-      //addCut("x", LESS_EQ, _xmax);
     }
     
     
@@ -30,6 +24,10 @@
     //@{
 
     void init() {
+      const DISKinematics& diskin = addProjection(DISKinematics(), "Kinematics");
+      const FinalStateHCM& fshcm = addProjection(FinalStateHCM(diskin), "FS");
+      addProjection(CentralEtHCM(fshcm), "Y1HCM");
+
       _hEtFlow = vector<AIDA::IHistogram1D *>(_nbin);
       _hEtFlowStat = vector<AIDA::IHistogram1D *>(_nbin);
       _nev = vector<double>(_nbin);

Modified: trunk/src/Analyses/H1_2000_S4129130.cc
==============================================================================
--- trunk/src/Analyses/H1_2000_S4129130.cc	Sun Oct  4 16:49:01 2009	(r1851)
+++ trunk/src/Analyses/H1_2000_S4129130.cc	Sun Oct  4 16:49:15 2009	(r1852)
@@ -16,13 +16,9 @@
   public:
 
     /// Constructor
-    H1_2000_S4129130()
-      : Analysis("H1_2000_S4129130")
+    H1_2000_S4129130() : Analysis("H1_2000_S4129130")
     {
       setBeams(ELECTRON, PROTON);
-      addProjection(DISLepton(), "Lepton");
-      addProjection(DISKinematics(), "Kinematics");
-      addProjection(FinalState(), "FS");
     }
     
     
@@ -196,15 +192,14 @@
     
     
     void init() {
+      // Projections
+      addProjection(DISLepton(), "Lepton");
+      addProjection(DISKinematics(), "Kinematics");
+      addProjection(FinalState(), "FS");
       
-      string t = "Transverse energy flow for ";
+      // Histos
       IHistogram1D* h = 0;
       
-      /// @todo What is "N"?
-      
-      const string xt = "\\langle x \\rangle";
-      const string Q2t = "\\langle Q^2 \\rangle";
-      
       // Histograms and weight vectors for low Q^2 a
       _histETLowQa.reserve(17);
       _weightETLowQa.reserve(17);

Modified: trunk/src/Analyses/ZEUS_2001_S4815815.cc
==============================================================================
--- trunk/src/Analyses/ZEUS_2001_S4815815.cc	Sun Oct  4 16:49:01 2009	(r1851)
+++ trunk/src/Analyses/ZEUS_2001_S4815815.cc	Sun Oct  4 16:49:15 2009	(r1852)
@@ -14,26 +14,24 @@
   ///
   /// @author Jon Butterworth
   class ZEUS_2001_S4815815 : public Analysis {
-
   public:
 
-    /// Default constructor.
-    ZEUS_2001_S4815815()
-      : Analysis("ZEUS_2001_S4815815") 
+    /// Constructor
+    ZEUS_2001_S4815815() : Analysis("ZEUS_2001_S4815815") 
     { 
       setBeams(POSITRON, PROTON);
-      FinalState fs;
-      addProjection(fs, "FS");
-      /// @todo This is the *wrong* jet def: correct it!
-      addProjection(FastJets(fs, FastJets::KT, 0.7), "Jets");
     }
 
 
     /// @name Analysis methods
     //@{
 
-    // Book histograms
+    // Book projections and histograms
     void init() {
+      FinalState fs;
+      addProjection(fs, "FS");
+      /// @todo This is the *wrong* jet def: correct it!
+      addProjection(FastJets(fs, FastJets::KT, 0.7), "Jets");
       getLog() << Log::WARN << "This analysis uses the wrong jet definition: the " 
                << "paper just says 'a cone algorithm was applied to the CAL cells and jets "
                << "were reconstructed using the energies and positions of these cells'" << endl;
@@ -45,14 +43,11 @@
 
     // Do the analysis
     void analyze(const Event& event) {
-      const FastJets& jets = applyProjection<FastJets>(event, "Jets");
-      const size_t nj = jets.size();
-      getLog() << Log::INFO << "Jet multiplicity = " << nj << endl;
-      
-      // Fill histograms
-      PseudoJets jetList = jets.pseudoJets();
-      for (PseudoJets::const_iterator j = jetList.begin(); j != jetList.end(); ++j) {
-        _histJetEt1->fill(j->perp(), event.weight() );
+      const double weight = event.weight();
+      const JetAlg& jets = applyProjection<FastJets>(event, "Jets");
+      getLog() << Log::INFO << "Jet multiplicity = " << jets.size() << endl;
+      foreach (const Jet& j, jets.jets()) {
+        _histJetEt1->fill(j.momentum().pT(), weight);
       }
     }
     


More information about the Rivet-svn mailing list