InvMassFinalState.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_InvMassFinalState_HH
00003 #define RIVET_InvMassFinalState_HH
00004 
00005 #include "Rivet/Projections/FinalState.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief Identify particles which can be paired to fit within a given invariant mass window
00011   class InvMassFinalState : public FinalState {
00012   public:
00013 
00014     /// Constructor for a single inv-mass pair.
00015     InvMassFinalState(const FinalState& fsp,
00016                       const std::pair<PdgId, PdgId>& idpair, // pair of decay products
00017                       double minmass, // min inv mass
00018                       double maxmass, // max inv mass
00019                       double masstarget=-1.0);
00020 
00021 
00022     /// Constructor for multiple inv-mass pairs.
00023     InvMassFinalState(const FinalState& fsp,
00024                       const std::vector<std::pair<PdgId, PdgId> >& idpairs,  // vector of pairs of decay products
00025                       double minmass, // min inv mass
00026                       double maxmass, // max inv mass
00027                       double masstarget=-1.0);
00028 
00029 
00030     /// Clone on the heap.
00031     virtual const Projection* clone() const {
00032         return new InvMassFinalState(*this);
00033     }
00034 
00035 
00036   public:
00037 
00038     /// Constituent pairs.
00039     const std::vector<std::pair<Particle, Particle> >& particlePairs() const;
00040 
00041 
00042     /// Choose whether to use the full inv mass or just the transverse mass.
00043     void useTransverseMass(bool usetrans=true) {
00044       _useTransverseMass = usetrans;
00045     }
00046 
00047     /// Operate on a given particle vector directly instead of through project (no caching)
00048     void calc(const ParticleVector& inparticles);
00049 
00050 
00051   protected:
00052 
00053     /// Apply the projection on the supplied event.
00054     void project(const Event& e);
00055 
00056     /// Compare projections.
00057     int compare(const Projection& p) const;
00058 
00059 
00060   private:
00061 
00062     /// IDs of the decay products.
00063     std::vector<PdgIdPair> _decayids;
00064 
00065     /// Constituent pairs.
00066     std::vector<std::pair<Particle, Particle> > _particlePairs;
00067 
00068     /// Min inv mass.
00069     double _minmass;
00070 
00071     /// Max inv mass.
00072     double _maxmass;
00073 
00074     /// Target mass if only one pair should be returned.
00075     double _masstarget;
00076 
00077     /// Flag to decide whether to use the full inv mass or just the transverse mass.
00078     bool _useTransverseMass;
00079   };
00080 
00081 
00082 }
00083 
00084 
00085 #endif