00001
00002 #include "Rivet/Analyses/MC_JetAnalysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 #include "Rivet/Projections/VetoedFinalState.hh"
00006 #include "Rivet/Tools/Logging.hh"
00007 #include "Rivet/Tools/ParticleIdUtils.hh"
00008 #include "Rivet/RivetAIDA.hh"
00009
00010 namespace Rivet {
00011
00012
00013 class MC_ZZJETS : public MC_JetAnalysis {
00014 public:
00015
00016
00017 MC_ZZJETS()
00018 : MC_JetAnalysis("MC_ZZJETS", 4, "Jets")
00019 {
00020 setNeedsCrossSection(true);
00021 }
00022
00023
00024
00025
00026
00027
00028 void init() {
00029 ZFinder zeefinder(-3.5, 3.5, 25.0*GeV, ELECTRON, 65.0*GeV, 115.0*GeV, 0.2, true, true);
00030 addProjection(zeefinder, "ZeeFinder");
00031 ZFinder zmmfinder(-3.5, 3.5, 25.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2, true, true);
00032 addProjection(zmmfinder, "ZmmFinder");
00033 VetoedFinalState jetinput;
00034 jetinput
00035 .addVetoOnThisFinalState(zeefinder)
00036 .addVetoOnThisFinalState(zmmfinder);
00037 FastJets jetpro(jetinput, FastJets::KT, 0.7);
00038 addProjection(jetpro, "Jets");
00039
00040
00041 _h_ZZ_pT = bookHistogram1D("ZZ_pT", logBinEdges(100, 1.0, 0.5*sqrtS()));
00042 _h_ZZ_pT_peak = bookHistogram1D("ZZ_pT_peak", 25, 0.0, 25.0);
00043 _h_ZZ_eta = bookHistogram1D("ZZ_eta", 40, -7.0, 7.0);
00044 _h_ZZ_phi = bookHistogram1D("ZZ_phi", 25, 0.0, TWOPI);
00045 _h_ZZ_m = bookHistogram1D("ZZ_m", logBinEdges(100, 150.0, 180.0+0.25*sqrtS()));
00046
00047
00048 _h_ZZ_dphi = bookHistogram1D("ZZ_dphi", 25, 0.0, PI);
00049 _h_ZZ_deta = bookHistogram1D("ZZ_deta", 25, -7.0, 7.0);
00050 _h_ZZ_dR = bookHistogram1D("ZZ_dR", 25, 0.5, 7.0);
00051 _h_ZZ_dpT = bookHistogram1D("ZZ_dpT", logBinEdges(100, 1.0, 0.5*sqrtS()));
00052 _h_ZZ_costheta_planes = bookHistogram1D("ZZ_costheta_planes", 25, -1.0, 1.0);
00053
00054
00055
00056
00057 _h_Z_pT = bookHistogram1D("Z_pT", logBinEdges(100, 10.0, 0.25*sqrtS()));
00058 _h_Z_eta = bookHistogram1D("Z_eta", 70, -7.0, 7.0);
00059
00060
00061 _h_Zl_pT = bookHistogram1D("Zl_pT", logBinEdges(100, 30.0, 0.1
00062 *sqrtS()));
00063 _h_Zl_eta = bookHistogram1D("Zl_eta", 40, -3.5, 3.5);
00064
00065
00066 _h_ZeZm_dphi = bookHistogram1D("ZeZm_dphi", 25, 0.0, PI);
00067 _h_ZeZm_deta = bookHistogram1D("ZeZm_deta", 25, -5.0, 5.0);
00068 _h_ZeZm_dR = bookHistogram1D("ZeZm_dR", 25, 0.5, 5.0);
00069 _h_ZeZm_m = bookHistogram1D("ZeZm_m", 100, 0.0, 300.0);
00070
00071
00072 _h_ZZ_jet1_deta = bookHistogram1D("ZZ_jet1_deta", 70, -7.0, 7.0);
00073 _h_ZZ_jet1_dR = bookHistogram1D("ZZ_jet1_dR", 25, 1.5, 7.0);
00074 _h_Ze_jet1_dR = bookHistogram1D("Ze_jet1_dR", 25, 0.0, 7.0);
00075
00076
00077 _h_HT = bookHistogram1D("HT", logBinEdges(100, 100.0, 0.5*sqrtS()));
00078
00079 MC_JetAnalysis::init();
00080 }
00081
00082
00083
00084
00085 void analyze(const Event & e) {
00086 const double weight = e.weight();
00087
00088 const ZFinder& zeefinder = applyProjection<ZFinder>(e, "ZeeFinder");
00089 if (zeefinder.bosons().size()!=1) {
00090 vetoEvent;
00091 }
00092
00093 const ZFinder& zmmfinder = applyProjection<ZFinder>(e, "ZmmFinder");
00094 if (zmmfinder.bosons().size()!=1) {
00095 vetoEvent;
00096 }
00097
00098 FourMomentum zee(zeefinder.bosons()[0].momentum());
00099 FourMomentum zmm(zmmfinder.bosons()[0].momentum());
00100 FourMomentum zz(zee+zmm);
00101
00102 FourMomentum ep(0.0,0.0,0.0,0.0), em(0.0,0.0,0.0,0.0);
00103 if (PID::threeCharge(zeefinder.constituents()[0])>0.0) {
00104 ep=zeefinder.constituents()[0].momentum();
00105 em=zeefinder.constituents()[1].momentum();
00106 }
00107 else {
00108 ep=zeefinder.constituents()[1].momentum();
00109 em=zeefinder.constituents()[0].momentum();
00110 }
00111 FourMomentum mp(0.0,0.0,0.0,0.0), mm(0.0,0.0,0.0,0.0);
00112 if (PID::threeCharge(zmmfinder.constituents()[0])>0.0) {
00113 mp=zmmfinder.constituents()[0].momentum();
00114 mm=zmmfinder.constituents()[1].momentum();
00115 }
00116 else {
00117 mp=zmmfinder.constituents()[1].momentum();
00118 mm=zmmfinder.constituents()[0].momentum();
00119 }
00120
00121 _h_ZZ_pT->fill(zz.pT(),weight);
00122 _h_ZZ_pT_peak->fill(zz.pT(),weight);
00123 _h_ZZ_eta->fill(zz.eta(),weight);
00124 _h_ZZ_phi->fill(zz.azimuthalAngle(),weight);
00125 double mzz2=zz.mass2();
00126 if (mzz2>0.0) _h_ZZ_m->fill(sqrt(mzz2), weight);
00127
00128 _h_ZZ_dphi->fill(mapAngle0ToPi(zee.phi()-zmm.phi()), weight);
00129 _h_ZZ_deta->fill(zee.eta()-zmm.eta(), weight);
00130 _h_ZZ_dR->fill(deltaR(zee,zmm), weight);
00131 _h_ZZ_dpT->fill(fabs(zee.pT()-zmm.pT()), weight);
00132
00133 Vector3 crossZee = ep.vector3().cross(em.vector3());
00134 Vector3 crossZmm = mp.vector3().cross(mm.vector3());
00135 double costheta = crossZee.dot(crossZmm)/crossZee.mod()/crossZmm.mod();
00136 _h_ZZ_costheta_planes->fill(costheta, weight);
00137
00138 _h_Z_pT->fill(zee.pT(),weight);
00139 _h_Z_pT->fill(zmm.pT(),weight);
00140 _h_Z_eta->fill(zee.eta(),weight);
00141 _h_Z_eta->fill(zmm.eta(),weight);
00142
00143 _h_Zl_pT->fill(ep.pT(), weight);
00144 _h_Zl_pT->fill(em.pT(), weight);
00145 _h_Zl_pT->fill(mp.pT(), weight);
00146 _h_Zl_pT->fill(mm.pT(), weight);
00147 _h_Zl_eta->fill(ep.eta(), weight);
00148 _h_Zl_eta->fill(em.eta(), weight);
00149 _h_Zl_eta->fill(mp.eta(), weight);
00150 _h_Zl_eta->fill(mm.eta(), weight);
00151
00152 _h_ZeZm_dphi->fill(mapAngle0ToPi(ep.phi()-mm.phi()), weight);
00153 _h_ZeZm_deta->fill(ep.eta()-mm.eta(), weight);
00154 _h_ZeZm_dR->fill(deltaR(ep,mm), weight);
00155 double m2=FourMomentum(ep+mm).mass2();
00156 if (m2 < 0) m2 = 0.0;
00157 _h_ZeZm_m->fill(sqrt(m2), weight);
00158
00159 const FastJets& jetpro = applyProjection<FastJets>(e, "Jets");
00160 const Jets& jets = jetpro.jetsByPt(20.0*GeV);
00161 if (jets.size() > 0) {
00162 _h_ZZ_jet1_deta->fill(zz.eta()-jets[0].momentum().eta(), weight);
00163 _h_ZZ_jet1_dR->fill(deltaR(zz, jets[0].momentum()), weight);
00164 _h_Ze_jet1_dR->fill(deltaR(ep, jets[0].momentum()), weight);
00165 }
00166
00167 double HT=ep.pT()+em.pT()+mp.pT()+mm.pT();
00168 foreach (const Jet& jet, jets) {
00169 HT+=jet.momentum().pT();
00170 }
00171 if (HT>0.0) _h_HT->fill(HT, weight);
00172
00173 MC_JetAnalysis::analyze(e);
00174 }
00175
00176
00177
00178 void finalize() {
00179 double norm=crossSection()/sumOfWeights();
00180 scale(_h_ZZ_pT, norm);
00181 scale(_h_ZZ_pT_peak, norm);
00182 scale(_h_ZZ_eta, norm);
00183 scale(_h_ZZ_phi, norm);
00184 scale(_h_ZZ_m, norm);
00185 scale(_h_ZZ_dphi, norm);
00186 scale(_h_ZZ_deta, norm);
00187 scale(_h_ZZ_dR, norm);
00188 scale(_h_ZZ_dpT, norm);
00189 scale(_h_ZZ_costheta_planes, norm);
00190 scale(_h_Z_pT, norm);
00191 scale(_h_Z_eta, norm);
00192 scale(_h_Zl_pT, norm);
00193 scale(_h_Zl_eta, norm);
00194 scale(_h_ZeZm_dphi, norm);
00195 scale(_h_ZeZm_deta, norm);
00196 scale(_h_ZeZm_dR, norm);
00197 scale(_h_ZeZm_m, norm);
00198 scale(_h_ZZ_jet1_deta, norm);
00199 scale(_h_ZZ_jet1_dR, norm);
00200 scale(_h_Ze_jet1_dR, norm);
00201 scale(_h_HT, norm);
00202
00203 MC_JetAnalysis::finalize();
00204 }
00205
00206
00207
00208
00209 private:
00210
00211
00212
00213 AIDA::IHistogram1D * _h_ZZ_pT;
00214 AIDA::IHistogram1D * _h_ZZ_pT_peak;
00215 AIDA::IHistogram1D * _h_ZZ_eta;
00216 AIDA::IHistogram1D * _h_ZZ_phi;
00217 AIDA::IHistogram1D * _h_ZZ_m;
00218 AIDA::IHistogram1D * _h_ZZ_dphi;
00219 AIDA::IHistogram1D * _h_ZZ_deta;
00220 AIDA::IHistogram1D * _h_ZZ_dR;
00221 AIDA::IHistogram1D * _h_ZZ_dpT;
00222 AIDA::IHistogram1D * _h_ZZ_costheta_planes;
00223 AIDA::IHistogram1D * _h_Z_pT;
00224 AIDA::IHistogram1D * _h_Z_eta;
00225 AIDA::IHistogram1D * _h_Zl_pT;
00226 AIDA::IHistogram1D * _h_Zl_eta;
00227 AIDA::IHistogram1D * _h_ZeZm_dphi;
00228 AIDA::IHistogram1D * _h_ZeZm_deta;
00229 AIDA::IHistogram1D * _h_ZeZm_dR;
00230 AIDA::IHistogram1D * _h_ZeZm_m;
00231 AIDA::IHistogram1D * _h_ZZ_jet1_deta;
00232 AIDA::IHistogram1D * _h_ZZ_jet1_dR;
00233 AIDA::IHistogram1D * _h_Ze_jet1_dR;
00234 AIDA::IHistogram1D * _h_HT;
00235
00236
00237 };
00238
00239
00240
00241
00242 AnalysisBuilder<MC_ZZJETS> plugin_MC_ZZJETS;
00243
00244 }