MC_DIJET.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/RivetYODA.hh" 00004 #include "Rivet/Projections/FinalState.hh" 00005 #include "Rivet/Projections/ChargedFinalState.hh" 00006 #include "Rivet/Projections/FastJets.hh" 00007 00008 namespace Rivet { 00009 00010 00011 /// @brief MC validation analysis for di-jet events 00012 class MC_DIJET : public Analysis { 00013 public: 00014 00015 /// Default constructor 00016 MC_DIJET() : Analysis("MC_DIJET") 00017 { } 00018 00019 00020 /// @name Analysis methods 00021 //@{ 00022 00023 void init() { 00024 FinalState fs(-4, 4, 0.5*GeV); 00025 ChargedFinalState cfs(fs); 00026 addProjection(fs, "FS"); 00027 addProjection(cfs, "CFS"); 00028 addProjection(FastJets(fs, FastJets::ANTIKT, 0.7), "Jets"); 00029 addProjection(FastJets(cfs, FastJets::ANTIKT, 0.7), "ChargedJets"); 00030 00031 _hist_jetcount = bookHisto1D("d01-x01-y01", 5, 0., 10.); 00032 _hist_jetpt = bookHisto1D("d02-x01-y01", 30, 30.,100.); 00033 _hist_jetptlog = bookHisto1D("d03-x01-y01", 20, 0.,8.); 00034 _hist_leadingjetpt = bookHisto1D("d04-x01-y01", 25, 30.,100.); 00035 _hist_secondleadingjetpt = bookHisto1D("d05-x01-y01", 25, 30.,100.); 00036 _hist_jetphi = bookHisto1D("d06-x01-y01",24, 0., 6.4); 00037 _hist_jeteta = bookHisto1D("d07-x01-y01", 30, -6., 6.); 00038 _hist_jetdphi = bookHisto1D("d08-x01-y01", 24, 0., 6.4); 00039 _hist_jetdeta = bookHisto1D("d09-x01-y01", 24, 0., 6.); 00040 _hist_chargemultiplicity = bookHisto1D("d10-x01-y01",30, 0.5, 250.5); 00041 _hist_chargemeanpt = bookHisto1D("d11-x01-y01", 25, 0., 10.); 00042 _hist_chargept = bookHisto1D("d12-x01-y01", 32, 0., 25.); 00043 _hist_chargelogpt = bookHisto1D("d13-x01-y01", 32, 0., 6.); 00044 _hist_chargermspt = bookHisto1D("d14-x01-y01", 32, 0., 10.); 00045 } 00046 00047 00048 void analyze(const Event& event) { 00049 const FastJets& fastjets = applyProjection<FastJets>(event, "Jets"); 00050 const Jets jets = fastjets.jetsByPt(20.*GeV); 00051 const double weight = event.weight(); 00052 00053 if (jets.size() < 2 || jets.size() >= 3) vetoEvent; 00054 const double angle = fabs(jets[1].momentum().azimuthalAngle() - jets[0].momentum().azimuthalAngle()); 00055 const double prapidity = fabs(jets[1].momentum().pseudorapidity() - jets[0].momentum().pseudorapidity()); 00056 _hist_jetcount->fill(jets.size(), weight); 00057 _hist_leadingjetpt->fill(jets[0].momentum().pT(), weight); 00058 _hist_secondleadingjetpt->fill(jets[1].momentum().pT(), weight); 00059 _hist_jetdphi->fill(angle , weight); 00060 _hist_jetdeta->fill(prapidity, weight); 00061 00062 foreach(Jet j, fastjets.jetsByPt(20.*GeV)) { 00063 _hist_jetpt->fill(j.momentum().pT(), weight); 00064 _hist_jetptlog->fill(log(j.momentum().pT()), weight); 00065 _hist_jetphi->fill(j.momentum().azimuthalAngle(), weight); 00066 _hist_jeteta->fill(j.momentum().pseudorapidity(), weight); 00067 } 00068 00069 const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); 00070 // const FastJets& cfastjets = applyProjection<FastJets>(event, "ChargedJets"); 00071 double meanpt(0), rmspt(0); 00072 /// @todo Add jets 00073 // foreach(Jet cj, cfastjets.jetsByPt(20.*GeV)){ 00074 _hist_chargemultiplicity->fill(cfs.particles().size(), weight); 00075 foreach(Particle cp, cfs.particles()) { 00076 meanpt= meanpt + cp.momentum().pT(); 00077 rmspt = rmspt + (cp.momentum().pT()*cp.momentum().pT()); 00078 _hist_chargept->fill(cp.momentum().pT(), weight); 00079 _hist_chargelogpt->fill(log(cp.momentum().pT()), weight); 00080 } 00081 meanpt = meanpt / cfs.particles().size(); 00082 _hist_chargemeanpt->fill(meanpt, weight); 00083 rmspt = sqrt(rmspt / cfs.particles().size()); 00084 _hist_chargermspt->fill(rmspt, weight); 00085 // } 00086 } 00087 00088 00089 void finalize() { 00090 /// @todo Normalise! 00091 } 00092 00093 //@} 00094 00095 00096 private: 00097 00098 Histo1DPtr _hist_jetcount; 00099 Histo1DPtr _hist_jetpt; 00100 Histo1DPtr _hist_jetptlog; 00101 Histo1DPtr _hist_leadingjetpt; 00102 Histo1DPtr _hist_secondleadingjetpt; 00103 Histo1DPtr _hist_jetphi; 00104 Histo1DPtr _hist_jetdphi; 00105 Histo1DPtr _hist_jeteta; 00106 Histo1DPtr _hist_jetdeta; 00107 Histo1DPtr _hist_chargemultiplicity; 00108 Histo1DPtr _hist_chargemeanpt; 00109 Histo1DPtr _hist_chargept; 00110 Histo1DPtr _hist_chargelogpt; 00111 Histo1DPtr _hist_chargermspt; 00112 00113 }; 00114 00115 00116 00117 // The hook for the plugin system 00118 DECLARE_RIVET_PLUGIN(MC_DIJET); 00119 00120 } Generated on Fri Dec 21 2012 15:03:41 for The Rivet MC analysis system by ![]() |