ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitCommon/DataFormats/interface/Vect4M.h
Revision: 1.1
Committed: Sun Mar 8 12:00:54 2009 UTC (16 years, 1 month ago) by loizides
Content type: text/plain
Branch: MAIN
Log Message:
Additional Vector classes.

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2     // $Id: Vect4M.h,v 1.1 2009/03/03 17:03:54 loizides Exp $
3     //
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     void SetXYZT(Double_t px, Double_t py, Double_t pz, Double_t e);
35     const FourVectorM V() const { return FourVectorM(fPt,fEta,fPhi,fM); }
36    
37     protected:
38     Double32_t fPt; //[0,0,12]
39     Double32_t fEta; //[0,0,10]
40     Double32_t fPhi; //[0,0,10]
41     Double32_t fM; //[0,0,12]
42    
43     ClassDef(Vect4M, 1) // Implementation of our own FourVectorM32
44     };
45     }
46    
47     //--------------------------------------------------------------------------------------------------
48     inline void mithep::Vect4M::SetXYZT(Double_t px, Double_t py, Double_t pz, Double_t e)
49     {
50     // Set four vector.
51    
52     FourVector tmp(px, py, pz, e);
53     fPt=tmp.Pt();
54     fEta=tmp.Eta();
55     fPhi=tmp.Phi();
56     fM=tmp.M();
57     }
58     #endif