CDF_1996_S3418421.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/Tools/BinnedHistogram.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief CDF dijet angular distributions
00013   class CDF_1996_S3418421 : public Analysis {
00014   public:
00015 
00016     /// @name Constructors etc.
00017     //@{
00018 
00019     /// Constructor
00020     CDF_1996_S3418421()
00021       : Analysis("CDF_1996_S3418421")
00022     {
00023       setBeams(PROTON, ANTIPROTON);
00024     }
00025 
00026     //@}
00027 
00028 
00029   public:
00030 
00031     /// @name Analysis methods
00032     //@{
00033 
00034     /// Book histograms and initialise projections before the run
00035     void init() {
00036       FinalState fs(-4.2, 4.2);
00037       addProjection(FastJets(fs, FastJets::CDFJETCLU, 0.7), "Jets");
00038 
00039       _h_chi.addHistogram(241.0, 300.0, bookHistogram1D(1, 1, 1));
00040       _h_chi.addHistogram(300.0, 400.0, bookHistogram1D(1, 1, 2));
00041       _h_chi.addHistogram(400.0, 517.0, bookHistogram1D(1, 1, 3));
00042       _h_chi.addHistogram(517.0, 625.0, bookHistogram1D(1, 1, 4));
00043       _h_chi.addHistogram(625.0, 1800.0, bookHistogram1D(1, 1, 5));
00044 
00045       _h_ratio = bookDataPointSet(2,1,1,"","","");
00046       _chi_above_25.resize(_h_ratio->size());
00047       _chi_below_25.resize(_h_ratio->size());
00048     }
00049 
00050 
00051     /// Perform the per-event analysis
00052     void analyze(const Event& event) {
00053       const double weight = event.weight();
00054 
00055       Jets jets = applyProjection<FastJets>(event, "Jets").jetsByPt(50.0*GeV);
00056       if (jets.size()<2) {
00057         vetoEvent;
00058       }
00059       FourMomentum jet1 = jets[0].momentum();
00060       FourMomentum jet2 = jets[1].momentum();
00061       double eta1 = jet1.eta();
00062       double eta2 = jet2.eta();
00063       double chi = exp(fabs(eta1-eta2));
00064       if (fabs(eta2)>2.0 || fabs(eta1)>2.0 || chi>5.0) {
00065         vetoEvent;
00066       }
00067 
00068       double m = FourMomentum(jet1+jet2).mass();
00069       _h_chi.fill(m, chi, weight);
00070 
00071       // fill ratio counter
00072       if (m > _h_ratio->lowerExtent(0) && m < _h_ratio->upperExtent(0)) {
00073         int bin=-1;
00074         for (int i=0; i<_h_ratio->size(); ++i) {
00075           AIDA::IMeasurement* x = _h_ratio->point(i)->coordinate(0);
00076           if (m > x->value()-x->errorMinus() && m < x->value()+x->errorPlus()) {
00077             bin=i;
00078             break;
00079           }
00080         }
00081         if (bin>-1) {
00082           if (chi>2.5) _chi_above_25[bin] += weight;
00083           else _chi_below_25[bin] += weight;
00084         }
00085       }
00086     }
00087 
00088 
00089     /// Normalise histograms etc., after the run
00090     void finalize() {
00091 
00092       foreach (AIDA::IHistogram1D* hist, _h_chi.getHistograms()) {
00093         normalize(hist);
00094       }
00095 
00096       for (int bin=0; bin<_h_ratio->size(); ++bin) {
00097         _h_ratio->point(bin)->coordinate(1)->setValue(_chi_below_25[bin]/_chi_above_25[bin]);
00098         /// @todo calculate errors while analysing and fill them here as well
00099       }
00100     }
00101 
00102     //@}
00103 
00104 
00105   private:
00106 
00107     // Data members like post-cuts event weight counters go here
00108     std::vector<double> _chi_above_25;
00109     std::vector<double> _chi_below_25;
00110 
00111   private:
00112 
00113     /// @name Histograms
00114     //@{
00115     BinnedHistogram<double> _h_chi;
00116     AIDA::IDataPointSet* _h_ratio;
00117     //@}
00118 
00119   };
00120 
00121 
00122 
00123   // This global object acts as a hook for the plugin system
00124   AnalysisBuilder<CDF_1996_S3418421> plugin_CDF_1996_S3418421;
00125 
00126 
00127 }