Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-12 09:05:02

0001 // -*- C++ -*-
0002 #ifndef RIVET_InvMassFinalState_HH
0003 #define RIVET_InvMassFinalState_HH
0004 
0005 #include "Rivet/Projections/FinalState.hh"
0006 
0007 namespace Rivet {
0008 
0009 
0010   /// @brief Identify particles which can be paired to fit within a given invariant mass window
0011   class InvMassFinalState : public FinalState {
0012   public:
0013 
0014     /// Constructor for a single inv-mass pair.
0015     InvMassFinalState(const FinalState& fsp,
0016                       const std::pair<PdgId, PdgId>& idpair, // pair of decay products
0017                       double minmass, // min inv mass
0018                       double maxmass, // max inv mass
0019                       double masstarget=-1.0);
0020 
0021 
0022     /// Constructor for multiple inv-mass pairs.
0023     InvMassFinalState(const FinalState& fsp,
0024                       const std::vector<std::pair<PdgId, PdgId> >& idpairs,  // vector of pairs of decay products
0025                       double minmass, // min inv mass
0026                       double maxmass, // max inv mass
0027                       double masstarget=-1.0);
0028 
0029 
0030     /// Same thing as above, but we want to pass the particles directly to the calc method
0031     InvMassFinalState(const std::pair<PdgId, PdgId>& idpair, // pair of decay products
0032                       double minmass, // min inv mass
0033                       double maxmass, // max inv mass
0034                       double masstarget=-1.0);
0035     InvMassFinalState(const std::vector<std::pair<PdgId, PdgId> >& idpairs,  // vector of pairs of decay products
0036                       double minmass, // min inv mass
0037                       double maxmass, // max inv mass
0038                       double masstarget=-1.0);
0039 
0040 
0041     /// Clone on the heap.
0042     RIVET_DEFAULT_PROJ_CLONE(InvMassFinalState);
0043 
0044     /// Import to avoid warnings about overload-hiding
0045     using Projection::operator =;
0046 
0047 
0048     /// Constituent pairs.
0049     const std::vector<std::pair<Particle, Particle> >& particlePairs() const;
0050 
0051 
0052     /// Choose whether to use the full inv mass or just the transverse mass.
0053     void useTransverseMass(bool usetrans=true) {
0054       _useTransverseMass = usetrans;
0055     }
0056 
0057     /// Operate on a given particle vector directly instead of through project (no caching)
0058     void calc(const Particles& inparticles);
0059 
0060 
0061     /// Apply the projection on the supplied event.
0062     void project(const Event& e);
0063 
0064     /// Compare projections.
0065     CmpState compare(const Projection& p) const;
0066 
0067 
0068   protected:
0069 
0070     /// IDs of the decay products.
0071     vector<PdgIdPair> _decayids;
0072 
0073     /// Constituent pairs.
0074     vector<pair<Particle, Particle> > _particlePairs;
0075 
0076     /// Min inv mass.
0077     double _minmass;
0078 
0079     /// Max inv mass.
0080     double _maxmass;
0081 
0082     /// Target mass if only one pair should be returned.
0083     double _masstarget;
0084 
0085     /// Flag to decide whether to use the full inv mass or just the transverse mass.
0086     bool _useTransverseMass;
0087 
0088   };
0089 
0090 
0091 }
0092 
0093 #endif