MC_VH2BB.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/RivetYODA.hh" 00004 #include "Rivet/Tools/Logging.hh" 00005 #include "Rivet/Projections/FinalState.hh" 00006 #include "Rivet/Tools/ParticleIdUtils.hh" 00007 #include "Rivet/Projections/ZFinder.hh" 00008 #include "Rivet/Projections/WFinder.hh" 00009 #include "Rivet/Projections/UnstableFinalState.hh" 00010 #include "Rivet/Projections/FastJets.hh" 00011 #include "Rivet/Math/LorentzTrans.hh" 00012 #include "Rivet/Math/Constants.hh" 00013 #include <cmath> 00014 #include <vector> 00015 00016 namespace Rivet { 00017 00018 00019 class MC_VH2BB : public Analysis { 00020 public: 00021 00022 /// @name Constructors etc. 00023 //@{ 00024 00025 /// Constructor 00026 MC_VH2BB() 00027 : Analysis("MC_VH2BB") 00028 { } 00029 00030 //@} 00031 00032 00033 public: 00034 00035 /// @name Analysis methods 00036 //@{ 00037 00038 vector<double> boostAngles(const FourMomentum& b1, const FourMomentum& b2, const FourMomentum& vb){ 00039 00040 // This should take in the four-momenta of two b's (jets/hadrons) and a vector boson, for the process VB*->VBH with H->bb 00041 // It should return the smallest angle between the virtual vector boson and one of the b's, in the rest frame of the Higgs boson. 00042 // It should also return (as the second element of the vector) the angle between the b's, in the rest frame of the Higgs boson. 00043 00044 FourMomentum higgsMomentum = b1 + b2; 00045 FourMomentum virtualVBMomentum = higgsMomentum + vb; 00046 00047 LorentzTransform lt( -higgsMomentum.boostVector() ); 00048 00049 FourMomentum virtualVBMomentumBOOSTED = lt.transform(virtualVBMomentum); 00050 FourMomentum b1BOOSTED = lt.transform(b1); 00051 FourMomentum b2BOOSTED = lt.transform(b2); 00052 00053 double angle1 = b1BOOSTED.angle(virtualVBMomentumBOOSTED); 00054 double angle2 = b2BOOSTED.angle(virtualVBMomentumBOOSTED); 00055 00056 double anglebb = b1BOOSTED.angle(b2BOOSTED); 00057 00058 vector<double> toReturn; 00059 toReturn.push_back(angle1 < angle2 ? angle1 : angle2); 00060 toReturn.push_back(anglebb); 00061 00062 return toReturn; 00063 } 00064 00065 00066 /// Book histograms and initialise projections before the run 00067 void init() { 00068 00069 FinalState fs; 00070 ZFinder zeefinder(fs, -3.5, 3.5, 25.0*GeV, ELECTRON, 65.0*GeV, 115.0*GeV, 0.2, true, true); 00071 addProjection(zeefinder, "ZeeFinder"); 00072 ZFinder zmmfinder(fs, -3.5, 3.5, 25.0*GeV, MUON, 65.0*GeV, 115.0*GeV, 0.2, true, true); 00073 addProjection(zmmfinder, "ZmmFinder"); 00074 00075 WFinder wefinder(fs, -3.5, 3.5, 25.0*GeV, ELECTRON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2); 00076 addProjection(wefinder, "WeFinder"); 00077 WFinder wmfinder(fs, -3.5, 3.5, 25.0*GeV, MUON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2); 00078 addProjection(wmfinder, "WmFinder"); 00079 00080 addProjection(fs, "FinalState"); 00081 addProjection(FastJets(fs, FastJets::ANTIKT, 0.4), "AntiKT04"); 00082 addProjection(FastJets(fs, FastJets::ANTIKT, 0.5), "AntiKT05"); 00083 addProjection(FastJets(fs, FastJets::ANTIKT, 0.6), "AntiKT06"); 00084 00085 /// Book histograms 00086 _h_jet_bb_Delta_eta = bookHisto1D("jet_bb_Delta_eta", 50, 0, 4); 00087 _h_jet_bb_Delta_phi = bookHisto1D("jet_bb_Delta_phi", 50, 0, M_PI); 00088 _h_jet_bb_Delta_pT = bookHisto1D("jet_bb_Delta_pT", 50,0, 500); 00089 _h_jet_bb_Delta_R = bookHisto1D("jet_bb_Delta_R", 50, 0, 5); 00090 _h_jet_b_jet_eta = bookHisto1D("jet_b_jet_eta", 50, -4, 4); 00091 _h_jet_b_jet_multiplicity = bookHisto1D("jet_b_jet_multiplicity", 11, -0.5, 10.5); 00092 _h_jet_b_jet_phi = bookHisto1D("jet_b_jet_phi", 50, 0, 2.*M_PI); 00093 _h_jet_b_jet_pT = bookHisto1D("jet_b_jet_pT", 50, 0, 500); 00094 _h_jet_H_eta_using_bb = bookHisto1D("jet_H_eta_using_bb", 50, -4, 4); 00095 _h_jet_H_mass_using_bb = bookHisto1D("jet_H_mass_using_bb", 50, 50, 200); 00096 _h_jet_H_phi_using_bb = bookHisto1D("jet_H_phi_using_bb", 50, 0, 2.*M_PI); 00097 _h_jet_H_pT_using_bb = bookHisto1D("jet_H_pT_using_bb", 50, 0, 500); 00098 _h_jet_eta = bookHisto1D("jet_eta", 50, -4, 4); 00099 _h_jet_multiplicity = bookHisto1D("jet_multiplicity", 11, -0.5, 10.5); 00100 _h_jet_phi = bookHisto1D("jet_phi", 50, 0, 2.*M_PI); 00101 _h_jet_pT = bookHisto1D("jet_pT", 50, 0, 500); 00102 _h_jet_VBbb_Delta_eta = bookHisto1D("jet_VBbb_Delta_eta", 50, 0, 4); 00103 _h_jet_VBbb_Delta_phi = bookHisto1D("jet_VBbb_Delta_phi", 50, 0, M_PI); 00104 _h_jet_VBbb_Delta_pT = bookHisto1D("jet_VBbb_Delta_pT", 50, 0, 500); 00105 _h_jet_VBbb_Delta_R = bookHisto1D("jet_VBbb_Delta_R", 50, 0, 8); 00106 00107 _h_VB_eta = bookHisto1D("VB_eta", 50, -4, 4); 00108 _h_VB_mass = bookHisto1D("VB_mass", 50, 60, 110); 00109 _h_Z_multiplicity = bookHisto1D("Z_multiplicity", 11, -0.5, 10.5); 00110 _h_W_multiplicity = bookHisto1D("W_multiplicity", 11, -0.5, 10.5); 00111 _h_VB_phi = bookHisto1D("VB_phi", 50, 0, 2.*M_PI); 00112 _h_VB_pT = bookHisto1D("VB_pT", 50, 0, 500); 00113 00114 _h_jet_bVB_angle_Hframe = bookHisto1D("jet_bVB_angle_Hframe", 50, 0, M_PI); 00115 _h_jet_bVB_cosangle_Hframe = bookHisto1D("jet_bVB_cosangle_Hframe", 50, -1, 1); 00116 _h_jet_bb_angle_Hframe = bookHisto1D("jet_bb_angle_Hframe", 50, 0, M_PI); 00117 _h_jet_bb_cosangle_Hframe = bookHisto1D("jet_bb_cosangle_Hframe", 50, -1, 1); 00118 } 00119 00120 00121 /// Perform the per-event analysis 00122 void analyze(const Event& event) { 00123 const double weight = event.weight(); 00124 00125 const double JETPTCUT = 30*GeV; 00126 00127 const ZFinder& zeefinder = applyProjection<ZFinder>(event, "ZeeFinder"); 00128 const ZFinder& zmmfinder = applyProjection<ZFinder>(event, "ZmmFinder"); 00129 00130 const WFinder& wefinder = applyProjection<WFinder>(event, "WeFinder"); 00131 const WFinder& wmfinder = applyProjection<WFinder>(event, "WmFinder"); 00132 00133 Jets jets = applyProjection<FastJets>(event, "AntiKT04").jetsByPt(JETPTCUT); 00134 00135 ParticleVector vectorBosons = zeefinder.bosons(); 00136 /// @todo Don't we have a neater vector concatenation? 00137 vectorBosons.insert(vectorBosons.end(), zmmfinder.bosons().begin(), zmmfinder.bosons().end()); 00138 vectorBosons.insert(vectorBosons.end(), wefinder.bosons().begin(), wefinder.bosons().end()); 00139 vectorBosons.insert(vectorBosons.end(), wmfinder.bosons().begin(), wmfinder.bosons().end()); 00140 00141 _h_Z_multiplicity->fill(zeefinder.bosons().size() + zmmfinder.bosons().size(), weight); 00142 _h_W_multiplicity->fill(wefinder.bosons().size() + wmfinder.bosons().size(), weight); 00143 _h_jet_multiplicity->fill(jets.size(), weight); 00144 00145 // Identify the b-jets 00146 Jets bjets; 00147 foreach (const Jet& jet, jets) { 00148 const double jetEta = jet.momentum().eta(); 00149 const double jetPhi = jet.momentum().phi(); 00150 const double jetPt = jet.momentum().pT(); 00151 _h_jet_eta->fill(jetEta, weight); 00152 _h_jet_phi->fill(jetPhi, weight); 00153 _h_jet_pT->fill(jetPt/GeV, weight); 00154 00155 if (jet.containsBottom() && jet.momentum().pT() > JETPTCUT) { 00156 bjets.push_back(jet); 00157 _h_jet_b_jet_eta->fill( jetEta , weight ); 00158 _h_jet_b_jet_phi->fill( jetPhi , weight ); 00159 _h_jet_b_jet_pT->fill( jetPt , weight ); 00160 } 00161 } 00162 _h_jet_b_jet_multiplicity->fill(bjets.size(), weight); 00163 00164 // Plot vector boson properties 00165 foreach (const Particle& v, vectorBosons) { 00166 _h_VB_phi->fill(v.momentum().phi(), weight); 00167 _h_VB_pT->fill(v.momentum().pT(), weight); 00168 _h_VB_eta->fill(v.momentum().eta(), weight); 00169 _h_VB_mass->fill(v.momentum().mass(), weight); 00170 } 00171 00172 // rest of analysis requires at least 1 b jets 00173 if(bjets.empty()) vetoEvent; 00174 00175 // Construct Higgs candidates from pairs of b-jets 00176 for (size_t i = 0; i < bjets.size()-1; ++i) { 00177 for (size_t j = i+1; j < bjets.size(); ++j) { 00178 const Jet& jet1 = bjets[i]; 00179 const Jet& jet2 = bjets[j]; 00180 00181 const double deltaEtaJJ = fabs(jet1.momentum().eta() - jet2.momentum().eta()); 00182 const double deltaPhiJJ = deltaPhi(jet1.momentum(), jet2.momentum()); 00183 const double deltaRJJ = deltaR(jet1.momentum(), jet2.momentum()); 00184 const double deltaPtJJ = fabs(jet1.momentum().pT() - jet2.momentum().pT()); 00185 _h_jet_bb_Delta_eta->fill(deltaEtaJJ, weight); 00186 _h_jet_bb_Delta_phi->fill(deltaPhiJJ, weight); 00187 _h_jet_bb_Delta_pT->fill(deltaPtJJ, weight); 00188 _h_jet_bb_Delta_R->fill(deltaRJJ, weight); 00189 00190 const FourMomentum phiggs = jet1.momentum() + jet2.momentum(); 00191 _h_jet_H_eta_using_bb->fill(phiggs.eta(), weight); 00192 _h_jet_H_mass_using_bb->fill(phiggs.mass(), weight); 00193 _h_jet_H_phi_using_bb->fill(phiggs.phi(), weight); 00194 _h_jet_H_pT_using_bb->fill(phiggs.pT(), weight); 00195 00196 foreach (const Particle& v, vectorBosons) { 00197 const double deltaEtaVH = fabs(phiggs.eta() - v.momentum().eta()); 00198 const double deltaPhiVH = deltaPhi(phiggs, v.momentum()); 00199 const double deltaRVH = deltaR(phiggs, v.momentum()); 00200 const double deltaPtVH = fabs(phiggs.pT() - v.momentum().pT()); 00201 _h_jet_VBbb_Delta_eta->fill(deltaEtaVH, weight); 00202 _h_jet_VBbb_Delta_phi->fill(deltaPhiVH, weight); 00203 _h_jet_VBbb_Delta_pT->fill(deltaPtVH, weight); 00204 _h_jet_VBbb_Delta_R->fill(deltaRVH, weight); 00205 00206 // Calculate boost angles 00207 const vector<double> angles = boostAngles(jet1.momentum(), jet2.momentum(), v.momentum()); 00208 _h_jet_bVB_angle_Hframe->fill(angles[0], weight); 00209 _h_jet_bb_angle_Hframe->fill(angles[1], weight); 00210 _h_jet_bVB_cosangle_Hframe->fill(cos(angles[0]), weight); 00211 _h_jet_bb_cosangle_Hframe->fill(cos(angles[1]), weight); 00212 } 00213 00214 } 00215 } 00216 } 00217 00218 00219 /// Normalise histograms etc., after the run 00220 void finalize() { 00221 scale(_h_jet_bb_Delta_eta, crossSection()/sumOfWeights()); 00222 scale(_h_jet_bb_Delta_phi, crossSection()/sumOfWeights()); 00223 scale(_h_jet_bb_Delta_pT, crossSection()/sumOfWeights()); 00224 scale(_h_jet_bb_Delta_R, crossSection()/sumOfWeights()); 00225 scale(_h_jet_b_jet_eta, crossSection()/sumOfWeights()); 00226 scale(_h_jet_b_jet_multiplicity, crossSection()/sumOfWeights()); 00227 scale(_h_jet_b_jet_phi, crossSection()/sumOfWeights()); 00228 scale(_h_jet_b_jet_pT, crossSection()/sumOfWeights()); 00229 scale(_h_jet_H_eta_using_bb, crossSection()/sumOfWeights()); 00230 scale(_h_jet_H_mass_using_bb, crossSection()/sumOfWeights()); 00231 scale(_h_jet_H_phi_using_bb, crossSection()/sumOfWeights()); 00232 scale(_h_jet_H_pT_using_bb, crossSection()/sumOfWeights()); 00233 scale(_h_jet_eta, crossSection()/sumOfWeights()); 00234 scale(_h_jet_multiplicity, crossSection()/sumOfWeights()); 00235 scale(_h_jet_phi, crossSection()/sumOfWeights()); 00236 scale(_h_jet_pT, crossSection()/sumOfWeights()); 00237 scale(_h_jet_VBbb_Delta_eta, crossSection()/sumOfWeights()); 00238 scale(_h_jet_VBbb_Delta_phi, crossSection()/sumOfWeights()); 00239 scale(_h_jet_VBbb_Delta_pT, crossSection()/sumOfWeights()); 00240 scale(_h_jet_VBbb_Delta_R, crossSection()/sumOfWeights()); 00241 00242 scale(_h_VB_eta, crossSection()/sumOfWeights()); 00243 scale(_h_VB_mass, crossSection()/sumOfWeights()); 00244 scale(_h_Z_multiplicity, crossSection()/sumOfWeights()); 00245 scale(_h_W_multiplicity, crossSection()/sumOfWeights()); 00246 scale(_h_VB_phi, crossSection()/sumOfWeights()); 00247 scale(_h_VB_pT, crossSection()/sumOfWeights()); 00248 00249 scale(_h_jet_bVB_angle_Hframe, crossSection()/sumOfWeights()); 00250 scale(_h_jet_bb_angle_Hframe, crossSection()/sumOfWeights()); 00251 scale(_h_jet_bVB_cosangle_Hframe, crossSection()/sumOfWeights()); 00252 scale(_h_jet_bb_cosangle_Hframe, crossSection()/sumOfWeights()); 00253 } 00254 00255 //@} 00256 00257 00258 private: 00259 00260 /// @name Histograms 00261 //@{ 00262 00263 Histo1DPtr _h_Z_multiplicity, _h_W_multiplicity; 00264 Histo1DPtr _h_jet_bb_Delta_eta, _h_jet_bb_Delta_phi, _h_jet_bb_Delta_pT, _h_jet_bb_Delta_R; 00265 Histo1DPtr _h_jet_b_jet_eta, _h_jet_b_jet_multiplicity, _h_jet_b_jet_phi, _h_jet_b_jet_pT; 00266 Histo1DPtr _h_jet_H_eta_using_bb, _h_jet_H_mass_using_bb, _h_jet_H_phi_using_bb, _h_jet_H_pT_using_bb; 00267 Histo1DPtr _h_jet_eta, _h_jet_multiplicity, _h_jet_phi, _h_jet_pT; 00268 Histo1DPtr _h_jet_VBbb_Delta_eta, _h_jet_VBbb_Delta_phi, _h_jet_VBbb_Delta_pT, _h_jet_VBbb_Delta_R; 00269 Histo1DPtr _h_VB_eta, _h_VB_mass, _h_VB_phi, _h_VB_pT; 00270 Histo1DPtr _h_jet_bVB_angle_Hframe, _h_jet_bb_angle_Hframe, _h_jet_bVB_cosangle_Hframe, _h_jet_bb_cosangle_Hframe; 00271 //Histo1DPtr _h_jet_cuts_bb_deltaR_v_HpT; 00272 00273 //@} 00274 00275 }; 00276 00277 00278 // This global object acts as a hook for the plugin system 00279 DECLARE_RIVET_PLUGIN(MC_VH2BB); 00280 00281 } Generated on Fri Dec 21 2012 15:03:41 for The Rivet MC analysis system by ![]() |