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