rivet is hosted by Hepforge, IPPP Durham
JADE_1998_S3612880.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/Thrust.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 #include "Rivet/Projections/Hemispheres.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 /// @todo Include more projections as required, e.g. ChargedFinalState, FastJets, ZFinder...
00008 
00009 namespace Rivet {
00010 
00011 
00012   class JADE_1998_S3612880 : public Analysis {
00013   public:
00014 
00015     /// @name Constructors etc.
00016     //@{
00017 
00018     /// Constructor
00019     JADE_1998_S3612880()
00020       : Analysis("JADE_1998_S3612880")
00021     {
00022       /// @todo Set whether your finalize method needs the generator cross section
00023     }
00024 
00025 
00026 
00027     /// Book histograms and initialise projections before the run
00028     void init() {
00029       const ChargedFinalState cfs(-MAXRAPIDITY, MAXRAPIDITY, 0.1/GeV);
00030       addProjection(cfs, "CFS");
00031       addProjection(FastJets(cfs, FastJets::DURHAM, 0.7), "DurhamJets");
00032 
00033       // Thrust
00034       const Thrust thrust(cfs);
00035       addProjection(thrust, "Thrust");
00036       addProjection(Hemispheres(thrust), "Hemispheres");
00037 
00038       // Histos
00039       int offset = 0;
00040       switch (int(sqrtS()/GeV)) {
00041 
00042         case 44:
00043           offset = 0;
00044           _h_thrust  = bookHisto1D( 2+offset, 1, 1);
00045           _h_MH = bookHisto1D( 3 + offset, 1, 1);
00046           _h_BT = bookHisto1D( 4 + offset, 1, 1);
00047           _h_BW = bookHisto1D( 5 + offset, 1, 1);
00048           _h_y23 = bookHisto1D(10, 1, 1);
00049           break;
00050         case 35:
00051           offset = 4;
00052           _h_thrust  = bookHisto1D( 2+offset, 1, 1);
00053           _h_MH = bookHisto1D( 3 + offset, 1, 1);
00054           _h_BT = bookHisto1D( 4 + offset, 1, 1);
00055           _h_BW = bookHisto1D( 5 + offset, 1, 1);
00056           _h_y23 = bookHisto1D(11, 1, 1);
00057           break;
00058         case 22:
00059           _h_y23 = bookHisto1D(12, 1, 1);
00060           break;
00061       }
00062     }
00063 
00064 
00065     /// Perform the per-event analysis
00066     void analyze(const Event& event) {
00067       const double weight = event.weight();
00068       const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(event, "CFS");
00069 
00070       // JADE hadronic event selection TODO: move this into a trigger definition
00071       if (cfs.particles().size() < 3 ) {
00072         vetoEvent;
00073       }
00074       const Thrust& thrust = applyProjection<Thrust>(event, "Thrust");
00075       const Vector3 & thrustAxis = thrust.thrustAxis ();
00076       double theta = thrustAxis.theta();
00077       if ( fabs(cos(theta)) >= 0.8 ) {
00078         MSG_DEBUG("Failed thrust angle cut: " << fabs(cos(theta)));
00079         vetoEvent;
00080       }
00081       // TODO Evis, pmiss, pbal
00082 
00083       const Hemispheres& hemi = applyProjection<Hemispheres>(event, "Hemispheres");
00084       const FastJets& durjet = applyProjection<FastJets>(event, "DurhamJets");
00085 
00086       double y23 = durjet.clusterSeq()->exclusive_ymerge_max(2);
00087 
00088       // Make sure we don't run into a segfault by trying to fill non-existing histos
00089       int s = int(sqrtS()/GeV);
00090       if (s == 44 || s == 35) {
00091         _h_thrust->fill(1. - thrust.thrust(), weight);
00092         _h_MH->fill(sqrt(hemi.scaledM2high()), weight);
00093         _h_BT->fill(hemi.Bsum(), weight);
00094         _h_BW->fill(hemi.Bmax(), weight);
00095       }
00096       _h_y23->fill(y23, weight);
00097     }
00098 
00099     /// Normalise histograms etc., after the run
00100     void finalize() {
00101       // Make sure we don't try to normalise non-existing histos
00102       int s = int(sqrtS()/GeV);
00103       if (s == 44 || s == 35) {
00104         normalize(_h_thrust);
00105         normalize(_h_MH);
00106         normalize(_h_BT);
00107         normalize(_h_BW);
00108       }
00109       normalize(_h_y23);
00110 
00111 
00112     }
00113 
00114     //@}
00115 
00116 
00117   private:
00118 
00119     Histo1DPtr _h_thrust;
00120     Histo1DPtr _h_MH;
00121     Histo1DPtr _h_BT;
00122     Histo1DPtr _h_BW;
00123     Histo1DPtr _h_y23;
00124 
00125 
00126   };
00127 
00128 
00129 
00130   // The hook for the plugin system
00131   DECLARE_RIVET_PLUGIN(JADE_1998_S3612880);
00132 
00133 }