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 /// Same thing as above, but we want to pass the particles directly to the calc method 00031 InvMassFinalState(const std::pair<PdgId, PdgId>& idpair, // pair of decay products 00032 double minmass, // min inv mass 00033 double maxmass, // max inv mass 00034 double masstarget=-1.0); 00035 InvMassFinalState(const std::vector<std::pair<PdgId, PdgId> >& idpairs, // vector of pairs of decay products 00036 double minmass, // min inv mass 00037 double maxmass, // max inv mass 00038 double masstarget=-1.0); 00039 00040 00041 /// Clone on the heap. 00042 DEFAULT_RIVET_PROJ_CLONE(InvMassFinalState); 00043 00044 00045 /// Constituent pairs. 00046 const std::vector<std::pair<Particle, Particle> >& particlePairs() const; 00047 00048 00049 /// Choose whether to use the full inv mass or just the transverse mass. 00050 void useTransverseMass(bool usetrans=true) { 00051 _useTransverseMass = usetrans; 00052 } 00053 00054 /// Operate on a given particle vector directly instead of through project (no caching) 00055 void calc(const Particles& inparticles); 00056 00057 private: 00058 00059 /// Transverse Mass 00060 inline double massT( FourMomentum v1, FourMomentum v2) { 00061 return sqrt( (v1.Et() + v2.Et())*(v1.Et() + v2.Et()) - 00062 (v1+v2).perp()*(v1+v2).perp() ); 00063 } 00064 00065 protected: 00066 00067 /// Apply the projection on the supplied event. 00068 void project(const Event& e); 00069 00070 /// Compare projections. 00071 int compare(const Projection& p) const; 00072 00073 00074 private: 00075 00076 /// IDs of the decay products. 00077 std::vector<PdgIdPair> _decayids; 00078 00079 /// Constituent pairs. 00080 std::vector<std::pair<Particle, Particle> > _particlePairs; 00081 00082 /// Min inv mass. 00083 double _minmass; 00084 00085 /// Max inv mass. 00086 double _maxmass; 00087 00088 /// Target mass if only one pair should be returned. 00089 double _masstarget; 00090 00091 /// Flag to decide whether to use the full inv mass or just the transverse mass. 00092 bool _useTransverseMass; 00093 }; 00094 00095 00096 } 00097 00098 00099 #endif Generated on Tue Dec 13 2016 16:32:38 for The Rivet MC analysis system by ![]() |