CDF_2010_S8591881_DY.cc

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