D0_2008_S7837160.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Tools/ParticleIdUtils.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/WFinder.hh"
00007 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00008 #include "Rivet/Projections/IdentifiedFinalState.hh"
00009 #include "Rivet/RivetAIDA.hh"
00010 
00011 #include "LWH/Histogram1D.h"
00012 #include "LWH/HistogramFactory.h"
00013 
00014 namespace Rivet {
00015 
00016 
00017   /// @brief D0 Run II measurement of W charge asymmetry
00018   /// @author Andy Buckley
00019   /// @author Gavin Hesketh
00020   class D0_2008_S7837160 : public Analysis {
00021 
00022   public:
00023 
00024     /// Default constructor.
00025     D0_2008_S7837160()
00026       : Analysis("D0_2008_S7837160")
00027     {
00028       // Run II W charge asymmetry
00029     }
00030 
00031 
00032     /// @name Analysis methods
00033     //@{
00034 
00035     // Book histograms and set up projections
00036     void init() {
00037       // Projections
00038       /// @todo Use separate pT and ETmiss cuts in WFinder
00039       const WFinder wfe(-5, 5, 25.0*GeV, ELECTRON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00040       addProjection(wfe, "WFe");
00041 
00042       // Cross-section histograms
00043       const BinEdges& edges = binEdges(1,1,1);
00044       _h_dsigplus_deta_25_35  = bookHistogram1D("/dsigplus_deta_25_35", edges);
00045       _h_dsigminus_deta_25_35 = bookHistogram1D("/dsigminus_deta_25_35", edges);
00046       _h_dsigplus_deta_35     = bookHistogram1D("/dsigplus_deta_35", edges);
00047       _h_dsigminus_deta_35    = bookHistogram1D("/dsigminus_deta_35", edges);
00048       _h_dsigplus_deta_25     = bookHistogram1D("/dsigplus_deta_25", edges);
00049       _h_dsigminus_deta_25    = bookHistogram1D("/dsigminus_deta_25", edges);
00050     }
00051 
00052 
00053     /// Do the analysis
00054     void analyze(const Event & event) {
00055       const WFinder& wf = applyProjection<WFinder>(event, "WFe");
00056       if (wf.bosons().size() == 0) {
00057         MSG_DEBUG("No W candidates found: vetoing");
00058         vetoEvent;
00059       }
00060 
00061       // Require that leptons have Et >= 25 GeV
00062       /// @todo Use pT cut in WFinder
00063       /// @todo Any ETmiss cut?
00064       FourMomentum p_e=wf.constituentLeptons()[0].momentum();
00065       int chg_e = PID::threeCharge(wf.constituentLeptons()[0].pdgId());
00066       if (p_e.eta() < 0) chg_e *= -1;
00067       assert(chg_e != 0);
00068 
00069       const double weight = event.weight();
00070       const double eta_e = fabs(p_e.eta());
00071       const double et_e = p_e.Et();
00072       if (et_e < 35*GeV) {
00073         // 25 <= ET < 35
00074         if (chg_e < 0) {
00075           _h_dsigminus_deta_25_35->fill(eta_e, weight);
00076         } else {
00077           _h_dsigplus_deta_25_35->fill(eta_e, weight);
00078         }
00079       } else {
00080         // ET >= 35
00081         if (chg_e < 0) {
00082           _h_dsigminus_deta_35->fill(eta_e, weight);
00083         } else {
00084           _h_dsigplus_deta_35->fill(eta_e, weight);
00085         }
00086       }
00087       // Inclusive: ET >= 25
00088       if (chg_e < 0) {
00089         _h_dsigminus_deta_25->fill(eta_e, weight);
00090       } else {
00091         _h_dsigplus_deta_25->fill(eta_e, weight);
00092       }
00093     }
00094 
00095 
00096     /// Finalize
00097     void finalize() {
00098       // Construct asymmetry: (dsig+/deta - dsig-/deta) / (dsig+/deta + dsig-/deta) for each Et region
00099       AIDA::IHistogramFactory& hf = histogramFactory();
00100 
00101       IHistogram1D* num25_35 = hf.subtract("/num25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
00102       num25_35->scale(100.);
00103       IHistogram1D* denom25_35 = hf.add("/denom25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
00104       assert(num25_35 && denom25_35);
00105       hf.divide(histoDir() + "/d01-x01-y01", *num25_35, *denom25_35);
00106       hf.destroy(num25_35);
00107       hf.destroy(denom25_35);
00108       //
00109       IHistogram1D* num35 = hf.subtract("/num35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
00110       num35->scale(100.);
00111       IHistogram1D* denom35 = hf.add("/denom35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
00112       assert(num35 && denom35);
00113       hf.divide(histoDir() + "/d01-x01-y02", *num35, *denom35);
00114       hf.destroy(num35);
00115       hf.destroy(denom35);
00116       //
00117       IHistogram1D* num25 = hf.subtract("/num25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
00118       num25->scale(100.);
00119       IHistogram1D* denom25 = hf.add("/denom25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
00120       assert(num25 && denom25);
00121       hf.divide(histoDir() + "/d01-x01-y03", *num25, *denom25);
00122       hf.destroy(num25);
00123       hf.destroy(denom25);
00124 
00125       // Delete raw histos
00126       hf.destroy(_h_dsigplus_deta_25_35);
00127       hf.destroy(_h_dsigminus_deta_25_35);
00128       hf.destroy(_h_dsigplus_deta_35);
00129       hf.destroy(_h_dsigminus_deta_35);
00130       hf.destroy(_h_dsigplus_deta_25);
00131       hf.destroy(_h_dsigminus_deta_25);
00132     }
00133 
00134     //@}
00135 
00136 
00137   private:
00138 
00139     /// @name Histograms
00140     //@{
00141     AIDA::IHistogram1D *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35;
00142     AIDA::IHistogram1D *_h_dsigplus_deta_35, *_h_dsigminus_deta_35;
00143     AIDA::IHistogram1D *_h_dsigplus_deta_25, *_h_dsigminus_deta_25;
00144     //@}
00145 
00146   };
00147 
00148 
00149 
00150   // The hook for the plugin system
00151   DECLARE_RIVET_PLUGIN(D0_2008_S7837160);
00152 
00153 }