ATLAS_2012_I1117704.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Tools/BinnedHistogram.hh" 00004 #include "Rivet/Projections/FinalState.hh" 00005 #include "Rivet/Projections/ChargedFinalState.hh" 00006 #include "Rivet/Projections/VisibleFinalState.hh" 00007 #include "Rivet/Projections/VetoedFinalState.hh" 00008 #include "Rivet/Projections/IdentifiedFinalState.hh" 00009 #include "Rivet/Projections/FastJets.hh" 00010 #include "Rivet/Tools/RivetMT2.hh" 00011 00012 namespace Rivet { 00013 00014 using namespace Cuts; 00015 00016 00017 class ATLAS_2012_I1117704 : public Analysis { 00018 public: 00019 00020 /// @name Constructors etc. 00021 //@{ 00022 00023 /// Constructor 00024 ATLAS_2012_I1117704() 00025 : Analysis("ATLAS_2012_I1117704") 00026 { } 00027 00028 //@} 00029 00030 00031 public: 00032 00033 /// @name Analysis methods 00034 //@{ 00035 00036 /// Book histograms and initialise projections before the run 00037 void init() { 00038 00039 // projection to find the electrons 00040 IdentifiedFinalState elecs(etaIn(-2.47, 2.47) & (pT >= 20.0*GeV)); 00041 elecs.acceptIdPair(PID::ELECTRON); 00042 addProjection(elecs, "elecs"); 00043 00044 // projection to find the muons 00045 IdentifiedFinalState muons(etaIn(-2.4, 2.4) & (pT >= 10.0*GeV)); 00046 muons.acceptIdPair(PID::MUON); 00047 addProjection(muons, "muons"); 00048 00049 // for pTmiss 00050 addProjection(VisibleFinalState(-4.9,4.9),"vfs"); 00051 00052 VetoedFinalState vfs; 00053 vfs.addVetoPairId(PID::MUON); 00054 00055 /// Jet finder 00056 addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4), 00057 "AntiKtJets04"); 00058 00059 // all tracks (to do deltaR with leptons) 00060 addProjection(ChargedFinalState(-3.0,3.0),"cfs"); 00061 00062 /// Book histograms 00063 _etmiss_HT_7j55 = bookHisto1D("etmiss_HT_7j55", 8, 0., 16.); 00064 _etmiss_HT_8j55 = bookHisto1D("etmiss_HT_8j55", 8, 0., 16.); 00065 _etmiss_HT_9j55 = bookHisto1D("etmiss_HT_9j55", 8, 0., 16.); 00066 _etmiss_HT_6j80 = bookHisto1D("etmiss_HT_6j80", 8, 0., 16.); 00067 _etmiss_HT_7j80 = bookHisto1D("etmiss_HT_7j80", 8, 0., 16.); 00068 _etmiss_HT_8j80 = bookHisto1D("etmiss_HT_8j80", 8, 0., 16.); 00069 00070 _hist_njet55 = bookHisto1D("hist_njet55", 11, 2.5, 13.5); 00071 _hist_njet80 = bookHisto1D("hist_njet80", 11, 2.5, 13.5); 00072 00073 _count_7j55 = bookHisto1D("count_7j55", 1, 0., 1.); 00074 _count_8j55 = bookHisto1D("count_8j55", 1, 0., 1.); 00075 _count_9j55 = bookHisto1D("count_9j55", 1, 0., 1.); 00076 _count_6j80 = bookHisto1D("count_6j80", 1, 0., 1.); 00077 _count_7j80 = bookHisto1D("count_7j80", 1, 0., 1.); 00078 _count_8j80 = bookHisto1D("count_8j80", 1, 0., 1.); 00079 00080 } 00081 00082 00083 /// Perform the per-event analysis 00084 void analyze(const Event& event) { 00085 const double weight = event.weight(); 00086 00087 // get the jet candidates 00088 Jets cand_jets; 00089 foreach (const Jet& jet, 00090 applyProjection<FastJets>(event, "AntiKtJets04").jetsByPt(20.0*GeV) ) { 00091 if ( fabs( jet.eta() ) < 2.8 ) { 00092 cand_jets.push_back(jet); 00093 } 00094 } 00095 00096 // candidate muons 00097 Particles cand_mu; 00098 Particles chg_tracks = 00099 applyProjection<ChargedFinalState>(event, "cfs").particles(); 00100 foreach ( const Particle & mu, 00101 applyProjection<IdentifiedFinalState>(event, "muons").particlesByPt() ) { 00102 double pTinCone = -mu.pT(); 00103 foreach ( const Particle & track, chg_tracks ) { 00104 if ( deltaR(mu.momentum(),track.momentum()) <= 0.2 ) 00105 pTinCone += track.pT(); 00106 } 00107 if ( pTinCone < 1.8*GeV ) 00108 cand_mu.push_back(mu); 00109 } 00110 00111 // candidate electrons 00112 Particles cand_e = 00113 applyProjection<IdentifiedFinalState>(event, "elecs").particlesByPt(); 00114 00115 // resolve jet/lepton ambiguity 00116 Jets recon_jets; 00117 foreach ( const Jet& jet, cand_jets ) { 00118 // candidates after |eta| < 2.8 00119 if ( fabs( jet.eta() ) >= 2.8 ) continue; 00120 bool away_from_e = true; 00121 foreach ( const Particle & e, cand_e ) { 00122 if ( deltaR(e.momentum(),jet.momentum()) <= 0.2 ) { 00123 away_from_e = false; 00124 break; 00125 } 00126 } 00127 if ( away_from_e ) recon_jets.push_back( jet ); 00128 } 00129 00130 // only keep electrons more than R=0.4 from jets 00131 Particles recon_e; 00132 foreach ( const Particle & e, cand_e ) { 00133 bool away = true; 00134 foreach ( const Jet& jet, recon_jets ) { 00135 if ( deltaR(e.momentum(),jet.momentum()) < 0.4 ) { 00136 away = false; 00137 break; 00138 } 00139 } 00140 if ( away ) 00141 recon_e.push_back( e ); 00142 } 00143 00144 // only keep muons more than R=0.4 from jets 00145 Particles recon_mu; 00146 foreach ( const Particle & mu, cand_mu ) { 00147 bool away = true; 00148 foreach ( const Jet& jet, recon_jets ) { 00149 if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 ) { 00150 away = false; 00151 break; 00152 } 00153 } 00154 if ( away ) 00155 recon_mu.push_back( mu ); 00156 } 00157 00158 // pTmiss 00159 Particles vfs_particles = 00160 applyProjection<VisibleFinalState>(event, "vfs").particles(); 00161 FourMomentum pTmiss; 00162 foreach ( const Particle & p, vfs_particles ) { 00163 pTmiss -= p.momentum(); 00164 } 00165 double eTmiss = pTmiss.pT(); 00166 00167 // now only use recon_jets, recon_mu, recon_e 00168 00169 // reject events with electrons and muons 00170 if ( ! ( recon_mu.empty() && recon_e.empty() ) ) { 00171 MSG_DEBUG("Charged leptons left after selection"); 00172 vetoEvent; 00173 } 00174 00175 // calculate H_T 00176 double HT=0; 00177 foreach ( const Jet& jet, recon_jets ) { 00178 if ( jet.pT() > 40 * GeV ) 00179 HT += jet.pT() ; 00180 } 00181 00182 // number of jets 00183 unsigned int njet55=0, njet80=0; 00184 for (unsigned int ix=0;ix<recon_jets.size();++ix) { 00185 if(recon_jets[ix].pT()>80.*GeV) ++njet80; 00186 if(recon_jets[ix].pT()>55.*GeV) ++njet55; 00187 } 00188 00189 if(njet55==0) vetoEvent; 00190 00191 double ratio = eTmiss/sqrt(HT); 00192 00193 if(ratio>4.) { 00194 _hist_njet55->fill(njet55,weight); 00195 _hist_njet80->fill(njet80,weight); 00196 // 7j55 00197 if(njet55>=7) 00198 _count_7j55->fill( 0.5, weight); 00199 // 8j55 00200 if(njet55>=8) 00201 _count_8j55->fill( 0.5, weight) ; 00202 // 8j55 00203 if(njet55>=9) 00204 _count_9j55->fill( 0.5, weight) ; 00205 // 6j80 00206 if(njet80>=6) 00207 _count_6j80->fill( 0.5, weight) ; 00208 // 7j80 00209 if(njet80>=7) 00210 _count_7j80->fill( 0.5, weight) ; 00211 // 8j80 00212 if(njet80>=8) 00213 _count_8j80->fill( 0.5, weight) ; 00214 } 00215 00216 if(njet55>=7) 00217 _etmiss_HT_7j55->fill( ratio, weight); 00218 // 8j55 00219 if(njet55>=8) 00220 _etmiss_HT_8j55->fill( ratio, weight) ; 00221 // 8j55 00222 if(njet55>=9) 00223 _etmiss_HT_9j55->fill( ratio, weight) ; 00224 // 6j80 00225 if(njet80>=6) 00226 _etmiss_HT_6j80->fill( ratio, weight) ; 00227 // 7j80 00228 if(njet80>=7) 00229 _etmiss_HT_7j80->fill( ratio, weight) ; 00230 // 8j80 00231 if(njet80>=8) 00232 _etmiss_HT_8j80->fill( ratio, weight) ; 00233 00234 } 00235 00236 //@} 00237 00238 void finalize() { 00239 double norm = crossSection()/femtobarn*4.7/sumOfWeights(); 00240 00241 scale(_etmiss_HT_7j55,2.*norm); 00242 scale(_etmiss_HT_8j55,2.*norm); 00243 scale(_etmiss_HT_9j55,2.*norm); 00244 scale(_etmiss_HT_6j80,2.*norm); 00245 scale(_etmiss_HT_7j80,2.*norm); 00246 scale(_etmiss_HT_8j80,2.*norm); 00247 00248 scale(_hist_njet55,norm); 00249 scale(_hist_njet80,norm); 00250 00251 scale(_count_7j55,norm); 00252 scale(_count_8j55,norm); 00253 scale(_count_9j55,norm); 00254 scale(_count_6j80,norm); 00255 scale(_count_7j80,norm); 00256 scale(_count_8j80,norm); 00257 } 00258 00259 private: 00260 00261 /// @name Histograms 00262 //@{ 00263 Histo1DPtr _etmiss_HT_7j55; 00264 Histo1DPtr _etmiss_HT_8j55; 00265 Histo1DPtr _etmiss_HT_9j55; 00266 Histo1DPtr _etmiss_HT_6j80; 00267 Histo1DPtr _etmiss_HT_7j80; 00268 Histo1DPtr _etmiss_HT_8j80; 00269 00270 Histo1DPtr _hist_njet55; 00271 Histo1DPtr _hist_njet80; 00272 00273 Histo1DPtr _count_7j55; 00274 Histo1DPtr _count_8j55; 00275 Histo1DPtr _count_9j55; 00276 Histo1DPtr _count_6j80; 00277 Histo1DPtr _count_7j80; 00278 Histo1DPtr _count_8j80; 00279 //@} 00280 00281 }; 00282 00283 // The hook for the plugin system 00284 DECLARE_RIVET_PLUGIN(ATLAS_2012_I1117704); 00285 00286 } Generated on Tue Sep 30 2014 19:45:42 for The Rivet MC analysis system by ![]() |