CDF_2008_S7541902.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/Tools/ParticleIdUtils.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/VetoedFinalState.hh"
00008 #include "Rivet/Projections/InvMassFinalState.hh"
00009 #include "Rivet/Projections/FastJets.hh"
00010 #include <algorithm>
00011 
00012 namespace Rivet {
00013 
00014 
00015   /// @brief CDF jet pT and multiplicity distributions in W + jets events
00016   ///
00017   /// This CDF analysis provides jet pT distributions for 4 jet multiplicity bins
00018   /// as well as the jet multiplicity distribution in W + jets events.
00019   /// e-Print: arXiv:0711.4044 [hep-ex]
00020   class CDF_2008_S7541902 : public Analysis {
00021   public:
00022 
00023     /// Constructor
00024     CDF_2008_S7541902()
00025       : Analysis("CDF_2008_S7541902"),
00026         _electronETCut(20.0*GeV), _electronETACut(1.1),
00027         _eTmissCut(30.0*GeV), _mTCut(20.0*GeV),
00028         _jetEtCutA(20.0*GeV),  _jetEtCutB(25.0*GeV), _jetETA(2.0),
00029         _xpoint(1960.)
00030     {
00031       setBeams(PROTON, ANTIPROTON);
00032       setNeedsCrossSection(true);
00033     }
00034 
00035 
00036     /// @name Analysis methods
00037     //@{
00038  
00039     void init() {
00040       // Set up projections
00041       // Basic FS
00042       FinalState fs(-3.6, 3.6);
00043       addProjection(fs, "FS");
00044    
00045       // Create a final state with any e-nu pair with invariant mass 65 -> 95 GeV and ET > 20 (W decay products)
00046       vector<pair<PdgId,PdgId> > vids;
00047       vids += make_pair(ELECTRON, NU_EBAR);
00048       vids += make_pair(POSITRON, NU_E);
00049       FinalState fs2(-3.6, 3.6, 20*GeV);
00050       InvMassFinalState invfs(fs2, vids, 65*GeV, 95*GeV);
00051       addProjection(invfs, "INVFS");
00052    
00053       // Make a final state without the W decay products for jet clustering
00054       VetoedFinalState vfs(fs);
00055       vfs.addVetoOnThisFinalState(invfs);
00056       addProjection(vfs, "VFS");
00057       addProjection(FastJets(vfs, FastJets::CDFJETCLU, 0.4), "Jets");
00058 
00059       // Book histograms
00060       for (int i = 0 ; i < 4 ; ++i) {
00061         _histJetEt[i] = bookHistogram1D(i+1, 1, 1);
00062         _histJetMultRatio[i] = bookDataPointSet(5 , 1, i+1);
00063         _histJetMult[i]   = bookHistogram1D(i+6, 1, 1);
00064       }
00065       _histJetMultNorm = bookHistogram1D("norm", 1, _xpoint, _xpoint+1.);
00066     }
00067  
00068 
00069     /// Do the analysis
00070     void analyze(const Event& event) {
00071       // Get the W decay products (electron and neutrino)
00072       const InvMassFinalState& invMassFinalState = applyProjection<InvMassFinalState>(event, "INVFS");
00073       const ParticleVector&  wDecayProducts = invMassFinalState.particles();
00074    
00075       FourMomentum electronP, neutrinoP;
00076       bool gotElectron(false), gotNeutrino(false);
00077       foreach (const Particle& p, wDecayProducts) {
00078         FourMomentum p4 = p.momentum();
00079         if (p4.Et() > _electronETCut && fabs(p4.eta()) < _electronETACut && abs(p.pdgId()) == ELECTRON) {
00080           electronP = p4;
00081           gotElectron = true;
00082         }
00083         else if (p4.Et() > _eTmissCut && abs(p.pdgId()) == NU_E) {
00084           neutrinoP = p4;
00085           gotNeutrino = true;
00086         }
00087       }
00088    
00089       // Veto event if the electron or MET cuts fail
00090       if (!gotElectron || !gotNeutrino) vetoEvent;
00091    
00092       // Veto event if the MTR cut fails
00093       double mT2 = 2.0 * ( electronP.pT()*neutrinoP.pT() - electronP.px()*neutrinoP.px() - electronP.py()*neutrinoP.py() );
00094       if (sqrt(mT2) < _mTCut ) vetoEvent;
00095    
00096       // Get the jets
00097       const JetAlg& jetProj = applyProjection<FastJets>(event, "Jets");
00098       Jets theJets = jetProj.jetsByEt(_jetEtCutA);
00099       size_t njetsA(0), njetsB(0);
00100       foreach (const Jet& j, theJets) {
00101         const FourMomentum pj = j.momentum();
00102         if (fabs(pj.rapidity()) < _jetETA) {
00103           // Fill differential histograms for top 4 jets with Et > 20
00104           if (njetsA < 4 && pj.Et() > _jetEtCutA) {
00105             ++njetsA;
00106             _histJetEt[njetsA-1]->fill(pj.Et(), event.weight());
00107           }
00108           // Count number of jets with Et > 25 (for multiplicity histograms)
00109           if (pj.Et() > _jetEtCutB) ++njetsB;
00110         }
00111       }
00112    
00113       // Jet multiplicity
00114       _histJetMultNorm->fill(_xpoint, event.weight());
00115       for (size_t i = 1; i <= njetsB; ++i) {
00116         _histJetMult[i-1]->fill(_xpoint, event.weight());
00117         if (i == 4) break;
00118       }
00119     }
00120  
00121  
00122 
00123     /// Finalize
00124     void finalize() {
00125       const double xsec = crossSection()/sumOfWeights();
00126       // Get the x-axis for the ratio plots
00127       /// @todo Replace with autobooking etc. once YODA in place
00128       std::vector<double> xval; xval.push_back(_xpoint);
00129       std::vector<double> xerr; xerr.push_back(.5);
00130       // Fill the first ratio histogram using the special normalisation histogram for the total cross section
00131       double ratio1to0 = 0.;
00132       if (_histJetMultNorm->binHeight(0) > 0.) ratio1to0 = _histJetMult[0]->binHeight(0)/_histJetMultNorm->binHeight(0);
00133       // Get the fractional error on the ratio histogram
00134       double frac_err1to0 = 0.;
00135       if (_histJetMult[0]->binHeight(0) > 0.)  frac_err1to0 = _histJetMult[0]->binError(0)/_histJetMult[0]->binHeight(0);
00136       if (_histJetMultNorm->binHeight(0) > 0.) {
00137         frac_err1to0 *= frac_err1to0;
00138         frac_err1to0 += pow(_histJetMultNorm->binError(0)/_histJetMultNorm->binHeight(0),2.);
00139         frac_err1to0 = sqrt(frac_err1to0);
00140       }
00141    
00142       /// @todo Replace with autobooking etc. once YODA in place
00143       vector<double> yval[4]; yval[0].push_back(ratio1to0);
00144       vector<double> yerr[4]; yerr[0].push_back(ratio1to0*frac_err1to0);
00145       _histJetMultRatio[0]->setCoordinate(0,xval,xerr);
00146       _histJetMultRatio[0]->setCoordinate(1,yval[0],yerr[0]);
00147       for (int i = 0; i < 4; ++i) {
00148         if (i < 3) {
00149           float ratio = 0.0;
00150           if (_histJetMult[i]->binHeight(0) > 0.0) ratio = _histJetMult[i+1]->binHeight(0)/_histJetMult[i]->binHeight(0);
00151           float frac_err = 0.0;
00152           if (_histJetMult[i]->binHeight(0) > 0.0) frac_err = _histJetMult[i]->binError(0)/_histJetMult[i]->binHeight(0);
00153           if (_histJetMult[i+1]->binHeight(0) > 0.0) {
00154             frac_err *= frac_err;
00155             frac_err += pow(_histJetMult[i+1]->binError(0)/_histJetMult[i+1]->binHeight(0),2.);
00156             frac_err = sqrt(frac_err);
00157           }
00158           yval[i+1].push_back(ratio);
00159           yerr[i+1].push_back(ratio*frac_err);
00160           _histJetMultRatio[i+1]->setCoordinate(0,xval,xerr);
00161           _histJetMultRatio[i+1]->setCoordinate(1,yval[i+1],yerr[i+1]);
00162         }
00163         _histJetEt[i]->scale(xsec);
00164         _histJetMult[i]->scale(xsec);
00165       }
00166       _histJetMultNorm->scale(xsec);
00167     }
00168 
00169     //@}
00170 
00171 
00172   private:
00173 
00174     /// @name Cuts
00175     //@{
00176     /// Cut on the electron ET:
00177     double _electronETCut;
00178     /// Cut on the electron ETA:
00179     double _electronETACut;
00180     /// Cut on the missing ET
00181     double _eTmissCut;
00182     /// Cut on the transverse mass squared
00183     double _mTCut;
00184     /// Cut on the jet ET for differential cross sections
00185     double _jetEtCutA;
00186     /// Cut on the jet ET for jet multiplicity
00187     double _jetEtCutB;
00188     /// Cut on the jet ETA
00189     double _jetETA;
00190     //@}
00191 
00192     double _xpoint;
00193 
00194     /// @name Histograms
00195     //@{
00196     AIDA::IHistogram1D* _histJetEt[4];
00197     AIDA::IHistogram1D* _histJetMultNorm;
00198     AIDA::IDataPointSet* _histJetMultRatio[4];
00199     AIDA::IHistogram1D* _histJetMult[4];
00200     //@}
00201 
00202   };
00203 
00204 
00205   // This global object acts as a hook for the plugin system
00206   AnalysisBuilder<CDF_2008_S7541902> plugin_CDF_2008_S7541902;
00207 
00208 }