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       ZFinder zeefinder(fs, -3.5, 3.5, 25.0*GeV, PID::ELECTRON, 65.0*GeV, 115.0*GeV, 0.2, true, true);
00068       addProjection(zeefinder, "ZeeFinder");
00069       ZFinder zmmfinder(fs, -3.5, 3.5, 25.0*GeV, PID::MUON, 65.0*GeV, 115.0*GeV, 0.2, true, true);
00070       addProjection(zmmfinder, "ZmmFinder");
00071 
00072       WFinder wefinder(fs, -3.5, 3.5, 25.0*GeV, PID::ELECTRON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00073       addProjection(wefinder, "WeFinder");
00074       WFinder wmfinder(fs, -3.5, 3.5, 25.0*GeV, PID::MUON, 60.0*GeV, 100.0*GeV, 25.0*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 
00127       const WFinder& wefinder = applyProjection<WFinder>(event, "WeFinder");
00128       const WFinder& wmfinder = applyProjection<WFinder>(event, "WmFinder");
00129 
00130       Jets jets = applyProjection<FastJets>(event, "AntiKT04").jetsByPt(JETPTCUT);
00131 
00132       Particles vectorBosons = zeefinder.bosons();
00133       /// @todo Don't we have a neater vector concatenation?
00134       vectorBosons.insert(vectorBosons.end(), zmmfinder.bosons().begin(), zmmfinder.bosons().end());
00135       vectorBosons.insert(vectorBosons.end(), wefinder.bosons().begin(), wefinder.bosons().end());
00136       vectorBosons.insert(vectorBosons.end(), wmfinder.bosons().begin(), wmfinder.bosons().end());
00137 
00138       _h_Z_multiplicity->fill(zeefinder.bosons().size() + zmmfinder.bosons().size(), weight);
00139       _h_W_multiplicity->fill(wefinder.bosons().size() + wmfinder.bosons().size(), weight);
00140       _h_jet_multiplicity->fill(jets.size(), weight);
00141 
00142       // Identify the b-jets
00143       Jets bjets;
00144       foreach (const Jet& jet, jets) {
00145         const double jetEta = jet.eta();
00146         const double jetPhi = jet.momentum().phi();
00147         const double jetPt = jet.pT();
00148         _h_jet_eta->fill(jetEta, weight);
00149         _h_jet_phi->fill(jetPhi, weight);
00150         _h_jet_pT->fill(jetPt/GeV, weight);
00151 
00152         if (jet.containsBottom() && jet.pT() > JETPTCUT) {
00153           bjets.push_back(jet);
00154           _h_jet_b_jet_eta->fill( jetEta , weight );
00155           _h_jet_b_jet_phi->fill( jetPhi , weight );
00156           _h_jet_b_jet_pT->fill( jetPt , weight );
00157         }
00158       }
00159       _h_jet_b_jet_multiplicity->fill(bjets.size(), weight);
00160 
00161       // Plot vector boson properties
00162       foreach (const Particle& v, vectorBosons) {
00163         _h_VB_phi->fill(v.momentum().phi(), weight);
00164         _h_VB_pT->fill(v.pT(), weight);
00165         _h_VB_eta->fill(v.eta(), weight);
00166         _h_VB_mass->fill(v.momentum().mass(), weight);
00167       }
00168 
00169       // rest of analysis requires at least 1 b jets
00170       if(bjets.empty()) vetoEvent;
00171 
00172       // Construct Higgs candidates from pairs of b-jets
00173       for (size_t i = 0; i < bjets.size()-1; ++i) {
00174         for (size_t j = i+1; j < bjets.size(); ++j) {
00175           const Jet& jet1 = bjets[i];
00176           const Jet& jet2 = bjets[j];
00177 
00178           const double deltaEtaJJ = fabs(jet1.eta() - jet2.eta());
00179           const double deltaPhiJJ = deltaPhi(jet1.momentum(), jet2.momentum());
00180           const double deltaRJJ = deltaR(jet1.momentum(), jet2.momentum());
00181           const double deltaPtJJ = fabs(jet1.pT() - jet2.pT());
00182           _h_jet_bb_Delta_eta->fill(deltaEtaJJ, weight);
00183           _h_jet_bb_Delta_phi->fill(deltaPhiJJ, weight);
00184           _h_jet_bb_Delta_pT->fill(deltaPtJJ, weight);
00185           _h_jet_bb_Delta_R->fill(deltaRJJ, weight);
00186 
00187           const FourMomentum phiggs = jet1.momentum() + jet2.momentum();
00188           _h_jet_H_eta_using_bb->fill(phiggs.eta(), weight);
00189           _h_jet_H_mass_using_bb->fill(phiggs.mass(), weight);
00190           _h_jet_H_phi_using_bb->fill(phiggs.phi(), weight);
00191           _h_jet_H_pT_using_bb->fill(phiggs.pT(), weight);
00192 
00193           foreach (const Particle& v, vectorBosons) {
00194             const double deltaEtaVH = fabs(phiggs.eta() - v.eta());
00195             const double deltaPhiVH = deltaPhi(phiggs, v.momentum());
00196             const double deltaRVH = deltaR(phiggs, v.momentum());
00197             const double deltaPtVH = fabs(phiggs.pT() - v.pT());
00198             _h_jet_VBbb_Delta_eta->fill(deltaEtaVH, weight);
00199             _h_jet_VBbb_Delta_phi->fill(deltaPhiVH, weight);
00200             _h_jet_VBbb_Delta_pT->fill(deltaPtVH, weight);
00201             _h_jet_VBbb_Delta_R->fill(deltaRVH, weight);
00202 
00203             // Calculate boost angles
00204             const vector<double> angles = boostAngles(jet1.momentum(), jet2.momentum(), v.momentum());
00205             _h_jet_bVB_angle_Hframe->fill(angles[0], weight);
00206             _h_jet_bb_angle_Hframe->fill(angles[1], weight);
00207             _h_jet_bVB_cosangle_Hframe->fill(cos(angles[0]), weight);
00208             _h_jet_bb_cosangle_Hframe->fill(cos(angles[1]), weight);
00209           }
00210 
00211         }
00212       }
00213     }
00214 
00215 
00216     /// Normalise histograms etc., after the run
00217     void finalize() {
00218       scale(_h_jet_bb_Delta_eta, crossSection()/sumOfWeights());
00219       scale(_h_jet_bb_Delta_phi, crossSection()/sumOfWeights());
00220       scale(_h_jet_bb_Delta_pT, crossSection()/sumOfWeights());
00221       scale(_h_jet_bb_Delta_R, crossSection()/sumOfWeights());
00222       scale(_h_jet_b_jet_eta, crossSection()/sumOfWeights());
00223       scale(_h_jet_b_jet_multiplicity, crossSection()/sumOfWeights());
00224       scale(_h_jet_b_jet_phi, crossSection()/sumOfWeights());
00225       scale(_h_jet_b_jet_pT, crossSection()/sumOfWeights());
00226       scale(_h_jet_H_eta_using_bb, crossSection()/sumOfWeights());
00227       scale(_h_jet_H_mass_using_bb, crossSection()/sumOfWeights());
00228       scale(_h_jet_H_phi_using_bb, crossSection()/sumOfWeights());
00229       scale(_h_jet_H_pT_using_bb, crossSection()/sumOfWeights());
00230       scale(_h_jet_eta, crossSection()/sumOfWeights());
00231       scale(_h_jet_multiplicity, crossSection()/sumOfWeights());
00232       scale(_h_jet_phi, crossSection()/sumOfWeights());
00233       scale(_h_jet_pT, crossSection()/sumOfWeights());
00234       scale(_h_jet_VBbb_Delta_eta, crossSection()/sumOfWeights());
00235       scale(_h_jet_VBbb_Delta_phi, crossSection()/sumOfWeights());
00236       scale(_h_jet_VBbb_Delta_pT, crossSection()/sumOfWeights());
00237       scale(_h_jet_VBbb_Delta_R, crossSection()/sumOfWeights());
00238 
00239       scale(_h_VB_eta, crossSection()/sumOfWeights());
00240       scale(_h_VB_mass, crossSection()/sumOfWeights());
00241       scale(_h_Z_multiplicity, crossSection()/sumOfWeights());
00242       scale(_h_W_multiplicity, crossSection()/sumOfWeights());
00243       scale(_h_VB_phi, crossSection()/sumOfWeights());
00244       scale(_h_VB_pT, crossSection()/sumOfWeights());
00245 
00246       scale(_h_jet_bVB_angle_Hframe, crossSection()/sumOfWeights());
00247       scale(_h_jet_bb_angle_Hframe, crossSection()/sumOfWeights());
00248       scale(_h_jet_bVB_cosangle_Hframe, crossSection()/sumOfWeights());
00249       scale(_h_jet_bb_cosangle_Hframe, crossSection()/sumOfWeights());
00250     }
00251 
00252     //@}
00253 
00254 
00255   private:
00256 
00257     /// @name Histograms
00258     //@{
00259 
00260     Histo1DPtr _h_Z_multiplicity, _h_W_multiplicity;
00261     Histo1DPtr _h_jet_bb_Delta_eta, _h_jet_bb_Delta_phi, _h_jet_bb_Delta_pT, _h_jet_bb_Delta_R;
00262     Histo1DPtr _h_jet_b_jet_eta, _h_jet_b_jet_multiplicity, _h_jet_b_jet_phi, _h_jet_b_jet_pT;
00263     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;
00264     Histo1DPtr _h_jet_eta, _h_jet_multiplicity, _h_jet_phi, _h_jet_pT;
00265     Histo1DPtr _h_jet_VBbb_Delta_eta, _h_jet_VBbb_Delta_phi, _h_jet_VBbb_Delta_pT, _h_jet_VBbb_Delta_R;
00266     Histo1DPtr _h_VB_eta, _h_VB_mass, _h_VB_phi, _h_VB_pT;
00267     Histo1DPtr _h_jet_bVB_angle_Hframe, _h_jet_bb_angle_Hframe, _h_jet_bVB_cosangle_Hframe, _h_jet_bb_cosangle_Hframe;
00268     //Histo1DPtr _h_jet_cuts_bb_deltaR_v_HpT;
00269 
00270     //@}
00271 
00272   };
00273 
00274 
00275   // This global object acts as a hook for the plugin system
00276   DECLARE_RIVET_PLUGIN(MC_VH2BB);
00277 
00278 }