~ubuntu-branches/ubuntu/saucy/rivet/saucy-proposed

« back to all changes in this revision

Viewing changes to src/Analyses/TOTEM_2012_002.cc

  • Committer: Package Import Robot
  • Author(s): Lifeng Sun
  • Date: 2013-05-07 09:24:27 UTC
  • mfrom: (1.2.1) (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130507092427-rpfijl4mn3y87ek7
Tags: 1.8.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
#include "Rivet/Analysis.hh"
 
3
#include "Rivet/RivetAIDA.hh"
 
4
#include "Rivet/Tools/Logging.hh"
 
5
#include "Rivet/Projections/ChargedFinalState.hh"
 
6
 
 
7
namespace Rivet {
 
8
 
 
9
 
 
10
  /// TOTEM elastic and total cross-section measurement
 
11
  class TOTEM_2012_002 : public Analysis {
 
12
  public:
 
13
 
 
14
    TOTEM_2012_002()
 
15
      : Analysis("TOTEM_2012_002")
 
16
    {    }
 
17
 
 
18
 
 
19
  public:
 
20
 
 
21
    void init() {
 
22
      addProjection(ChargedFinalState(), "CFS");
 
23
      _hist_tlow  = bookHistogram1D(1, 1, 1);
 
24
      _hist_thigh = bookHistogram1D(2, 1, 1);
 
25
      _hist_sigma = bookHistogram1D(3, 1, 1);
 
26
    }
 
27
 
 
28
 
 
29
    void analyze(const Event& event) {
 
30
      const double weight = event.weight();
 
31
 
 
32
      const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
 
33
      if (cfs.size() > 2) MSG_WARNING("Final state includes more than two charged particles !");
 
34
      _hist_sigma->fill(sqrtS()/GeV, weight);
 
35
 
 
36
      foreach (const Particle& p, cfs.particles()) {
 
37
        if (p.momentum().eta() > 0. && p.pdgId() == PROTON) {
 
38
          double t = sqr(p.momentum().pT());
 
39
          _hist_tlow->fill(t, weight);
 
40
          _hist_thigh->fill(t, weight);
 
41
        }
 
42
      }
 
43
    }
 
44
 
 
45
 
 
46
    void finalize() {
 
47
      normalize(_hist_tlow, crossSection()/millibarn);
 
48
      normalize(_hist_thigh, crossSection()/millibarn);
 
49
      normalize(_hist_sigma, crossSection()/millibarn);
 
50
    }
 
51
 
 
52
 
 
53
  private:
 
54
 
 
55
    AIDA::IHistogram1D *_hist_tlow, *_hist_thigh, *_hist_sigma;
 
56
 
 
57
  };
 
58
 
 
59
 
 
60
  DECLARE_RIVET_PLUGIN(TOTEM_2012_002);
 
61
 
 
62
}