ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Vect3C.h
Revision: 1.1
Committed: Tue Mar 3 17:03:54 2009 UTC (16 years, 2 months ago) by loizides
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre1
Log Message:
Added Vector classes

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Types.h,v 1.4 2008/11/05 10:46:48 bendavid Exp $
3 //
4 // Vect3C
5 //
6 // Implementation of our own ThreeVectorC32.
7 //
8 // Authors: C.Loizides
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITANA_TREEDATA_VECT3C_H
12 #define MITANA_TREEDATA_VECT3C_H
13
14 #include "MitAna/DataTree/interface/Types.h"
15
16 namespace mithep
17 {
18 class Vect3C
19 {
20 public:
21 Vect3C() :
22 fRho(0), fEta(0), fPhi(0) {}
23 Vect3C(Double_t rho, Double_t eta, Double_t phi) :
24 fRho(rho), fEta(eta), fPhi(phi) {}
25 Vect3C(const ThreeVector pos) :
26 fRho(pos.Rho()), fEta(pos.Eta()), fPhi(pos.Phi()) {}
27 Vect3C(const ThreeVectorC pos) :
28 fRho(pos.Rho()), fEta(pos.Eta()), fPhi(pos.Phi()) {}
29
30 Double_t Eta() const { return fEta; }
31 Double_t Phi() const { return fPhi; }
32 Double_t Rho() const { return fRho; }
33 const ThreeVectorC V() const { return ThreeVectorC(fRho,fEta,fPhi); }
34 void SetXYZ(Double_t x, Double_t y, Double_t z);
35
36 protected:
37 Double32_t fRho; //[0,0,12]
38 Double32_t fEta; //[0,0,10]
39 Double32_t fPhi; //[0,0,10]
40
41 ClassDef(Vect3C, 1)
42 };
43 }
44
45 //--------------------------------------------------------------------------------------------------
46 inline void mithep::Vect3C::SetXYZ(Double_t x, Double_t y, Double_t z)
47 {
48 // Set four vector.
49
50 ThreeVector tmp(x, y, z);
51 fRho=tmp.Rho();
52 fEta=tmp.Eta();
53 fPhi=tmp.Phi();
54 }
55 #endif