rivet is hosted by Hepforge, IPPP Durham
CDF_2010_S8591881_DY.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 #include "Rivet/Projections/ChargedLeptons.hh"
00005 
00006 namespace Rivet {
00007 
00008   
00009 
00010 
00011   /// @brief CDF Run II underlying event in Drell-Yan
00012   /// @author Hendrik Hoeth
00013   ///
00014   /// Measurement of the underlying event in Drell-Yan
00015   /// \f$ Z/\gamma^* \to e^+ e^- \f$ and
00016   /// \f$ Z/\gamma^* \to \mu^+ \mu^- \f$ events. The reconstructed
00017   /// Z defines the \f$ \phi \f$ orientation. A Z mass window cut is applied.
00018   ///
00019   /// @par Run conditions
00020   ///
00021   /// @arg \f$ \sqrt{s} = \f$ 1960 GeV
00022   /// @arg produce Drell-Yan events
00023   /// @arg Set particles with c*tau > 10 mm stable
00024   /// @arg Z decay mode: Z -> e+e- and Z -> mu+mu-
00025   /// @arg gamma decay mode: gamma -> e+e- and gamma -> mu+mu-
00026   /// @arg minimum invariant mass of the fermion pair coming from the Z/gamma: 70 GeV
00027   class CDF_2010_S8591881_DY : public Analysis {
00028   public:
00029 
00030     /// Constructor
00031     CDF_2010_S8591881_DY() : Analysis("CDF_2010_S8591881_DY")
00032     {
00033     }
00034 
00035 
00036     /// @name Analysis methods
00037     //@{
00038 
00039     void init() {
00040       // Set up projections
00041       const ChargedFinalState cfs(-1.0, 1.0, 0.5*GeV);
00042       const ChargedFinalState clfs(-1.0, 1.0, 20*GeV);
00043       addProjection(cfs, "FS");
00044       addProjection(ChargedLeptons(clfs), "CL");
00045 
00046       // Book histograms
00047       _hist_tnchg      = bookProfile1D( 1, 1, 1);
00048       _hist_pnchg      = bookProfile1D( 1, 1, 2);
00049       _hist_anchg      = bookProfile1D( 1, 1, 3);
00050       _hist_pmaxnchg   = bookProfile1D( 2, 1, 1);
00051       _hist_pminnchg   = bookProfile1D( 2, 1, 2);
00052       _hist_pdifnchg   = bookProfile1D( 2, 1, 3);
00053       _hist_tcptsum    = bookProfile1D( 3, 1, 1);
00054       _hist_pcptsum    = bookProfile1D( 3, 1, 2);
00055       _hist_acptsum    = bookProfile1D( 3, 1, 3);
00056       _hist_pmaxcptsum = bookProfile1D( 4, 1, 1);
00057       _hist_pmincptsum = bookProfile1D( 4, 1, 2);
00058       _hist_pdifcptsum = bookProfile1D( 4, 1, 3);
00059       _hist_tcptave    = bookProfile1D( 5, 1, 1);
00060       _hist_pcptave    = bookProfile1D( 5, 1, 2);
00061       _hist_tcptmax    = bookProfile1D( 6, 1, 1);
00062       _hist_pcptmax    = bookProfile1D( 6, 1, 2);
00063       _hist_zptvsnchg  = bookProfile1D( 7, 1, 1);
00064       _hist_cptavevsnchg = bookProfile1D( 8, 1, 1);
00065       _hist_cptavevsnchgsmallzpt = bookProfile1D( 9, 1, 1);
00066     }
00067 
00068 
00069     /// Do the analysis
00070     void analyze(const Event& e) {
00071 
00072       const FinalState& fs = applyProjection<FinalState>(e, "FS");
00073       const size_t numParticles = fs.particles().size();
00074 
00075       // Even if we only generate hadronic events, we still need a cut on numCharged >= 2.
00076       if (numParticles < 1) {
00077         MSG_DEBUG("Failed multiplicity cut");
00078         vetoEvent;
00079       }
00080 
00081       // Get the event weight
00082       const double weight = e.weight();
00083 
00084       // Get the leptons
00085       const Particles& leptons = applyProjection<ChargedLeptons>(e, "CL").chargedLeptons();
00086 
00087       // We want exactly two leptons of the same flavour.
00088       MSG_DEBUG("lepton multiplicity = " << leptons.size());
00089       if (leptons.size() != 2 || leptons[0].pid() != -leptons[1].pid() ) vetoEvent;
00090 
00091       // Lepton pT > 20 GeV
00092       if (leptons[0].pT()/GeV <= 20 || leptons[1].pT()/GeV <= 20) vetoEvent;
00093 
00094       // Lepton pair should have an invariant mass between 70 and 110 and |eta| < 6
00095       const FourMomentum dilepton = leptons[0].momentum() + leptons[1].momentum();
00096       if (!inRange(dilepton.mass()/GeV, 70., 110.) || fabs(dilepton.eta()) >= 6) vetoEvent;
00097       MSG_DEBUG("Dilepton mass = " << dilepton.mass()/GeV << " GeV");
00098       MSG_DEBUG("Dilepton pT   = " << dilepton.pT()/GeV << " GeV");
00099 
00100       // Calculate the observables
00101       size_t   numToward(0),     numAway(0);
00102       long int numTrans1(0),     numTrans2(0);
00103       double ptSumToward(0.0), ptSumTrans1(0.0), ptSumTrans2(0.0), ptSumAway(0.0);
00104       double ptMaxToward(0.0), ptMaxTrans1(0.0), ptMaxTrans2(0.0), ptMaxAway(0.0);
00105       const double phiZ = dilepton.azimuthalAngle();
00106       const double pTZ  = dilepton.pT();
00107       /// @todo Replace with foreach
00108       for (Particles::const_iterator p = fs.particles().begin(); p != fs.particles().end(); ++p) {
00109         // Don't use the leptons
00110         /// @todo Replace with PID::isLepton
00111         if (abs(p->pid()) < 20) continue;
00112 
00113         const double dPhi = deltaPhi(p->momentum().phi(), phiZ);
00114         const double pT = p->pT();
00115         double rotatedphi = p->momentum().phi() - phiZ;
00116         while (rotatedphi < 0) rotatedphi += 2*PI;
00117 
00118         if (dPhi < PI/3.0) {
00119           ptSumToward += pT;
00120           ++numToward;
00121           if (pT > ptMaxToward)
00122             ptMaxToward = pT;
00123         } else if (dPhi < 2*PI/3.0) {
00124           if (rotatedphi <= PI) {
00125             ptSumTrans1 += pT;
00126             ++numTrans1;
00127             if (pT > ptMaxTrans1)
00128               ptMaxTrans1 = pT;
00129           }
00130           else {
00131             ptSumTrans2 += pT;
00132             ++numTrans2;
00133             if (pT > ptMaxTrans2)
00134               ptMaxTrans2 = pT;
00135           }
00136         } else {
00137           ptSumAway += pT;
00138           ++numAway;
00139           if (pT > ptMaxAway)
00140             ptMaxAway = pT;
00141         }
00142         // We need to subtract the two leptons from the number of particles to get the correct multiplicity
00143         _hist_cptavevsnchg->fill(numParticles-2, pT, weight);
00144         if (pTZ < 10)
00145           _hist_cptavevsnchgsmallzpt->fill(numParticles-2, pT, weight);
00146       }
00147 
00148       // Fill the histograms
00149       _hist_tnchg->fill(pTZ, numToward/(4*PI/3), weight);
00150       _hist_pnchg->fill(pTZ, (numTrans1+numTrans2)/(4*PI/3), weight);
00151       _hist_pmaxnchg->fill(pTZ, (numTrans1>numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00152       _hist_pminnchg->fill(pTZ, (numTrans1<numTrans2 ? numTrans1 : numTrans2)/(2*PI/3), weight);
00153       _hist_pdifnchg->fill(pTZ, abs(numTrans1-numTrans2)/(2*PI/3), weight);
00154       _hist_anchg->fill(pTZ, numAway/(4*PI/3), weight);
00155 
00156       _hist_tcptsum->fill(pTZ, ptSumToward/(4*PI/3), weight);
00157       _hist_pcptsum->fill(pTZ, (ptSumTrans1+ptSumTrans2)/(4*PI/3), weight);
00158       _hist_pmaxcptsum->fill(pTZ, (ptSumTrans1>ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/(2*PI/3), weight);
00159       _hist_pmincptsum->fill(pTZ, (ptSumTrans1<ptSumTrans2 ? ptSumTrans1 : ptSumTrans2)/(2*PI/3), weight);
00160       _hist_pdifcptsum->fill(pTZ, fabs(ptSumTrans1-ptSumTrans2)/(2*PI/3), weight);
00161       _hist_acptsum->fill(pTZ, ptSumAway/(4*PI/3), weight);
00162 
00163       if (numToward > 0) {
00164         _hist_tcptave->fill(pTZ, ptSumToward/numToward, weight);
00165         _hist_tcptmax->fill(pTZ, ptMaxToward, weight);
00166       }
00167       if ((numTrans1+numTrans2) > 0) {
00168         _hist_pcptave->fill(pTZ, (ptSumTrans1+ptSumTrans2)/(numTrans1+numTrans2), weight);
00169         _hist_pcptmax->fill(pTZ, (ptMaxTrans1 > ptMaxTrans2 ? ptMaxTrans1 : ptMaxTrans2), weight);
00170       }
00171 
00172       // We need to subtract the two leptons from the number of particles to get the correct multiplicity
00173       _hist_zptvsnchg->fill(numParticles-2, pTZ, weight);
00174     }
00175 
00176 
00177     void finalize() {
00178     }
00179 
00180     //@}
00181 
00182 
00183   private:
00184 
00185     Profile1DPtr _hist_tnchg;
00186     Profile1DPtr _hist_pnchg;
00187     Profile1DPtr _hist_pmaxnchg;
00188     Profile1DPtr _hist_pminnchg;
00189     Profile1DPtr _hist_pdifnchg;
00190     Profile1DPtr _hist_anchg;
00191     Profile1DPtr _hist_tcptsum;
00192     Profile1DPtr _hist_pcptsum;
00193     Profile1DPtr _hist_pmaxcptsum;
00194     Profile1DPtr _hist_pmincptsum;
00195     Profile1DPtr _hist_pdifcptsum;
00196     Profile1DPtr _hist_acptsum;
00197     Profile1DPtr _hist_tcptave;
00198     Profile1DPtr _hist_pcptave;
00199     Profile1DPtr _hist_tcptmax;
00200     Profile1DPtr _hist_pcptmax;
00201     Profile1DPtr _hist_zptvsnchg;
00202     Profile1DPtr _hist_cptavevsnchg;
00203     Profile1DPtr _hist_cptavevsnchgsmallzpt;
00204 
00205   };
00206 
00207 
00208 
00209   // The hook for the plugin system
00210   DECLARE_RIVET_PLUGIN(CDF_2010_S8591881_DY);
00211 
00212 }