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