DELPHI_1999_S3960137.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/Beam.hh" 00004 #include "Rivet/Projections/FinalState.hh" 00005 #include "Rivet/Projections/ChargedFinalState.hh" 00006 #include "Rivet/Projections/UnstableFinalState.hh" 00007 00008 namespace Rivet { 00009 00010 00011 /// @brief DELPHI rho,f_0 and f_2 fragmentation function paper 00012 /// @author Peter Richardson 00013 class DELPHI_1999_S3960137 : public Analysis { 00014 public: 00015 00016 /// Constructor 00017 DELPHI_1999_S3960137() 00018 : Analysis("DELPHI_1999_S3960137") 00019 {} 00020 00021 00022 /// @name Analysis methods 00023 //@{ 00024 00025 void init() { 00026 addProjection(Beam(), "Beams"); 00027 addProjection(ChargedFinalState(), "FS"); 00028 addProjection(UnstableFinalState(), "UFS"); 00029 _histXpRho = bookHisto1D( 1, 1, 1); 00030 _histXpf0 = bookHisto1D( 1, 1, 2); 00031 _histXpf2 = bookHisto1D( 1, 1, 3); 00032 } 00033 00034 00035 void analyze(const Event& e) { 00036 // First, veto on leptonic events by requiring at least 4 charged FS particles 00037 const FinalState& fs = applyProjection<FinalState>(e, "FS"); 00038 const size_t numParticles = fs.particles().size(); 00039 00040 // Even if we only generate hadronic events, we still need a cut on numCharged >= 2. 00041 if (numParticles < 2) { 00042 MSG_DEBUG("Failed leptonic event cut"); 00043 vetoEvent; 00044 } 00045 MSG_DEBUG("Passed leptonic event cut"); 00046 00047 // Get event weight for histo filling 00048 const double weight = e.weight(); 00049 00050 // Get beams and average beam momentum 00051 const ParticlePair& beams = applyProjection<Beam>(e, "Beams").beams(); 00052 const double meanBeamMom = ( beams.first.p3().mod() + 00053 beams.second.p3().mod() ) / 2.0; 00054 MSG_DEBUG("Avg beam momentum = " << meanBeamMom); 00055 00056 // Final state of unstable particles to get particle spectra 00057 const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(e, "UFS"); 00058 00059 foreach (const Particle& p, ufs.particles()) { 00060 const int id = p.abspid(); 00061 double xp = p.p3().mod()/meanBeamMom; 00062 switch (id) { 00063 case 9010221: 00064 _histXpf0->fill(xp, weight); 00065 break; 00066 case 225: 00067 _histXpf2->fill(xp, weight); 00068 break; 00069 case 113: 00070 _histXpRho->fill(xp, weight); 00071 break; 00072 } 00073 } 00074 } 00075 00076 00077 /// Finalize 00078 void finalize() { 00079 scale(_histXpf0 , 1./sumOfWeights()); 00080 scale(_histXpf2 , 1./sumOfWeights()); 00081 scale(_histXpRho, 1./sumOfWeights()); 00082 } 00083 00084 //@} 00085 00086 00087 private: 00088 00089 Histo1DPtr _histXpf0; 00090 Histo1DPtr _histXpf2; 00091 Histo1DPtr _histXpRho; 00092 //@} 00093 00094 }; 00095 00096 // The hook for the plugin system 00097 DECLARE_RIVET_PLUGIN(DELPHI_1999_S3960137); 00098 00099 } Generated on Tue Mar 24 2015 17:35:26 for The Rivet MC analysis system by ![]() |