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