rivet is hosted by Hepforge, IPPP Durham
CMS_2013_I1256943.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/UnstableFinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009   using namespace Cuts;
00010 
00011 
00012   /// CMS cross-section and angular correlations in Z boson + b-hadrons events at 7 TeV
00013   class CMS_2013_I1256943 : public Analysis {
00014   public:
00015 
00016     /// Constructor
00017     CMS_2013_I1256943()
00018       : Analysis("CMS_2013_I1256943")
00019     {     }
00020 
00021 
00022     /// Add projections and book histograms
00023     void init() {
00024       _sumW = 0;
00025       _sumW50 = 0;
00026       _sumWpT = 0;
00027 
00028       FinalState fs(-2.4, 2.4, 20.0*GeV);
00029       addProjection(fs, "FS");
00030 
00031       UnstableFinalState ufs(-2, 2, 15.0*GeV);
00032       addProjection(ufs, "UFS");
00033 
00034       Cut etacut = etaIn(-2.4, 2.4);
00035 
00036       ZFinder zfindermu(fs, etacut, PID::MUON, 81.0*GeV, 101.0*GeV, 0.1, ZFinder::NOCLUSTER, ZFinder::TRACK, 91.2*GeV);
00037       addProjection(zfindermu, "ZFinderMu");
00038 
00039       ZFinder zfinderel(fs, etacut, PID::ELECTRON, 81.0*GeV, 101.0*GeV, 0.1, ZFinder::NOCLUSTER, ZFinder::TRACK, 91.2*GeV);
00040       addProjection(zfinderel, "ZFinderEl");
00041 
00042       /// Histograms in non-boosted region of Z pT
00043       _h_dR_BB = bookHisto1D(1, 1, 1);
00044       _h_dphi_BB = bookHisto1D(2, 1, 1);
00045       _h_min_dR_ZB = bookHisto1D(3, 1, 1);
00046       _h_A_ZBB = bookHisto1D(4, 1, 1);
00047 
00048       /// Histograms in boosted region of Z pT (pT > 50 GeV)
00049       _h_dR_BB_boost = bookHisto1D(5, 1, 1);
00050       _h_dphi_BB_boost = bookHisto1D(6, 1, 1);
00051       _h_min_dR_ZB_boost = bookHisto1D(7, 1, 1);
00052       _h_A_ZBB_boost = bookHisto1D(8, 1, 1);
00053 
00054       _h_min_ZpT = bookHisto1D(9,1,1);
00055     }
00056 
00057 
00058     /// Do the analysis
00059     void analyze(const Event& e) {
00060       vector<FourMomentum> Bmom;
00061 
00062       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS");
00063       const ZFinder& zfindermu = applyProjection<ZFinder>(e, "ZFinderMu");
00064       const ZFinder& zfinderel = applyProjection<ZFinder>(e, "ZFinderEl");
00065 
00066       // Look for a Z --> mu+ mu- event in the final state
00067       if (zfindermu.empty() && zfinderel.empty()) vetoEvent;
00068 
00069       const Particles& z = !zfindermu.empty() ? zfindermu.bosons() : zfinderel.bosons();
00070       const bool is_boosted = ( z[0].pT() > 50*GeV );
00071 
00072       // Loop over the unstable particles
00073       foreach (const Particle& p, ufs.particles()) {
00074         const PdgId pid = p.pid();
00075 
00076         // Look for particles with a bottom quark
00077         if (PID::hasBottom(pid)) {
00078 
00079           bool good_B = false;
00080           const HepMC::GenParticle* pgen = p.genParticle();
00081           HepMC::GenVertex* vgen = pgen -> end_vertex();
00082 
00083           // Loop over the decay products of each unstable particle.
00084           // Look for a couple of B hadrons.
00085           for (HepMC::GenVertex::particles_out_const_iterator it = vgen->particles_out_const_begin(); it !=  vgen->particles_out_const_end(); ++it) {
00086             // If the particle produced has a bottom quark do not count it and go to the next loop cycle.
00087             if (!( PID::hasBottom( (*it)->pdg_id() ) ) ) {
00088               good_B = true;
00089               continue;
00090             } else {
00091               good_B = false;
00092               break;
00093             }
00094           }
00095           if (good_B ) Bmom.push_back( p.momentum() );
00096         }
00097         else continue;
00098       }
00099 
00100       // If there are more than two B's in the final state veto the event
00101       if (Bmom.size() != 2 ) vetoEvent;
00102 
00103       // Calculate the observables
00104       double dphiBB = fabs(Bmom[0].phi() - Bmom[1].phi());
00105       double dRBB = deltaR(Bmom[0], Bmom[1]);
00106 
00107       const FourMomentum& pZ = z[0].momentum();
00108       const bool closest_B = ( deltaR(pZ, Bmom[0]) < deltaR(pZ, Bmom[1]) );
00109       const double mindR_ZB = closest_B ? deltaR(pZ, Bmom[0]) : deltaR(pZ, Bmom[1]);
00110       const double maxdR_ZB = closest_B ? deltaR(pZ, Bmom[1]) : deltaR(pZ, Bmom[0]);
00111       const double AZBB = ( maxdR_ZB - mindR_ZB ) / ( maxdR_ZB + mindR_ZB );
00112 
00113       // Get event weight for histogramming
00114       const double weight = e.weight();
00115 
00116       // Fill the histograms in the non-boosted region
00117       _h_dphi_BB->fill(dphiBB, weight);
00118       _h_dR_BB->fill(dRBB, weight);
00119       _h_min_dR_ZB->fill(mindR_ZB, weight);
00120       _h_A_ZBB->fill(AZBB, weight);
00121       _sumW += weight;
00122       _sumWpT += weight;
00123 
00124       // Fill the histograms in the boosted region
00125       if (is_boosted) {
00126         _sumW50 += weight;
00127         _h_dphi_BB_boost->fill(dphiBB, weight);
00128         _h_dR_BB_boost->fill(dRBB, weight);
00129         _h_min_dR_ZB_boost->fill(mindR_ZB, weight);
00130         _h_A_ZBB_boost->fill(AZBB, weight);
00131       }
00132 
00133       // Fill Z pT (cumulative) histogram
00134       _h_min_ZpT->fill(0, weight);
00135       if (pZ.pT() > 40*GeV ) {
00136         _sumWpT += weight;
00137         _h_min_ZpT->fill(40, weight);
00138       }
00139       if (pZ.pT() > 80*GeV ) {
00140         _sumWpT += weight;
00141         _h_min_ZpT->fill(80, weight);
00142       }
00143       if (pZ.pT() > 120*GeV ) {
00144         _sumWpT += weight;
00145         _h_min_ZpT->fill(120, weight);
00146       }
00147 
00148       Bmom.clear();
00149     }
00150 
00151 
00152     /// Finalize
00153     void finalize() {
00154 
00155       // Normalize excluding overflow bins (d'oh)
00156       normalize(_h_dR_BB, 0.7*crossSection()*_sumW/sumOfWeights(), false);  // d01-x01-y01
00157       normalize(_h_dphi_BB, 0.53*crossSection()*_sumW/sumOfWeights(), false);   // d02-x01-y01
00158       normalize(_h_min_dR_ZB, 0.84*crossSection()*_sumW/sumOfWeights(), false); // d03-x01-y01
00159       normalize(_h_A_ZBB, 0.2*crossSection()*_sumW/sumOfWeights(), false);  // d04-x01-y01
00160 
00161       normalize(_h_dR_BB_boost, 0.84*crossSection()*_sumW50/sumOfWeights(), false); // d05-x01-y01
00162       normalize(_h_dphi_BB_boost, 0.63*crossSection()*_sumW50/sumOfWeights(), false);   // d06-x01-y01
00163       normalize(_h_min_dR_ZB_boost, 1*crossSection()*_sumW50/sumOfWeights(), false);    // d07-x01-y01
00164       normalize(_h_A_ZBB_boost, 0.25*crossSection()*_sumW50/sumOfWeights(), false); // d08-x01-y01
00165 
00166       normalize(_h_min_ZpT, 40*crossSection()*_sumWpT/sumOfWeights(), false);   // d09-x01-y01
00167     }
00168 
00169 
00170   private:
00171 
00172     /// @name Weight counters
00173     //@{
00174     double _sumW, _sumW50, _sumWpT;
00175     //@}
00176 
00177     /// @name Histograms
00178     //@{
00179     Histo1DPtr _h_dphi_BB, _h_dR_BB, _h_min_dR_ZB, _h_A_ZBB;
00180     Histo1DPtr _h_dphi_BB_boost, _h_dR_BB_boost, _h_min_dR_ZB_boost, _h_A_ZBB_boost, _h_min_ZpT;
00181     //@}
00182 
00183   };
00184 
00185 
00186   // Hook for the plugin system
00187   DECLARE_RIVET_PLUGIN(CMS_2013_I1256943);
00188 
00189 }