//  
// Author: Daniel Richter <mailto: danri@physik.hu-berlin.de>
// Update: $Id: Hep3DHit.h,v 1.4 2012/06/18 17:01:24 kind Exp $
// Copyright: 2008 (C) Daniel Richter
//
//
#ifndef HEP_Hep3DHit
#define HEP_Hep3DHit
#ifndef ROOT_TObject
#include <TObject.h>
#endif
#ifndef ROOT_TVector3
#include "TVector3.h"
#endif

class Hep3DHit : public TObject {

protected:
    Int_t    fId;   // Id number (for convenience only)
    TVector3 fPos;  // Position of the hit
public:
    Hep3DHit();
    Hep3DHit(Int_t Id, Float_t X, Float_t Y, Float_t Z);
    virtual ~Hep3DHit();
    
    virtual void Clear(Option_t *option = "");
    virtual void Print(Option_t *option = "") const;
    static void PrintHeader();
    static void PrintFooter();
    
    inline TVector3& Pos() { return fPos; }
    inline const Float_t X() const { return fPos.X(); }
    inline const Float_t Y() const { return fPos.Y(); }
    inline const Float_t Z() const { return fPos.Z(); }
    inline const Float_t Eta() const { if ( fPos.Pt() != 0. ) {
	return fPos.Eta();
    } else {
        return ( fPos.Pz() > 0. ) ? 10e10 : -10e10;}}
    inline const Float_t Phi() const { return fPos.Phi(); }
    inline const Float_t R() const { return fPos.Mag(); }
    inline const Float_t R2() const { return fPos.Mag2(); }   // squared radius (spherical coordinates)
    inline const Float_t Rt() const { return fPos.Perp(); }   // transverse distance to z-Axis
    inline const Float_t Rt2() const { return fPos.Perp2(); } 

    inline Int_t GetId() const { return fId; }
    inline void SetId(Int_t Id) { fId = Id; }
    
    ClassDef(Hep3DHit,1) // Abstract 3D hit class
};
#endif

 Hep3DHit.h:1
 Hep3DHit.h:2
 Hep3DHit.h:3
 Hep3DHit.h:4
 Hep3DHit.h:5
 Hep3DHit.h:6
 Hep3DHit.h:7
 Hep3DHit.h:8
 Hep3DHit.h:9
 Hep3DHit.h:10
 Hep3DHit.h:11
 Hep3DHit.h:12
 Hep3DHit.h:13
 Hep3DHit.h:14
 Hep3DHit.h:15
 Hep3DHit.h:16
 Hep3DHit.h:17
 Hep3DHit.h:18
 Hep3DHit.h:19
 Hep3DHit.h:20
 Hep3DHit.h:21
 Hep3DHit.h:22
 Hep3DHit.h:23
 Hep3DHit.h:24
 Hep3DHit.h:25
 Hep3DHit.h:26
 Hep3DHit.h:27
 Hep3DHit.h:28
 Hep3DHit.h:29
 Hep3DHit.h:30
 Hep3DHit.h:31
 Hep3DHit.h:32
 Hep3DHit.h:33
 Hep3DHit.h:34
 Hep3DHit.h:35
 Hep3DHit.h:36
 Hep3DHit.h:37
 Hep3DHit.h:38
 Hep3DHit.h:39
 Hep3DHit.h:40
 Hep3DHit.h:41
 Hep3DHit.h:42
 Hep3DHit.h:43
 Hep3DHit.h:44
 Hep3DHit.h:45
 Hep3DHit.h:46
 Hep3DHit.h:47
 Hep3DHit.h:48
 Hep3DHit.h:49
 Hep3DHit.h:50
 Hep3DHit.h:51