CDF_2005_S6217184.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/FastJets.hh"
00006 #include "Rivet/Projections/TotalVisibleMomentum.hh"
00007 #include "Rivet/Projections/JetShape.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /* CDF Run II jet shape analysis
00013    * @author Lars Sonnenschein
00014    * @author Andy Buckley
00015    */   
00016   class CDF_2005_S6217184 : public Analysis {
00017   public:
00018  
00019     /// Constructor
00020     CDF_2005_S6217184()
00021       : Analysis("CDF_2005_S6217184")
00022     {
00023       setBeams(PROTON, ANTIPROTON);
00024     }
00025      
00026     /// @name Analysis methods
00027     //@{
00028  
00029     void init() {
00030       // Set up projections
00031       const FinalState fs(-2.0, 2.0);
00032       addProjection(fs, "FS");
00033       addProjection(FastJets(fs, FastJets::CDFMIDPOINT, 0.7), "Jets");
00034       addProjection(TotalVisibleMomentum(fs), "CalMET");
00035    
00036       // Veto (anti)neutrinos, and muons with pT above 1.0 GeV
00037       VetoedFinalState vfs(fs);
00038       vfs.vetoNeutrinos();
00039       vfs.addVetoPairDetail(MUON, 1.0*GeV, MAXDOUBLE);
00040       addProjection(vfs, "VFS");
00041       addProjection(JetShape(vfs, _jetaxes, 0.0, 0.7, 0.1, 0.3), "JetShape");
00042    
00043       // Specify pT bins
00044       _pTbins += 37.0, 45.0, 55.0, 63.0, 73.0, 84.0, 97.0, 112.0, 128.0,
00045         148.0, 166.0, 186.0, 208.0, 229.0, 250.0, 277.0, 304.0, 340.0, 380.0;
00046 
00047       /// Book histograms
00048       // 18 = 6x3 pT bins, one histogram each
00049       for (size_t i = 0; i < 6; ++i) {
00050         for (size_t j = 0; j < 3; ++j) {
00051           size_t k = i*3 + j;
00052           _profhistRho_pT[k] = bookProfile1D(i+1, 1, j+1);
00053           _profhistPsi_pT[k] = bookProfile1D(6+i+1, 1, j+1);
00054         }
00055       }
00056    
00057       _profhistPsi = bookProfile1D(13, 1, 1);
00058     }
00059  
00060  
00061  
00062     /// Do the analysis
00063     void analyze(const Event& event) {
00064    
00065       // Get jets and require at least one to pass pT and y cuts
00066       const Jets jets = applyProjection<FastJets>(event, "Jets").jetsByPt();
00067       getLog() << Log::DEBUG << "Jet multiplicity before cuts = " << jets.size() << endl;
00068    
00069       // Determine the central jet axes
00070       _jetaxes.clear();
00071       foreach (const Jet& jt, jets) {
00072         const FourMomentum pj = jt.momentum();
00073         if (inRange(pj.pT()/GeV, 37.0, 380.0) && inRange(fabs(pj.rapidity()), 0.1, 0.7)) {
00074           _jetaxes.push_back(jt.momentum());
00075         }
00076       }
00077       if (_jetaxes.empty()) vetoEvent;
00078    
00079       // Calculate and histogram jet shapes
00080       const double weight = event.weight();
00081       const JetShape& js = applyProjection<JetShape>(event, "JetShape");
00082    
00083       /// @todo Use BinnedHistogram, for collections of histos each for a range of values of an extra variable
00084       for (size_t jind = 0; jind < _jetaxes.size(); ++jind) {
00085         for (size_t ipT = 0; ipT < 18; ++ipT) {
00086           if (_jetaxes[jind].pT() > _pTbins[ipT] && _jetaxes[jind].pT() <= _pTbins[ipT+1]) {
00087             for (size_t rbin = 0; rbin < js.numBins(); ++rbin) {
00088               const double rad_Rho = js.rMin() + (rbin+0.5)*js.interval();
00089               _profhistRho_pT[ipT]->fill(rad_Rho/0.7, (0.7/1.0)*js.diffJetShape(jind, rbin), weight);
00090               /// @todo Calc int histos from diff histos
00091               const double rad_Psi = js.rMin() +(rbin+1.0)*js.interval();
00092               _profhistPsi_pT[ipT]->fill(rad_Psi/0.7, js.intJetShape(jind, rbin), weight);
00093             }
00094             /// @todo Calc int histos from diff histos
00095             _profhistPsi->fill((_pTbins[ipT] + _pTbins[ipT+1])/2.0, js.psi(jind), weight);
00096           }
00097         }
00098       }
00099    
00100     }
00101  
00102  
00103     // Finalize
00104     void finalize() {
00105       //
00106     }
00107  
00108     //@}
00109 
00110 
00111   private:
00112 
00113     /// @name Analysis data
00114     //@{
00115 
00116     /// Vector of jet axes
00117     vector<FourMomentum> _jetaxes;
00118 
00119     /// \f$p_\perp\f$ bins to be distinguished during analysis
00120     vector<double> _pTbins;
00121     //@}
00122 
00123 
00124     /// @name Histograms
00125     //@{
00126     AIDA::IProfile1D* _profhistRho_pT[18];
00127     AIDA::IProfile1D* _profhistPsi_pT[18];
00128     AIDA::IProfile1D* _profhistPsi;
00129     //@}
00130 
00131   };
00132  
00133 
00134   // This global object acts as a hook for the plugin system
00135   AnalysisBuilder<CDF_2005_S6217184> plugin_CDF_2005_S6217184;
00136 
00137 }