rivet is hosted by Hepforge, IPPP Durham
JADE_OPAL_2000_S4300807.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FastJets.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief Jet rates in \f$ e^+ e^- \f$ at OPAL and JADE
00010   /// @author Frank Siegert
00011   class JADE_OPAL_2000_S4300807 : public Analysis {
00012   public:
00013 
00014     /// @name Constructors etc.
00015     //@{
00016 
00017     /// Constructor
00018     JADE_OPAL_2000_S4300807()
00019       : Analysis("JADE_OPAL_2000_S4300807")
00020     {    }
00021 
00022     //@}
00023 
00024 
00025     /// @name Analysis methods
00026     //@{
00027 
00028     void init() {
00029       // Projections
00030       const FinalState fs;
00031       addProjection(fs, "FS");
00032       FastJets jadeJets = FastJets(fs, FastJets::JADE, 0.7);
00033       FastJets durhamJets = FastJets(fs, FastJets::DURHAM, 0.7);
00034       jadeJets.useInvisibles(true);
00035       durhamJets.useInvisibles(true);
00036       addProjection(jadeJets, "JadeJets");
00037       addProjection(durhamJets, "DurhamJets");
00038 
00039       // Histos
00040       int offset = 0;
00041       switch (int(sqrtS()/GeV + 0.5)) {
00042       case 35: offset = 7; break;
00043       case 44: offset = 8; break;
00044       case 91: offset = 9; break;
00045       case 133: offset = 10; break;
00046       case 161: offset = 11; break;
00047       case 172: offset = 12; break;
00048       case 183: offset = 13; break;
00049       case 189: offset = 14; break;
00050       default: break;
00051       }
00052       for (size_t i = 0; i < 5; ++i) {
00053         _h_R_Jade[i] = bookHisto1D(offset, 1, i+1);
00054         _h_R_Durham[i] = bookHisto1D(offset+9, 1, i+1);
00055         if (i < 4) _h_y_Durham[i] = bookHisto1D(offset+17, 1, i+1);
00056       }
00057     }
00058 
00059 
00060 
00061     void analyze(const Event& e) {
00062       const double weight = e.weight();
00063       MSG_DEBUG("Num particles = " << applyProjection<FinalState>(e, "FS").particles().size());
00064 
00065       const FastJets& jadejet = applyProjection<FastJets>(e, "JadeJets");
00066       if (jadejet.clusterSeq()) {
00067         const double y_23 = jadejet.clusterSeq()->exclusive_ymerge_max(2);
00068         const double y_34 = jadejet.clusterSeq()->exclusive_ymerge_max(3);
00069         const double y_45 = jadejet.clusterSeq()->exclusive_ymerge_max(4);
00070         const double y_56 = jadejet.clusterSeq()->exclusive_ymerge_max(5);
00071 
00072         for (size_t i = 0; i < _h_R_Jade[0]->numBins(); ++i) {
00073           double ycut = _h_R_Jade[0]->bin(i).xMid();
00074           double width = _h_R_Jade[0]->bin(i).width();
00075           if (y_23 < ycut) {
00076             _h_R_Jade[0]->fillBin(i, weight*width);
00077           }
00078         }
00079         for (size_t i = 0; i < _h_R_Jade[1]->numBins(); ++i) {
00080           double ycut = _h_R_Jade[1]->bin(i).xMid();
00081           double width = _h_R_Jade[1]->bin(i).width();
00082           if (y_34 < ycut && y_23 > ycut) {
00083             _h_R_Jade[1]->fillBin(i, weight*width);
00084           }
00085         }
00086         for (size_t i = 0; i < _h_R_Jade[2]->numBins(); ++i) {
00087           double ycut = _h_R_Jade[2]->bin(i).xMid();
00088           double width = _h_R_Jade[2]->bin(i).width();
00089           if (y_45 < ycut && y_34 > ycut) {
00090             _h_R_Jade[2]->fillBin(i, weight*width);
00091           }
00092         }
00093         for (size_t i = 0; i < _h_R_Jade[3]->numBins(); ++i) {
00094           double ycut = _h_R_Jade[3]->bin(i).xMid();
00095           double width = _h_R_Jade[3]->bin(i).width();
00096           if (y_56 < ycut && y_45 > ycut) {
00097             _h_R_Jade[3]->fillBin(i, weight*width);
00098           }
00099         }
00100         for (size_t i = 0; i < _h_R_Jade[4]->numBins(); ++i) {
00101           double ycut = _h_R_Jade[4]->bin(i).xMid();
00102           double width = _h_R_Jade[4]->bin(i).width();
00103           if (y_56 > ycut) {
00104             _h_R_Jade[4]->fillBin(i, weight*width);
00105           }
00106         }
00107       }
00108 
00109       const FastJets& durjet = applyProjection<FastJets>(e, "DurhamJets");
00110       if (durjet.clusterSeq()) {
00111         const double y_23 = durjet.clusterSeq()->exclusive_ymerge_max(2);
00112         const double y_34 = durjet.clusterSeq()->exclusive_ymerge_max(3);
00113         const double y_45 = durjet.clusterSeq()->exclusive_ymerge_max(4);
00114         const double y_56 = durjet.clusterSeq()->exclusive_ymerge_max(5);
00115 
00116         _h_y_Durham[0]->fill(y_23, weight);
00117         _h_y_Durham[1]->fill(y_34, weight);
00118         _h_y_Durham[2]->fill(y_45, weight);
00119         _h_y_Durham[3]->fill(y_56, weight);
00120 
00121         for (size_t i = 0; i < _h_R_Durham[0]->numBins(); ++i) {
00122           double ycut = _h_R_Durham[0]->bin(i).xMid();
00123           double width = _h_R_Durham[0]->bin(i).width();
00124           if (y_23 < ycut) {
00125             _h_R_Durham[0]->fillBin(i, weight*width);
00126           }
00127         }
00128         for (size_t i = 0; i < _h_R_Durham[1]->numBins(); ++i) {
00129           double ycut = _h_R_Durham[1]->bin(i).xMid();
00130           double width = _h_R_Durham[1]->bin(i).width();
00131           if (y_34 < ycut && y_23 > ycut) {
00132             _h_R_Durham[1]->fillBin(i, weight*width);
00133           }
00134         }
00135         for (size_t i = 0; i < _h_R_Durham[2]->numBins(); ++i) {
00136           double ycut = _h_R_Durham[2]->bin(i).xMid();
00137           double width = _h_R_Durham[2]->bin(i).width();
00138           if (y_45 < ycut && y_34 > ycut) {
00139             _h_R_Durham[2]->fillBin(i, weight*width);
00140           }
00141         }
00142         for (size_t i = 0; i < _h_R_Durham[3]->numBins(); ++i) {
00143           double ycut = _h_R_Durham[3]->bin(i).xMid();
00144           double width = _h_R_Durham[3]->bin(i).width();
00145           if (y_56 < ycut && y_45 > ycut) {
00146             _h_R_Durham[3]->fillBin(i, weight*width);
00147           }
00148         }
00149         for (size_t i = 0; i < _h_R_Durham[4]->numBins(); ++i) {
00150           double ycut = _h_R_Durham[4]->bin(i).xMid();
00151           double width = _h_R_Durham[4]->bin(i).width();
00152           if (y_56 > ycut) {
00153             _h_R_Durham[4]->fillBin(i, weight*width);
00154           }
00155         }
00156       }
00157     }
00158 
00159 
00160 
00161     /// Finalize
00162     void finalize() {
00163       for (size_t n = 0; n < 4; ++n) normalize(_h_y_Durham[n]);
00164       for (size_t n = 0; n < 5; ++n) scale(_h_R_Jade[n], 100/sumOfWeights());
00165       for (size_t n = 0; n < 5; ++n) scale(_h_R_Durham[n], 100/sumOfWeights());
00166     }
00167 
00168     //@}
00169 
00170 
00171   private:
00172 
00173     /// @name Histograms
00174     //@{
00175     Histo1DPtr _h_R_Jade[5];
00176     Histo1DPtr _h_R_Durham[5];
00177     Histo1DPtr _h_y_Durham[4];
00178     //@}
00179 
00180   };
00181 
00182 
00183 
00184   // The hook for the plugin system
00185   DECLARE_RIVET_PLUGIN(JADE_OPAL_2000_S4300807);
00186 
00187 }