CDF_2008_S7782535.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/FastJets.hh"
00008 #include "Rivet/Projections/JetShape.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// Implementation of CDF RunII b-jet shape paper
00014   class CDF_2008_S7782535 : public Analysis {
00015   public:
00016 
00017     /// Constructor
00018     CDF_2008_S7782535() : Analysis("CDF_2008_S7782535")
00019     {
00020       setBeams(PROTON, ANTIPROTON);
00021       _Rjet = 0.7;
00022       _NpTbins = 4;
00023     }
00024  
00025 
00026     /// @name Analysis methods
00027     //@{
00028 
00029     void init() {
00030       // Set up projections
00031       const FinalState fs(-3.6, 3.6);
00032       addProjection(fs, "FS");
00033       // Veto (anti)neutrinos, and muons with pT above 1.0 GeV
00034       VetoedFinalState vfs(fs);
00035       vfs.vetoNeutrinos();
00036       vfs.addVetoPairDetail(MUON, 1.0*GeV, MAXDOUBLE);
00037       addProjection(vfs, "VFS");
00038       addProjection(FastJets(vfs, FastJets::CDFMIDPOINT, 0.7), "Jets");
00039       addProjection(JetShape(vfs, _jetaxes, 0.0, 0.7, 0.1, 0.3), "JetShape");
00040 
00041       // Book histograms
00042       _pTbins += 52, 80, 104, 142, 300;
00043       for (int i = 0; i < _NpTbins; ++i) {
00044         _h_Psi_pT[i] = bookProfile1D(i+1, 2, 1);
00045       }
00046       _h_OneMinusPsi_vs_pT = bookDataPointSet(5, 1, 1);
00047     }
00048  
00049  
00050     // Do the analysis
00051     void analyze(const Event& event) {
00052       // Get jets
00053       const Jets& jets = applyProjection<FastJets>(event, "Jets").jetsByPt();
00054       getLog() << Log::DEBUG << "Jet multiplicity before any pT cut = " << jets.size() << endl;
00055    
00056       // Determine the central jet axes
00057       _jetaxes.clear();
00058       foreach (const Jet& j, jets) {
00059         if (j.containsBottom()) {
00060           // Only use central calorimeter jets
00061           FourMomentum pjet = j.momentum();
00062           if (pjet.pT()/GeV > _pTbins[0] && fabs(pjet.rapidity()) < 0.7) {
00063             _jetaxes.push_back(pjet);
00064           }
00065         }
00066       }
00067       if (_jetaxes.empty())  {
00068         getLog() << Log::DEBUG << "No b-jet axes in acceptance" << endl;
00069         vetoEvent;
00070       }
00071    
00072       // Determine jet shapes
00073       const JetShape& js = applyProjection<JetShape>(event, "JetShape");
00074    
00075       /// @todo Replace with foreach
00076       for (size_t jind = 0; jind < _jetaxes.size(); ++jind) {
00077         // Put jet in correct pT bin
00078         int jet_pt_bin = -1;
00079         for (size_t i = 0; i < 4; ++i) {
00080           if (inRange(_jetaxes[jind].pT(), _pTbins[i], _pTbins[i+1])) {
00081             jet_pt_bin = i;
00082             break;
00083           }
00084         }
00085         if (jet_pt_bin > -1) {
00086           // Fill each entry in profile
00087           for (size_t rbin = 0; rbin < js.numBins(); ++rbin) {
00088             const double rad_Psi = js.rMin() + (rbin+1.0)*js.interval();
00089             /// @todo Yuck... JetShape's interface sucks
00090             _h_Psi_pT[jet_pt_bin]->fill(rad_Psi/_Rjet, js.intJetShape(jind, rbin), event.weight() );
00091           }
00092         }
00093       }
00094    
00095     }
00096  
00097  
00098     /// Finalize
00099     void finalize() {
00100       vector<double> y, ey;
00101       for (size_t i = 0; i < _pTbins.size()-1; ++i) {
00102         // Get entry for rad_Psi = 0.2 bin
00103         AIDA::IProfile1D* ph_i = _h_Psi_pT[i];
00104         y.push_back(1.0 - ph_i->binHeight(1));
00105         ey.push_back(ph_i->binError(1));
00106       }
00107       _h_OneMinusPsi_vs_pT->setCoordinate(1, y, ey);
00108     }
00109  
00110     //@}
00111 
00112 
00113   private:
00114 
00115     /// @name Analysis data
00116     //@{
00117     vector<FourMomentum> _jetaxes;
00118     double _Rjet;
00119     vector<double> _pTbins;
00120     int _NpTbins;
00121     //@}
00122 
00123 
00124     /// @name Histograms
00125     //@{
00126     AIDA::IProfile1D* _h_Psi_pT[4];
00127     AIDA::IDataPointSet* _h_OneMinusPsi_vs_pT;
00128     //@}
00129 
00130   };
00131 
00132 
00133   // This global object acts as a hook for the plugin system
00134   AnalysisBuilder<CDF_2008_S7782535> plugin_CDF_2008_S7782535;
00135 
00136 }