CDF_2008_LEADINGJETS.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /* CDF Run II underlying event in leading jet events
00013    * @author Hendrik Hoeth
00014    *
00015    * Rick Field's measurement of the underlying event in "leading jet" events.
00016    * The leading jet (CDF midpoint R=0.7) must be within |eta|<2 and defines
00017    * the "toward" phi direction. Particles are selected in |eta|<1. For the pT
00018    * related observables there is a pT>0.5 GeV cut. For sum(ET) there is no pT cut.
00019    *
00020    *
00021    * @par Run conditions
00022    *
00023    * @arg \f$ \sqrt{s} = \f$ 1960 GeV
00024    * @arg Run with generic QCD events.
00025    * @arg Set particles with c*tau > 10 mm stable
00026    * @arg Several \f$ p_\perp^\text{min} \f$ cutoffs are probably required to fill the profile histograms:
00027    *   @arg \f$ p_\perp^\text{min} = \f$ 0 (min bias), 10, 20, 50, 100, 150 GeV
00028    *   @arg The corresponding merging points are at \f$ p_T = \f$ 0, 30, 50, 80, 130, 180 GeV
00029    *
00030    */
00031   class CDF_2008_LEADINGJETS : public Analysis {
00032   public:
00033 
00034     /// Constructor
00035     CDF_2008_LEADINGJETS()
00036       : Analysis("CDF_2008_LEADINGJETS")
00037     {
00038       setBeams(PROTON, ANTIPROTON);
00039     }
00040 
00041 
00042     /// @name Analysis methods
00043     //@{
00044 
00045     void init() {
00046       // Final state for the jet finding
00047       const FinalState fsj(-4.0, 4.0, 0.0*GeV);
00048       addProjection(fsj, "FSJ");
00049       addProjection(FastJets(fsj, FastJets::CDFMIDPOINT, 0.7), "MidpointJets");
00050 
00051       // Final state for the sum(ET) distributions
00052       const FinalState fs(-1.0, 1.0, 0.0*GeV);
00053       addProjection(fs, "FS");
00054 
00055       // Charged final state for the distributions
00056       const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
00057       addProjection(cfs, "CFS");
00058 
00059       // Book histograms
00060       _hist_pnchg      = bookProfile1D( 1, 1, 1);
00061       _hist_pmaxnchg   = bookProfile1D( 2, 1, 1);
00062       _hist_pminnchg   = bookProfile1D( 3, 1, 1);
00063       _hist_pdifnchg   = bookProfile1D( 4, 1, 1);
00064       _hist_pcptsum    = bookProfile1D( 5, 1, 1);
00065       _hist_pmaxcptsum = bookProfile1D( 6, 1, 1);
00066       _hist_pmincptsum = bookProfile1D( 7, 1, 1);
00067       _hist_pdifcptsum = bookProfile1D( 8, 1, 1);
00068       _hist_pcptave    = bookProfile1D( 9, 1, 1);
00069       //_hist_onchg   = bookProfile1D( 1, 1, 1, "Overall number of charged particles");
00070       //_hist_ocptsum = bookProfile1D( 2, 1, 1, "Overall charged $p_\\perp$ sum");
00071       //_hist_oetsum  = bookProfile1D( 3, 1, 1, "Overall $E_\\perp$ sum");
00072     }
00073 
00074 
00075     // Do the analysis
00076     void analyze(const Event& e) {
00077       /// @todo Implement Run II min bias trigger cf. CDF_2009?
00078 
00079       const FinalState& fsj = applyProjection<FinalState>(e, "FSJ");
00080       if (fsj.particles().size() < 1) {
00081         getLog() << Log::DEBUG << "Failed multiplicity cut" << endl;
00082         vetoEvent;
00083       }
00084 
00085       const Jets& jets = applyProjection<FastJets>(e, "MidpointJets").jetsByPt();
00086       getLog() << Log::DEBUG << "Jet multiplicity = " << jets.size() << endl;
00087 
00088       // We require the leading jet to be within |eta|<2
00089       if (jets.size() < 1 || fabs(jets[0].momentum().eta()) >= 2) {
00090         getLog() << Log::DEBUG << "Failed leading jet cut" << endl;
00091         vetoEvent;
00092       }
00093 
00094       const double jetphi = jets[0].momentum().phi();
00095       const double jeteta = jets[0].momentum().eta();
00096       const double jetpT  = jets[0].momentum().pT();
00097       getLog() << Log::DEBUG << "Leading jet: pT = " << jetpT
00098                << ", eta = " << jeteta << ", phi = " << jetphi << endl;
00099 
00100       // Get the event weight
00101       const double weight = e.weight();
00102 
00103       // Get the final states to work with for filling the distributions
00104       const FinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS");
00105 
00106       size_t numOverall(0),     numToward(0),     numTrans1(0),     numTrans2(0),     numAway(0)  ;
00107       double ptSumOverall(0.0), ptSumToward(0.0), ptSumTrans1(0.0), ptSumTrans2(0.0), ptSumAway(0.0);
00108       //double EtSumOverall(0.0), EtSumToward(0.0), EtSumTrans1(0.0), EtSumTrans2(0.0), EtSumAway(0.0);
00109       double ptMaxOverall(0.0), ptMaxToward(0.0), ptMaxTrans1(0.0), ptMaxTrans2(0.0), ptMaxAway(0.0);
00110 
00111       // Calculate all the charged stuff
00112       foreach (const Particle& p, cfs.particles()) {
00113         const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
00114         const double pT = p.momentum().pT();
00115         const double phi = p.momentum().phi();
00116         double rotatedphi = phi - jetphi;
00117         while (rotatedphi < 0) rotatedphi += 2*PI;
00118 
00119         ptSumOverall += pT;
00120         ++numOverall;
00121         if (pT > ptMaxOverall) {
00122           ptMaxOverall = pT;
00123         }
00124 
00125         if (dPhi < PI/3.0) {
00126           ptSumToward += pT;
00127           ++numToward;
00128           if (pT > ptMaxToward) ptMaxToward = pT;
00129         }
00130         else if (dPhi < 2*PI/3.0) {
00131           if (rotatedphi <= PI) {
00132             ptSumTrans1 += pT;
00133             ++numTrans1;
00134             if (pT > ptMaxTrans1) ptMaxTrans1 = pT;
00135           } else {
00136             ptSumTrans2 += pT;
00137             ++numTrans2;
00138             if (pT > ptMaxTrans2) ptMaxTrans2 = pT;
00139           }
00140         }
00141         else {
00142           ptSumAway += pT;
00143           ++numAway;
00144           if (pT > ptMaxAway) ptMaxAway = pT;
00145         }
00146       } // end charged particle loop
00147 
00148 
00149       #if 0
00150       /// @todo Enable this part when we have the numbers from Rick Field
00151 
00152       // And now the same business for all particles (including neutrals)
00153       foreach (const Particle& p, fs.particles()) {
00154         const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
00155         const double ET = p.momentum().Et();
00156         const double phi = p.momentum().phi();
00157         double rotatedphi = phi - jetphi;
00158         while (rotatedphi < 0) rotatedphi += 2*PI;
00159 
00160         EtSumOverall += ET;
00161 
00162         if (dPhi < PI/3.0) {
00163           EtSumToward += ET;
00164         }
00165         else if (dPhi < 2*PI/3.0) {
00166           if (rotatedphi <= PI) {
00167             EtSumTrans1 += ET;
00168           }
00169           else {
00170             EtSumTrans2 += ET;
00171           }
00172         }
00173         else {
00174           EtSumAway += ET;
00175         }
00176       } // end all particle loop
00177       #endif
00178 
00179 
00180       // Fill the histograms
00181       //_hist_tnchg->fill(jetpT/GeV, numToward/(4*PI/3), weight);
00182       _hist_pnchg->fill(jetpT/GeV, (numTrans1+numTrans2)/(4*PI/3), weight);
00183       _hist_pmaxnchg->fill(jetpT/GeV, (numTrans1>numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00184       _hist_pminnchg->fill(jetpT/GeV, (numTrans1<numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00185       _hist_pdifnchg->fill(jetpT/GeV, abs(numTrans1-numTrans2)/(2*PI/3), weight);
00186       //_hist_anchg->fill(jetpT/GeV, numAway/(4*PI/3), weight);
00187 
00188       //_hist_tcptsum->fill(jetpT/GeV, ptSumToward/GeV/(4*PI/3), weight);
00189       _hist_pcptsum->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(4*PI/3), weight);
00190       _hist_pmaxcptsum->fill(jetpT/GeV, (ptSumTrans1>ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00191       _hist_pmincptsum->fill(jetpT/GeV, (ptSumTrans1<ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00192       _hist_pdifcptsum->fill(jetpT/GeV, fabs(ptSumTrans1-ptSumTrans2)/GeV/(2*PI/3), weight);
00193       //_hist_acptsum->fill(jetpT/GeV, ptSumAway/GeV/(4*PI/3), weight);
00194 
00195       //if (numToward > 0) {
00196       //  _hist_tcptave->fill(jetpT/GeV, ptSumToward/GeV/numToward, weight);
00197       //  _hist_tcptmax->fill(jetpT/GeV, ptMaxToward/GeV, weight);
00198       //}
00199       if ((numTrans1+numTrans2) > 0) {
00200         _hist_pcptave->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(numTrans1+numTrans2), weight);
00201         //_hist_pcptmax->fill(jetpT/GeV, (ptMaxTrans1 > ptMaxTrans2 ? ptMaxTrans1 : ptMaxTrans2)/GeV, weight);
00202       }
00203       //if (numAway > 0) {
00204       //  _hist_acptave->fill(jetpT/GeV, ptSumAway/GeV/numAway, weight);
00205       //  _hist_acptmax->fill(jetpT/GeV, ptMaxAway/GeV, weight);
00206       //}
00207     }
00208 
00209 
00210     void finalize() {
00211       //
00212     }
00213 
00214     //@}
00215 
00216 
00217   private:
00218 
00219     AIDA::IProfile1D *_hist_pnchg;
00220     AIDA::IProfile1D *_hist_pmaxnchg;
00221     AIDA::IProfile1D *_hist_pminnchg;
00222     AIDA::IProfile1D *_hist_pdifnchg;
00223     AIDA::IProfile1D *_hist_pcptsum;
00224     AIDA::IProfile1D *_hist_pmaxcptsum;
00225     AIDA::IProfile1D *_hist_pmincptsum;
00226     AIDA::IProfile1D *_hist_pdifcptsum;
00227     AIDA::IProfile1D *_hist_pcptave;
00228 
00229   };
00230 
00231 
00232 
00233   // This global object acts as a hook for the plugin system
00234   AnalysisBuilder<CDF_2008_LEADINGJETS> plugin_CDF_2008_LEADINGJETS;
00235 
00236 }