SFM_1984_S1178091.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 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief SFM charged multiplicities in NSD and inelastic minbias events
00011   class SFM_1984_S1178091 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     SFM_1984_S1178091() : Analysis("SFM_1984_S1178091") {
00016       setBeams(PROTON, PROTON);
00017       _sumW = 0;
00018       _sumWDiff = 0;
00019     }
00020 
00021 
00022     /// @name Analysis methods
00023     //@{
00024 
00025     void init() {
00026       // Projections
00027       /// @todo Corrected to full phase space?
00028       addProjection(ChargedFinalState(), "FS");
00029 
00030       // Histograms
00031       if (fuzzyEquals(sqrtS()/GeV, 30.4, 1E-1)) {
00032         _hist_multiplicity_inel = bookHistogram1D(1, 1, 1);
00033         _hist_multiplicity_nsd = bookHistogram1D(2, 1, 1);
00034       } else if (fuzzyEquals(sqrtS(), 44.5, 1E-1)) {
00035         _hist_multiplicity_inel = bookHistogram1D(1, 1, 2);
00036         _hist_multiplicity_nsd = bookHistogram1D(2, 1, 2);
00037       } else if (fuzzyEquals(sqrtS(), 52.2, 1E-1)) {
00038         _hist_multiplicity_inel = bookHistogram1D(1, 1, 3);
00039         _hist_multiplicity_nsd = bookHistogram1D(2, 1, 3);
00040       } else if (fuzzyEquals(sqrtS(), 62.2, 1E-1)) {
00041         _hist_multiplicity_inel = bookHistogram1D(1, 1, 4);
00042         _hist_multiplicity_nsd = bookHistogram1D(2, 1, 4);
00043       }
00044 
00045     }
00046 
00047 
00048     // Analyse each event
00049     void analyze(const Event& event) {
00050       const double weight = event.weight();
00051       const ChargedFinalState& fs = applyProjection<ChargedFinalState>(event, "FS");
00052       const size_t numParticles = fs.particles().size();
00053 
00054       /// @todo Any trigger?
00055 
00056       // Decide whether event is of diffractive type or not
00057       // @todo It is not so clear in the paper how this distinction is made.
00058       // They seem to require either exactly one particle with Feynman x larger
00059       // than 0.8 to call an event diffractive or that there are no tracks
00060       // reconstructed in either of the two hemispheres. For the latter
00061       // they require in addition also the number of charged particles
00062       // to be smaller than 8.
00063       int n_left(0), n_right(0), n_large_x(0);
00064       foreach (const Particle& p, fs.particles()) {
00065         // Calculate the particles' Feynman x
00066         const double x_feyn = 2.0 * fabs(p.momentum().pz())/sqrtS();
00067         if (x_feyn > 0.8 ) n_large_x += 1;
00068 
00069         // Pseudorapidity
00070         const double eta = p.momentum().pseudorapidity();
00071         if (eta > 0.0) n_right += 1;
00072         else if (eta < 0.0) n_left += 1;
00073       }
00074       getLog() << Log::DEBUG
00075                << "N_left: " << n_left << ", "
00076                << "N_right: " << n_right << ", "
00077                << "N_large_x: " << n_large_x << endl;
00078 
00079       // Not sure about the "=="!
00080       // @todo Not sure about the "== 1", the paper says no charged particle
00081       // that was reconstructed so the incoming protons must run down the beam
00082       // pipe. Since we look a the complete final state here no particle being
00083       // reconstructed should be equal to one particle (proton) in each
00084       // hemisphere.  The "< 8" is also not certain.
00085       const bool isDiffractive = (n_large_x == 1) ||
00086         ((n_left == 1 || n_right == 1) && numParticles < 8 );
00087 
00088       // Increment weight counters
00089       _sumW += weight;
00090       _sumWDiff += weight;
00091 
00092       // Fill histos of charged multiplicity distributions
00093       _hist_multiplicity_inel->fill(numParticles, weight);
00094       if (!isDiffractive) _hist_multiplicity_nsd->fill(numParticles, weight);
00095     }
00096 
00097 
00098     void finalize() {
00099       scale(_hist_multiplicity_inel, 1.0/_sumWDiff);
00100       scale(_hist_multiplicity_nsd, 1.0/_sumW );
00101     }
00102 
00103     //@}
00104 
00105 
00106   private:
00107 
00108     /// @name Weight counters
00109     //@{
00110     double _sumW, _sumWDiff;
00111     //@}
00112 
00113     /// @name Histograms
00114     //@{
00115     AIDA::IHistogram1D *_hist_multiplicity_inel;
00116     AIDA::IHistogram1D *_hist_multiplicity_nsd;
00117     //@}
00118 
00119   };
00120 
00121 
00122 
00123   // This global object acts as a hook for the plugin system
00124   AnalysisBuilder<SFM_1984_S1178091> plugin_SFM_1984_S1178091;
00125 
00126 }