rivet is hosted by Hepforge, IPPP Durham
E735_1998_S3905616.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 
00005 #include "Rivet/Projections/TriggerCDFRun0Run1.hh"
00006 #include "Rivet/Projections/TriggerUA5.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief E735 charged multiplicity in NSD-triggered events
00012   class E735_1998_S3905616 : public Analysis {
00013   public:
00014 
00015     /// Constructor
00016     E735_1998_S3905616() : Analysis("E735_1998_S3905616") {
00017       _sumWTrig = 0;
00018     }
00019 
00020 
00021     /// @name Analysis methods
00022     //@{
00023 
00024     void init() {
00025       // Projections
00026       /// @todo E735 trigger?
00027       //addProjection(TriggerCDFRun0Run1(), "Trigger");
00028       addProjection(TriggerUA5(), "Trigger");
00029       addProjection(ChargedFinalState(), "FS");
00030 
00031       // Histo
00032       _hist_multiplicity = bookHisto1D(1, 1, 1);
00033     }
00034 
00035 
00036     void analyze(const Event& event) {
00037       //const bool trigger = applyProjection<TriggerCDFRun0Run1>(event, "Trigger").minBiasDecision();
00038       const bool trigger = applyProjection<TriggerUA5>(event, "Trigger").nsdDecision();
00039       if (!trigger) vetoEvent;
00040       const double weight = event.weight();
00041       _sumWTrig += weight;
00042 
00043       const ChargedFinalState& fs = applyProjection<ChargedFinalState>(event, "FS");
00044       const size_t numParticles = fs.particles().size();
00045       _hist_multiplicity->fill(numParticles, weight);
00046     }
00047 
00048 
00049     void finalize() {
00050       scale(_hist_multiplicity, 1/_sumWTrig);
00051     }
00052 
00053     //@}
00054 
00055 
00056   private:
00057 
00058     /// @name Weight counter
00059     //@{
00060     double _sumWTrig;
00061     //@}
00062 
00063     /// @name Histograms
00064     //@{
00065     Histo1DPtr _hist_multiplicity;
00066     //@}
00067 
00068   };
00069 
00070 
00071 
00072   // The hook for the plugin system
00073   DECLARE_RIVET_PLUGIN(E735_1998_S3905616);
00074 
00075 }