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
Definition: MC_JetAnalysis.hh:9
Identify particles which can be paired to fit within a given invariant mass window.
Definition: InvMassFinalState.hh:11
void project(const Event &e)
Apply the projection on the supplied event.
Definition: InvMassFinalState.cc:82
Projection()
The default constructor.
Definition: Projection.cc:10
double perp(const Vector3 &v)
Synonym for polarRadius.
Definition: Vector3.hh:266
virtual const Projection * clone() const
Clone on the heap.
Definition: InvMassFinalState.hh:42
friend class Event
Event is a friend.
Definition: Projection.hh:33
InvMassFinalState(const FinalState &fsp, const std::pair< PdgId, PdgId > &idpair, double minmass, double maxmass, double masstarget=-1.0)
Constructor for a single inv-mass pair.
int compare(const Projection &p) const
Compare projections.
Definition: InvMassFinalState.cc:55
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
void calc(const ParticleVector &inparticles)
Operate on a given particle vector directly instead of through project (no caching) ...
Definition: InvMassFinalState.cc:88
void useTransverseMass(bool usetrans=true)
Choose whether to use the full inv mass or just the transverse mass.
Definition: InvMassFinalState.hh:54
const std::vector< std::pair< Particle, Particle > > & particlePairs() const
Constituent pairs.
Definition: InvMassFinalState.cc:187
double Et() const
Calculate the transverse energy .
Definition: Vector4.hh:420
Base class for all Rivet projections.
Definition: Projection.hh:28
Specialized version of the FourVector with momentum/energy functionality.
Definition: Vector4.hh:324