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 const ZFinder zfe(fs, -2.4, 2.4, 20*GeV, PID::ELECTRON, 71*GeV, 111*GeV); 00027 const ZFinder zfm(fs, -2.4, 2.4, 20*GeV, PID::ELECTRON, 71*GeV, 111*GeV); 00028 addProjection(zfe, "ZFE"); 00029 addProjection(zfm, "ZFM"); 00030 // Jets 00031 const FastJets jets(fs, FastJets::ANTIKT, 0.5); 00032 addProjection(jets, "JETS"); 00033 00034 // Book histograms from data 00035 for (size_t i = 0; i < 2; ++i) { 00036 _histDeltaPhiZJ1_1[i] = bookHisto1D(1, 1, 1); 00037 _histDeltaPhiZJ1_2[i] = bookHisto1D(2, 1, 1); 00038 _histDeltaPhiZJ1_3[i] = bookHisto1D(4, 1, 1); 00039 _histDeltaPhiZJ2_3[i] = bookHisto1D(5, 1, 1); 00040 _histDeltaPhiZJ3_3[i] = bookHisto1D(3, 1, 1); 00041 _histDeltaPhiJ1J2_3[i] = bookHisto1D(6, 1, 1); 00042 _histDeltaPhiJ1J3_3[i] = bookHisto1D(7, 1, 1); 00043 _histDeltaPhiJ2J3_3[i] = bookHisto1D(8, 1, 1); 00044 _histTransvThrust[i] = bookHisto1D(9, 1, 1); 00045 } 00046 } 00047 00048 00049 void analyze(const Event& event) { 00050 const double weight = event.weight(); 00051 00052 // Apply the Z finders 00053 const ZFinder& zfe = applyProjection<ZFinder>(event, "ZFE"); 00054 const ZFinder& zfm = applyProjection<ZFinder>(event, "ZFM"); 00055 00056 // Choose the Z candidate (there must be one) 00057 if (zfe.empty() && zfm.empty()) vetoEvent; 00058 const ParticleVector& z = !zfm.empty() ? zfm.bosons() : zfe.bosons(); 00059 const ParticleVector& leptons = !zfm.empty() ? zfm.constituents() : zfe.constituents(); 00060 00061 // Determine whether we are in the boosted regime 00062 const bool is_boosted = (z[0].momentum().pT() > 150*GeV); 00063 00064 // Build the jets 00065 const FastJets& jetfs = applyProjection<FastJets>(event, "JETS"); 00066 const Jets& jets = jetfs.jetsByPt(50.*GeV, MAXDOUBLE, -2.5, 2.5); 00067 00068 // Clean the jets against the lepton candidates, as in the paper, with a deltaR cut of 0.4 against the clustered leptons 00069 vector<const Jet*> cleanedJets; 00070 for (size_t i = 0; i < jets.size(); ++i) { 00071 bool isolated = true; 00072 for (size_t j = 0; j < 2; ++j) { 00073 if (deltaR(leptons[j], jets[i]) < 0.4) { 00074 isolated = false; 00075 break; 00076 } 00077 } 00078 if (isolated) cleanedJets.push_back(&jets[i]); 00079 } 00080 00081 // Require at least 1 jet 00082 const unsigned int Njets = cleanedJets.size(); 00083 if (Njets < 1) vetoEvent; 00084 00085 // Now compute the thrust 00086 // Collect Z and jets transverse momenta to calculate transverse thrust 00087 vector<Vector3> momenta; 00088 momenta.clear(); 00089 Vector3 mom = z[0].momentum().p(); 00090 mom.setZ(0); 00091 momenta.push_back(mom); 00092 00093 for (size_t i = 0; i < cleanedJets.size(); ++i) { 00094 Vector3 mj = cleanedJets[i]->momentum().vector3(); 00095 mj.setZ(0); 00096 momenta.push_back(mj); 00097 } 00098 00099 // Define a macro to appropriately fill both unboosted and boosted histo versions 00100 #define FILLx2(HNAME, VAL) do { double x = VAL; for (size_t i = 0; i < 2; ++i) { \ 00101 if (i == 0 || is_boosted) HNAME[i]->fill(x, weight); } } while(0) 00102 00103 Thrust thrust; thrust.calc(momenta); 00104 const double T = thrust.thrust(); 00105 FILLx2(_histTransvThrust, log(max(1-T, 1e-6))); 00106 00107 const double dphiZJ1 = deltaPhi(z[0], *cleanedJets[0]); 00108 FILLx2(_histDeltaPhiZJ1_1, dphiZJ1); 00109 if (Njets > 1) { 00110 FILLx2(_histDeltaPhiZJ1_2, dphiZJ1); 00111 if (Njets > 2) { 00112 FILLx2(_histDeltaPhiZJ1_3, dphiZJ1); 00113 FILLx2(_histDeltaPhiZJ2_3, deltaPhi(z[0], *cleanedJets[1])); 00114 FILLx2(_histDeltaPhiZJ3_3, deltaPhi(z[0], *cleanedJets[2])); 00115 FILLx2(_histDeltaPhiJ1J2_3, deltaPhi(*cleanedJets[0], *cleanedJets[1])); 00116 FILLx2(_histDeltaPhiJ1J3_3, deltaPhi(*cleanedJets[0], *cleanedJets[2])); 00117 FILLx2(_histDeltaPhiJ2J3_3, deltaPhi(*cleanedJets[1], *cleanedJets[2])); 00118 } 00119 } 00120 } 00121 00122 00123 /// Normalizations 00124 /// @note Most of these data normalizations neglect the overflow bins 00125 void finalize() { 00126 for (size_t i = 0; i < 2; ++i) { 00127 normalize(_histDeltaPhiZJ1_1[i], 1, false); 00128 normalize(_histDeltaPhiZJ1_2[i], 1, false); 00129 normalize(_histDeltaPhiZJ1_3[i], 1, false); 00130 normalize(_histDeltaPhiZJ2_3[i], 1, false); 00131 normalize(_histDeltaPhiZJ3_3[i], 1, false); 00132 normalize(_histDeltaPhiJ1J2_3[i], 1, false); 00133 normalize(_histDeltaPhiJ1J3_3[i], 1, false); 00134 normalize(_histDeltaPhiJ2J3_3[i], 1, false); 00135 normalize(_histTransvThrust[i]); 00136 } 00137 } 00138 00139 00140 private: 00141 00142 // Arrays of unboosted/boosted histos 00143 Histo1DPtr _histDeltaPhiZJ1_1[2]; 00144 Histo1DPtr _histDeltaPhiZJ1_2[2]; 00145 Histo1DPtr _histDeltaPhiZJ1_3[2]; 00146 Histo1DPtr _histDeltaPhiZJ2_3[2]; 00147 Histo1DPtr _histDeltaPhiZJ3_3[2]; 00148 Histo1DPtr _histDeltaPhiJ1J2_3[2]; 00149 Histo1DPtr _histDeltaPhiJ1J3_3[2]; 00150 Histo1DPtr _histDeltaPhiJ2J3_3[2]; 00151 Histo1DPtr _histTransvThrust[2]; 00152 00153 }; 00154 00155 00156 DECLARE_RIVET_PLUGIN(CMS_2013_I1209721); 00157 00158 } Generated on Tue May 13 2014 11:38:27 for The Rivet MC analysis system by ![]() |