rivet is hosted by Hepforge, IPPP Durham
CDF_2010_S8591881_QCD.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief CDF Run II underlying event in leading jet events
00011   /// @author Hendrik Hoeth
00012   ///
00013   /// Rick Field's measurement of the underlying event in "leading jet" events.
00014   /// The leading jet (CDF midpoint \f$ R = 0.7 \f$) must be within \f$|\eta| < 2 \f$
00015   /// and defines the "toward" phi direction. Particles are selected in
00016   /// \f$ |\eta| < 1 \f$. For the \f$ p_\perp \f$-related observables there
00017   /// is a \f$ p_\perp > 0.5 \f$ GeV cut. For \f$ \sum E_\perp \f$ there is no
00018   /// \f$ p_\perp \f$ cut.
00019   ///
00020   /// @par Run conditions
00021   /// @arg \f$ \sqrt{s} = \f$ 1960 GeV
00022   /// @arg Run with generic QCD events.
00023   /// @arg Set particles with c*tau > 10 mm stable
00024   /// @arg Several \f$ p_\perp^\text{min} \f$ cutoffs are probably required to fill the profile histograms:
00025   /// @arg \f$ p_\perp^\text{min} = \f$ 0 (min bias), 10, 20, 50, 100, 150 GeV
00026   /// @arg The corresponding merging points are at \f$ p_T = \f$ 0, 30, 50, 80, 130, 180 GeV
00027   class CDF_2010_S8591881_QCD : public Analysis {
00028   public:
00029 
00030     /// Constructor
00031     CDF_2010_S8591881_QCD()
00032       : Analysis("CDF_2010_S8591881_QCD")
00033     {
00034     }
00035 
00036 
00037     /// @name Analysis methods
00038     //@{
00039 
00040     void init() {
00041       // Final state for the jet finding
00042       const FinalState fsj(-4.0, 4.0, 0.0*GeV);
00043       addProjection(fsj, "FSJ");
00044       addProjection(FastJets(fsj, FastJets::CDFMIDPOINT, 0.7), "MidpointJets");
00045 
00046       // Charged final state for the distributions
00047       const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
00048       addProjection(cfs, "CFS");
00049 
00050       // Book histograms
00051       _hist_tnchg      = bookProfile1D(10, 1, 1);
00052       _hist_pnchg      = bookProfile1D(10, 1, 2);
00053       _hist_anchg      = bookProfile1D(10, 1, 3);
00054       _hist_pmaxnchg   = bookProfile1D(11, 1, 1);
00055       _hist_pminnchg   = bookProfile1D(11, 1, 2);
00056       _hist_pdifnchg   = bookProfile1D(11, 1, 3);
00057       _hist_tcptsum    = bookProfile1D(12, 1, 1);
00058       _hist_pcptsum    = bookProfile1D(12, 1, 2);
00059       _hist_acptsum    = bookProfile1D(12, 1, 3);
00060       _hist_pmaxcptsum = bookProfile1D(13, 1, 1);
00061       _hist_pmincptsum = bookProfile1D(13, 1, 2);
00062       _hist_pdifcptsum = bookProfile1D(13, 1, 3);
00063       _hist_pcptave    = bookProfile1D(14, 1, 1);
00064       _hist_pcptmax    = bookProfile1D(15, 1, 1);
00065     }
00066 
00067 
00068     // Do the analysis
00069     void analyze(const Event& e) {
00070       /// @todo Implement Run II min bias trigger cf. CDF_2009?
00071 
00072       const FinalState& fsj = applyProjection<FinalState>(e, "FSJ");
00073       if (fsj.particles().size() < 1) {
00074         MSG_DEBUG("Failed multiplicity cut");
00075         vetoEvent;
00076       }
00077 
00078       const Jets& jets = applyProjection<FastJets>(e, "MidpointJets").jetsByPt();
00079       MSG_DEBUG("Jet multiplicity = " << jets.size());
00080 
00081       // We require the leading jet to be within |eta|<2
00082       if (jets.size() < 1 || fabs(jets[0].eta()) >= 2) {
00083         MSG_DEBUG("Failed leading jet cut");
00084         vetoEvent;
00085       }
00086 
00087       const double jetphi = jets[0].momentum().phi();
00088       const double jeteta = jets[0].eta();
00089       const double jetpT  = jets[0].pT();
00090       MSG_DEBUG("Leading jet: pT = " << jetpT
00091                 << ", eta = " << jeteta << ", phi = " << jetphi);
00092 
00093       // Get the event weight
00094       const double weight = e.weight();
00095 
00096       // Get the final states to work with for filling the distributions
00097       const FinalState& cfs = applyProjection<ChargedFinalState>(e, "CFS");
00098 
00099       size_t numOverall(0),     numToward(0),          numAway(0)  ;
00100       long int numTrans1(0),     numTrans2(0);
00101       double ptSumOverall(0.0), ptSumToward(0.0), ptSumTrans1(0.0), ptSumTrans2(0.0), ptSumAway(0.0);
00102       double ptMaxOverall(0.0), ptMaxToward(0.0), ptMaxTrans1(0.0), ptMaxTrans2(0.0), ptMaxAway(0.0);
00103 
00104       // Calculate all the charged stuff
00105       foreach (const Particle& p, cfs.particles()) {
00106         const double dPhi = deltaPhi(p.momentum().phi(), jetphi);
00107         const double pT = p.pT();
00108         const double phi = p.momentum().phi();
00109         double rotatedphi = phi - jetphi;
00110         while (rotatedphi < 0) rotatedphi += 2*PI;
00111 
00112         ptSumOverall += pT;
00113         ++numOverall;
00114         if (pT > ptMaxOverall) {
00115           ptMaxOverall = pT;
00116         }
00117 
00118         if (dPhi < PI/3.0) {
00119           ptSumToward += pT;
00120           ++numToward;
00121           if (pT > ptMaxToward) ptMaxToward = pT;
00122         }
00123         else if (dPhi < 2*PI/3.0) {
00124           if (rotatedphi <= PI) {
00125             ptSumTrans1 += pT;
00126             ++numTrans1;
00127             if (pT > ptMaxTrans1) ptMaxTrans1 = pT;
00128           } else {
00129             ptSumTrans2 += pT;
00130             ++numTrans2;
00131             if (pT > ptMaxTrans2) ptMaxTrans2 = pT;
00132           }
00133         }
00134         else {
00135           ptSumAway += pT;
00136           ++numAway;
00137           if (pT > ptMaxAway) ptMaxAway = pT;
00138         }
00139       } // end charged particle loop
00140 
00141       // Fill the histograms
00142       _hist_tnchg->fill(jetpT/GeV, numToward/(4*PI/3), weight);
00143       _hist_pnchg->fill(jetpT/GeV, (numTrans1+numTrans2)/(4*PI/3), weight);
00144       _hist_pmaxnchg->fill(jetpT/GeV, (numTrans1>numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00145       _hist_pminnchg->fill(jetpT/GeV, (numTrans1<numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00146       _hist_pdifnchg->fill(jetpT/GeV, abs(numTrans1-numTrans2)/(2*PI/3), weight);
00147       _hist_anchg->fill(jetpT/GeV, numAway/(4*PI/3), weight);
00148 
00149       _hist_tcptsum->fill(jetpT/GeV, ptSumToward/GeV/(4*PI/3), weight);
00150       _hist_pcptsum->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(4*PI/3), weight);
00151       _hist_pmaxcptsum->fill(jetpT/GeV, (ptSumTrans1>ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00152       _hist_pmincptsum->fill(jetpT/GeV, (ptSumTrans1<ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/GeV/(2*PI/3), weight);
00153       _hist_pdifcptsum->fill(jetpT/GeV, fabs(ptSumTrans1-ptSumTrans2)/GeV/(2*PI/3), weight);
00154       _hist_acptsum->fill(jetpT/GeV, ptSumAway/GeV/(4*PI/3), weight);
00155 
00156       if ((numTrans1+numTrans2) > 0) {
00157         _hist_pcptave->fill(jetpT/GeV, (ptSumTrans1+ptSumTrans2)/GeV/(numTrans1+numTrans2), weight);
00158         _hist_pcptmax->fill(jetpT/GeV, (ptMaxTrans1 > ptMaxTrans2 ? ptMaxTrans1 : ptMaxTrans2)/GeV, weight);
00159       }
00160     }
00161 
00162 
00163     void finalize() {
00164     }
00165 
00166     //@}
00167 
00168 
00169   private:
00170 
00171     Profile1DPtr _hist_tnchg;
00172     Profile1DPtr _hist_pnchg;
00173     Profile1DPtr _hist_anchg;
00174     Profile1DPtr _hist_pmaxnchg;
00175     Profile1DPtr _hist_pminnchg;
00176     Profile1DPtr _hist_pdifnchg;
00177     Profile1DPtr _hist_tcptsum;
00178     Profile1DPtr _hist_pcptsum;
00179     Profile1DPtr _hist_acptsum;
00180     Profile1DPtr _hist_pmaxcptsum;
00181     Profile1DPtr _hist_pmincptsum;
00182     Profile1DPtr _hist_pdifcptsum;
00183     Profile1DPtr _hist_pcptave;
00184     Profile1DPtr _hist_pcptmax;
00185 
00186   };
00187 
00188 
00189 
00190   // The hook for the plugin system
00191   DECLARE_RIVET_PLUGIN(CDF_2010_S8591881_QCD);
00192 
00193 }