00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Projections/DISFinalState.hh"
00005 #include "Rivet/Projections/CentralEtHCM.hh"
00006
00007 namespace Rivet {
00008
00009
00010
00011
00012
00013 class H1_1995_S3167097 : public Analysis {
00014 public:
00015
00016
00017 H1_1995_S3167097() : Analysis("H1_1995_S3167097")
00018 {
00019 }
00020
00021
00022
00023
00024
00025 void init() {
00026 const DISKinematics& diskin = addProjection(DISKinematics(), "Kinematics");
00027 const DISFinalState& fshcm = addProjection(DISFinalState(diskin, DISFinalState::HCM), "FS");
00028 addProjection(CentralEtHCM(fshcm), "Y1HCM");
00029
00030 _hEtFlow = vector<AIDA::IHistogram1D *>(_nbin);
00031 _hEtFlowStat = vector<AIDA::IHistogram1D *>(_nbin);
00032 _nev = vector<double>(_nbin);
00033
00034 for (size_t i = 0; i < _nbin; ++i) {
00035 string istr(1, char('1' + i));
00036 _hEtFlow[i] = bookHistogram1D(istr, _nb, _xmin, _xmax);
00037 _hEtFlowStat[i] = bookHistogram1D(istr, _nb, _xmin, _xmax);
00038 }
00039 _hAvEt = bookHistogram1D("21tmp", _nbin, 1.0, 10.0);
00040 _hAvX = bookHistogram1D("22tmp", _nbin, 1.0, 10.0);
00041 _hAvQ2 = bookHistogram1D("23tmp", _nbin, 1.0, 10.0);
00042 _hN = bookHistogram1D("24", _nbin, 1.0, 10.0);
00043 }
00044
00045
00046
00047 int _getbin(const DISKinematics& dk) {
00048 if ( dk.Q2() > 5.0*GeV2 && dk.Q2() <= 10.0*GeV2 ) {
00049 if ( dk.x() > 0.0001 && dk.x() <= 0.0002 )
00050 return 0;
00051 else if ( dk.x() > 0.0002 && dk.x() <= 0.0005 && dk.Q2() > 6.0*GeV2 )
00052 return 1;
00053 }
00054 else if ( dk.Q2() > 10.0*GeV2 && dk.Q2() <= 20.0*GeV2 ){
00055 if ( dk.x() > 0.0002 && dk.x() <= 0.0005 )
00056 return 2;
00057 else if ( dk.x() > 0.0005 && dk.x() <= 0.0008 )
00058 return 3;
00059 else if ( dk.x() > 0.0008 && dk.x() <= 0.0015 )
00060 return 4;
00061 else if ( dk.x() > 0.0015 && dk.x() <= 0.0040 )
00062 return 5;
00063 }
00064 else if ( dk.Q2() > 20.0*GeV2 && dk.Q2() <= 50.0*GeV2 ){
00065 if ( dk.x() > 0.0005 && dk.x() <= 0.0014 )
00066 return 6;
00067 else if ( dk.x() > 0.0014 && dk.x() <= 0.0030 )
00068 return 7;
00069 else if ( dk.x() > 0.0030 && dk.x() <= 0.0100 )
00070 return 8;
00071 }
00072 return -1;
00073 }
00074
00075
00076 void analyze(const Event& event) {
00077 const FinalState& fs = applyProjection<FinalState>(event, "FS");
00078 const DISKinematics& dk = applyProjection<DISKinematics>(event, "Kinematics");
00079 const CentralEtHCM y1 = applyProjection<CentralEtHCM>(event, "Y1HCM");
00080
00081 const int ibin = _getbin(dk);
00082 if (ibin < 0) vetoEvent;
00083 const double weight = event.weight();
00084
00085 for (size_t i = 0, N = fs.particles().size(); i < N; ++i) {
00086 const double rap = fs.particles()[i].momentum().rapidity();
00087 const double et = fs.particles()[i].momentum().Et();
00088 _hEtFlow[ibin]->fill(rap, weight * et/GeV);
00089 _hEtFlowStat[ibin]->fill(rap, weight * et/GeV);
00090 }
00091
00092 _nev[ibin] += weight;
00093 _hAvEt->fill(ibin + 1.5, weight * y1.sumEt()/GeV);
00094 _hAvX->fill(ibin + 1.5, weight * dk.x());
00095 _hAvQ2->fill(ibin + 1.5, weight * dk.Q2()/GeV2);
00096 _hN->fill(ibin + 1.5, weight);
00097 }
00098
00099
00100 void finalize() {
00101 for (size_t ibin = 0; ibin < _nbin; ++ibin) {
00102 _hEtFlow[ibin]->scale(1.0/(_nev[ibin]*double(_nb)/(_xmax-_xmin)));
00103 _hEtFlowStat[ibin]->scale(1.0/(_nev[ibin]*double(_nb)/(_xmax-_xmin)));
00104 }
00105
00106
00107 AIDA::IDataPointSet* h = 0;
00108 h = histogramFactory().divide("/H1_1995_S3167097/21", *_hAvEt, *_hN);
00109 h->setTitle(_hAvEt->title());
00110 histogramFactory().destroy(_hAvEt);
00111
00112 h = histogramFactory().divide("/H1_1995_S3167097/22", *_hAvX, *_hN);
00113 h->setTitle(_hAvX->title());
00114 histogramFactory().destroy(_hAvX);
00115
00116 h = histogramFactory().divide("/H1_1995_S3167097/23", *_hAvQ2, *_hN);
00117 h->setTitle(_hAvQ2->title());
00118 histogramFactory().destroy(_hAvQ2);
00119 }
00120
00121
00122
00123
00124 private:
00125
00126
00127
00128 static const size_t _nb = 24, _nbin = 9;
00129
00130
00131
00132 static const double _xmin, _xmax;
00133
00134
00135 vector<AIDA::IHistogram1D*> _hEtFlow, _hEtFlowStat;
00136
00137
00138 AIDA::IHistogram1D *_hAvEt, *_hAvX, *_hAvQ2, *_hN;
00139
00140
00141 vector<double> _nev;
00142 };
00143
00144
00145
00146 const double H1_1995_S3167097::_xmin = -6.0;
00147 const double H1_1995_S3167097::_xmax = 6.0;
00148
00149
00150
00151
00152 DECLARE_RIVET_PLUGIN(H1_1995_S3167097);
00153
00154 }