Rivet  1.8.3
InvMassFinalState.hh
1 // -*- C++ -*-
2 #ifndef RIVET_InvMassFinalState_HH
3 #define RIVET_InvMassFinalState_HH
4 
5 #include "Rivet/Projections/FinalState.hh"
6 
7 namespace Rivet {
8 
9 
11  class InvMassFinalState : public FinalState {
12  public:
13 
15  InvMassFinalState(const FinalState& fsp,
16  const std::pair<PdgId, PdgId>& idpair, // pair of decay products
17  double minmass, // min inv mass
18  double maxmass, // max inv mass
19  double masstarget=-1.0);
20 
21 
23  InvMassFinalState(const FinalState& fsp,
24  const std::vector<std::pair<PdgId, PdgId> >& idpairs, // vector of pairs of decay products
25  double minmass, // min inv mass
26  double maxmass, // max inv mass
27  double masstarget=-1.0);
28 
29 
31  InvMassFinalState(const std::pair<PdgId, PdgId>& idpair, // pair of decay products
32  double minmass, // min inv mass
33  double maxmass, // max inv mass
34  double masstarget=-1.0);
35  InvMassFinalState(const std::vector<std::pair<PdgId, PdgId> >& idpairs, // vector of pairs of decay products
36  double minmass, // min inv mass
37  double maxmass, // max inv mass
38  double masstarget=-1.0);
39 
40 
42  virtual const Projection* clone() const {
43  return new InvMassFinalState(*this);
44  }
45 
46 
47  public:
48 
50  const std::vector<std::pair<Particle, Particle> >& particlePairs() const;
51 
52 
54  void useTransverseMass(bool usetrans=true) {
55  _useTransverseMass = usetrans;
56  }
57 
59  void calc(const ParticleVector& inparticles);
60 
61  private:
62 
64  inline double massT( FourMomentum v1, FourMomentum v2) {
65  return sqrt( (v1.Et() + v2.Et())*(v1.Et() + v2.Et()) -
66  (v1+v2).perp()*(v1+v2).perp() );
67  }
68 
69  protected:
70 
72  void project(const Event& e);
73 
75  int compare(const Projection& p) const;
76 
77 
78  private:
79 
81  std::vector<PdgIdPair> _decayids;
82 
84  std::vector<std::pair<Particle, Particle> > _particlePairs;
85 
87  double _minmass;
88 
90  double _maxmass;
91 
93  double _masstarget;
94 
96  bool _useTransverseMass;
97  };
98 
99 
100 }
101 
102 
103 #endif