STAR_2008_S7993412.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Projections/ChargedFinalState.hh"
00005 #include "Rivet/RivetAIDA.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief STAR di-hadron correlations in d-Au at 200 GeV
00011   class STAR_2008_S7993412 : public Analysis {
00012   public:
00013 
00014     STAR_2008_S7993412() : Analysis("STAR_2008_S7993412")
00015     {
00016       setBeams(PROTON, PROTON);
00017     }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book projections and histograms
00024     void init() {
00025       ChargedFinalState fs(-1.0, 1.0, 1.0*GeV);
00026       addProjection(fs, "FS");
00027 
00028       _h_Y_jet_trigger = bookProfile1D(1, 1, 1);
00029       _h_Y_jet_associated = bookProfile1D(2, 1, 1);
00030     }
00031 
00032 
00033     /// Do the analysis
00034     void analyze(const Event& event) {
00035       // Skip if the event is empty
00036       const FinalState& fs = applyProjection<FinalState>(event, "FS");
00037       if (fs.empty()) {
00038         getLog() << Log::DEBUG << "Skipping event " << event.genEvent().event_number()
00039                  << " because no final state found " << endl;
00040         vetoEvent;
00041       }
00042 
00043       const double weight = event.weight();
00044 
00045       foreach (const Particle& tp, fs.particles()) {
00046         const double triggerpT = tp.momentum().pT();
00047         if (triggerpT >= 2.0 && triggerpT < 5.0) {
00048           int n_associated = 0;
00049           foreach (const Particle& ap, fs.particles()) {
00050             if (!inRange(ap.momentum().pT()/GeV, 1.5, triggerpT)) continue;
00051             if (deltaPhi(tp.momentum().phi(), ap.momentum().phi()) > 1) continue;
00052             if (fabs(tp.momentum().eta() - ap.momentum().eta()) > 1.75) continue;
00053             n_associated += 1;
00054           }
00055           //const double dPhidEta = 2 * 2*1.75;
00056           //_h_Y_jet_trigger->fill(triggerpT, n_associated/dPhidEta, weight);
00057           _h_Y_jet_trigger->fill(triggerpT, n_associated, weight);
00058         }
00059       }
00060     }
00061 
00062 
00063     /// Finalize
00064     void finalize() {
00065     }
00066 
00067     //@}
00068 
00069 
00070   private:
00071 
00072     /// @name Histograms
00073     //@{
00074     AIDA::IProfile1D * _h_Y_jet_trigger;
00075     AIDA::IProfile1D * _h_Y_jet_associated;
00076     //@}
00077 
00078   };
00079 
00080 
00081 
00082   // This global object acts as a hook for the plugin system
00083   AnalysisBuilder<STAR_2008_S7993412> plugin_STAR_2008_S7993412;
00084 
00085 }