00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Tools/BinnedHistogram.hh"
00006 #include "Rivet/Tools/ParticleIdUtils.hh"
00007 #include "Rivet/Projections/FinalState.hh"
00008 #include "Rivet/Projections/ZFinder.hh"
00009
00010
00011 namespace Rivet {
00012
00013
00014 class D0_2010_S8821313 : public Analysis {
00015 public:
00016
00017
00018
00019
00020
00021 D0_2010_S8821313()
00022 : Analysis("D0_2010_S8821313")
00023 { }
00024
00025
00026
00027
00028 public:
00029
00030
00031
00032
00033
00034 void init() {
00035
00036
00037 vector<pair<double, double> > etaRanges_ee;
00038 etaRanges_ee.push_back(make_pair(-3.0, -1.5));
00039 etaRanges_ee.push_back(make_pair(-1.1, 1.1));
00040 etaRanges_ee.push_back(make_pair(1.5, 3.0));
00041 ZFinder zfinder_ee(etaRanges_ee, 20.0*GeV, ELECTRON, 70.0*GeV, 110.0*GeV, 0.2, true, true);
00042 addProjection(zfinder_ee, "zfinder_ee");
00043
00044 ZFinder zfinder_mm(-2.0, 2.0, 15.0*GeV, MUON, 70.0*GeV, 110.0*GeV, 0.0, false, false);
00045 addProjection(zfinder_mm, "zfinder_mm");
00046
00047
00048 _h_phistar_ee.addHistogram(0.0, 1.0, bookHistogram1D(1, 1, 1));
00049 _h_phistar_ee.addHistogram(1.0, 2.0, bookHistogram1D(1, 1, 2));
00050 _h_phistar_ee.addHistogram(2.0, 10.0, bookHistogram1D(1, 1, 3));
00051
00052 _h_phistar_mm.addHistogram(0.0, 1.0, bookHistogram1D(2, 1, 1));
00053 _h_phistar_mm.addHistogram(1.0, 2.0, bookHistogram1D(2, 1, 2));
00054 }
00055
00056
00057
00058 void analyze(const Event& event) {
00059 const double weight = event.weight();
00060
00061 const ZFinder& zfinder_ee = applyProjection<ZFinder>(event, "zfinder_ee");
00062 if (zfinder_ee.bosons().size()==1) {
00063 ParticleVector ee=zfinder_ee.constituents();
00064 std::sort(ee.begin(), ee.end(), cmpParticleByPt);
00065 FourMomentum eminus=PID::threeCharge(ee[0].pdgId())<0.0?ee[0].momentum():ee[1].momentum();
00066 FourMomentum eplus=PID::threeCharge(ee[0].pdgId())<0.0?ee[1].momentum():ee[0].momentum();
00067 double phi_acop=M_PI-mapAngle0ToPi(eminus.phi()-eplus.phi());
00068 double costhetastar=tanh((eminus.eta()-eplus.eta())/2.0);
00069 double sin2thetastar=1.0-sqr(costhetastar);
00070 if (sin2thetastar<0.0) sin2thetastar=0.0;
00071 double phistar=tan(phi_acop/2.0)*sqrt(sin2thetastar);
00072
00073 FourMomentum Zmom=zfinder_ee.bosons()[0].momentum();
00074 _h_phistar_ee.fill(Zmom.rapidity(), phistar, weight);
00075 }
00076
00077 const ZFinder& zfinder_mm = applyProjection<ZFinder>(event, "zfinder_mm");
00078 if (zfinder_mm.bosons().size()==1) {
00079 ParticleVector mm=zfinder_mm.constituents();
00080 std::sort(mm.begin(), mm.end(), cmpParticleByPt);
00081 FourMomentum mminus=PID::threeCharge(mm[0].pdgId())<0.0?mm[0].momentum():mm[1].momentum();
00082 FourMomentum mplus=PID::threeCharge(mm[0].pdgId())<0.0?mm[1].momentum():mm[0].momentum();
00083 double phi_acop=M_PI-mapAngle0ToPi(mminus.phi()-mplus.phi());
00084 double costhetastar=tanh((mminus.eta()-mplus.eta())/2.0);
00085 double sin2thetastar=1.0-sqr(costhetastar);
00086 if (sin2thetastar<0.0) sin2thetastar=0.0;
00087 double phistar=tan(phi_acop/2.0)*sqrt(sin2thetastar);
00088
00089 FourMomentum Zmom=zfinder_mm.bosons()[0].momentum();
00090 _h_phistar_mm.fill(Zmom.rapidity(), phistar, weight);
00091 }
00092 }
00093
00094
00095
00096 void finalize() {
00097 foreach (AIDA::IHistogram1D* hist, _h_phistar_ee.getHistograms()) {
00098 normalize(hist, 1.0);
00099 }
00100 foreach (AIDA::IHistogram1D* hist, _h_phistar_mm.getHistograms()) {
00101 normalize(hist, 1.0);
00102 }
00103 }
00104
00105
00106
00107
00108 private:
00109
00110
00111
00112
00113 private:
00114
00115
00116
00117
00118 BinnedHistogram<double> _h_phistar_ee;
00119 BinnedHistogram<double> _h_phistar_mm;
00120
00121
00122
00123 };
00124
00125
00126
00127
00128 DECLARE_RIVET_PLUGIN(D0_2010_S8821313);
00129
00130 }