D0_1998_S3711838.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/WFinder.hh"
00007 #include "Rivet/Tools/ParticleIdUtils.hh"
00008 /// @todo Include more projections as required, e.g. ChargedFinalState, FastJets, ZFinder...
00009 
00010 namespace Rivet {
00011 
00012 
00013   class D0_1998_S3711838 : public Analysis {
00014   public:
00015 
00016     /// @name Constructors etc.
00017     //@{
00018 
00019     /// Constructor
00020     D0_1998_S3711838()
00021       : Analysis("D0_1998_S3711838") 
00022     {
00023       /// @todo Set approriate for your analysis
00024       setBeams(PROTON, ANTIPROTON);
00025       
00026       /// @todo Set whether your finalize method needs the generator cross section
00027       setNeedsCrossSection(false);
00028     }
00029 
00030     //@}
00031 
00032 
00033   public:
00034 
00035     /// @name Analysis methods
00036     //@{
00037 
00038     /// Book histograms and initialise projections before the run
00039     void init() {
00040       /// @todo Use separate pT and ETmiss cuts in WFinder
00041       WFinder wfe(-5, 5, 0.0*GeV, ELECTRON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00042       addProjection(wfe, "WFe");
00043 
00044       // Book histogram
00045       _hist_wpt = bookHistogram1D(1, 1, 1);
00046 
00047     }
00048 
00049 
00050     /// Perform the per-event analysis
00051     void analyze(const Event& event) {
00052       const double weight = event.weight();
00053       const WFinder& wf = applyProjection<WFinder>(event, "WFe");
00054       if (wf.size() == 0) {
00055         getLog() << Log::DEBUG << "No W candidates found: vetoing" << endl;
00056         vetoEvent;
00057       }
00058 
00059       // Require the electron to have ET > 25 GeV  and |eta| < 1.1
00060       /// @todo Use separate pT and ETmiss cuts in WFinder
00061       FourMomentum p_e;
00062       int chg_e = 0;
00063 
00064       foreach (const Particle& l, wf.constituentsFinalState().particles()) {
00065         const FourMomentum pl = l.momentum();
00066         if (abs(l.pdgId()) == ELECTRON) {
00067           chg_e = PID::threeCharge(l.pdgId());
00068           p_e = pl;
00069           const double eta_e = fabs(p_e.pseudorapidity());
00070           if ( (pl.Et()/GeV < 25.0) || (eta_e > 1.1) ) {
00071             getLog() << Log::DEBUG << l.pdgId() << " ET,pT,eta: " << pl.Et()/GeV << "," << pl.pT()/GeV << "," << eta_e << " fails electron cut" << endl;
00072             vetoEvent;
00073           }
00074         }
00075         // Require ETmiss to be > 25 GeV
00076         else if (abs(l.pdgId()) == NU_E) {
00077           FourMomentum p_nu = l.momentum();
00078           if (p_nu.Et()/GeV < 25.0) {
00079             getLog() << Log::DEBUG << l.pdgId() << " ET(miss): " << p_nu.Et() << "fails ETmiss cut" << endl;
00080             vetoEvent;
00081           }
00082         }
00083       }
00084       assert(chg_e != 0);
00085 
00086       FourMomentum pW = wf.particles()[0].momentum();
00087       getLog() << Log::DEBUG << "Dilepton mass = " << pW.mass()/GeV << " GeV"  << endl;
00088       getLog() << Log::DEBUG << "Dilepton pT   = " << pW.pT()/GeV << " GeV" << endl;
00089       _hist_wpt->fill(pW.pT()/GeV, weight);
00090 
00091     }
00092 
00093 
00094     /// Normalise histograms etc., after the run
00095     void finalize() {
00096       
00097     }
00098 
00099     //@}
00100 
00101   private:
00102 
00103     /// @name Histograms
00104     AIDA::IHistogram1D *_hist_wpt;
00105 
00106   };
00107 
00108 
00109 
00110   // This global object acts as a hook for the plugin system
00111   AnalysisBuilder<D0_1998_S3711838> plugin_D0_1998_S3711838;
00112 
00113 
00114 }