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