ATLAS_2010_CONF_2010_049.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 #include "Rivet/Tools/Logging.hh"
00007 #include "LWH/Histogram1D.h"
00008 
00009 namespace Rivet {
00010 
00011 
00012   class ATLAS_2010_CONF_2010_049 : public Analysis {
00013   public:
00014 
00015     ATLAS_2010_CONF_2010_049()
00016       : Analysis("ATLAS_2010_CONF_2010_049")
00017     {    }
00018 
00019 
00020     void init() {
00021       ChargedFinalState cfs(-1.5, 1.5, 0.5*GeV);
00022       addProjection(cfs, "CFS");
00023 
00024       FastJets jetsproj6(cfs, FastJets::ANTIKT, 0.6);
00025       addProjection(jetsproj6, "Jets6");
00026 
00027       FastJets jetsproj4(cfs, FastJets::ANTIKT, 0.4);
00028       addProjection(jetsproj4, "Jets4");
00029 
00030       for (size_t i=0 ; i<2 ; i++) {
00031         _h_xsec[i]       = bookHistogram1D(1+i, 1, 1);
00032         _h_frag_04_06[i] = bookHistogram1D(3+i, 1, 1);
00033         _h_frag_06_10[i] = bookHistogram1D(3+i, 2, 1);
00034         _h_frag_10_15[i] = bookHistogram1D(3+i, 3, 1);
00035         _h_frag_15_24[i] = bookHistogram1D(3+i, 4, 1);
00036         _njets_04_06[i] = 0.0;
00037         _njets_06_10[i] = 0.0;
00038         _njets_10_15[i] = 0.0;
00039         _njets_15_24[i] = 0.0;
00040       }
00041     }
00042 
00043 
00044     void analyze(const Event& event) {
00045       const double weight = event.weight();
00046 
00047       const FastJets & jetsproj6 = applyProjection<FastJets>(event, "Jets6");
00048       const FastJets & jetsproj4 = applyProjection<FastJets>(event, "Jets4");
00049       Jets alljets[2];
00050       alljets[0] = jetsproj6.jetsByPt(4.0*GeV);
00051       alljets[1] = jetsproj4.jetsByPt(4.0*GeV);
00052 
00053       for (size_t i=0 ; i<2 ; i++) {
00054         Jets jets;
00055 
00056         // First we want to make sure that we only use jets within |eta|<0.57
00057         foreach (const Jet& jet, alljets[i]) {
00058           if (fabs(jet.momentum().eta())<0.57) {
00059             jets.push_back(jet);
00060           }
00061         }
00062         foreach (const Jet& jet, jets) {
00063           const double pTjet = jet.momentum().pT();
00064           const double pjet = jet.momentum().p().mod();
00065           _h_xsec[i]->fill(pTjet, weight);
00066           if (pTjet > 24*GeV) continue;
00067           foreach (const Particle& p, jet.particles()) {
00068             const double z=p.momentum().p().mod()/pjet;
00069             if (pTjet > 15*GeV) {
00070               _h_frag_15_24[i]->fill(z, weight);
00071             }
00072             else if (pTjet > 10*GeV) {
00073               _h_frag_10_15[i]->fill(z, weight);
00074             }
00075             else if (pTjet > 6*GeV) {
00076               _h_frag_06_10[i]->fill(z, weight);
00077             }
00078             else {
00079               _h_frag_04_06[i]->fill(z, weight);
00080             }
00081           }
00082           if (pTjet > 15*GeV) {
00083             _njets_15_24[i] += weight;
00084           }
00085           else if (pTjet > 10*GeV) {
00086             _njets_10_15[i] += weight;
00087           }
00088           else if (pTjet > 6*GeV) {
00089             _njets_06_10[i] += weight;
00090           }
00091           else {
00092             _njets_04_06[i] += weight;
00093           }
00094         }
00095       }
00096     }
00097 
00098     void finalize() {
00099       for (size_t i=0 ; i<2 ; i++) {
00100         // deta = 2*0.57
00101         scale(_h_xsec[i], crossSection()/microbarn/sumOfWeights()/(2*0.57));
00102         scale(_h_frag_04_06[i], 1./_njets_04_06[i]);
00103         scale(_h_frag_06_10[i], 1./_njets_06_10[i]);
00104         scale(_h_frag_10_15[i], 1./_njets_10_15[i]);
00105         scale(_h_frag_15_24[i], 1./_njets_15_24[i]);
00106       }
00107     }
00108 
00109 
00110   private:
00111 
00112     AIDA::IHistogram1D* _h_xsec[2];
00113     AIDA::IHistogram1D* _h_frag_04_06[2];
00114     AIDA::IHistogram1D* _h_frag_06_10[2];
00115     AIDA::IHistogram1D* _h_frag_10_15[2];
00116     AIDA::IHistogram1D* _h_frag_15_24[2];
00117     double _njets_04_06[2];
00118     double _njets_06_10[2];
00119     double _njets_10_15[2];
00120     double _njets_15_24[2];
00121   };
00122 
00123 
00124 
00125   // The hook for the plugin system
00126   DECLARE_RIVET_PLUGIN(ATLAS_2010_CONF_2010_049);
00127 
00128 }