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