CMS_2014_I1303894.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/FastJets.hh" 00005 #include "Rivet/Projections/VetoedFinalState.hh" 00006 #include "Rivet/Projections/InvMassFinalState.hh" 00007 #include "Rivet/Projections/MissingMomentum.hh" 00008 #include "Rivet/Projections/WFinder.hh" 00009 #include "Rivet/Projections/DressedLeptons.hh" 00010 00011 namespace Rivet { 00012 00013 00014 /// @brief Differential cross-section of W bosons + jets in pp collisions at sqrt(s)=7 TeV 00015 /// @author Darin Baumgartel (darinb@cern.ch) 00016 /// 00017 /// Based on Rivet analysis originally created by Anil Singh (anil@cern.ch), Lovedeep Saini (lovedeep@cern.ch) 00018 class CMS_2014_I1303894 : public Analysis { 00019 public: 00020 00021 /// Constructor 00022 CMS_2014_I1303894() 00023 : Analysis("CMS_2014_I1303894") 00024 { } 00025 00026 00027 // Book histograms and initialise projections before the run 00028 void init() { 00029 // Projections 00030 const FinalState fs; 00031 addProjection(fs, "FS"); 00032 00033 MissingMomentum missing(fs); 00034 addProjection(missing, "MET"); 00035 00036 IdentifiedFinalState bareMuons(fs); 00037 bareMuons.acceptIdPair(PID::MUON); 00038 DressedLeptons muonClusters(fs, bareMuons, 0.1, Cuts::open(), false, false); 00039 addProjection(muonClusters, "muonClusters"); 00040 00041 IdentifiedFinalState neutrinos; 00042 neutrinos.acceptIdPair(PID::NU_MU); 00043 addProjection(neutrinos, "neutrinos"); 00044 00045 VetoedFinalState jetFS(fs); 00046 jetFS.addVetoOnThisFinalState(muonClusters); 00047 jetFS.addVetoOnThisFinalState(neutrinos); 00048 jetFS.vetoNeutrinos(); 00049 FastJets JetProjection(jetFS, FastJets::ANTIKT, 0.5); 00050 JetProjection.useInvisibles(false); 00051 addProjection(JetProjection, "Jets"); 00052 00053 // Histograms 00054 _histDPhiMuJet1 = bookHisto1D(1,1,1); 00055 _histDPhiMuJet2 = bookHisto1D(2,1,1); 00056 _histDPhiMuJet3 = bookHisto1D(3,1,1); 00057 _histDPhiMuJet4 = bookHisto1D(4,1,1); 00058 00059 _histEtaJet1 = bookHisto1D(5,1,1); 00060 _histEtaJet2 = bookHisto1D(6,1,1); 00061 _histEtaJet3 = bookHisto1D(7,1,1); 00062 _histEtaJet4 = bookHisto1D(8,1,1); 00063 00064 _histHT1JetInc = bookHisto1D(9,1,1); 00065 _histHT2JetInc = bookHisto1D(10,1,1); 00066 _histHT3JetInc = bookHisto1D(11,1,1); 00067 _histHT4JetInc = bookHisto1D(12,1,1); 00068 00069 _histJet30MultExc = bookHisto1D(13,1,1); 00070 _histJet30MultInc = bookHisto1D(14,1,1); 00071 00072 _histPtJet1 = bookHisto1D(15,1,1); 00073 _histPtJet2 = bookHisto1D(16,1,1); 00074 _histPtJet3 = bookHisto1D(17,1,1); 00075 _histPtJet4 = bookHisto1D(18,1,1); 00076 00077 // Counters 00078 _n_1jet = 0.0; 00079 _n_2jet = 0.0; 00080 _n_3jet = 0.0; 00081 _n_4jet = 0.0; 00082 _n_inclusivebinsummation = 0.0; 00083 } 00084 00085 00086 void analyze(const Event& event) { 00087 // Get the dressed muon 00088 const DressedLeptons& muonClusters = applyProjection<DressedLeptons>(event, "muonClusters"); 00089 int nmu = muonClusters.dressedLeptons().size(); 00090 if (nmu < 1) vetoEvent; 00091 DressedLepton dressedmuon = muonClusters.dressedLeptons()[0]; 00092 if (dressedmuon.momentum().abseta() > 2.1) vetoEvent; 00093 if (dressedmuon.momentum().pT() < 25.0*GeV) vetoEvent; 00094 00095 // Get the muon neutrino 00096 const Particles& neutrinos = applyProjection<FinalState>(event, "neutrinos").particlesByPt(); 00097 if (neutrinos.empty()) vetoEvent; 00098 00099 // Check that the muon and neutrino are not decay products of tau 00100 if (dressedmuon.constituentLepton().hasAncestor( PID::TAU)) vetoEvent; 00101 if (dressedmuon.constituentLepton().hasAncestor(-PID::TAU)) vetoEvent; 00102 if (dressedmuon.constituentLepton().hasAncestor( PID::NU_TAU)) vetoEvent; 00103 if (dressedmuon.constituentLepton().hasAncestor(-PID::NU_TAU)) vetoEvent; 00104 if (neutrinos[0].hasAncestor( PID::TAU)) vetoEvent; 00105 if (neutrinos[0].hasAncestor(-PID::TAU)) vetoEvent; 00106 if (neutrinos[0].hasAncestor( PID::NU_TAU)) vetoEvent; 00107 if (neutrinos[0].hasAncestor(-PID::NU_TAU)) vetoEvent; 00108 00109 // Recording of event weight and numbers 00110 const double weight = event.weight(); 00111 00112 // Get the missing momentum 00113 const MissingMomentum& met = applyProjection<MissingMomentum>(event, "MET"); 00114 const double ptmet = met.visibleMomentum().pT(); 00115 const double phimet = (-met.visibleMomentum()).phi(); 00116 00117 // Calculate MET and MT(mu,MET), and remove events with MT < 50 GeV 00118 const double ptmuon = dressedmuon.pT(); 00119 const double phimuon = dressedmuon.phi(); 00120 const double mt_mumet = sqrt(2*ptmuon*ptmet*(1.0 - cos(phimet-phimuon))); 00121 00122 // Remove events in MT < 50 region 00123 if (mt_mumet < 50*GeV) vetoEvent; 00124 00125 // Loop over jets and fill pt/eta/phi quantities in vectors 00126 const Jets& jets_filtered = applyProjection<FastJets>(event, "Jets").jetsByPt(0.0*GeV); 00127 vector<float> finaljet_pT_list, finaljet_eta_list, finaljet_phi_list; 00128 double htjets = 0.0; 00129 for (size_t ii = 0; ii < jets_filtered.size(); ++ii) { 00130 // Jet pT/eta/phi 00131 double jet_pt = jets_filtered[ii].pT(); 00132 double jet_eta = jets_filtered[ii].eta(); 00133 double jet_phi = jets_filtered[ii].phi(); 00134 00135 // Kinemetic cuts for jet acceptance 00136 if (fabs(jet_eta) > 2.4) continue; 00137 if (jet_pt < 30.0*GeV) continue; 00138 if (deltaR(dressedmuon, jets_filtered[ii]) < 0.5) continue; 00139 00140 // Add jet to jet list and increases the HT variable 00141 finaljet_pT_list.push_back(jet_pt); 00142 finaljet_eta_list.push_back(jet_eta); 00143 finaljet_phi_list.push_back(jet_phi); 00144 htjets += fabs(jet_pt); 00145 } 00146 00147 00148 // Filling of histograms: 00149 // Fill as many jets as there are into the exclusive jet multiplicity 00150 if (!finaljet_pT_list.empty()) 00151 _histJet30MultExc->fill(finaljet_pT_list.size(), weight); 00152 00153 for (size_t ij = 0; ij < finaljet_pT_list.size(); ++ij) { 00154 _histJet30MultInc->fill(ij+1, weight); 00155 _n_inclusivebinsummation += weight; 00156 } 00157 00158 if (finaljet_pT_list.size() >= 1) { 00159 _histPtJet1->fill(finaljet_pT_list[0],weight); 00160 _histEtaJet1->fill(fabs(finaljet_eta_list[0]), weight); 00161 _histDPhiMuJet1->fill(deltaPhi(finaljet_phi_list[0], phimuon),weight); 00162 _histHT1JetInc->fill(htjets, weight); 00163 _n_1jet +=weight; 00164 } 00165 00166 if (finaljet_pT_list.size() >= 2) { 00167 _histPtJet2->fill(finaljet_pT_list[1], weight); 00168 _histEtaJet2->fill(fabs(finaljet_eta_list[1]), weight); 00169 _histDPhiMuJet2->fill(deltaPhi(finaljet_phi_list[1], phimuon), weight); 00170 _histHT2JetInc->fill(htjets, weight); 00171 _n_2jet += weight; 00172 } 00173 00174 if (finaljet_pT_list.size() >= 3) { 00175 _histPtJet3->fill(finaljet_pT_list[2], weight); 00176 _histEtaJet3->fill(fabs(finaljet_eta_list[2]), weight); 00177 _histDPhiMuJet3->fill(deltaPhi(finaljet_phi_list[2], phimuon), weight); 00178 _histHT3JetInc->fill(htjets, weight); 00179 _n_3jet += weight; 00180 } 00181 00182 if (finaljet_pT_list.size() >=4 ) { 00183 _histPtJet4->fill(finaljet_pT_list[3], weight); 00184 _histEtaJet4->fill(fabs(finaljet_eta_list[3]), weight); 00185 _histDPhiMuJet4->fill(deltaPhi(finaljet_phi_list[3], phimuon), weight); 00186 _histHT4JetInc-> fill(htjets, weight); 00187 _n_4jet += weight; 00188 } 00189 00190 } 00191 00192 00193 // Finalize the histograms. 00194 void finalize() { 00195 00196 const double inclusive_cross_section = crossSection(); 00197 const double norm_1jet_histo = inclusive_cross_section*_n_1jet/sumOfWeights(); 00198 const double norm_2jet_histo = inclusive_cross_section*_n_2jet/sumOfWeights(); 00199 const double norm_3jet_histo = inclusive_cross_section*_n_3jet/sumOfWeights(); 00200 const double norm_4jet_histo = inclusive_cross_section*_n_4jet/sumOfWeights(); 00201 const double norm_incmultiplicity = inclusive_cross_section*_n_inclusivebinsummation/sumOfWeights(); 00202 00203 normalize(_histJet30MultExc, norm_1jet_histo); 00204 normalize(_histJet30MultInc, norm_incmultiplicity); 00205 00206 normalize(_histPtJet1, norm_1jet_histo); 00207 normalize(_histHT1JetInc, norm_1jet_histo); 00208 normalize(_histEtaJet1, norm_1jet_histo); 00209 normalize(_histDPhiMuJet1, norm_1jet_histo); 00210 00211 normalize(_histPtJet2, norm_2jet_histo); 00212 normalize(_histHT2JetInc, norm_2jet_histo); 00213 normalize(_histEtaJet2, norm_2jet_histo); 00214 normalize(_histDPhiMuJet2, norm_2jet_histo); 00215 00216 normalize(_histPtJet3, norm_3jet_histo); 00217 normalize(_histHT3JetInc, norm_3jet_histo); 00218 normalize(_histEtaJet3, norm_3jet_histo); 00219 normalize(_histDPhiMuJet3, norm_3jet_histo); 00220 00221 normalize(_histPtJet4, norm_4jet_histo); 00222 normalize(_histHT4JetInc, norm_4jet_histo); 00223 normalize(_histEtaJet4, norm_4jet_histo); 00224 normalize(_histDPhiMuJet4, norm_4jet_histo); 00225 } 00226 00227 00228 private: 00229 00230 Histo1DPtr _histJet30MultExc, _histJet30MultInc; 00231 Histo1DPtr _histPtJet1, _histPtJet2, _histPtJet3, _histPtJet4; 00232 Histo1DPtr _histEtaJet1, _histEtaJet2, _histEtaJet3, _histEtaJet4; 00233 Histo1DPtr _histDPhiMuJet1, _histDPhiMuJet2, _histDPhiMuJet3, _histDPhiMuJet4; 00234 Histo1DPtr _histHT1JetInc, _histHT2JetInc, _histHT3JetInc, _histHT4JetInc; 00235 00236 double _n_1jet, _n_2jet, _n_3jet, _n_4jet, _n_inclusivebinsummation; 00237 00238 }; 00239 00240 00241 DECLARE_RIVET_PLUGIN(CMS_2014_I1303894); 00242 00243 } Generated on Wed Oct 7 2015 12:09:12 for The Rivet MC analysis system by ![]() |