rivet is hosted by Hepforge, IPPP Durham
D0_2010_S8570965.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/IdentifiedFinalState.hh"
00005 #include "Rivet/Tools/BinnedHistogram.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief D0 direct photon pair production
00011   class D0_2010_S8570965 : public Analysis {
00012   public:
00013 
00014 
00015     D0_2010_S8570965()
00016       : Analysis("D0_2010_S8570965")
00017     {    }
00018 
00019 
00020     void init() {
00021       FinalState fs;
00022       addProjection(fs, "FS");
00023 
00024       IdentifiedFinalState ifs(-0.9, 0.9, 20.0*GeV);
00025       ifs.acceptId(PID::PHOTON);
00026       addProjection(ifs, "IFS");
00027 
00028       _h_M = bookHisto1D(1, 1, 1);
00029       _h_pT = bookHisto1D(2, 1, 1);
00030       _h_dPhi = bookHisto1D(3, 1, 1);
00031       _h_costheta = bookHisto1D(4, 1, 1);
00032 
00033       std::pair<double, double> M_ranges[] = { std::make_pair(30.0, 50.0),
00034                                                std::make_pair(50.0, 80.0),
00035                                                std::make_pair(80.0, 350.0) };
00036 
00037       for (size_t i = 0; i < 3; ++i) {
00038         _h_pT_M.addHistogram(M_ranges[i].first, M_ranges[i].second, bookHisto1D(5+3*i, 1, 1));
00039         _h_dPhi_M.addHistogram(M_ranges[i].first, M_ranges[i].second, bookHisto1D(6+3*i, 1, 1));
00040         _h_costheta_M.addHistogram(M_ranges[i].first, M_ranges[i].second, bookHisto1D(7+3*i, 1, 1));
00041       }
00042     }
00043 
00044 
00045     /// Perform the per-event analysis
00046     void analyze(const Event& event) {
00047       const double weight = event.weight();
00048 
00049       Particles photons = applyProjection<IdentifiedFinalState>(event, "IFS").particlesByPt();
00050       if (photons.size() < 2 ||
00051           (photons[0].pT() < 21.0*GeV)) {
00052         vetoEvent;
00053       }
00054 
00055       // Isolate photons with ET_sum in cone
00056       Particles isolated_photons;
00057       Particles fs = applyProjection<FinalState>(event, "FS").particles();
00058       foreach (const Particle& photon, photons) {
00059         double eta_P = photon.eta();
00060         double phi_P = photon.momentum().phi();
00061         double Etsum=0.0;
00062         foreach (const Particle& p, fs) {
00063           if (p.genParticle()->barcode() != photon.genParticle()->barcode() &&
00064               deltaR(eta_P, phi_P, p.eta(), p.momentum().phi()) < 0.4) {
00065             Etsum += p.momentum().Et();
00066           }
00067         }
00068         if (Etsum < 2.5*GeV) {
00069           isolated_photons.push_back(photon);
00070         }
00071       }
00072 
00073       if (isolated_photons.size() != 2) {
00074         vetoEvent;
00075       }
00076       std::sort(isolated_photons.begin(), isolated_photons.end(), cmpMomByPt);
00077 
00078       FourMomentum y1=isolated_photons[0].momentum();
00079       FourMomentum y2=isolated_photons[1].momentum();
00080       if (deltaR(y1, y2)<0.4) {
00081         vetoEvent;
00082       }
00083 
00084       FourMomentum yy=y1+y2;
00085       double Myy = yy.mass()/GeV;
00086       if (Myy<30.0 || Myy>350.0) {
00087         vetoEvent;
00088       }
00089 
00090       double pTyy = yy.pT()/GeV;
00091       if (Myy<pTyy) {
00092         vetoEvent;
00093       }
00094 
00095       double dPhiyy = mapAngle0ToPi(y1.phi()-y2.phi());
00096       if (dPhiyy<0.5*M_PI) {
00097         vetoEvent;
00098       }
00099 
00100       double costhetayy = fabs(tanh((y1.eta()-y2.eta())/2.0));
00101 
00102       _h_M->fill(Myy, weight);
00103       _h_pT->fill(pTyy, weight);
00104       _h_dPhi->fill(dPhiyy, weight);
00105       _h_costheta->fill(costhetayy, weight);
00106 
00107       _h_pT_M.fill(Myy, pTyy, weight);
00108       _h_dPhi_M.fill(Myy, dPhiyy, weight);
00109       _h_costheta_M.fill(Myy, costhetayy, weight);
00110     }
00111 
00112 
00113     void finalize() {
00114 
00115       scale(_h_M, crossSection()/sumOfWeights());
00116       scale(_h_pT, crossSection()/sumOfWeights());
00117       scale(_h_dPhi, crossSection()/sumOfWeights());
00118       scale(_h_costheta, crossSection()/sumOfWeights());
00119 
00120       _h_pT_M.scale(crossSection()/sumOfWeights(), this);
00121       _h_dPhi_M.scale(crossSection()/sumOfWeights(), this);
00122       _h_costheta_M.scale(crossSection()/sumOfWeights(), this);
00123 
00124     }
00125 
00126 
00127   private:
00128 
00129     Histo1DPtr _h_M;
00130     Histo1DPtr _h_pT;
00131     Histo1DPtr _h_dPhi;
00132     Histo1DPtr _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   // The hook for the plugin system
00142   DECLARE_RIVET_PLUGIN(D0_2010_S8570965);
00143 
00144 }