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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Oct 14 11:42:52 BST 2009


Author: hoeth
Date: Wed Oct 14 11:42:52 2009
New Revision: 1903

Log:
code cleanup (whitespaces, variable names ...)

Modified:
   trunk/src/Analyses/CDF_2008_LEADINGJETS.cc

Modified: trunk/src/Analyses/CDF_2008_LEADINGJETS.cc
==============================================================================
--- trunk/src/Analyses/CDF_2008_LEADINGJETS.cc	Wed Oct 14 08:28:07 2009	(r1902)
+++ trunk/src/Analyses/CDF_2008_LEADINGJETS.cc	Wed Oct 14 11:42:52 2009	(r1903)
@@ -11,30 +11,30 @@
 
   /* CDF Run II underlying event in leading jet events
    * @author Hendrik Hoeth
-   * 
+   *
    * Rick Field's measurement of the underlying event in "leading jet" events.
    * The leading jet (CDF midpoint R=0.7) must be within |eta|<2 and defines
    * the "toward" phi direction. Particles are selected in |eta|<1. For the pT
    * related observables there is a pT>0.5 GeV cut. For sum(ET) there is no pT cut.
-   * 
-   * 
+   *
+   *
    * @par Run conditions
-   * 
+   *
    * @arg \f$ \sqrt{s} = \f$ 1960 GeV
    * @arg Run with generic QCD events.
    * @arg Set particles with c*tau > 10 mm stable
    * @arg Several \f$ p_\perp^\text{min} \f$ cutoffs are probably required to fill the profile histograms:
    *   @arg \f$ p_\perp^\text{min} = \f$ 0 (min bias), 10, 20, 50, 100, 150 GeV
    *   @arg The corresponding merging points are at \f$ p_T = \f$ 0, 30, 50, 80, 130, 180 GeV
-   * 
-   */ 
+   *
+   */
   class CDF_2008_LEADINGJETS : public Analysis {
   public:
-    
+
     /// Constructor
     CDF_2008_LEADINGJETS()
       : Analysis("CDF_2008_LEADINGJETS")
-    { 
+    {
       setBeams(PROTON, ANTIPROTON);
     }
 
@@ -47,11 +47,11 @@
       const FinalState fsj(-4.0, 4.0, 0.0*GeV);
       addProjection(fsj, "FSJ");
       addProjection(FastJets(fsj, FastJets::CDFMIDPOINT, 0.7), "MidpointJets");
-      
+
       // 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");
@@ -70,8 +70,8 @@
       //_hist_ocptsum = bookProfile1D( 2, 1, 1, "Overall charged $p_\\perp$ sum");
       //_hist_oetsum  = bookProfile1D( 3, 1, 1, "Overall $E_\\perp$ sum");
     }
-    
-    
+
+
     // Do the analysis
     void analyze(const Event& e) {
       /// @todo Implement Run II min bias trigger cf. CDF_2009?
@@ -81,49 +81,47 @@
         getLog() << Log::DEBUG << "Failed multiplicity cut" << endl;
         vetoEvent;
       }
-      
+
       const Jets& jets = applyProjection<FastJets>(e, "MidpointJets").jetsByPt();
       getLog() << Log::DEBUG << "Jet multiplicity = " << jets.size() << endl;
-      
+
       // We require the leading jet to be within |eta|<2
       if (jets.size() < 1 || fabs(jets[0].momentum().eta()) >= 2) {
         getLog() << Log::DEBUG << "Failed leading jet cut" << endl;
         vetoEvent;
       }
-      
+
       const double jetphi = jets[0].momentum().phi();
       const double jeteta = jets[0].momentum().eta();
-      const double jetpT  = jets[0].momentum().perp();
+      const double jetpT  = jets[0].momentum().pT();
       getLog() << Log::DEBUG << "Leading jet: pT = " << jetpT
                << ", eta = " << jeteta << ", phi = " << jetphi << endl;
-      
+
       // Get the event weight
       const double weight = e.weight();
-      
+
       // Get the final states to work with for filling the distributions
       const FinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS");
-      
+
       size_t numOverall(0),     numToward(0),     numTrans1(0),     numTrans2(0),     numAway(0)  ;
       double ptSumOverall(0.0), ptSumToward(0.0), ptSumTrans1(0.0), ptSumTrans2(0.0), ptSumAway(0.0);
       //double EtSumOverall(0.0), EtSumToward(0.0), EtSumTrans1(0.0), EtSumTrans2(0.0), EtSumAway(0.0);
       double ptMaxOverall(0.0), ptMaxToward(0.0), ptMaxTrans1(0.0), ptMaxTrans2(0.0), ptMaxAway(0.0);
-      
+
       // Calculate all the charged stuff
       foreach (const Particle& p, cfs.particles()) {
         const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
         const double pT = p.momentum().pT();
         const double phi = p.momentum().phi();
-        
-        /// @todo The jet and particle phis should now be the same: check
         double rotatedphi = phi - jetphi;
         while (rotatedphi < 0) rotatedphi += 2*PI;
-        
+
         ptSumOverall += pT;
         ++numOverall;
         if (pT > ptMaxOverall) {
           ptMaxOverall = pT;
         }
-        
+
         if (dPhi < PI/3.0) {
           ptSumToward += pT;
           ++numToward;
@@ -151,26 +149,25 @@
             ptMaxAway = pT;
         }
       } // end charged particle loop
-      
-      
-      #if 0   
+
+
+      #if 0
       /// @todo Enable this part when we have the numbers from Rick Field
-      
+
       // And now the same business for all particles (including neutrals)
       foreach (const Particle& p, fs.particles()) {
         const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
         const double ET = p.momentum().Et();
-        const double phi = p.momentum().azimuthalAngle();
-        /// @todo Check that phi mappings really match (they should now)
+        const double phi = p.momentum().phi();
         double rotatedphi = phi - jetphi;
         while (rotatedphi < 0) rotatedphi += 2*PI;
-        
+
         EtSumOverall += ET;
-        
-        if (deltaPhi < PI/3.0) {
+
+        if (dPhi < PI/3.0) {
           EtSumToward += ET;
         }
-        else if (deltaPhi < 2*PI/3.0) {
+        else if (dPhi < 2*PI/3.0) {
           if (rotatedphi <= PI) {
             EtSumTrans1 += ET;
           }
@@ -183,8 +180,8 @@
         }
       } // end all particle loop
       #endif
-      
-      
+
+
       // Fill the histograms
       //_hist_tnchg->fill(jetpT, numToward/(4*PI/3), weight);
       _hist_pnchg->fill(jetpT, (numTrans1+numTrans2)/(4*PI/3), weight);
@@ -192,14 +189,14 @@
       _hist_pminnchg->fill(jetpT, (numTrans1<numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
       _hist_pdifnchg->fill(jetpT, abs(numTrans1-numTrans2)/(2*PI/3), weight);
       //_hist_anchg->fill(jetpT, numAway/(4*PI/3), weight);
-      
+
       //_hist_tcptsum->fill(jetpT, ptSumToward/(4*PI/3), weight);
       _hist_pcptsum->fill(jetpT, (ptSumTrans1+ptSumTrans2)/(4*PI/3), weight);
       _hist_pmaxcptsum->fill(jetpT, (ptSumTrans1>ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/(2*PI/3), weight);
       _hist_pmincptsum->fill(jetpT, (ptSumTrans1<ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/(2*PI/3), weight);
       _hist_pdifcptsum->fill(jetpT, fabs(ptSumTrans1-ptSumTrans2)/(2*PI/3), weight);
       //_hist_acptsum->fill(jetpT, ptSumAway/(4*PI/3), weight);
-      
+
       //if (numToward > 0) {
       //  _hist_tcptave->fill(jetpT, ptSumToward/numToward, weight);
       //  _hist_tcptmax->fill(jetpT, ptMaxToward, weight);
@@ -213,12 +210,12 @@
       //  _hist_acptmax->fill(jetpT, ptMaxAway, weight);
       //}
     }
-    
-    
-    void finalize() {  
+
+
+    void finalize() {
       //
     }
-    
+
     //@}
 
 


More information about the Rivet-svn mailing list