rivet is hosted by Hepforge, IPPP Durham
CMS_2013_I1209721.cc
Go to the documentation of this file.
00001 #include "Rivet/Analysis.hh"
00002 #include "Rivet/Tools/BinnedHistogram.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 #include "Rivet/Projections/ZFinder.hh"
00006 #include "Rivet/Projections/Thrust.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// CMS Z+jets delta(phi) and jet thrust measurement at 7 TeV
00012   class CMS_2013_I1209721 : public Analysis {
00013   public:
00014 
00015     CMS_2013_I1209721()
00016       : Analysis("CMS_2013_I1209721")
00017     {    }
00018 
00019 
00020     /// Book projections and histograms
00021     void init() {
00022       // Full final state
00023       const FinalState fs(-5.0,5.0);
00024       addProjection(fs, "FS");
00025       // Z finders for electrons and muons
00026       Cut cuts = EtaIn(-2.4,2.4) & (Cuts::pT >= 20.0*GeV);
00027       const ZFinder zfe(fs, cuts, PID::ELECTRON, 71*GeV, 111*GeV);
00028       const ZFinder zfm(fs, cuts, PID::ELECTRON, 71*GeV, 111*GeV);
00029       addProjection(zfe, "ZFE");
00030       addProjection(zfm, "ZFM");
00031       // Jets
00032       const FastJets jets(fs, FastJets::ANTIKT, 0.5);
00033       addProjection(jets, "JETS");
00034 
00035       // Book histograms from data
00036       for (size_t i = 0; i < 2; ++i) {
00037         _histDeltaPhiZJ1_1[i]  = bookHisto1D(1, 1, 1);
00038         _histDeltaPhiZJ1_2[i]  = bookHisto1D(2, 1, 1);
00039         _histDeltaPhiZJ1_3[i]  = bookHisto1D(4, 1, 1);
00040         _histDeltaPhiZJ2_3[i]  = bookHisto1D(5, 1, 1);
00041         _histDeltaPhiZJ3_3[i]  = bookHisto1D(3, 1, 1);
00042         _histDeltaPhiJ1J2_3[i] = bookHisto1D(6, 1, 1);
00043         _histDeltaPhiJ1J3_3[i] = bookHisto1D(7, 1, 1);
00044         _histDeltaPhiJ2J3_3[i] = bookHisto1D(8, 1, 1);
00045         _histTransvThrust[i]   = bookHisto1D(9, 1, 1);
00046       }
00047     }
00048 
00049 
00050     void analyze(const Event& event) {
00051       const double weight = event.weight();
00052 
00053       // Apply the Z finders
00054       const ZFinder& zfe = applyProjection<ZFinder>(event, "ZFE");
00055       const ZFinder& zfm = applyProjection<ZFinder>(event, "ZFM");
00056 
00057       // Choose the Z candidate (there must be one)
00058       if (zfe.empty() && zfm.empty()) vetoEvent;
00059       const ParticleVector& z = !zfm.empty() ? zfm.bosons() : zfe.bosons();
00060       const ParticleVector& leptons = !zfm.empty() ? zfm.constituents() : zfe.constituents();
00061 
00062       // Determine whether we are in the boosted regime
00063       const bool is_boosted = (z[0].momentum().pT() > 150*GeV);
00064 
00065       // Build the jets
00066       const FastJets& jetfs = applyProjection<FastJets>(event, "JETS");
00067       const Jets& jets = jetfs.jetsByPt(50.*GeV, MAXDOUBLE, -2.5, 2.5);
00068 
00069       // Clean the jets against the lepton candidates, as in the paper, with a deltaR cut of 0.4 against the clustered leptons
00070       vector<const Jet*> cleanedJets;
00071       for (size_t i = 0; i < jets.size(); ++i) {
00072         bool isolated = true;
00073         for (size_t j = 0; j < 2; ++j) {
00074           if (deltaR(leptons[j], jets[i]) < 0.4) {
00075             isolated = false;
00076             break;
00077           }
00078         }
00079         if (isolated) cleanedJets.push_back(&jets[i]);
00080       }
00081 
00082       // Require at least 1 jet
00083       const unsigned int Njets = cleanedJets.size();
00084       if (Njets < 1) vetoEvent;
00085 
00086       // Now compute the thrust
00087       // Collect Z and jets transverse momenta to calculate transverse thrust
00088       vector<Vector3> momenta;
00089       momenta.clear();
00090       Vector3 mom = z[0].momentum().p();
00091       mom.setZ(0);
00092       momenta.push_back(mom);
00093 
00094       for (size_t i = 0; i < cleanedJets.size(); ++i) {
00095         Vector3 mj = cleanedJets[i]->momentum().vector3();
00096         mj.setZ(0);
00097         momenta.push_back(mj);
00098       }
00099 
00100       // Define a macro to appropriately fill both unboosted and boosted histo versions
00101       #define FILLx2(HNAME, VAL) do { double x = VAL; for (size_t i = 0; i < 2; ++i) { \
00102         if (i == 0 || is_boosted) HNAME[i]->fill(x, weight); } } while(0)
00103 
00104       Thrust thrust; thrust.calc(momenta);
00105       const double T = thrust.thrust();
00106       FILLx2(_histTransvThrust, log(max(1-T, 1e-6)));
00107 
00108       const double dphiZJ1 = deltaPhi(z[0], *cleanedJets[0]);
00109       FILLx2(_histDeltaPhiZJ1_1, dphiZJ1);
00110       if (Njets > 1) {
00111         FILLx2(_histDeltaPhiZJ1_2, dphiZJ1);
00112         if (Njets > 2) {
00113           FILLx2(_histDeltaPhiZJ1_3, dphiZJ1);
00114           FILLx2(_histDeltaPhiZJ2_3, deltaPhi(z[0], *cleanedJets[1]));
00115           FILLx2(_histDeltaPhiZJ3_3, deltaPhi(z[0], *cleanedJets[2]));
00116           FILLx2(_histDeltaPhiJ1J2_3, deltaPhi(*cleanedJets[0], *cleanedJets[1]));
00117           FILLx2(_histDeltaPhiJ1J3_3, deltaPhi(*cleanedJets[0], *cleanedJets[2]));
00118           FILLx2(_histDeltaPhiJ2J3_3, deltaPhi(*cleanedJets[1], *cleanedJets[2]));
00119         }
00120       }
00121     }
00122 
00123 
00124     /// Normalizations
00125     /// @note Most of these data normalizations neglect the overflow bins
00126     void finalize() {
00127       for (size_t i = 0; i < 2; ++i) {
00128         normalize(_histDeltaPhiZJ1_1[i], 1, false);
00129         normalize(_histDeltaPhiZJ1_2[i], 1, false);
00130         normalize(_histDeltaPhiZJ1_3[i], 1, false);
00131         normalize(_histDeltaPhiZJ2_3[i], 1, false);
00132         normalize(_histDeltaPhiZJ3_3[i], 1, false);
00133         normalize(_histDeltaPhiJ1J2_3[i], 1, false);
00134         normalize(_histDeltaPhiJ1J3_3[i], 1, false);
00135         normalize(_histDeltaPhiJ2J3_3[i], 1, false);
00136         normalize(_histTransvThrust[i]);
00137       }
00138     }
00139 
00140 
00141   private:
00142 
00143     // Arrays of unboosted/boosted histos
00144     Histo1DPtr _histDeltaPhiZJ1_1[2];
00145     Histo1DPtr _histDeltaPhiZJ1_2[2];
00146     Histo1DPtr _histDeltaPhiZJ1_3[2];
00147     Histo1DPtr _histDeltaPhiZJ2_3[2];
00148     Histo1DPtr _histDeltaPhiZJ3_3[2];
00149     Histo1DPtr _histDeltaPhiJ1J2_3[2];
00150     Histo1DPtr _histDeltaPhiJ1J3_3[2];
00151     Histo1DPtr _histDeltaPhiJ2J3_3[2];
00152     Histo1DPtr _histTransvThrust[2];
00153 
00154   };
00155 
00156 
00157   DECLARE_RIVET_PLUGIN(CMS_2013_I1209721);
00158 
00159 }