CMS_2012_I1107658.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/RivetYODA.hh" 00004 #include "Rivet/Projections/FinalState.hh" 00005 #include "Rivet/Projections/ZFinder.hh" 00006 #include "Rivet/Projections/FinalState.hh" 00007 #include "Rivet/Projections/ChargedFinalState.hh" 00008 #include "Rivet/Projections/VetoedFinalState.hh" 00009 #include "Rivet/ParticleName.hh" 00010 00011 namespace Rivet { 00012 00013 00014 class CMS_2012_I1107658 : public Analysis { 00015 public: 00016 00017 /// Constructor 00018 CMS_2012_I1107658() : Analysis("CMS_2012_I1107658") {} 00019 00020 void init() { 00021 00022 FinalState fs; 00023 ZFinder zfinder(fs, -2.4, 2.4, 20.0*GeV, MUON, 4.0*GeV, 140.0*GeV, 0.2, false, false); 00024 addProjection(zfinder, "ZFinder"); 00025 00026 ChargedFinalState cfs(-2.0, 2.0, 500*MeV); // For charged particles 00027 VetoedFinalState nonmuons(cfs); 00028 nonmuons.addVetoPairId(MUON); 00029 addProjection(nonmuons, "nonmuons"); 00030 00031 _h_Nchg_towards_pTmumu = bookProfile1D(1, 1, 1); 00032 _h_Nchg_transverse_pTmumu = bookProfile1D(2, 1, 1); 00033 _h_Nchg_away_pTmumu = bookProfile1D(3, 1, 1); 00034 _h_pTsum_towards_pTmumu = bookProfile1D(4, 1, 1); 00035 _h_pTsum_transverse_pTmumu = bookProfile1D(5, 1, 1); 00036 _h_pTsum_away_pTmumu = bookProfile1D(6, 1, 1); 00037 _h_avgpT_towards_pTmumu = bookProfile1D(7, 1, 1); 00038 _h_avgpT_transverse_pTmumu = bookProfile1D(8, 1, 1); 00039 _h_avgpT_away_pTmumu = bookProfile1D(9, 1, 1); 00040 _h_Nchg_towards_plus_transverse_Mmumu = bookProfile1D(10, 1, 1); 00041 _h_pTsum_towards_plus_transverse_Mmumu = bookProfile1D(11, 1, 1); 00042 _h_avgpT_towards_plus_transverse_Mmumu = bookProfile1D(12, 1, 1); 00043 _h_Nchg_towards_zmass_81_101 = bookHisto1D(13, 1, 1); 00044 _h_Nchg_transverse_zmass_81_101 = bookHisto1D(14, 1, 1); 00045 _h_Nchg_away_zmass_81_101 = bookHisto1D(15, 1, 1); 00046 _h_pT_towards_zmass_81_101 = bookHisto1D(16, 1, 1); 00047 _h_pT_transverse_zmass_81_101 = bookHisto1D(17, 1, 1); 00048 _h_pT_away_zmass_81_101 = bookHisto1D(18, 1, 1); 00049 _h_Nchg_transverse_zpt_5 = bookHisto1D(19, 1, 1); 00050 _h_pT_transverse_zpt_5 = bookHisto1D(20, 1, 1); 00051 } 00052 00053 00054 /// Perform the per-event analysis 00055 void analyze(const Event& event) { 00056 const double weight = event.weight(); 00057 const ZFinder& zfinder = applyProjection<ZFinder>(event, "ZFinder"); 00058 00059 if (zfinder.bosons().size() != 1) vetoEvent; 00060 00061 double Zpt = zfinder.bosons()[0].momentum().pT()/GeV; 00062 double Zphi = zfinder.bosons()[0].momentum().phi(); 00063 double Zmass = zfinder.bosons()[0].momentum().mass()/GeV; 00064 00065 ParticleVector particles = applyProjection<VetoedFinalState>(event, "nonmuons").particles(); 00066 00067 int nTowards = 0; 00068 int nTransverse = 0; 00069 int nAway = 0; 00070 double ptSumTowards = 0.0; 00071 double ptSumTransverse = 0.0; 00072 double ptSumAway = 0.0; 00073 00074 foreach (const Particle& p, particles) { 00075 double dphi = fabs(deltaPhi(Zphi, p.momentum().phi())); 00076 double pT = p.momentum().pT(); 00077 00078 if ( dphi < M_PI/3.0 ) { 00079 nTowards++; 00080 ptSumTowards += pT; 00081 if (Zmass > 81. && Zmass < 101.) _h_pT_towards_zmass_81_101->fill(pT, weight); 00082 } else if ( dphi < 2.*M_PI/3.0 ) { 00083 nTransverse++; 00084 ptSumTransverse += pT; 00085 if (Zmass > 81. && Zmass < 101.) _h_pT_transverse_zmass_81_101->fill(pT, weight); 00086 if (Zpt < 5.) _h_pT_transverse_zpt_5->fill(pT, weight); 00087 } else { 00088 nAway++; 00089 ptSumAway += pT; 00090 if (Zmass > 81. && Zmass < 101.) _h_pT_away_zmass_81_101->fill(pT, weight); 00091 } 00092 00093 } // Loop over particles 00094 00095 00096 const double area = 8./3.*M_PI; 00097 if (Zmass > 81. && Zmass < 101.) { 00098 _h_Nchg_towards_pTmumu-> fill(Zpt, 1./area * nTowards, weight); 00099 _h_Nchg_transverse_pTmumu-> fill(Zpt, 1./area * nTransverse, weight); 00100 _h_Nchg_away_pTmumu-> fill(Zpt, 1./area * nAway, weight); 00101 _h_pTsum_towards_pTmumu-> fill(Zpt, 1./area * ptSumTowards, weight); 00102 _h_pTsum_transverse_pTmumu-> fill(Zpt, 1./area * ptSumTransverse, weight); 00103 _h_pTsum_away_pTmumu-> fill(Zpt, 1./area * ptSumAway, weight); 00104 if (nTowards > 0) _h_avgpT_towards_pTmumu-> fill(Zpt, ptSumTowards/nTowards, weight); 00105 if (nTransverse > 0) _h_avgpT_transverse_pTmumu-> fill(Zpt, ptSumTransverse/nTransverse, weight); 00106 if (nAway > 0) _h_avgpT_away_pTmumu-> fill(Zpt, ptSumAway/nAway, weight); 00107 _h_Nchg_towards_zmass_81_101-> fill(nTowards, weight); 00108 _h_Nchg_transverse_zmass_81_101->fill(nTransverse, weight); 00109 _h_Nchg_away_zmass_81_101-> fill(nAway, weight); 00110 } 00111 00112 if (Zpt < 5.) { 00113 _h_Nchg_towards_plus_transverse_Mmumu->fill(Zmass, (nTowards + nTransverse)/(2.*area), weight); 00114 _h_pTsum_towards_plus_transverse_Mmumu->fill(Zmass, (ptSumTowards + ptSumTransverse)/(2.*area), weight); 00115 if ((nTowards + nTransverse) > 0) _h_avgpT_towards_plus_transverse_Mmumu->fill(Zmass, (ptSumTowards + ptSumTransverse)/(nTowards + nTransverse), weight); 00116 _h_Nchg_transverse_zpt_5->fill(nTransverse, weight); 00117 } 00118 00119 } 00120 00121 00122 /// Normalise histograms etc., after the run 00123 void finalize() { 00124 if (integral(_h_Nchg_towards_zmass_81_101) > 0) scale(_h_pT_towards_zmass_81_101, 1.0/integral(_h_Nchg_towards_zmass_81_101)); 00125 if (integral(_h_Nchg_transverse_zmass_81_101) > 0) scale(_h_pT_transverse_zmass_81_101, 1.0/integral(_h_Nchg_transverse_zmass_81_101)); 00126 if (integral(_h_Nchg_away_zmass_81_101) > 0) scale(_h_pT_away_zmass_81_101, 1.0/integral(_h_Nchg_away_zmass_81_101)); 00127 if (integral(_h_Nchg_transverse_zpt_5) > 0) scale(_h_pT_transverse_zpt_5, 1.0/integral(_h_Nchg_transverse_zpt_5)); 00128 normalize(_h_Nchg_towards_zmass_81_101); 00129 normalize(_h_Nchg_transverse_zmass_81_101); 00130 normalize(_h_Nchg_away_zmass_81_101); 00131 normalize(_h_Nchg_transverse_zpt_5); 00132 } 00133 00134 00135 private: 00136 00137 00138 /// @name Histogram objects 00139 //@{ 00140 Profile1DPtr _h_Nchg_towards_pTmumu; 00141 Profile1DPtr _h_Nchg_transverse_pTmumu; 00142 Profile1DPtr _h_Nchg_away_pTmumu; 00143 Profile1DPtr _h_pTsum_towards_pTmumu; 00144 Profile1DPtr _h_pTsum_transverse_pTmumu; 00145 Profile1DPtr _h_pTsum_away_pTmumu; 00146 Profile1DPtr _h_avgpT_towards_pTmumu; 00147 Profile1DPtr _h_avgpT_transverse_pTmumu; 00148 Profile1DPtr _h_avgpT_away_pTmumu; 00149 Profile1DPtr _h_Nchg_towards_plus_transverse_Mmumu; 00150 Profile1DPtr _h_pTsum_towards_plus_transverse_Mmumu; 00151 Profile1DPtr _h_avgpT_towards_plus_transverse_Mmumu; 00152 Histo1DPtr _h_Nchg_towards_zmass_81_101; 00153 Histo1DPtr _h_Nchg_transverse_zmass_81_101; 00154 Histo1DPtr _h_Nchg_away_zmass_81_101; 00155 Histo1DPtr _h_pT_towards_zmass_81_101; 00156 Histo1DPtr _h_pT_transverse_zmass_81_101; 00157 Histo1DPtr _h_pT_away_zmass_81_101; 00158 Histo1DPtr _h_Nchg_transverse_zpt_5; 00159 Histo1DPtr _h_pT_transverse_zpt_5; 00160 //@} 00161 00162 }; 00163 00164 // This global object acts as a hook for the plugin system 00165 DECLARE_RIVET_PLUGIN(CMS_2012_I1107658); 00166 00167 } Generated on Fri Dec 21 2012 15:03:40 for The Rivet MC analysis system by ![]() |