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