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

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


Author: buckley
Date: Sun Oct  4 16:49:01 2009
New Revision: 1851

Log:
Moving projection registration into init for RHIC analyses

Modified:
   trunk/src/Analyses/STAR_2006_S6870392.cc
   trunk/src/Analyses/STAR_2008_S7993412.cc
   trunk/src/Analyses/STAR_2009_UE_HELEN.cc

Modified: trunk/src/Analyses/STAR_2006_S6870392.cc
==============================================================================
--- trunk/src/Analyses/STAR_2006_S6870392.cc	Sun Oct  4 16:48:47 2009	(r1850)
+++ trunk/src/Analyses/STAR_2006_S6870392.cc	Sun Oct  4 16:49:01 2009	(r1851)
@@ -16,23 +16,25 @@
       : Analysis("STAR_2006_S6870392")
     {
       setBeams(PROTON, PROTON);
-      FinalState fs(-2.0, 2.0);
-      addProjection(fs, "FS");
-      // R=0.4, pTmin=0, seed_threshold=0.5:
-      /// @todo Presumably this jet alg is wrong...
-      addProjection(FastJets(fs, FastJets::CDFMIDPOINT, 0.4, 0.0, 0.5), "MidpointJets");
     } 
 
 
     /// @name Analysis methods
     //@{ 
 
-    /// Book histograms
+    /// Book projections and histograms
     void init() {
+      FinalState fs(-2.0, 2.0);
+      addProjection(fs, "FS");
+      // R=0.4, pTmin=0, seed_threshold=0.5:
+      /// @todo Presumably this jet alg is wrong...
+      addProjection(FastJets(fs, FastJets::CDFMIDPOINT, 0.4, 0.0, 0.5), "MidpointJets");
+
       _h_jet_pT_MB = bookHistogram1D(1, 1, 1);
       _h_jet_pT_HT = bookHistogram1D(2, 1, 1);
     }
 
