CMS 3D CMS Logo

EgHLTParticlePair.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_TRIGGER_EGHLTPARTICLEPAIR
2 #define DQMOFFLINE_TRIGGER_EGHLTPARTICLEPAIR
3 
4 //a useful struct for defining a pair of particles
5 
6 namespace egHLT {
7  template <class T>
8  struct ParticlePair {
9  const T& part1;
10  const T& part2;
11 
12  ParticlePair(const T& particle1, const T& particle2) : part1(particle1), part2(particle2) {}
13  ~ParticlePair() = default;
14 
15  float mass() const { return (part1.p4() + part2.p4()).mag(); }
16  };
17 } // namespace egHLT
18 #endif
~ParticlePair()=default
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
ParticlePair(const T &particle1, const T &particle2)
long double T