rivet is hosted by Hepforge, IPPP Durham
WFinder.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_WFinder_HH
00003 #define RIVET_WFinder_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/ChargedFinalState.hh"
00011 #include "Rivet/Projections/DressedLeptons.hh"
00012 
00013 namespace Rivet {
00014 
00015 
00016   /// @brief Convenience finder of leptonically decaying Ws
00017   ///
00018   /// Chain together different projections as convenience for finding W's
00019   /// from two leptons in the final state, including photon clustering.
00020   class WFinder : public FinalState {
00021   public:
00022 
00023     enum ClusterPhotons { NOCLUSTER=0, CLUSTERNODECAY=1, CLUSTERALL };
00024     enum PhotonTracking { NOTRACK=0, TRACK=1 };
00025     enum MassWindow { MASS=0, TRANSMASS=1 };
00026 
00027     /// @name Constructors
00028     //@{
00029 
00030     /// Constructor taking cuts object
00031     /// @param inputfs Input final state
00032     /// @param cuts charged lepton cuts
00033     /// @param pid type of the charged lepton
00034     /// @param minmass,maxmass (transverse) mass window
00035     /// @param missingET minimal amount of missing ET (neutrinos) required
00036     /// @param dRmax maximum dR of photons around charged lepton to take into account
00037     ///  for W reconstruction (only relevant if one of the following are true)
00038     /// @param clusterPhotons whether such photons are supposed to be
00039     ///  clustered to the lepton object and thus W mom
00040     /// @param trackPhotons whether such photons should be added to _theParticles
00041     /// @param masstype whether mass window should be applied using m or mT
00042     WFinder(const FinalState& inputfs,
00043             Cut cuts,
00044             PdgId pid,
00045             double minmass, double maxmass,
00046             double missingET,
00047             double dRmax=0.1, 
00048             ClusterPhotons clusterPhotons=CLUSTERNODECAY,
00049             PhotonTracking trackPhotons=NOTRACK,
00050             MassWindow masstype=MASS,
00051             double masstarget=80.4*GeV);
00052 
00053     /// Clone on the heap.
00054     virtual const Projection* clone() const {
00055       return new WFinder(*this);
00056     }
00057 
00058     //@}
00059 
00060 
00061     /// Access to the found bosons
00062     ///
00063     /// @note Currently either 0 or 1 boson can be found.
00064     const Particles& bosons() const { return _bosons; }
00065 
00066     /// Access to the found boson (assuming it exists)
00067     const Particle& boson() const { return _bosons[0]; }
00068 
00069 
00070     /// Access to the W constituent clustered leptons
00071     ///
00072     /// @note Either size 0 if no boson was found or 1 if one boson was found
00073     const Particles& constituentLeptons() const { return _constituentLeptons; }
00074 
00075     /// Access to the W constituent clustered lepton (assuming it exists)
00076     const Particle& constituentLepton() const { return _constituentLeptons[0]; }
00077 
00078 
00079     /// Access to the W constituent neutrinos
00080     ///
00081     /// @note Either size 0 if no boson was found or 1 if one boson was found
00082     const Particles& constituentNeutrinos() const { return _constituentNeutrinos; }
00083 
00084     /// Access to the W constituent neutrinos
00085     const Particle& constituentNeutrino() const { return _constituentNeutrinos[0]; }
00086 
00087 
00088     /// Access to the particles other than the W leptons and clustered photons
00089     ///
00090     /// Useful for e.g. input to a jet finder
00091     const FinalState& remainingFinalState() const;
00092 
00093     /// @brief Calculate the transverse mass of the W, from the charged lepton and neutrino
00094     ///
00095     /// Defined as sqrt(2 pT_l pT_nu (1.0 - cos(dphi_lnu))). Return -1 if no boson found.
00096     double mT() const {
00097       if (bosons().empty()) return -1;
00098       const FourMomentum& l = constituentLeptons()[0].momentum();
00099       const FourMomentum& nu = constituentNeutrinos()[0].momentum();
00100       return sqrt( 2 * l.pT() * nu.pT() * (1 - cos(deltaPhi(l, nu))) );
00101     }
00102 
00103 
00104   protected:
00105 
00106     /// Apply the projection on the supplied event.
00107     void project(const Event& e);
00108 
00109     /// Compare projections.
00110     int compare(const Projection& p) const;
00111 
00112 
00113   public:
00114 
00115     /// Clear the projection
00116     void clear() {
00117       _theParticles.clear();
00118       _bosons.clear();
00119       _constituentLeptons.clear();
00120       _constituentNeutrinos.clear();
00121     }
00122 
00123   private:
00124 
00125     /// Transverse mass cuts
00126     double _minmass, _maxmass, _masstarget;
00127     bool _useTransverseMass;
00128 
00129     /// Missing ET cut
00130     double _etMiss;
00131 
00132     /// Switch for tracking of photons (whether to add them to _theParticles)
00133     /// This is relevant when the ZFinder::_theParticles are to be excluded
00134     /// from e.g. the input to a jet finder, to specify whether the clustered
00135     /// photons are to be excluded as well.
00136     /// (Yes, some experiments make a difference between clusterPhotons and
00137     /// trackPhotons!)
00138     PhotonTracking _trackPhotons;
00139 
00140     /// Lepton flavour
00141     PdgId _pid;
00142 
00143     /// Neutrino flavour
00144     PdgId _nu_pid;
00145 
00146     /// list of found bosons (currently either 0 or 1)
00147     Particles _bosons;
00148 
00149     /// Constituent leptons (currently either 0 or 1)
00150     Particles _constituentLeptons;
00151 
00152     /// Constituent neutrinos (currently either 0 or 1)
00153     Particles _constituentNeutrinos;
00154 
00155   };
00156 
00157 
00158 }
00159 
00160 
00161 #endif