rivet is hosted by Hepforge, IPPP Durham
ATLAS_2011_S9128077.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetYODA.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 = bookHisto1D(1, 1, 1);
00044       _h_jet_multi_ratio = bookScatter2D(2, 1, 1);
00045       _h_jet_pT.resize(4);
00046       _h_jet_pT[0] = bookHisto1D(3, 1, 1);
00047       _h_jet_pT[1] = bookHisto1D(4, 1, 1);
00048       _h_jet_pT[2] = bookHisto1D(5, 1, 1);
00049       _h_jet_pT[3] = bookHisto1D(6, 1, 1);
00050       _h_HT_2 = bookHisto1D(7, 1, 1);
00051       _h_HT_3 = bookHisto1D(8, 1, 1);
00052       _h_HT_4 = bookHisto1D(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  = bookHisto1D(10, 1, 1, "tmp1");
00056       _h_tmp_pTlead_R06_80_2  = bookHisto1D(11, 1, 1, "tmp2");
00057       _h_tmp_pTlead_R06_110_2 = bookHisto1D(12, 1, 1, "tmp3");
00058       _h_tmp_pTlead_R06_60_3  = bookHisto1D(10, 1, 1, "tmp4");
00059       _h_tmp_pTlead_R06_80_3  = bookHisto1D(11, 1, 1, "tmp5");
00060       _h_tmp_pTlead_R06_110_3 = bookHisto1D(12, 1, 1, "tmp6");
00061 
00062       _h_tmp_pTlead_R04_60_2  = bookHisto1D(13, 1, 1, "tmp7");
00063       _h_tmp_pTlead_R04_80_2  = bookHisto1D(14, 1, 1, "tmp8");
00064       _h_tmp_pTlead_R04_110_2 = bookHisto1D(15, 1, 1, "tmp9");
00065       _h_tmp_pTlead_R04_60_3  = bookHisto1D(13, 1, 1, "tmp10");
00066       _h_tmp_pTlead_R04_80_3  = bookHisto1D(14, 1, 1, "tmp11");
00067       _h_tmp_pTlead_R04_110_3 = bookHisto1D(15, 1, 1, "tmp12");
00068 
00069       _h_tmp_HT2_R06_2 = bookHisto1D(16, 1, 1, "tmp13");
00070       _h_tmp_HT2_R06_3 = bookHisto1D(16, 1, 1, "tmp14");
00071       _h_tmp_HT2_R04_2 = bookHisto1D(17, 1, 1, "tmp15");
00072       _h_tmp_HT2_R04_3 = bookHisto1D(17, 1, 1, "tmp16");
00073 
00074       _h_pTlead_R06_60_ratio = bookScatter2D(10, 1, 1);      
00075       _h_pTlead_R06_80_ratio = bookScatter2D(11, 1, 1);
00076       _h_pTlead_R06_110_ratio = bookScatter2D(12, 1, 1);
00077       _h_pTlead_R04_60_ratio = bookScatter2D(13, 1, 1);
00078       _h_pTlead_R04_80_ratio = bookScatter2D(14, 1, 1);
00079       _h_pTlead_R04_110_ratio = bookScatter2D(15, 1, 1);
00080       _h_HT2_R06_ratio = bookScatter2D(16, 1, 1);
00081       _h_HT2_R04_ratio = bookScatter2D(17, 1, 1);
00082     }
00083 
00084 
00085     /// Perform the per-event analysis
00086     void analyze(const Event& event) {
00087       const double weight = event.weight();
00088 
00089       vector<FourMomentum> jets04;
00090       foreach (const Jet& jet, applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(60.0*GeV)) {
00091         if (fabs(jet.momentum().eta())<2.8) {
00092           jets04.push_back(jet.momentum());
00093         }
00094       }
00095 
00096       if (jets04.size()>1 && jets04[0].pT()>80.0*GeV) {
00097         for (size_t i=2; i<=jets04.size(); ++i) {
00098           _h_jet_multi_inclusive->fill(i, weight);
00099         }
00100 
00101         double HT=0.0;
00102         for (size_t i=0; i<jets04.size(); ++i) {
00103           if (i<_h_jet_pT.size()) _h_jet_pT[i]->fill(jets04[i].pT(), weight);
00104           HT += jets04[i].pT();
00105         }
00106 
00107         if (jets04.size()>=2) _h_HT_2->fill(HT, weight);
00108         if (jets04.size()>=3) _h_HT_3->fill(HT, weight);
00109         if (jets04.size()>=4) _h_HT_4->fill(HT, weight);
00110 
00111         double pT1(jets04[0].pT()), pT2(jets04[1].pT());
00112         double HT2=pT1+pT2;
00113         if (jets04.size()>=2) {
00114           _h_tmp_HT2_R04_2->fill(HT2, weight);
00115           _h_tmp_pTlead_R04_60_2->fill(pT1, weight);
00116           if (pT2>80.0*GeV) _h_tmp_pTlead_R04_80_2->fill(pT1, weight);
00117           if (pT2>110.0*GeV) _h_tmp_pTlead_R04_110_2->fill(pT1, weight);
00118         }
00119         if (jets04.size()>=3) {
00120           double pT3(jets04[2].pT());
00121           _h_tmp_HT2_R04_3->fill(HT2, weight);
00122           _h_tmp_pTlead_R04_60_3->fill(pT1, weight);
00123           if (pT3>80.0*GeV) _h_tmp_pTlead_R04_80_3->fill(pT1, weight);
00124           if (pT3>110.0*GeV) _h_tmp_pTlead_R04_110_3->fill(pT1, weight);
00125         }
00126       }
00127 
00128       vector<FourMomentum> jets06;
00129       foreach (const Jet& jet, applyProjection<FastJets>(event, "AntiKtJets06").jetsByPt(60.0*GeV)) {
00130         if (fabs(jet.momentum().eta())<2.8) {
00131           jets06.push_back(jet.momentum());
00132         }
00133       }
00134       if (jets06.size()>1 && jets06[0].pT()>80.0*GeV) {
00135         double pT1(jets06[0].pT()), pT2(jets06[1].pT());
00136         double HT2=pT1+pT2;
00137         if (jets06.size()>=2) {
00138           _h_tmp_HT2_R06_2->fill(HT2, weight);
00139           _h_tmp_pTlead_R06_60_2->fill(pT1, weight);
00140           if (pT2>80.0*GeV) _h_tmp_pTlead_R06_80_2->fill(pT1, weight);
00141           if (pT2>110.0*GeV) _h_tmp_pTlead_R06_110_2->fill(pT1, weight);
00142         }
00143         if (jets06.size()>=3) {
00144           double pT3(jets06[2].pT());
00145           _h_tmp_HT2_R06_3->fill(HT2, weight);
00146           _h_tmp_pTlead_R06_60_3->fill(pT1, weight);
00147           if (pT3>80.0*GeV) _h_tmp_pTlead_R06_80_3->fill(pT1, weight);
00148           if (pT3>110.0*GeV) _h_tmp_pTlead_R06_110_3->fill(pT1, weight);
00149         }
00150       }
00151 
00152     }
00153 
00154 
00155     /// Normalise histograms etc., after the run
00156     void finalize() {
00157 
00158       // Fill inclusive jet multi ratio
00159       int Nbins = _h_jet_multi_inclusive->numBins();
00160       std::vector<double> ratio(Nbins-1, 0.0);
00161       std::vector<double> err(Nbins-1, 0.0);
00162       for (int i = 0; i < Nbins-1; ++i) {
00163         if (_h_jet_multi_inclusive->bin(i).area() > 0.0 && _h_jet_multi_inclusive->bin(i+1).area() > 0.0) {
00164           ratio[i] = _h_jet_multi_inclusive->bin(i+1).area()/_h_jet_multi_inclusive->bin(i).area();
00165           double relerr_i = _h_jet_multi_inclusive->bin(i).areaErr()/_h_jet_multi_inclusive->bin(i).area();
00166           double relerr_j = _h_jet_multi_inclusive->bin(i+1).areaErr()/_h_jet_multi_inclusive->bin(i+1).area();
00167           err[i] = ratio[i] * (relerr_i + relerr_j);
00168         }
00169       }
00170       //\todo YODA
00171       //_h_jet_multi_ratio->setCoordinate(1, ratio, err);
00172 
00173       scale(_h_jet_multi_inclusive, crossSectionPerEvent());
00174       scale(_h_jet_pT[0], crossSectionPerEvent());
00175       scale(_h_jet_pT[1], crossSectionPerEvent());
00176       scale(_h_jet_pT[2], crossSectionPerEvent());
00177       scale(_h_jet_pT[3], crossSectionPerEvent());
00178       scale(_h_HT_2, crossSectionPerEvent());
00179       scale(_h_HT_3, crossSectionPerEvent());
00180       scale(_h_HT_4, crossSectionPerEvent());
00181 
00182       /// create ratio histograms
00183       divide(_h_tmp_pTlead_R06_60_3,_h_tmp_pTlead_R06_60_2,
00184          _h_pTlead_R06_60_ratio);
00185 
00186       divide(_h_tmp_pTlead_R06_80_3,_h_tmp_pTlead_R06_80_2,
00187          _h_pTlead_R06_80_ratio);
00188 
00189       divide(_h_tmp_pTlead_R06_110_3,_h_tmp_pTlead_R06_110_2,
00190          _h_pTlead_R06_110_ratio);
00191 
00192       divide(_h_tmp_pTlead_R04_60_3,_h_tmp_pTlead_R04_60_2,
00193          _h_pTlead_R04_60_ratio);
00194 
00195       divide(_h_tmp_pTlead_R04_80_3,_h_tmp_pTlead_R04_80_2,
00196          _h_pTlead_R04_80_ratio);
00197 
00198       divide(_h_tmp_pTlead_R04_110_3,_h_tmp_pTlead_R04_110_2,
00199          _h_pTlead_R04_110_ratio);
00200 
00201       divide(_h_tmp_HT2_R06_3,_h_tmp_HT2_R06_2,
00202          _h_HT2_R06_ratio);
00203 
00204       divide(_h_tmp_HT2_R04_3,_h_tmp_HT2_R04_2,
00205          _h_HT2_R04_ratio);
00206 
00207     }
00208 
00209     //@}
00210 
00211 
00212   private:
00213 
00214     // Data members like post-cuts event weight counters go here
00215 
00216 
00217   private:
00218 
00219     /// @name Histograms
00220     //@{
00221     Histo1DPtr _h_jet_multi_inclusive;
00222     Scatter2DPtr _h_jet_multi_ratio;
00223     vector<Histo1DPtr> _h_jet_pT;
00224     Histo1DPtr _h_HT_2;
00225     Histo1DPtr _h_HT_3;
00226     Histo1DPtr _h_HT_4;
00227 
00228     /// temporary histograms which will be divided in the end for the dsigma3/dsigma2 ratios
00229     Histo1DPtr _h_tmp_pTlead_R06_60_2;
00230     Histo1DPtr _h_tmp_pTlead_R06_80_2;
00231     Histo1DPtr _h_tmp_pTlead_R06_110_2;
00232     Histo1DPtr _h_tmp_pTlead_R06_60_3;
00233     Histo1DPtr _h_tmp_pTlead_R06_80_3;
00234     Histo1DPtr _h_tmp_pTlead_R06_110_3;
00235 
00236     Histo1DPtr _h_tmp_pTlead_R04_60_2;
00237     Histo1DPtr _h_tmp_pTlead_R04_80_2;
00238     Histo1DPtr _h_tmp_pTlead_R04_110_2;
00239     Histo1DPtr _h_tmp_pTlead_R04_60_3;
00240     Histo1DPtr _h_tmp_pTlead_R04_80_3;
00241     Histo1DPtr _h_tmp_pTlead_R04_110_3;
00242 
00243     Histo1DPtr _h_tmp_HT2_R06_2;
00244     Histo1DPtr _h_tmp_HT2_R06_3;
00245     Histo1DPtr _h_tmp_HT2_R04_2;
00246     Histo1DPtr _h_tmp_HT2_R04_3;
00247 
00248     Scatter2DPtr _h_pTlead_R06_60_ratio;
00249     Scatter2DPtr _h_pTlead_R06_80_ratio;
00250     Scatter2DPtr _h_pTlead_R06_110_ratio;
00251     Scatter2DPtr _h_pTlead_R04_60_ratio;
00252     Scatter2DPtr _h_pTlead_R04_80_ratio;
00253     Scatter2DPtr _h_pTlead_R04_110_ratio;
00254     Scatter2DPtr _h_HT2_R06_ratio;
00255     Scatter2DPtr _h_HT2_R04_ratio;
00256 
00257     //@}
00258 
00259   };
00260 
00261 
00262 
00263   // The hook for the plugin system
00264   DECLARE_RIVET_PLUGIN(ATLAS_2011_S9128077);
00265 
00266 
00267 }