rivet is hosted by Hepforge, IPPP Durham
CMS_2012_PAS_QCD_11_010.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ChargedFinalState.hh"
00004 #include "Rivet/Projections/UnstableFinalState.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 
00007 namespace Rivet {
00008 
00009   class CMS_2012_PAS_QCD_11_010 : public Analysis {
00010   public:
00011 
00012     CMS_2012_PAS_QCD_11_010()
00013       : Analysis("CMS_2012_PAS_QCD_11_010")
00014     {  }
00015 
00016     void init() {
00017       const FastJets jets(ChargedFinalState(-2.5, 2.5, 0.5*GeV), FastJets::ANTIKT, 0.5);
00018       addProjection(jets, "Jets");
00019 
00020       const UnstableFinalState ufs(-2.0, 2.0, 0.6*GeV);
00021       addProjection(ufs, "UFS");
00022 
00023       _h_nTrans_Lambda     = bookProfile1D(1, 1, 1);
00024       _h_nTrans_Kaon       = bookProfile1D(2, 1, 1);
00025       _h_ptsumTrans_Lambda = bookProfile1D(3, 1, 1);
00026       _h_ptsumTrans_Kaon   = bookProfile1D(4, 1, 1);
00027     }
00028 
00029 
00030     void analyze(const Event& event) {
00031       const double weight = event.weight();
00032 
00033       Jets jets = applyProjection<FastJets>(event, "Jets").jetsByPt(1.0*GeV);
00034       if (jets.size() < 1) vetoEvent;
00035 
00036       if (fabs(jets[0].eta()) >= 2) { // cuts on leading jets
00037         vetoEvent;
00038       }
00039 
00040       FourMomentum p_lead = jets[0].momentum();
00041       const double pTlead  = p_lead.pT();
00042 
00043       const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(event, "UFS");
00044 
00045       int numTrans_Kaon = 0;
00046       int numTrans_Lambda = 0;
00047       double ptSumTrans_Kaon = 0.;
00048       double ptSumTrans_Lambda = 0.;
00049 
00050       foreach (const Particle& p, ufs.particles()) {
00051         double dphi = deltaPhi(p, p_lead);
00052         double pT = p.pT();
00053         const PdgId id = abs(p.pdgId());
00054 
00055         if (dphi > PI/3. && dphi < 2./3.*PI) {
00056           if (id == 310 && pT > 0.6*GeV) {
00057             ptSumTrans_Kaon += pT/GeV;
00058             numTrans_Kaon++;
00059           }
00060           else if (id == 3122 && pT > 1.5*GeV) {
00061             ptSumTrans_Lambda += pT/GeV;
00062             numTrans_Lambda++;
00063           }
00064         }
00065       }
00066 
00067       _h_nTrans_Kaon->fill(pTlead/GeV, numTrans_Kaon / (8.0 * PI/3.0), weight);
00068       _h_nTrans_Lambda->fill(pTlead/GeV, numTrans_Lambda / (8.0 * PI/3.0), weight);
00069       _h_ptsumTrans_Kaon->fill(pTlead/GeV, ptSumTrans_Kaon / (GeV * (8.0 * PI/3.0)), weight);
00070       _h_ptsumTrans_Lambda->fill(pTlead/GeV, ptSumTrans_Lambda / (GeV * (8.0 * PI/3.0)), weight);
00071     }
00072 
00073 
00074     void finalize() { }
00075 
00076   private:
00077 
00078     Profile1DPtr _h_nTrans_Kaon;
00079     Profile1DPtr _h_nTrans_Lambda;
00080     Profile1DPtr _h_ptsumTrans_Kaon;
00081     Profile1DPtr _h_ptsumTrans_Lambda;
00082 
00083   };
00084 
00085 
00086   // The hook for the plugin system
00087   DECLARE_RIVET_PLUGIN(CMS_2012_PAS_QCD_11_010);
00088 
00089 }