1 |
loizides |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.2 |
// $Id: Vect4M.h,v 1.1 2009/03/08 12:00:54 loizides Exp $
|
3 |
loizides |
1.1 |
//
|
4 |
|
|
// Vect4M
|
5 |
|
|
//
|
6 |
|
|
// Implementation of our own FourVectorM32.
|
7 |
|
|
//
|
8 |
|
|
// Authors: C.Loizides
|
9 |
|
|
//--------------------------------------------------------------------------------------------------
|
10 |
|
|
|
11 |
|
|
#ifndef MITCOMMON_DATAFORMATS_VECT4M_H
|
12 |
|
|
#define MITCOMMON_DATAFORMATS_VECT4M_H
|
13 |
|
|
|
14 |
|
|
#include "MitCommon/DataFormats/interface/Types.h"
|
15 |
|
|
|
16 |
|
|
namespace mithep
|
17 |
|
|
{
|
18 |
|
|
class Vect4M
|
19 |
|
|
{
|
20 |
|
|
public:
|
21 |
|
|
Vect4M() :
|
22 |
|
|
fPt(0), fEta(0), fPhi(0), fM(0) {}
|
23 |
|
|
Vect4M(Double_t pt, Double_t eta, Double_t phi, Double_t m) :
|
24 |
|
|
fPt(pt), fEta(eta), fPhi(phi), fM(m) {}
|
25 |
|
|
Vect4M(const FourVector &mom) :
|
26 |
|
|
fPt(mom.Pt()), fEta(mom.Eta()), fPhi(mom.Phi()), fM(mom.M()) {}
|
27 |
|
|
Vect4M(const FourVectorM &mom) :
|
28 |
|
|
fPt(mom.Pt()), fEta(mom.Eta()), fPhi(mom.Phi()), fM(mom.M()) {}
|
29 |
|
|
|
30 |
|
|
Double_t Eta() const { return fEta; }
|
31 |
|
|
Double_t Phi() const { return fPhi; }
|
32 |
|
|
Double_t Pt() const { return fPt; }
|
33 |
|
|
Double_t M() const { return fM; }
|
34 |
loizides |
1.2 |
void Set(Double_t pt, Double_t eta, Double_t phi, Double_t m);
|
35 |
loizides |
1.1 |
void SetXYZT(Double_t px, Double_t py, Double_t pz, Double_t e);
|
36 |
|
|
const FourVectorM V() const { return FourVectorM(fPt,fEta,fPhi,fM); }
|
37 |
|
|
|
38 |
|
|
protected:
|
39 |
|
|
Double32_t fPt; //[0,0,12]
|
40 |
|
|
Double32_t fEta; //[0,0,10]
|
41 |
|
|
Double32_t fPhi; //[0,0,10]
|
42 |
|
|
Double32_t fM; //[0,0,12]
|
43 |
|
|
|
44 |
|
|
ClassDef(Vect4M, 1) // Implementation of our own FourVectorM32
|
45 |
|
|
};
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
//--------------------------------------------------------------------------------------------------
|
49 |
loizides |
1.2 |
inline void mithep::Vect4M::Set(Double_t pt, Double_t eta, Double_t phi, Double_t m)
|
50 |
|
|
{
|
51 |
|
|
// Set four vector.
|
52 |
|
|
|
53 |
|
|
fPt = pt;
|
54 |
|
|
fEta = eta;
|
55 |
|
|
fPhi = phi;
|
56 |
|
|
fM = m;
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
//--------------------------------------------------------------------------------------------------
|
60 |
loizides |
1.1 |
inline void mithep::Vect4M::SetXYZT(Double_t px, Double_t py, Double_t pz, Double_t e)
|
61 |
|
|
{
|
62 |
|
|
// Set four vector.
|
63 |
|
|
|
64 |
|
|
FourVector tmp(px, py, pz, e);
|
65 |
loizides |
1.2 |
fPt = tmp.Pt();
|
66 |
|
|
fEta = tmp.Eta();
|
67 |
|
|
fPhi = tmp.Phi();
|
68 |
|
|
fM = tmp.M();
|
69 |
loizides |
1.1 |
}
|
70 |
|
|
#endif
|