ALEPH_1999_S4193598.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/Beam.hh" 00004 #include "HepMC/GenParticle.h" 00005 #include "HepMC/GenVertex.h" 00006 #include "Rivet/Projections/ChargedFinalState.hh" 00007 #include "Rivet/Projections/UnstableFinalState.hh" 00008 00009 00010 bool hasDecayedTo(const HepMC::GenParticle* p, int id1, int id2) { 00011 bool decision = false; 00012 HepMC::GenVertex* decV = p->end_vertex(); 00013 std::vector<int> decids; 00014 if (decV->particles_out_size() == 2) { 00015 for (HepMC::GenVertex::particles_out_const_iterator pp = decV->particles_out_const_begin() ; 00016 pp != decV->particles_out_const_end() ; ++pp) { 00017 decids.push_back(abs((*pp)->pdg_id())); 00018 } 00019 if ( (decids[0] == abs(id1) && decids[1] == abs(id2)) || (decids[1] == abs(id1) && decids[0] == abs(id2)) ) decision = true; 00020 00021 }; 00022 return decision; 00023 } 00024 00025 bool hasDecayedTo(const Rivet::Particle& p, int id1, int id2) { 00026 return hasDecayedTo(p.genParticle(), id1, id2); 00027 } 00028 00029 00030 namespace Rivet { 00031 00032 00033 class ALEPH_1999_S4193598 : public Analysis { 00034 public: 00035 00036 /// @name Constructors etc. 00037 //@{ 00038 00039 /// Constructor 00040 ALEPH_1999_S4193598() 00041 : Analysis("ALEPH_1999_S4193598") 00042 { 00043 _sumWpassed = 0.0; 00044 } 00045 00046 //@} 00047 00048 00049 public: 00050 00051 /// Book histograms and initialise projections before the run 00052 void init() { 00053 addProjection(Beam(), "Beams"); 00054 addProjection(UnstableFinalState(), "UFS"); 00055 addProjection(ChargedFinalState(), "CFS"); 00056 00057 _h_Xe_Ds = bookHisto1D(1, 1, 1); 00058 } 00059 00060 00061 /// Perform the per-event analysis 00062 void analyze(const Event& event) { 00063 const double weight = event.weight(); 00064 00065 // Trigger condition 00066 const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS"); 00067 if (cfs.size() < 5) vetoEvent; 00068 00069 _sumWpassed += weight; 00070 00071 const UnstableFinalState& ufs = applyProjection<UnstableFinalState>(event, "UFS"); 00072 00073 // Get beams and average beam momentum 00074 const ParticlePair& beams = applyProjection<Beam>(event, "Beams").beams(); 00075 const double meanBeamMom = ( beams.first.p3().mod() + 00076 beams.second.p3().mod() ) / 2.0/GeV; 00077 00078 foreach (const Particle& p, ufs.particles()) { 00079 const PdgId pid = p.abspid(); 00080 00081 switch (pid) { 00082 case 413: 00083 00084 // Accept all D*+- decays. Normalisation to D0 + pi+- in finalize() 00085 00086 // Scaled energy. 00087 const double energy = p.E()/GeV; 00088 const double scaledEnergy = energy/meanBeamMom; 00089 _h_Xe_Ds->fill(scaledEnergy, weight); 00090 00091 break; 00092 } 00093 } 00094 } 00095 00096 00097 /// Normalise histograms etc., after the run 00098 void finalize() { 00099 00100 // Scale to the product of branching fractions D0*->D0 pi x D0->Kpi(charged) 00101 // Numbers are taken from PDG 2010 00102 scale(_h_Xe_Ds, 0.677*0.0389/_sumWpassed); 00103 00104 } 00105 00106 private: 00107 double _sumWpassed; 00108 00109 private: 00110 00111 Histo1DPtr _h_Xe_Ds; 00112 00113 }; 00114 00115 00116 00117 // The hook for the plugin system 00118 DECLARE_RIVET_PLUGIN(ALEPH_1999_S4193598); 00119 00120 } Generated on Tue Sep 30 2014 19:45:41 for The Rivet MC analysis system by ![]() |