BELLE_2011_I878990.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/Projections/UnstableFinalState.hh" 00004 00005 namespace Rivet { 00006 00007 00008 /// @brief Add a short analysis description here 00009 class BELLE_2011_I878990 : public Analysis { 00010 public: 00011 00012 /// Constructor 00013 DEFAULT_RIVET_ANALYSIS_CTOR(BELLE_2011_I878990); 00014 00015 00016 /// @name Analysis methods 00017 //@{ 00018 00019 /// Book histograms and initialise projections before the run 00020 void init() { 00021 00022 // Initialise and register projections 00023 declare(UnstableFinalState(), "UFS"); 00024 00025 // Book histograms 00026 _h_q2 = bookHisto1D(1, 1, 1); 00027 } 00028 00029 // Calculate the Q2 using mother and daugher meson 00030 double q2(const Particle& B, int mesonID) { 00031 FourMomentum q = B.mom() - filter_select(B.children(), Cuts::pid==mesonID)[0]; 00032 return q*q; 00033 } 00034 00035 // Check for explicit decay into pdgids 00036 bool isSemileptonicDecay(const Particle& mother, vector<int> ids) { 00037 // Trivial check to ignore any other decays but the one in question modulo photons 00038 const Particles children = mother.children(Cuts::pid!=PID::PHOTON); 00039 if (children.size()!=ids.size()) return false; 00040 // Check for the explicit decay 00041 return all(ids, [&](int i){return count(children, hasPID(i))==1;}); 00042 } 00043 00044 /// Perform the per-event analysis 00045 void analyze(const Event& event) { 00046 // Loop over B0 mesons 00047 foreach(const Particle& p, apply<UnstableFinalState>(event, "UFS").particles(Cuts::pid==PID::B0)) { 00048 if (isSemileptonicDecay(p, {PID::PIMINUS, PID::POSITRON, PID::NU_E}) || 00049 isSemileptonicDecay(p, {PID::PIMINUS, PID::ANTIMUON, PID::NU_MU})) { 00050 _h_q2->fill(q2(p, PID::PIMINUS), event.weight()); 00051 } 00052 } 00053 } 00054 00055 00056 /// Normalise histograms etc., after the run 00057 void finalize() { 00058 00059 normalize(_h_q2, 3000.86); // normalize to BF*dQ2 00060 00061 } 00062 00063 //@} 00064 00065 00066 private: 00067 00068 00069 /// @name Histograms 00070 //@{ 00071 Histo1DPtr _h_q2; 00072 //@} 00073 00074 00075 }; 00076 00077 00078 // The hook for the plugin system 00079 DECLARE_RIVET_PLUGIN(BELLE_2011_I878990); 00080 00081 00082 } Generated on Tue Dec 13 2016 16:32:36 for The Rivet MC analysis system by ![]() |