rivet is hosted by Hepforge, IPPP Durham
TOTEM_2012_I1220862.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 
00005 namespace Rivet {
00006 
00007 
00008   /// TOTEM elastic and total cross-section measurement
00009   class TOTEM_2012_I1220862 : public Analysis {
00010   public:
00011 
00012     TOTEM_2012_I1220862()
00013       : Analysis("TOTEM_2012_I1220862")
00014     {    }
00015 
00016 
00017     void init() {
00018       declare(ChargedFinalState(), "CFS");
00019       _hist_tlow  = bookHisto1D(1, 1, 1);
00020       _hist_thigh = bookHisto1D(2, 1, 1);
00021       _hist_sigma = bookHisto1D(3, 1, 1);
00022     }
00023 
00024 
00025     void analyze(const Event& event) {
00026       const double weight = event.weight();
00027 
00028       const ChargedFinalState& cfs = apply<ChargedFinalState>(event, "CFS");
00029       if (cfs.size() > 2) MSG_WARNING("Final state includes more than two charged particles!");
00030       _hist_sigma->fill(sqrtS()/GeV, weight);
00031 
00032       for (const Particle& p : cfs.particles(Cuts::eta > 0)) { // && Cuts::pid == PID::PROTON)) {
00033         if (p.pid() != PID::PROTON) continue;
00034         const double t = sqr(p.pT());
00035         _hist_tlow->fill(t, weight);
00036         _hist_thigh->fill(t, weight);
00037       }
00038     }
00039 
00040 
00041     void finalize() {
00042       normalize(_hist_tlow, crossSection()/millibarn);
00043       normalize(_hist_thigh, crossSection()/millibarn);
00044       normalize(_hist_sigma, crossSection()/millibarn);
00045     }
00046 
00047 
00048   private:
00049 
00050     Histo1DPtr _hist_tlow, _hist_thigh, _hist_sigma;
00051 
00052   };
00053 
00054 
00055   DECLARE_ALIASED_RIVET_PLUGIN(TOTEM_2012_I1220862, TOTEM_2012_002);
00056 
00057 }