rivet is hosted by Hepforge, IPPP Durham
ZFinder.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_ZFinder_HH
00003 #define RIVET_ZFinder_HH
00004 
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/Rivet.hh"
00007 #include "Rivet/Particle.hh"
00008 #include "Rivet/Event.hh"
00009 #include "Rivet/Projection.hh"
00010 #include "Rivet/Projections/FinalState.hh"
00011 #include "Rivet/Projections/DressedLeptons.hh"
00012 
00013 namespace Rivet {
00014 
00015 
00016   /// @brief Convenience finder of leptonically decaying Zs
00017   ///
00018   /// Chain together different projections as convenience for finding Z's
00019   /// from two leptons in the final state, including photon clustering.
00020   class ZFinder : public FinalState {
00021   public:
00022 
00023     enum ClusterPhotons { NOCLUSTER=0, CLUSTERNODECAY=1, CLUSTERALL };
00024     enum PhotonTracking { NOTRACK=0, TRACK=1 };
00025 
00026     /// @name Constructors
00027     //@{
00028 
00029     /// Constructor taking cuts object
00030     /// @param inputfs Input final state
00031     /// @param cuts lepton cuts
00032     /// @param pid type of the leptons
00033     /// @param minmass,maxmass mass window
00034     /// @param dRmax maximum dR of photons around leptons to take into account
00035     ///  for Z reconstruction (only relevant if one of the following are true)
00036     /// @param clusterPhotons whether such photons are supposed to be
00037     ///  clustered to the lepton objects and thus Z mom
00038     /// @param trackPhotons whether such photons should be added to _theParticles
00039     ///  (cf. _trackPhotons)
00040     ZFinder(const FinalState& inputfs,
00041             Cut cuts,
00042             PdgId pid,
00043             double minmass, double maxmass,
00044             double dRmax=0.1, 
00045             ClusterPhotons clusterPhotons=CLUSTERNODECAY, 
00046             PhotonTracking trackPhotons=NOTRACK,
00047             double masstarget=91.2*GeV);
00048 
00049     /// Clone on the heap.
00050     virtual const Projection* clone() const {
00051       return new ZFinder(*this);
00052     }
00053 
00054     //@}
00055 
00056 
00057     /// Access to the found bosons
00058     ///
00059     /// @note Currently either 0 or 1 boson can be found.
00060     const Particles& bosons() const { return _bosons; }
00061 
00062     /// Access to the found boson (assuming it exists).
00063     const Particle boson() const { return _bosons[0]; }
00064 
00065     /// Access to the Z constituent clustered leptons
00066     ///
00067     /// For example, to make more fine-grained cuts on the clustered leptons.
00068     /// The positive charge constituent is first in the list (if not empty), and
00069     /// the negative one second.
00070     const Particles& constituents() const { return _constituents; }
00071 
00072     /// Access to the Z constituent clustered leptons, sorted by a comparison functor
00073     ///
00074     /// Unlike the no-arg version, this returns by value (i.e. is less efficient)
00075     template <typename CMP>
00076     Particles constituents(const CMP& cmp) const {
00077       Particles rtn = constituents();
00078       std::sort(rtn.begin(), rtn.end(), cmp);
00079       return rtn;
00080     }
00081 
00082     /// Access to the particles other than the Z leptons and clustered photons
00083     ///
00084     /// Useful for e.g. input to a jet finder
00085     const FinalState& remainingFinalState() const;
00086 
00087 
00088   protected:
00089 
00090     /// Apply the projection on the supplied event.
00091     void project(const Event& e);
00092 
00093     /// Compare projections.
00094     int compare(const Projection& p) const;
00095 
00096 
00097   public:
00098 
00099     /// Clear the projection
00100     void clear() {
00101       _theParticles.clear();
00102       _bosons.clear();
00103       _constituents.clear();
00104     }
00105 
00106 
00107   private:
00108     /// Mass cuts to apply to clustered leptons (cf. InvMassFinalState)
00109     double _minmass, _maxmass, _masstarget;
00110 
00111     /// Switch for tracking of photons (whether to add them to _theParticles)
00112     /// This is relevant when the ZFinder::_theParticles are to be excluded
00113     /// from e.g. the input to a jet finder, to specify whether the clustered
00114     /// photons are to be excluded as well.
00115     /// (Yes, some experiments make a difference between clusterPhotons and
00116     /// trackPhotons!)
00117     PhotonTracking _trackPhotons;
00118 
00119     /// Lepton flavour
00120     PdgId _pid;
00121 
00122     /// list of found bosons (currently either 0 or 1)
00123     Particles _bosons;
00124 
00125     /// Clustered leptons
00126     vector<Particle> _constituents;
00127 
00128   };
00129 
00130 
00131 }
00132 
00133 
00134 
00135 #endif