ATLAS_2011_I928289_Z.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/FinalState.hh" 00004 #include "Rivet/Projections/ZFinder.hh" 00005 00006 namespace Rivet { 00007 00008 00009 class ATLAS_2011_I928289_Z : public Analysis { 00010 public: 00011 00012 /// Constructor 00013 ATLAS_2011_I928289_Z() 00014 : Analysis("ATLAS_2011_I928289_Z") 00015 { 00016 setNeedsCrossSection(true); 00017 } 00018 00019 00020 /// @name Analysis methods 00021 //@{ 00022 00023 /// Book histograms and initialise projections before the run 00024 void init() { 00025 00026 FinalState fs; 00027 00028 Cut cut = (Cuts::pT >= 20.0*GeV); 00029 00030 ZFinder zfinder_ee_bare( fs, cut, PID::ELECTRON, 66.0*GeV, 116.0*GeV, 0.0, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK); 00031 ZFinder zfinder_ee_dressed(fs, cut, PID::ELECTRON, 66.0*GeV, 116.0*GeV, 0.1, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK); 00032 ZFinder zfinder_mm_bare( fs, cut, PID::MUON , 66.0*GeV, 116.0*GeV, 0.0, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK); 00033 ZFinder zfinder_mm_dressed(fs, cut, PID::MUON , 66.0*GeV, 116.0*GeV, 0.1, ZFinder::CLUSTERNODECAY, ZFinder::NOTRACK); 00034 00035 declare(zfinder_ee_bare , "ZFinder_ee_bare" ); 00036 declare(zfinder_ee_dressed, "ZFinder_ee_dressed"); 00037 declare(zfinder_mm_bare , "ZFinder_mm_bare" ); 00038 declare(zfinder_mm_dressed, "ZFinder_mm_dressed"); 00039 00040 // y(Z) cross-section dependence 00041 _h_Z_y_ee_bare = bookHisto1D(1, 1, 1); 00042 _h_Z_y_ee_dressed = bookHisto1D(1, 1, 2); 00043 _h_Z_y_mm_bare = bookHisto1D(1, 1, 3); 00044 _h_Z_y_mm_dressed = bookHisto1D(1, 1, 4); 00045 00046 } 00047 00048 00049 /// Perform the per-event analysis 00050 void analyze(const Event& event) { 00051 00052 const ZFinder& zfinder_ee_bare = apply<ZFinder>(event, "ZFinder_ee_bare" ); 00053 const ZFinder& zfinder_ee_dressed = apply<ZFinder>(event, "ZFinder_ee_dressed"); 00054 const ZFinder& zfinder_mm_bare = apply<ZFinder>(event, "ZFinder_mm_bare" ); 00055 const ZFinder& zfinder_mm_dressed = apply<ZFinder>(event, "ZFinder_mm_dressed"); 00056 00057 const double weight = event.weight(); 00058 fillPlots1D(zfinder_ee_bare , _h_Z_y_ee_bare , weight); 00059 fillPlots1D(zfinder_ee_dressed, _h_Z_y_ee_dressed, weight); 00060 fillPlots1D(zfinder_mm_bare , _h_Z_y_mm_bare , weight); 00061 fillPlots1D(zfinder_mm_dressed, _h_Z_y_mm_dressed, weight); 00062 00063 } 00064 00065 00066 void fillPlots1D(const ZFinder& zfinder, Histo1DPtr hist, double weight) { 00067 if (zfinder.bosons().size() != 1) return; 00068 const FourMomentum zmom = zfinder.bosons()[0].momentum(); 00069 hist->fill(zmom.absrap(), weight); 00070 } 00071 00072 00073 /// Normalise histograms etc., after the run 00074 void finalize() { 00075 00076 // Print summary info 00077 const double xs_pb(crossSection() / picobarn); 00078 const double sumw(sumOfWeights()); 00079 MSG_DEBUG("Cross-Section/pb: " << xs_pb ); 00080 MSG_DEBUG("Sum of weights : " << sumw ); 00081 MSG_DEBUG("nEvents : " << numEvents()); 00082 00083 // Normalise, scale and otherwise manipulate histograms here 00084 const double sf(0.5 * xs_pb / sumw); // 0.5 accounts for rapidity bin width 00085 scale(_h_Z_y_ee_bare , sf); 00086 scale(_h_Z_y_ee_dressed, sf); 00087 scale(_h_Z_y_mm_bare , sf); 00088 scale(_h_Z_y_mm_dressed, sf); 00089 00090 } 00091 00092 //@} 00093 00094 00095 private: 00096 00097 /// @name Histograms 00098 //@{ 00099 Histo1DPtr _h_Z_y_ee_bare; 00100 Histo1DPtr _h_Z_y_ee_dressed; 00101 Histo1DPtr _h_Z_y_mm_bare; 00102 Histo1DPtr _h_Z_y_mm_dressed; 00103 //@} 00104 00105 }; 00106 00107 00108 // The hook for the plugin system 00109 DECLARE_RIVET_PLUGIN(ATLAS_2011_I928289_Z); 00110 00111 } Generated on Tue Dec 13 2016 16:32:34 for The Rivet MC analysis system by ![]() |