+
     /// Do the analysis 
     void analyze(const Event& event) {
       const double weight = event.weight();
@@ -47,12 +49,15 @@
       
       // Find jets
       const FastJets& jetpro = applyProjection<FastJets>(event, "MidpointJets");
-      const PseudoJets& jets = jetpro.pseudoJetsByPt();
-      
-      foreach (fastjet::PseudoJet jet, jets) {
-        if (fabs(jets[0].eta()) < 0.8 && fabs(jets[0].eta()) > 0.2) {
-          _h_jet_pT_MB->fill(jet.perp(), weight);
-          _h_jet_pT_HT->fill(jet.perp(), weight);
+      const Jets& jets = jetpro.jetsByPt();
+      if (!jets.empty()) {
+        const Jet& j1 = jets.front();
+        if (inRange(fabs(j1.eta()), 0.2, 0.8)) {
+          foreach (const Jet& j, jets) {
+            const FourMomentum pj = j.momentum();
+            _h_jet_pT_MB->fill(pj.pT(), weight);
+            _h_jet_pT_HT->fill(pj.pT(), weight);
+          }
         }
       }
     }

Modified: trunk/src/Analyses/STAR_2008_S7993412.cc
==============================================================================
--- trunk/src/Analyses/STAR_2008_S7993412.cc	Sun Oct  4 16:48:47 2009	(r1850)
+++ trunk/src/Analyses/STAR_2008_S7993412.cc	Sun Oct  4 16:49:01 2009	(r1851)
@@ -10,29 +10,27 @@
   class STAR_2008_S7993412 : public Analysis {
   public:
 
-    STAR_2008_S7993412()
-      : Analysis("STAR_2008_S7993412")
+    STAR_2008_S7993412() : Analysis("STAR_2008_S7993412")
     {
       setBeams(PROTON, PROTON);
-      ChargedFinalState fs(-1.0, 1.0, 1.0*GeV);
-      addProjection(fs, "FS");
     }
     
     
     /// @name Analysis methods
     //@{ 
 
-    /// Book histograms
+    /// Book projections and histograms
     void init() {
+      ChargedFinalState fs(-1.0, 1.0, 1.0*GeV);
+      addProjection(fs, "FS");
+
       _h_Y_jet_trigger = bookProfile1D(1, 1, 1);
       _h_Y_jet_associated = bookProfile1D(2, 1, 1);
     }
 
 
     /// Do the analysis 
-    void analyze(const Event & event) {
-      const double weight = event.weight();
-
+    void analyze(const Event& event) {
       // Skip if the event is empty
       const FinalState& fs = applyProjection<FinalState>(event, "FS");
       if (fs.empty()) {
@@ -41,21 +39,21 @@
         vetoEvent;
       }
       
+      const double weight = event.weight();
+
       foreach (const Particle& tp, fs.particles()) {
         const double triggerpT = tp.momentum().pT();
         if (triggerpT >= 2.0 && triggerpT < 5.0) {
-          int N_associated = 0;
+          int n_associated = 0;
           foreach (const Particle& ap, fs.particles()) {
-            if (ap.momentum().pT() > 1.5 &&
-                ap.momentum().pT() < triggerpT &&
-                deltaPhi(tp.momentum().phi(), ap.momentum().phi()) < 1 &&
-                fabs(tp.momentum().pseudorapidity() - ap.momentum().pseudorapidity()) < 1.75) {
-              N_associated += 1;
-            }
+            if (!inRange(ap.momentum().pT()/GeV, 1.5, triggerpT)) continue;
+            if (deltaPhi(tp.momentum().phi(), ap.momentum().phi()) > 1) continue;
+            if (fabs(tp.momentum().eta() - ap.momentum().eta()) > 1.75) continue;
+            n_associated += 1;
           }
           //const double dPhidEta = 2 * 2*1.75;
-          //_h_Y_jet_trigger->fill(triggerpT, N_associated/dPhidEta, weight);
-          _h_Y_jet_trigger->fill(triggerpT, N_associated, weight);
+          //_h_Y_jet_trigger->fill(triggerpT, n_associated/dPhidEta, weight);
+          _h_Y_jet_trigger->fill(triggerpT, n_associated, weight);
         }
       }
     }

Modified: trunk/src/Analyses/STAR_2009_UE_HELEN.cc
==============================================================================
--- trunk/src/Analyses/STAR_2009_UE_HELEN.cc	Sun Oct  4 16:48:47 2009	(r1850)
+++ trunk/src/Analyses/STAR_2009_UE_HELEN.cc	Sun Oct  4 16:49:01 2009	(r1851)
@@ -20,23 +20,11 @@
       : Analysis("STAR_2009_UE_HELEN")  
     {
       setBeams(PROTON, ANTIPROTON);
-      
-      // Final state for the jet finding
-      const FinalState fsj(-4.0, 4.0, 0.0*GeV);
-      addProjection(fsj, "FSJ");
-      /// @todo STAR doesn't really use a CDF midpoint algorithm!
-      addProjection(FastJets(fsj, FastJets::CDFMIDPOINT, 0.7), "Jets");
-      
-      // Final state for the sum(ET) distributions
-      const FinalState fs(-1.0, 1.0, 0.0*GeV);
-      addProjection(fs, "FS");
-      
-      // Charged final state for the distributions
-      const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
-      addProjection(cfs, "CFS");
     }
 
 
+    /// TODO: make sure this goes into the .info file:
+
     // /// @name Publication metadata
     // //@{
 
@@ -99,8 +87,23 @@
     /// @name Analysis methods
     //@{
     
-    /// Book histograms
+    /// Book projections and histograms
     void init() {
+      // Final state for the jet finding
+      const FinalState fsj(-4.0, 4.0, 0.0*GeV);
+      addProjection(fsj, "FSJ");
+      /// @todo STAR doesn't really use a CDF midpoint algorithm!
+      addProjection(FastJets(fsj, FastJets::CDFMIDPOINT, 0.7), "Jets");
+      
+      // Final state for the sum(ET) distributions
+      const FinalState fs(-1.0, 1.0, 0.0*GeV);
+      addProjection(fs, "FS");
+      
+      // Charged final state for the distributions
+      const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
+      addProjection(cfs, "CFS");
+
+      // Histograms
       _hist_pnchg      = bookProfile1D( 1, 1, 1);
       _hist_pmaxnchg   = bookProfile1D( 2, 1, 1);
       _hist_pminnchg   = bookProfile1D( 3, 1, 1);


More information about the Rivet-svn mailing list