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