rivet is hosted by Hepforge, IPPP Durham
UA5_1988_S1867512.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/Math/MathUtils.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 #include "Rivet/Projections/Beam.hh"
00008 #include "Rivet/Projections/TriggerUA5.hh"
00009 
00010 namespace Rivet {
00011 
00012   /// @brief helper function to fill correlation points into scatter plot
00013   Point2D correlation_helper(double x, double xerr, 
00014                  const vector<int> & nf, const vector<int> & nb, 
00015                  double sumWPassed)
00016   {
00017     return Point2D( x,  correlation(nf, nb),
00018             xerr,   correlation_err(nf, nb)/sqrt(sumWPassed)  );
00019   }
00020 
00021 
00022   /// @brief UA5 charged particle correlations at 200, 546 and 900 GeV
00023   class UA5_1988_S1867512 : public Analysis {
00024   public:
00025 
00026     UA5_1988_S1867512() : Analysis("UA5_1988_S1867512")
00027     {
00028       _sumWPassed = 0;
00029     }
00030 
00031 
00032     /// @name Analysis methods
00033     //@{
00034 
00035     void init() {
00036       // Projections
00037       addProjection(TriggerUA5(), "Trigger");
00038 
00039       // Symmetric eta interval
00040       addProjection(ChargedFinalState(-0.5, 0.5), "CFS05");
00041 
00042       // Asymmetric intervals first
00043       // Forward eta intervals
00044       addProjection(ChargedFinalState(0.0, 1.0), "CFS10F");
00045       addProjection(ChargedFinalState(0.5, 1.5), "CFS15F");
00046       addProjection(ChargedFinalState(1.0, 2.0), "CFS20F");
00047       addProjection(ChargedFinalState(1.5, 2.5), "CFS25F");
00048       addProjection(ChargedFinalState(2.0, 3.0), "CFS30F");
00049       addProjection(ChargedFinalState(2.5, 3.5), "CFS35F");
00050       addProjection(ChargedFinalState(3.0, 4.0), "CFS40F");
00051 
00052       // Backward eta intervals
00053       addProjection(ChargedFinalState(-1.0,  0.0), "CFS10B");
00054       addProjection(ChargedFinalState(-1.5, -0.5), "CFS15B");
00055       addProjection(ChargedFinalState(-2.0, -1.0), "CFS20B");
00056       addProjection(ChargedFinalState(-2.5, -1.5), "CFS25B");
00057       addProjection(ChargedFinalState(-3.0, -2.0), "CFS30B");
00058       addProjection(ChargedFinalState(-3.5, -2.5), "CFS35B");
00059       addProjection(ChargedFinalState(-4.0, -3.0), "CFS40B");
00060 
00061       // Histogram booking, we have sqrt(s) = 200, 546 and 900 GeV
00062       // TODO use Scatter2D to be able to output errors
00063       if (fuzzyEquals(sqrtS()/GeV, 200.0, 1E-4)) {
00064         _hist_correl = bookScatter2D(2, 1, 1);
00065         _hist_correl_asym = bookScatter2D(3, 1, 1);
00066       } else if (fuzzyEquals(sqrtS()/GeV, 546.0, 1E-4)) {
00067         _hist_correl = bookScatter2D(2, 1, 2);
00068         _hist_correl_asym = bookScatter2D(3, 1, 2);
00069       } else if (fuzzyEquals(sqrtS()/GeV, 900.0, 1E-4)) {
00070         _hist_correl = bookScatter2D(2, 1, 3);
00071         _hist_correl_asym = bookScatter2D(3, 1, 3);
00072       }
00073     }
00074 
00075 
00076     void analyze(const Event& event) {
00077       // Trigger
00078       const bool trigger = applyProjection<TriggerUA5>(event, "Trigger").nsdDecision();
00079       if (!trigger) vetoEvent;
00080       _sumWPassed += event.weight();
00081 
00082       // Count forward/backward particles
00083       n_10f += applyProjection<ChargedFinalState>(event, "CFS10F").size();
00084       n_15f += applyProjection<ChargedFinalState>(event, "CFS15F").size();
00085       n_20f += applyProjection<ChargedFinalState>(event, "CFS20F").size();
00086       n_25f += applyProjection<ChargedFinalState>(event, "CFS25F").size();
00087       n_30f += applyProjection<ChargedFinalState>(event, "CFS30F").size();
00088       n_35f += applyProjection<ChargedFinalState>(event, "CFS35F").size();
00089       n_40f += applyProjection<ChargedFinalState>(event, "CFS40F").size();
00090       //
00091       n_10b += applyProjection<ChargedFinalState>(event, "CFS10B").size();
00092       n_15b += applyProjection<ChargedFinalState>(event, "CFS15B").size();
00093       n_20b += applyProjection<ChargedFinalState>(event, "CFS20B").size();
00094       n_25b += applyProjection<ChargedFinalState>(event, "CFS25B").size();
00095       n_30b += applyProjection<ChargedFinalState>(event, "CFS30B").size();
00096       n_35b += applyProjection<ChargedFinalState>(event, "CFS35B").size();
00097       n_40b += applyProjection<ChargedFinalState>(event, "CFS40B").size();
00098       //
00099       n_05 += applyProjection<ChargedFinalState>(event, "CFS05").size();
00100     }
00101 
00102     void finalize() {
00103       // The correlation strength is defined in formulas
00104       // 4.1 and 4.2
00105 
00106       // Fill histos, gap width histo comes first
00107       //      * Set the errors as Delta b / sqrt(sumWPassed) with
00108       //      Delta b being the absolute uncertainty of b according to
00109       //      Gaussian error-propagation (linear limit) and assuming
00110       //      Poissonian uncertainties for the number of particles in
00111       //      the eta-intervals
00112       //
00113 
00114       // Define vectors to be able to fill Scatter2Ds
00115       vector<Point2D> points;
00116       // Fill the y-value vector
00117       points.push_back(correlation_helper(0, 0.5, n_10f, n_10b, _sumWPassed));
00118       points.push_back(correlation_helper(1, 0.5, n_15f, n_15b, _sumWPassed));
00119       points.push_back(correlation_helper(2, 0.5, n_20f, n_20b, _sumWPassed));
00120       points.push_back(correlation_helper(3, 0.5, n_25f, n_25b, _sumWPassed));
00121       points.push_back(correlation_helper(4, 0.5, n_30f, n_30b, _sumWPassed));
00122       points.push_back(correlation_helper(5, 0.5, n_35f, n_35b, _sumWPassed));
00123       points.push_back(correlation_helper(6, 0.5, n_40f, n_40b, _sumWPassed));
00124 
00125       // Fill the DPS
00126       _hist_correl->addPoints(points);
00127 
00128       // Fill gap-center histo (Fig 15)
00129       //
00130       // The first bin contains the c_str strengths of
00131       // the gap size histo that has ane eta gap of two
00132       //
00133       // Now do the other histo -- clear already defined vectors first
00134       points.clear();
00135 
00136       points.push_back(correlation_helper(0,   0.25, n_20f, n_20b, _sumWPassed));
00137       points.push_back(correlation_helper(0.5, 0.25, n_25f, n_15b, _sumWPassed));
00138       points.push_back(correlation_helper(1,   0.25, n_30f, n_10b, _sumWPassed));
00139       points.push_back(correlation_helper(1.5, 0.25, n_35f, n_05 , _sumWPassed));
00140       points.push_back(correlation_helper(2,   0.25, n_40f, n_10f, _sumWPassed));
00141 
00142       // Fill in correlation strength for assymetric intervals,
00143       // see Tab. 5
00144       // Fill the DPS
00145       _hist_correl_asym->addPoints(points);
00146     }
00147 
00148     //@}
00149 
00150 
00151   private:
00152 
00153     /// @name Counters
00154     //@{
00155     double _sumWPassed;
00156     //@}
00157 
00158 
00159     /// @name Vectors for storing the number of particles in the different eta intervals per event.
00160     /// @todo Is there a better way?
00161     //@{
00162     std::vector<int> n_10f;
00163     std::vector<int> n_15f;
00164     std::vector<int> n_20f;
00165     std::vector<int> n_25f;
00166     std::vector<int> n_30f;
00167     std::vector<int> n_35f;
00168     std::vector<int> n_40f;
00169     //
00170     std::vector<int> n_10b;
00171     std::vector<int> n_15b;
00172     std::vector<int> n_20b;
00173     std::vector<int> n_25b;
00174     std::vector<int> n_30b;
00175     std::vector<int> n_35b;
00176     std::vector<int> n_40b;
00177     //
00178     std::vector<int> n_05;
00179     //@}
00180 
00181 
00182     /// @name Histograms
00183     //@{
00184     // Symmetric eta intervals
00185     Scatter2DPtr _hist_correl;
00186     // For asymmetric eta intervals
00187     Scatter2DPtr _hist_correl_asym;
00188     //@}
00189 
00190   };
00191 
00192 
00193 
00194   // The hook for the plugin system
00195   DECLARE_RIVET_PLUGIN(UA5_1988_S1867512);
00196 
00197 }