D0_2008_S7863608.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Projections/ZFinder.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 #include "Rivet/RivetAIDA.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief Measurement differential Z/gamma* + jet +X cross sections
00012   /// @author Gavin Hesketh, Andy Buckley, Frank Siegert
00013   class D0_2008_S7863608 : public Analysis {
00014 
00015   public:
00016 
00017     /// @name Construction
00018     //@{
00019     /// Constructor
00020     D0_2008_S7863608() : Analysis("D0_2008_S7863608")
00021     {
00022       setBeams(PROTON, ANTIPROTON);
00023       setNeedsCrossSection(true);
00024     }
00025  
00026     //@}
00027 
00028 
00029     /// @name Analysis methods
00030     //@{
00031  
00032     /// Book histograms
00033     void init() {
00034       ZFinder zfinder(-1.7, 1.7, 15.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2);
00035       addProjection(zfinder, "ZFinder");
00036    
00037       FastJets conefinder(zfinder.remainingFinalState(), FastJets::D0ILCONE, 0.5);
00038       addProjection(conefinder, "ConeFinder");
00039 
00040       _h_jet_pT_cross_section = bookHistogram1D(1, 1, 1);
00041       _h_jet_y_cross_section = bookHistogram1D(2, 1, 1);
00042       _h_Z_pT_cross_section = bookHistogram1D(3, 1, 1);
00043       _h_Z_y_cross_section = bookHistogram1D(4, 1, 1);
00044       _h_total_cross_section = bookHistogram1D(5, 1, 1);
00045     }
00046  
00047  
00048 
00049     // Do the analysis
00050     void analyze(const Event& e) {
00051       const double weight = e.weight();
00052    
00053       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00054       if (zfinder.particles().size()==1) {
00055         const JetAlg& jetpro = applyProjection<JetAlg>(e, "ConeFinder");
00056         const Jets& jets = jetpro.jetsByPt(20.0*GeV);
00057         Jets jets_cut;
00058         foreach (const Jet& j, jets) {
00059           if (fabs(j.momentum().pseudorapidity()) < 2.8) {
00060             jets_cut.push_back(j);
00061           }
00062         }
00063      
00064         // Return if there are no jets:
00065         if(jets_cut.size()<1) {
00066           getLog() << Log::DEBUG << "Skipping event " << e.genEvent().event_number()
00067                    << " because no jets pass cuts " << endl;
00068           vetoEvent;
00069         }
00070      
00071         // cut on Delta R between jet and muons
00072         foreach (const Jet& j, jets_cut) {
00073           foreach (const Particle& mu, zfinder.constituentsFinalState().particles()) {
00074             if (deltaR(mu.momentum().pseudorapidity(), mu.momentum().azimuthalAngle(),
00075                        j.momentum().pseudorapidity(), j.momentum().azimuthalAngle()) < 0.5) {
00076               vetoEvent;
00077             }
00078           }
00079         }
00080      
00081         const FourMomentum Zmom = zfinder.particles()[0].momentum();
00082      
00083         // In jet pT
00084         _h_jet_pT_cross_section->fill( jets_cut[0].momentum().pT(), weight);
00085         _h_jet_y_cross_section->fill( fabs(jets_cut[0].momentum().rapidity()), weight);
00086      
00087         // In Z pT
00088         _h_Z_pT_cross_section->fill(Zmom.pT(), weight);
00089         _h_Z_y_cross_section->fill(fabs(Zmom.rapidity()), weight);
00090      
00091         _h_total_cross_section->fill(1960.0, weight);
00092       }
00093     }
00094  
00095  
00096  
00097     /// Finalize
00098     void finalize() {
00099       const double invlumi = crossSection()/sumOfWeights();
00100       scale(_h_total_cross_section, invlumi);
00101       scale(_h_jet_pT_cross_section, invlumi);
00102       scale(_h_jet_y_cross_section, invlumi);
00103       scale(_h_Z_pT_cross_section, invlumi);
00104       scale(_h_Z_y_cross_section, invlumi);
00105     }
00106  
00107     //@}
00108 
00109 
00110   private:
00111 
00112     /// @name Histograms
00113     //@{
00114     AIDA::IHistogram1D * _h_jet_pT_cross_section;
00115     AIDA::IHistogram1D * _h_jet_y_cross_section;
00116     AIDA::IHistogram1D * _h_Z_pT_cross_section;
00117     AIDA::IHistogram1D * _h_Z_y_cross_section;
00118     AIDA::IHistogram1D * _h_total_cross_section;
00119     //@}
00120 
00121   };
00122 
00123  
00124  
00125   // This global object acts as a hook for the plugin system
00126   AnalysisBuilder<D0_2008_S7863608> plugin_D0_2008_S7863608;
00127 
00128 }