PRD65092002.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_PRD65092002_HH
00003 #define RIVET_PRD65092002_HH
00004 
00005 #include "Rivet/Analysis.hh"
00006 #include "Rivet/Projections/TrackJet.hh"
00007 #include "Rivet/Projections/FinalState.hh"
00008 #include "Rivet/RivetAIDA.fhh"
00009 
00010 namespace Rivet {
00011 
00012   class PRD65092002 : public Analysis {
00013 
00014   public:
00015 
00016     /// Default constructor: cuts on final state are \f$ -1 < \eta < 1 \f$ and
00017     /// \f$ p_T > 0.5 \f$ GeV.
00018     inline PRD65092002()
00019       : _fsproj(-1.0, 1.0, 0.5), _trackjetproj(_fsproj), 
00020         _dpsToward(0), _dpsAway(0), _dpsTrans(0), _numBins(50)
00021     { 
00022       setBeams(PROTON, ANTIPROTON);
00023       addProjection(_fsproj);
00024       addProjection(_trackjetproj);
00025     }
00026 
00027 
00028   public:
00029 
00030     /// Factory method
00031     static Analysis* create() { return new PRD65092002(); }
00032 
00033     /// Return the name of the analysis.
00034     inline string getName() const {
00035       return "PRD65092002";
00036     }
00037 
00038   public:
00039 
00040     void init();
00041     
00042     void analyze(const Event & event);
00043     
00044     void finalize();
00045 
00046 
00047   private:
00048 
00049     /// The FinalState projection used.
00050     FinalState _fsproj;
00051 
00052     /// The TrackJet projection used by this analysis.
00053     TrackJet _trackjetproj;
00054 
00055   private:
00056 
00057     /// @name Histograms and data point sets
00058     //@{
00059     AIDA::IDataPointSet* _dpsToward;
00060     AIDA::IDataPointSet* _dpsAway;
00061     AIDA::IDataPointSet* _dpsTrans;
00062     //@}
00063 
00064     // Number of bins in the histograms
00065     const size_t _numBins;
00066 
00067     /// Internal storage of \f$ p_T \f$ flow data.
00068     class MiniHisto {
00069     public:
00070       /// Constructor
00071       inline MiniHisto() : numEntries(0), sumPt(0.0), sumPtSq(0.0) { }
00072 
00073       /// Appending operator
00074       inline void operator+=(const double evtPtSum) { 
00075         numEntries += 1;
00076         sumPt += evtPtSum;
00077         sumPtSq += evtPtSum*evtPtSum;
00078       }
00079 
00080       double numEntries;
00081       double sumPt;
00082       double sumPtSq;
00083     };
00084 
00085     /// @name Histogram collections
00086     //@{
00087     /// These arrays of minimal histogram data, binned in the \f$ p_T \f$ of the
00088     /// leading jet, will be used to calculate the output profile histograms.
00089     vector<MiniHisto> _dataToward;
00090     vector<MiniHisto> _dataAway;
00091     vector<MiniHisto> _dataTrans;
00092     //@}
00093 
00094   private:
00095 
00096     /// Hide the assignment operator
00097     PRD65092002& operator=(const PRD65092002&);
00098 
00099   };
00100 
00101 }
00102 
00103 #endif