UA5_1989_S1926373.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/ChargedFinalState.hh"
00006 #include "Rivet/Projections/TriggerUA5.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief UA5 min bias charged multiplicities in central \f$ \eta \f$ ranges
00012   class UA5_1989_S1926373 : public Analysis {
00013   public:
00014 
00015     /// Constructor
00016     UA5_1989_S1926373() : Analysis("UA5_1989_S1926373") {
00017       setBeams(PROTON, ANTIPROTON);
00018       _sumWPassed = 0;
00019     }
00020 
00021 
00022     /// @name Analysis methods
00023     //@{
00024 
00025     /// Book histograms and projections
00026     void init() {
00027       addProjection(TriggerUA5(), "Trigger");
00028       addProjection(ChargedFinalState(-0.5, 0.5), "CFS05");
00029       addProjection(ChargedFinalState(-1.5, 1.5), "CFS15");
00030       addProjection(ChargedFinalState(-3.0, 3.0), "CFS30");
00031       addProjection(ChargedFinalState(-5.0, 5.0), "CFS50");
00032 
00033       // NB. _hist_nch and _hist_ncheta50 use the same data but different binning
00034       if (fuzzyEquals(sqrtS()/GeV, 200, 1E-3)) {
00035         _hist_nch        = bookHistogram1D(1, 1, 1);
00036         _hist_nch_eta05  = bookHistogram1D(3, 1, 1);
00037         _hist_nch_eta15  = bookHistogram1D(4, 1, 1);
00038         _hist_nch_eta30  = bookHistogram1D(5, 1, 1);
00039         _hist_nch_eta50  = bookHistogram1D(6, 1, 1);
00040         _hist_mean_nch   = bookHistogram1D(11, 1, 1);
00041       } else if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00042         _hist_nch        = bookHistogram1D(2, 1, 1);
00043         _hist_nch_eta05  = bookHistogram1D(7, 1, 1);
00044         _hist_nch_eta15  = bookHistogram1D(8, 1, 1);
00045         _hist_nch_eta30  = bookHistogram1D(9, 1, 1);
00046         _hist_nch_eta50  = bookHistogram1D(10, 1, 1);
00047         _hist_mean_nch   = bookHistogram1D(12, 1, 1);
00048       }
00049 
00050       /// @todo Moments of distributions
00051     }
00052 
00053 
00054     /// Do the analysis
00055     void analyze(const Event& event) {
00056       // Trigger
00057       const TriggerUA5& trigger = applyProjection<TriggerUA5>(event, "Trigger");
00058       if (!trigger.nsdDecision()) vetoEvent;
00059 
00060       const double weight = event.weight();
00061       _sumWPassed += weight;
00062 
00063       // Count final state particles in several eta regions
00064       const int numP05 = applyProjection<ChargedFinalState>(event, "CFS05").size();
00065       const int numP15 = applyProjection<ChargedFinalState>(event, "CFS15").size();
00066       const int numP30 = applyProjection<ChargedFinalState>(event, "CFS30").size();
00067       const int numP50 = applyProjection<ChargedFinalState>(event, "CFS50").size();
00068 
00069       // Fill histograms
00070       _hist_nch->fill(numP50, weight);
00071       _hist_nch_eta05->fill(numP05, weight);
00072       _hist_nch_eta15->fill(numP15, weight);
00073       _hist_nch_eta30->fill(numP30, weight);
00074       _hist_nch_eta50->fill(numP50, weight);
00075       _hist_mean_nch->fill(_hist_mean_nch->binMean(0), numP50);
00076     }
00077 
00078 
00079     void finalize() {
00080       scale(_hist_nch, _sumWPassed);
00081       scale(_hist_nch_eta05, _sumWPassed);
00082       scale(_hist_nch_eta15, _sumWPassed);
00083       scale(_hist_nch_eta30, _sumWPassed);
00084       scale(_hist_nch_eta50, _sumWPassed);
00085       scale(_hist_mean_nch, 1.0/_sumWPassed);
00086     }
00087 
00088     //@}
00089 
00090 
00091   private:
00092 
00093     /// @name Counters
00094     //@{
00095     double _sumWPassed;
00096     //@}
00097 
00098     /// @name Histograms
00099     //@{
00100     AIDA::IHistogram1D* _hist_nch;
00101     AIDA::IHistogram1D* _hist_nch_eta05;
00102     AIDA::IHistogram1D* _hist_nch_eta15;
00103     AIDA::IHistogram1D* _hist_nch_eta30;
00104     AIDA::IHistogram1D* _hist_nch_eta50;
00105     AIDA::IHistogram1D* _hist_mean_nch;
00106     //@}
00107 
00108   };
00109 
00110 
00111 
00112   // This global object acts as a hook for the plugin system
00113   AnalysisBuilder<UA5_1989_S1926373> plugin_UA5_1989_S1926373;
00114 
00115 }