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