ATLAS_2011_S9128077.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/FinalState.hh"
00006 #include "Rivet/Projections/FastJets.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   class ATLAS_2011_S9128077 : public Analysis {
00012   public:
00013 
00014     /// @name Constructors etc.
00015     //@{
00016 
00017     /// Constructor
00018     ATLAS_2011_S9128077()
00019       : Analysis("ATLAS_2011_S9128077")
00020     {    }
00021 
00022     //@}
00023 
00024 
00025   public:
00026 
00027     /// @name Analysis methods
00028     //@{
00029 
00030     /// Book histograms and initialise projections before the run
00031     void init() {
00032 
00033       const FinalState fs;
00034 
00035       FastJets j4(fs, FastJets::ANTIKT, 0.4);
00036       j4.useInvisibles();
00037       addProjection(j4, "AntiKtJets04");
00038 
00039       FastJets j6(fs, FastJets::ANTIKT, 0.6);
00040       j6.useInvisibles();
00041       addProjection(j6, "AntiKtJets06");
00042 
00043       _h_jet_multi_inclusive = bookHistogram1D(1, 1, 1);
00044       _h_jet_multi_ratio = bookDataPointSet(2, 1, 1);
00045       _h_jet_pT.resize(4);
00046       _h_jet_pT[0] = bookHistogram1D(3, 1, 1);
00047       _h_jet_pT[1] = bookHistogram1D(4, 1, 1);
00048       _h_jet_pT[2] = bookHistogram1D(5, 1, 1);
00049       _h_jet_pT[3] = bookHistogram1D(6, 1, 1);
00050       _h_HT_2 = bookHistogram1D(7, 1, 1);
00051       _h_HT_3 = bookHistogram1D(8, 1, 1);
00052       _h_HT_4 = bookHistogram1D(9, 1, 1);
00053 
00054       /// temporary histograms which will be divided in the end for the dsigma3/dsigma2 ratios
00055       _h_tmp_pTlead_R06_60_2 = bookHistogram1D("tmp1", binEdges(10, 1, 1));
00056       _h_tmp_pTlead_R06_80_2 = bookHistogram1D("tmp2", binEdges(11, 1, 1));
00057       _h_tmp_pTlead_R06_110_2 = bookHistogram1D("tmp3", binEdges(12, 1, 1));
00058       _h_tmp_pTlead_R06_60_3 = bookHistogram1D("tmp4", binEdges(10, 1, 1));
00059       _h_tmp_pTlead_R06_80_3 = bookHistogram1D("tmp5", binEdges(11, 1, 1));
00060       _h_tmp_pTlead_R06_110_3 = bookHistogram1D("tmp6", binEdges(12, 1, 1));
00061 
00062       _h_tmp_pTlead_R04_60_2 = bookHistogram1D("tmp7", binEdges(13, 1, 1));
00063       _h_tmp_pTlead_R04_80_2 = bookHistogram1D("tmp8", binEdges(14, 1, 1));
00064       _h_tmp_pTlead_R04_110_2 = bookHistogram1D("tmp9", binEdges(15, 1, 1));
00065       _h_tmp_pTlead_R04_60_3 = bookHistogram1D("tmp10", binEdges(13, 1, 1));
00066       _h_tmp_pTlead_R04_80_3 = bookHistogram1D("tmp11", binEdges(14, 1, 1));
00067       _h_tmp_pTlead_R04_110_3 = bookHistogram1D("tmp12", binEdges(15, 1, 1));
00068 
00069       _h_tmp_HT2_R06_2 = bookHistogram1D("tmp13", binEdges(16, 1, 1));
00070       _h_tmp_HT2_R06_3 = bookHistogram1D("tmp14", binEdges(16, 1, 1));
00071       _h_tmp_HT2_R04_2 = bookHistogram1D("tmp15", binEdges(17, 1, 1));
00072       _h_tmp_HT2_R04_3 = bookHistogram1D("tmp16", binEdges(17, 1, 1));
00073 
00074     }
00075 
00076 
00077     /// Perform the per-event analysis
00078     void analyze(const Event& event) {
00079       const double weight = event.weight();
00080 
00081       vector<FourMomentum> jets04;
00082       foreach (const Jet& jet, applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(60.0*GeV)) {
00083         if (fabs(jet.momentum().eta())<2.8) {
00084           jets04.push_back(jet.momentum());
00085         }
00086       }
00087 
00088       if (jets04.size()>1 && jets04[0].pT()>80.0*GeV) {
00089         for (size_t i=2; i<=jets04.size(); ++i) {
00090           _h_jet_multi_inclusive->fill(i, weight);
00091         }
00092 
00093         double HT=0.0;
00094         for (size_t i=0; i<jets04.size(); ++i) {
00095           if (i<_h_jet_pT.size()) _h_jet_pT[i]->fill(jets04[i].pT(), weight);
00096           HT += jets04[i].pT();
00097         }
00098 
00099         if (jets04.size()>=2) _h_HT_2->fill(HT, weight);
00100         if (jets04.size()>=3) _h_HT_3->fill(HT, weight);
00101         if (jets04.size()>=4) _h_HT_4->fill(HT, weight);
00102 
00103         double pT1(jets04[0].pT()), pT2(jets04[1].pT());
00104         double HT2=pT1+pT2;
00105         if (jets04.size()>=2) {
00106           _h_tmp_HT2_R04_2->fill(HT2, weight);
00107           _h_tmp_pTlead_R04_60_2->fill(pT1, weight);
00108           if (pT2>80.0*GeV) _h_tmp_pTlead_R04_80_2->fill(pT1, weight);
00109           if (pT2>110.0*GeV) _h_tmp_pTlead_R04_110_2->fill(pT1, weight);
00110         }
00111         if (jets04.size()>=3) {
00112           double pT3(jets04[2].pT());
00113           _h_tmp_HT2_R04_3->fill(HT2, weight);
00114           _h_tmp_pTlead_R04_60_3->fill(pT1, weight);
00115           if (pT3>80.0*GeV) _h_tmp_pTlead_R04_80_3->fill(pT1, weight);
00116           if (pT3>110.0*GeV) _h_tmp_pTlead_R04_110_3->fill(pT1, weight);
00117         }
00118       }
00119 
00120       vector<FourMomentum> jets06;
00121       foreach (const Jet& jet, applyProjection<FastJets>(event, "AntiKtJets06").jetsByPt(60.0*GeV)) {
00122         if (fabs(jet.momentum().eta())<2.8) {
00123           jets06.push_back(jet.momentum());
00124         }
00125       }
00126       if (jets06.size()>1 && jets06[0].pT()>80.0*GeV) {
00127         double pT1(jets06[0].pT()), pT2(jets06[1].pT());
00128         double HT2=pT1+pT2;
00129         if (jets06.size()>=2) {
00130           _h_tmp_HT2_R06_2->fill(HT2, weight);
00131           _h_tmp_pTlead_R06_60_2->fill(pT1, weight);
00132           if (pT2>80.0*GeV) _h_tmp_pTlead_R06_80_2->fill(pT1, weight);
00133           if (pT2>110.0*GeV) _h_tmp_pTlead_R06_110_2->fill(pT1, weight);
00134         }
00135         if (jets06.size()>=3) {
00136           double pT3(jets06[2].pT());
00137           _h_tmp_HT2_R06_3->fill(HT2, weight);
00138           _h_tmp_pTlead_R06_60_3->fill(pT1, weight);
00139           if (pT3>80.0*GeV) _h_tmp_pTlead_R06_80_3->fill(pT1, weight);
00140           if (pT3>110.0*GeV) _h_tmp_pTlead_R06_110_3->fill(pT1, weight);
00141         }
00142       }
00143 
00144     }
00145 
00146 
00147     /// Normalise histograms etc., after the run
00148     void finalize() {
00149 
00150       // Fill inclusive jet multi ratio
00151       int Nbins = _h_jet_multi_inclusive->axis().bins();
00152       std::vector<double> ratio(Nbins-1, 0.0);
00153       std::vector<double> err(Nbins-1, 0.0);
00154       for (int i = 0; i < Nbins-1; ++i) {
00155         if (_h_jet_multi_inclusive->binHeight(i) > 0.0 && _h_jet_multi_inclusive->binHeight(i+1) > 0.0) {
00156           ratio[i] = _h_jet_multi_inclusive->binHeight(i+1)/_h_jet_multi_inclusive->binHeight(i);
00157           double relerr_i = _h_jet_multi_inclusive->binError(i)/_h_jet_multi_inclusive->binHeight(i);
00158           double relerr_j = _h_jet_multi_inclusive->binError(i+1)/_h_jet_multi_inclusive->binHeight(i+1);
00159           err[i] = ratio[i] * (relerr_i + relerr_j);
00160         }
00161       }
00162       _h_jet_multi_ratio->setCoordinate(1, ratio, err);
00163 
00164       scale(_h_jet_multi_inclusive, crossSectionPerEvent());
00165       scale(_h_jet_pT[0], crossSectionPerEvent());
00166       scale(_h_jet_pT[1], crossSectionPerEvent());
00167       scale(_h_jet_pT[2], crossSectionPerEvent());
00168       scale(_h_jet_pT[3], crossSectionPerEvent());
00169       scale(_h_HT_2, crossSectionPerEvent());
00170       scale(_h_HT_3, crossSectionPerEvent());
00171       scale(_h_HT_4, crossSectionPerEvent());
00172 
00173       /// create ratio histograms
00174       histogramFactory().divide(histoDir() + "/d10-x01-y01", *_h_tmp_pTlead_R06_60_3, *_h_tmp_pTlead_R06_60_2);
00175       histogramFactory().divide(histoDir() + "/d11-x01-y01", *_h_tmp_pTlead_R06_80_3, *_h_tmp_pTlead_R06_80_2);
00176       histogramFactory().divide(histoDir() + "/d12-x01-y01", *_h_tmp_pTlead_R06_110_3, *_h_tmp_pTlead_R06_110_2);
00177       histogramFactory().divide(histoDir() + "/d13-x01-y01", *_h_tmp_pTlead_R04_60_3, *_h_tmp_pTlead_R04_60_2);
00178       histogramFactory().divide(histoDir() + "/d14-x01-y01", *_h_tmp_pTlead_R04_80_3, *_h_tmp_pTlead_R04_80_2);
00179       histogramFactory().divide(histoDir() + "/d15-x01-y01", *_h_tmp_pTlead_R04_110_3, *_h_tmp_pTlead_R04_110_2);
00180       histogramFactory().divide(histoDir() + "/d16-x01-y01", *_h_tmp_HT2_R06_3, *_h_tmp_HT2_R06_2);
00181       histogramFactory().divide(histoDir() + "/d17-x01-y01", *_h_tmp_HT2_R04_3, *_h_tmp_HT2_R04_2);
00182       histogramFactory().destroy(_h_tmp_pTlead_R06_60_2);
00183       histogramFactory().destroy(_h_tmp_pTlead_R06_80_2);
00184       histogramFactory().destroy(_h_tmp_pTlead_R06_110_2);
00185       histogramFactory().destroy(_h_tmp_pTlead_R06_60_3);
00186       histogramFactory().destroy(_h_tmp_pTlead_R06_80_3);
00187       histogramFactory().destroy(_h_tmp_pTlead_R06_110_3);
00188       histogramFactory().destroy(_h_tmp_pTlead_R04_60_2);
00189       histogramFactory().destroy(_h_tmp_pTlead_R04_80_2);
00190       histogramFactory().destroy(_h_tmp_pTlead_R04_110_2);
00191       histogramFactory().destroy(_h_tmp_pTlead_R04_60_3);
00192       histogramFactory().destroy(_h_tmp_pTlead_R04_80_3);
00193       histogramFactory().destroy(_h_tmp_pTlead_R04_110_3);
00194       histogramFactory().destroy(_h_tmp_HT2_R06_2);
00195       histogramFactory().destroy(_h_tmp_HT2_R06_3);
00196       histogramFactory().destroy(_h_tmp_HT2_R04_2);
00197       histogramFactory().destroy(_h_tmp_HT2_R04_3);
00198 
00199     }
00200 
00201     //@}
00202 
00203 
00204   private:
00205 
00206     // Data members like post-cuts event weight counters go here
00207 
00208 
00209   private:
00210 
00211     /// @name Histograms
00212     //@{
00213     AIDA::IHistogram1D * _h_jet_multi_inclusive;
00214     AIDA::IDataPointSet * _h_jet_multi_ratio;
00215     vector<AIDA::IHistogram1D *> _h_jet_pT;
00216     AIDA::IHistogram1D * _h_HT_2;
00217     AIDA::IHistogram1D * _h_HT_3;
00218     AIDA::IHistogram1D * _h_HT_4;
00219 
00220     /// temporary histograms which will be divided in the end for the dsigma3/dsigma2 ratios
00221     AIDA::IHistogram1D * _h_tmp_pTlead_R06_60_2;
00222     AIDA::IHistogram1D * _h_tmp_pTlead_R06_80_2;
00223     AIDA::IHistogram1D * _h_tmp_pTlead_R06_110_2;
00224     AIDA::IHistogram1D * _h_tmp_pTlead_R06_60_3;
00225     AIDA::IHistogram1D * _h_tmp_pTlead_R06_80_3;
00226     AIDA::IHistogram1D * _h_tmp_pTlead_R06_110_3;
00227 
00228     AIDA::IHistogram1D * _h_tmp_pTlead_R04_60_2;
00229     AIDA::IHistogram1D * _h_tmp_pTlead_R04_80_2;
00230     AIDA::IHistogram1D * _h_tmp_pTlead_R04_110_2;
00231     AIDA::IHistogram1D * _h_tmp_pTlead_R04_60_3;
00232     AIDA::IHistogram1D * _h_tmp_pTlead_R04_80_3;
00233     AIDA::IHistogram1D * _h_tmp_pTlead_R04_110_3;
00234 
00235     AIDA::IHistogram1D * _h_tmp_HT2_R06_2;
00236     AIDA::IHistogram1D * _h_tmp_HT2_R06_3;
00237     AIDA::IHistogram1D * _h_tmp_HT2_R04_2;
00238     AIDA::IHistogram1D * _h_tmp_HT2_R04_3;
00239     //@}
00240 
00241   };
00242 
00243 
00244 
00245   // The hook for the plugin system
00246   DECLARE_RIVET_PLUGIN(ATLAS_2011_S9128077);
00247 
00248 
00249 }