00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/IdentifiedFinalState.hh"
00007 #include "Rivet/Tools/BinnedHistogram.hh"
00008
00009 namespace Rivet {
00010
00011 typedef std::pair<double, double> doublepair;
00012
00013
00014
00015 class D0_2010_S8570965 : public Analysis {
00016 public:
00017
00018 D0_2010_S8570965()
00019 : Analysis("D0_2010_S8570965")
00020 {
00021 setBeams(PROTON, ANTIPROTON);
00022 setNeedsCrossSection(true);
00023 }
00024
00025
00026 public:
00027
00028 void init() {
00029 FinalState fs;
00030 addProjection(fs, "FS");
00031
00032 IdentifiedFinalState ifs(-0.9, 0.9, 20.0*GeV);
00033 ifs.acceptId(PHOTON);
00034 addProjection(ifs, "IFS");
00035
00036 _h_M = bookHistogram1D(1, 1, 1);
00037 _h_pT = bookHistogram1D(2, 1, 1);
00038 _h_dPhi = bookHistogram1D(3, 1, 1);
00039 _h_costheta = bookHistogram1D(4, 1, 1);
00040
00041 std::pair<double, double> M_ranges[] = { std::make_pair(30.0, 50.0),
00042 std::make_pair(50.0, 80.0),
00043 std::make_pair(80.0, 350.0) };
00044
00045 for (size_t i=0; i<3; ++i) {
00046 _h_pT_M.addHistogram(M_ranges[i].first, M_ranges[i].second, bookHistogram1D(5+3*i, 1, 1));
00047 _h_dPhi_M.addHistogram(M_ranges[i].first, M_ranges[i].second, bookHistogram1D(6+3*i, 1, 1));
00048 _h_costheta_M.addHistogram(M_ranges[i].first, M_ranges[i].second, bookHistogram1D(7+3*i, 1, 1));
00049 }
00050 }
00051
00052
00053
00054 void analyze(const Event& event) {
00055 const double weight = event.weight();
00056
00057 ParticleVector photons = applyProjection<IdentifiedFinalState>(event, "IFS").particlesByPt();
00058 if (photons.size() < 2 ||
00059 (photons[0].momentum().pT() < 21.0*GeV)) {
00060 vetoEvent;
00061 }
00062
00063
00064 ParticleVector isolated_photons;
00065 ParticleVector fs = applyProjection<FinalState>(event, "FS").particles();
00066 foreach (const Particle& photon, photons) {
00067 double eta_P = photon.momentum().eta();
00068 double phi_P = photon.momentum().phi();
00069 double Etsum=0.0;
00070 foreach (const Particle& p, fs) {
00071 if (p.genParticle().barcode()!=photon.genParticle().barcode() &&
00072 deltaR(eta_P, phi_P, p.momentum().eta(), p.momentum().phi()) < 0.4) {
00073 Etsum += p.momentum().Et();
00074 }
00075 }
00076 if (Etsum<2.5*GeV) {
00077 isolated_photons.push_back(photon);
00078 }
00079 }
00080
00081 if (isolated_photons.size() != 2) {
00082 vetoEvent;
00083 }
00084 std::sort(isolated_photons.begin(), isolated_photons.end(), cmpParticleByPt);
00085
00086 FourMomentum y1=isolated_photons[0].momentum();
00087 FourMomentum y2=isolated_photons[1].momentum();
00088 if (deltaR(y1, y2)<0.4) {
00089 vetoEvent;
00090 }
00091
00092 FourMomentum yy=y1+y2;
00093 double Myy = yy.mass()/GeV;
00094 if (Myy<30.0 || Myy>350.0) {
00095 vetoEvent;
00096 }
00097
00098 double pTyy = yy.pT()/GeV;
00099 if (Myy<pTyy) {
00100 vetoEvent;
00101 }
00102
00103 double dPhiyy = mapAngle0ToPi(y1.phi()-y2.phi());
00104 if (dPhiyy<0.5*M_PI) {
00105 vetoEvent;
00106 }
00107
00108 double costhetayy = fabs(tanh((y1.eta()-y2.eta())/2.0));
00109
00110 _h_M->fill(Myy, weight);
00111 _h_pT->fill(pTyy, weight);
00112 _h_dPhi->fill(dPhiyy, weight);
00113 _h_costheta->fill(costhetayy, weight);
00114
00115 _h_pT_M.fill(Myy, pTyy, weight);
00116 _h_dPhi_M.fill(Myy, dPhiyy, weight);
00117 _h_costheta_M.fill(Myy, costhetayy, weight);
00118 }
00119
00120
00121 void finalize() {
00122
00123 scale(_h_M, crossSection()/sumOfWeights());
00124 scale(_h_pT, crossSection()/sumOfWeights());
00125 scale(_h_dPhi, crossSection()/sumOfWeights());
00126 scale(_h_costheta, crossSection()/sumOfWeights());
00127
00128 _h_pT_M.scale(crossSection()/sumOfWeights(), this);
00129 _h_dPhi_M.scale(crossSection()/sumOfWeights(), this);
00130 _h_costheta_M.scale(crossSection()/sumOfWeights(), this);
00131
00132 }
00133
00134
00135 private:
00136
00137 AIDA::IHistogram1D *_h_M;
00138 AIDA::IHistogram1D *_h_pT;
00139 AIDA::IHistogram1D *_h_dPhi;
00140 AIDA::IHistogram1D *_h_costheta;
00141 BinnedHistogram<double> _h_pT_M;
00142 BinnedHistogram<double> _h_dPhi_M;
00143 BinnedHistogram<double> _h_costheta_M;
00144
00145 };
00146
00147
00148
00149
00150 AnalysisBuilder<D0_2010_S8570965> plugin_D0_2010_S8570965;
00151
00152
00153 }