ATLAS_2011_S8924791.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/VetoedFinalState.hh"
00007 #include "Rivet/Projections/VisibleFinalState.hh"
00008 #include "Rivet/Projections/JetShape.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// @brief ATLAS jet shape analysis
00014   /// @author Andy Buckley, Judith Katzy, Francesc Vives
00015   class ATLAS_2011_S8924791 : public Analysis {
00016   public:
00017 
00018     /// Constructor
00019     ATLAS_2011_S8924791()
00020       : Analysis("ATLAS_2011_S8924791")
00021     {
00022       setBeams(PROTON, PROTON);
00023     }
00024 
00025 
00026     /// @name Analysis methods
00027     //@{
00028 
00029     void init() {
00030       // Set up projections
00031       const FinalState fs(-5.0, 5.0);
00032       addProjection(fs, "FS");
00033       FastJets fj(fs, FastJets::ANTIKT, 0.6);
00034       fj.useInvisibles();
00035       addProjection(fj, "Jets");
00036 
00037       // Specify pT bins
00038       _ptedges += 30.0, 40.0, 60.0, 80.0, 110.0, 160.0, 210.0, 260.0, 310.0, 400.0, 500.0, 600.0;
00039       _yedges  += 0.0, 0.3, 0.8, 1.2, 2.1, 2.8;
00040 
00041 
00042       // Register a jet shape projection and histogram for each pT bin
00043       for (size_t i = 0; i < 11; ++i) {
00044         for (size_t j = 0; j < 6; ++j) {
00045           if (i==8 && j==4) continue;
00046           if (i==9 && j==4) continue;
00047           if (i==10 && j!=5) continue;
00048           stringstream ss; ss << "JetShape" << i << j;
00049           const string pname = ss.str();
00050           _jsnames_pT[i][j] = pname;
00051 
00052           if (j < 5) {
00053             const JetShape jsp(fj, 0.0, 0.7, 7, _ptedges[i], _ptedges[i+1], _yedges[j], _yedges[j+1], RAPIDITY);
00054             addProjection(jsp, pname);
00055           } else {
00056             const JetShape jsp(fj, 0.0, 0.7, 7, _ptedges[i], _ptedges[i+1], _yedges.front(), _yedges.back(), RAPIDITY);
00057             addProjection(jsp, pname);
00058           }
00059           _profhistRho_pT[i][j] = bookProfile1D(i+1, j+1, 1);
00060           _profhistPsi_pT[i][j] = bookProfile1D(i+1, j+1, 2);
00061         }
00062       }
00063     }
00064 
00065 
00066 
00067     /// Do the analysis
00068     void analyze(const Event& evt) {
00069 
00070       // Get jets and require at least one to pass pT and y cuts
00071       const Jets jets = applyProjection<FastJets>(evt, "Jets").jetsByPt(_ptedges.front()*GeV, _ptedges.back()*GeV,
00072                                                                         -2.8, 2.8, RAPIDITY);
00073       MSG_DEBUG("Jet multiplicity before cuts = " << jets.size());
00074       if (jets.size() == 0) {
00075         MSG_DEBUG("No jets found in required pT & rapidity range");
00076         vetoEvent;
00077       }
00078       // Calculate and histogram jet shapes
00079       const double weight = evt.weight();
00080 
00081       for (size_t ipt = 0; ipt < 11; ++ipt) {
00082         for (size_t jy = 0; jy < 6; ++jy) {
00083           if (ipt==8 && jy==4) continue;
00084           if (ipt==9 && jy==4) continue;
00085           if (ipt==10 && jy!=5) continue;
00086           const JetShape& jsipt = applyProjection<JetShape>(evt, _jsnames_pT[ipt][jy]);
00087           for (size_t ijet = 0; ijet < jsipt.numJets(); ++ijet) {
00088             for (size_t rbin = 0; rbin < jsipt.numBins(); ++rbin) {
00089               const double r_rho = jsipt.rBinMid(rbin);
00090               _profhistRho_pT[ipt][jy]->fill(r_rho, (1./0.1)*jsipt.diffJetShape(ijet, rbin), weight);
00091               const double r_Psi = jsipt.rBinMid(rbin);
00092               _profhistPsi_pT[ipt][jy]->fill(r_Psi, jsipt.intJetShape(ijet, rbin), weight);
00093             }
00094           }
00095         }
00096       }
00097     }
00098 
00099 
00100     // Finalize
00101     void finalize() {
00102     }
00103 
00104     //@}
00105 
00106 
00107   private:
00108 
00109     /// @name Analysis data
00110     //@{
00111 
00112     /// Jet \f$ p_\perp\f$ bins.
00113     vector<double> _ptedges; // This can't be a raw array if we want to initialise it non-painfully
00114     vector<double> _yedges;
00115 
00116     /// JetShape projection name for each \f$p_\perp\f$ bin.
00117     string _jsnames_pT[11][6];
00118 
00119     //@}
00120 
00121     /// @name Histograms
00122     //@{
00123     AIDA::IProfile1D* _profhistRho_pT[11][6];
00124     AIDA::IProfile1D* _profhistPsi_pT[11][6];
00125     //@}
00126 
00127   };
00128 
00129 
00130   // This global object acts as a hook for the plugin system
00131   AnalysisBuilder<ATLAS_2011_S8924791> plugin_ATLAS_2011_S8924791;
00132 
00133 }