ATLAS_2012_I1082009.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/IdentifiedFinalState.hh" 00004 #include "Rivet/Projections/VetoedFinalState.hh" 00005 #include "Rivet/Projections/MissingMomentum.hh" 00006 #include "Rivet/Projections/FastJets.hh" 00007 #include "Rivet/Projections/LeadingParticlesFinalState.hh" 00008 #include "Rivet/Projections/UnstableFinalState.hh" 00009 00010 namespace Rivet { 00011 00012 00013 class ATLAS_2012_I1082009 : public Analysis { 00014 public: 00015 00016 /// @name Constructors etc. 00017 //@{ 00018 00019 /// Constructor 00020 ATLAS_2012_I1082009() 00021 : Analysis("ATLAS_2012_I1082009"), 00022 _weight25_30(0.),_weight30_40(0.),_weight40_50(0.), 00023 _weight50_60(0.),_weight60_70(0.),_weight25_70(0.) 00024 { } 00025 00026 //@} 00027 00028 00029 public: 00030 00031 /// @name Analysis methods 00032 //@{ 00033 00034 /// Book histograms and initialise projections before the run 00035 void init() { 00036 00037 // Input for the jets: No neutrinos, no muons 00038 VetoedFinalState veto; 00039 veto.addVetoPairId(PID::MUON); 00040 veto.vetoNeutrinos(); 00041 FastJets jets(veto, FastJets::ANTIKT, 0.6); 00042 addProjection(jets, "jets"); 00043 // unstable final-state for D* 00044 addProjection(UnstableFinalState(), "UFS"); 00045 00046 _h_pt25_30 = bookHisto1D( 8,1,1); 00047 _h_pt30_40 = bookHisto1D( 9,1,1); 00048 _h_pt40_50 = bookHisto1D(10,1,1); 00049 _h_pt50_60 = bookHisto1D(11,1,1); 00050 _h_pt60_70 = bookHisto1D(12,1,1); 00051 _h_pt25_70 = bookHisto1D(13,1,1); 00052 } 00053 00054 00055 /// Perform the per-event analysis 00056 void analyze(const Event& event) { 00057 const double weight = event.weight(); 00058 00059 // get the jets 00060 Jets jets; 00061 foreach (const Jet& jet, applyProjection<FastJets>(event, "jets").jetsByPt(25.0*GeV)) { 00062 if ( jet.abseta() < 2.5 ) jets.push_back(jet); 00063 } 00064 // get the D* mesons 00065 const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(event, "UFS"); 00066 Particles Dstar; 00067 foreach (const Particle& p, ufs.particles()) { 00068 const int id = p.abspid(); 00069 if(id==413) Dstar.push_back(p); 00070 } 00071 00072 // loop over the jobs 00073 foreach (const Jet& jet, jets ) { 00074 double perp = jet.perp(); 00075 bool found = false; 00076 double z(0.); 00077 if(perp<25.||perp>70.) continue; 00078 foreach(const Particle & p, Dstar) { 00079 if(p.perp()<7.5) continue; 00080 if(deltaR(p, jet.momentum())<0.6) { 00081 Vector3 axis = jet.p3().unit(); 00082 z = axis.dot(p.p3())/jet.E(); 00083 if(z<0.3) continue; 00084 found = true; 00085 break; 00086 } 00087 } 00088 _weight25_70 += weight; 00089 if(found) _h_pt25_70->fill(z,weight); 00090 if(perp>=25.&&perp<30.) { 00091 _weight25_30 += weight; 00092 if(found) _h_pt25_30->fill(z,weight); 00093 } 00094 else if(perp>=30.&&perp<40.) { 00095 _weight30_40 += weight; 00096 if(found) _h_pt30_40->fill(z,weight); 00097 } 00098 else if(perp>=40.&&perp<50.) { 00099 _weight40_50 += weight; 00100 if(found) _h_pt40_50->fill(z,weight); 00101 } 00102 else if(perp>=50.&&perp<60.) { 00103 _weight50_60 += weight; 00104 if(found) _h_pt50_60->fill(z,weight); 00105 } 00106 else if(perp>=60.&&perp<70.) { 00107 _weight60_70 += weight; 00108 if(found) _h_pt60_70->fill(z,weight); 00109 } 00110 } 00111 } 00112 00113 00114 /// Normalise histograms etc., after the run 00115 void finalize() { 00116 scale(_h_pt25_30,1./_weight25_30); 00117 scale(_h_pt30_40,1./_weight30_40); 00118 scale(_h_pt40_50,1./_weight40_50); 00119 scale(_h_pt50_60,1./_weight50_60); 00120 scale(_h_pt60_70,1./_weight60_70); 00121 scale(_h_pt25_70,1./_weight25_70); 00122 } 00123 00124 //@} 00125 00126 00127 private: 00128 00129 /// @name Histograms 00130 //@{ 00131 double _weight25_30,_weight30_40,_weight40_50; 00132 double _weight50_60,_weight60_70,_weight25_70; 00133 00134 Histo1DPtr _h_pt25_30; 00135 Histo1DPtr _h_pt30_40; 00136 Histo1DPtr _h_pt40_50; 00137 Histo1DPtr _h_pt50_60; 00138 Histo1DPtr _h_pt60_70; 00139 Histo1DPtr _h_pt25_70; 00140 //@} 00141 00142 }; 00143 00144 // The hook for the plugin system 00145 DECLARE_RIVET_PLUGIN(ATLAS_2012_I1082009); 00146 00147 } Generated on Thu Mar 10 2016 08:29:47 for The Rivet MC analysis system by ![]() |